Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
SHMCamStudio
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SexHackMe
SHMCamStudio
Commits
d273782e
Commit
d273782e
authored
1 month ago
by
nextime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added input type feedback and buttons
parent
51ee691c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
167 additions
and
18 deletions
+167
-18
shmcamstudio.conf
shmcamstudio.conf
+88
-14
obs.py
shmcs/obs.py
+45
-1
panel.py
shmcs/panel.py
+13
-0
studio.py
shmcs/studio.py
+2
-2
webpanel.py
shmcs/webpanel.py
+14
-1
index.html
templates/index.html
+5
-0
No files found.
shmcamstudio.conf
View file @
d273782e
[
General
]
[
General
]
log_file
= /
tmp
/
streaming_control
.
log
log_file
= /
tmp
/
streaming_control
.
log
log_level
=
INFO
log_level
=
DEBUG
[
Web
]
[
Web
]
stream_url
=
https
://
192
.
168
.
42
.
1
/
HLS
/
record
/
Live
.
m3u8
stream_url
=
https
://
192
.
168
.
42
.
1
/
HLS
/
record
/
Live
.
m3u8
...
@@ -29,6 +29,20 @@ port = 4455
...
@@ -29,6 +29,20 @@ port = 4455
password
=
motorol4
password
=
motorol4
[
INPUT
:
doubleleeloo
]
obs
=
leeloo
scene
=
LIVE
SFW
source
=
6
[
INPUT
:
doublestefy
]
obs
=
slut
scene
=
live
SFW
source
=
6
[
INPUT
:
doubleshine
]
obs
=
slut
scene
=
SHINE
source
=
7
# OUTPUT are shenes on OBS sending to a specific stream, can be a rtmp stream with
# OUTPUT are shenes on OBS sending to a specific stream, can be a rtmp stream with
# OBS multistream plugin or a virtual cam, both the included in OBS or the ones
# OBS multistream plugin or a virtual cam, both the included in OBS or the ones
...
@@ -43,6 +57,7 @@ status.close.enable = 5,4
...
@@ -43,6 +57,7 @@ status.close.enable = 5,4
status
.
tease
.
disable
=
4
status
.
tease
.
disable
=
4
status
.
tease
.
enable
=
5
,
3
status
.
tease
.
enable
=
5
,
3
[
OUTPUT
:
smstefy
]
[
OUTPUT
:
smstefy
]
obs
=
slut
obs
=
slut
scene
=
live
SFW
scene
=
live
SFW
...
@@ -72,21 +87,44 @@ status.tease.enable = 4,3
...
@@ -72,21 +87,44 @@ status.tease.enable = 4,3
# BUTTON:<rownum>:<button_name>
# BUTTON:<rownum>:<button_name>
[
BUTTON
:
1
:
private_shine
]
#[BUTTON:1:private_shine]
title
=
Private
Shine
#title = Private Shine
action
=
private_shine
#action = private_shine
color
=
maroon
#color = maroon
#[BUTTON:1:private_stefy]
#title = Private Stefy
#action = private_stefy
#color = maroon
#[BUTTON:1:private_leelo]
#title = Private Leeloo
#action = private_leeloo
#color = maroon
[
BUTTON
:
1
:
private_stefy
]
[
BUTTON
:
1
:
Doubles_shine
]]
title
=
Private
Stefy
title
=
Double
SHINE
action
=
private_stefy
action
=
double_shine
color
=
maroon
input
=
doubleshine
color
=
gray
color
.
enabled
=
blue
[
BUTTON
:
1
:
Double_stefy
]]
title
=
DOUBLE
STEFY
action
=
double_stefy
input
=
doublestefy
color
=
gray
color
.
enabled
=
blue
[
BUTTON
:
1
:
double_leeloo
]]
title
=
DOUBLE
LEELOO
action
=
double_leeloo
input
=
doubleleeloo
color
=
gray
color
.
enabled
=
blue
[
BUTTON
:
1
:
private_leelo
]
title
=
Private
Leeloo
action
=
private_leeloo
color
=
maroon
[
BUTTON
:
1
:
open_all
]]
[
BUTTON
:
1
:
open_all
]]
title
=
Open
ALL
title
=
Open
ALL
...
@@ -126,6 +164,11 @@ color.open = green
...
@@ -126,6 +164,11 @@ color.open = green
color
.
tease
=
orange
color
.
tease
=
orange
color
=
grey
color
=
grey
[
BUTTON
:
2
:
spotify
]
title
=
MUSIC
PAUSE
action
=
spotify_pause
color
=
blue
#[BUTTON:2:leelo_livejasmine]
#[BUTTON:2:leelo_livejasmine]
#title = Open/Close JASM
#title = Open/Close JASM
#action = jasmine_openclose
#action = jasmine_openclose
...
@@ -134,21 +177,29 @@ color = grey
...
@@ -134,21 +177,29 @@ color = grey
title
=
SCENE
Tease
ALL
title
=
SCENE
Tease
ALL
action
=
tease_all
action
=
tease_all
color
=
teal
color
=
teal
color
.
active
=
turquoise
feedback
=
scene
[
BUTTON
:
3
:
tease
]
[
BUTTON
:
3
:
tease
]
title
=
SCENE
Tease
title
=
SCENE
Tease
action
=
tease
action
=
tease
color
=
teal
color
=
teal
color
.
active
=
turquoise
feedback
=
scene
[
BUTTON
:
3
:
scene_all_open
]
[
BUTTON
:
3
:
scene_all_open
]
title
=
SCENE
ALL
OPEN
title
=
SCENE
ALL
OPEN
action
=
open_all
action
=
open_all
color
=
teal
color
=
teal
color
.
active
=
turquoise
feedback
=
scene
[
BUTTON
:
3
:
scene_shile_always_open
]
[
BUTTON
:
3
:
scene_shile_always_open
]
title
=
SCENE
SHINE
ALWAYS
OPEN
title
=
SCENE
SHINE
ALWAYS
OPEN
action
=
open_all
action
=
open_all
_shine_open
color
=
teal
color
=
teal
color
.
active
=
turquoise
feedback
=
scene
[
BUTTON
:
3
:
scene_manual
]
[
BUTTON
:
3
:
scene_manual
]
title
=
MANUAL
title
=
MANUAL
...
@@ -165,6 +216,9 @@ feedback = status
...
@@ -165,6 +216,9 @@ feedback = status
setstatus
=
change
setstatus
=
change
[
ACTION
:
spotify_pause
]
execute
= /
home
/
nextime
/
bin
/
spotifypause
[
ACTION
:
private_shine
]
[
ACTION
:
private_shine
]
execute
= /
usr
/
local
/
bin
/
smblur_private
execute
= /
usr
/
local
/
bin
/
smblur_private
...
@@ -177,6 +231,20 @@ execute = /usr/local/bin/smblur_private_leeloo
...
@@ -177,6 +231,20 @@ execute = /usr/local/bin/smblur_private_leeloo
#[ACTION:private_jasmine]
#[ACTION:private_jasmine]
#execute = /usr/local/bin/smblur_private_jasmin
#execute = /usr/local/bin/smblur_private_jasmin
[
ACTION
:
double_shine
]
execute
= /
usr
/
local
/
bin
/
smdouble_shine
setscene
=
double
[
ACTION
:
double_stefy
]
execute
= /
usr
/
local
/
bin
/
smdouble_stefy
setscene
=
double
[
ACTION
:
double_leeloo
]
execute
= /
usr
/
local
/
bin
/
smdouble_leeloo
setscene
=
double
[
ACTION
:
leelo_openclose
]
[
ACTION
:
leelo_openclose
]
execute
= /
usr
/
local
/
bin
/
smblur_leeloo
execute
= /
usr
/
local
/
bin
/
smblur_leeloo
...
@@ -191,10 +259,16 @@ execute = /usr/local/bin/smblur_stefy
...
@@ -191,10 +259,16 @@ execute = /usr/local/bin/smblur_stefy
[
ACTION
:
tease_all
]
[
ACTION
:
tease_all
]
execute
= /
usr
/
local
/
bin
/
smblur_teaseall
execute
= /
usr
/
local
/
bin
/
smblur_teaseall
setscene
=
tease_all
[
ACTION
:
tease
]
[
ACTION
:
tease
]
execute
= /
usr
/
local
/
bin
/
smblur_tease
execute
= /
usr
/
local
/
bin
/
smblur_tease
setscene
=
tease
[
ACTION
:
open_all
]
[
ACTION
:
open_all
]
execute
= /
usr
/
local
/
bin
/
smblur_clean
execute
= /
usr
/
local
/
bin
/
smblur_clean
setscene
=
open_all
[
ACTION
:
open_all_shine_open
]
execute
= /
usr
/
local
/
bin
/
smblur_clean
setscene
=
open_all_shine_open
This diff is collapsed.
Click to expand it.
shmcs/obs.py
View file @
d273782e
...
@@ -26,6 +26,29 @@ obws_logger.setLevel(logging.CRITICAL)
...
@@ -26,6 +26,29 @@ obws_logger.setLevel(logging.CRITICAL)
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
class
OBSInput
:
def
__init__
(
self
,
inp
,
config_section
,
obss
):
self
.
config_section
=
config_section
self
.
inp
=
inp
self
.
status
=
False
self
.
obss
=
obss
self
.
config_options
=
config
.
options
(
config_section
)
self
.
config_section
=
config_section
for
c
in
self
.
config_options
:
setattr
(
self
,
c
,
config
.
get
(
config_section
,
c
))
def
getStatus
(
self
):
return
self
.
obss
.
getInputStatus
(
self
.
scene
,
self
.
source
)
def
updateStatus
(
self
):
status
=
self
.
getStatus
()
if
status
!=
self
.
status
:
self
.
status
=
status
logging
.
info
(
'INPUT '
+
self
.
inp
+
" FOUND "
+
str
(
self
.
status
))
self
.
obss
.
queue
.
put
({
'event'
:
'INPUTSTATUSCHANGE'
,
'data'
:
{
'server'
:
self
.
obss
.
server
,
'input'
:
self
.
inp
,
'status'
:
self
.
status
}})
class
OBSOutput
:
class
OBSOutput
:
def
__init__
(
self
,
output
,
config_section
,
obss
):
def
__init__
(
self
,
output
,
config_section
,
obss
):
...
@@ -37,6 +60,7 @@ class OBSOutput:
...
@@ -37,6 +60,7 @@ class OBSOutput:
self
.
config_section
=
config_section
self
.
config_section
=
config_section
self
.
statuses
=
{}
self
.
statuses
=
{}
self
.
inputs
=
{}
self
.
inputs
=
{}
self
.
inpmon
=
[]
for
c
in
self
.
config_options
:
for
c
in
self
.
config_options
:
if
'status.'
in
c
:
if
'status.'
in
c
:
for
inp
in
config
.
get
(
config_section
,
c
)
.
split
(
','
):
for
inp
in
config
.
get
(
config_section
,
c
)
.
split
(
','
):
...
@@ -53,8 +77,9 @@ class OBSOutput:
...
@@ -53,8 +77,9 @@ class OBSOutput:
'enable'
:
enabled
,
'enable'
:
enabled
,
}
}
setattr
(
self
,
c
,
config
.
get
(
config_section
,
c
))
setattr
(
self
,
c
,
config
.
get
(
config_section
,
c
))
logging
.
debug
(
self
.
statuses
)
logging
.
debug
(
self
.
inputs
)
#print(getattr(self, 'source.closed'))
#print(getattr(self, 'source.closed'))
#print(dir(self))
#print(dir(self))
...
@@ -104,6 +129,11 @@ class OBSOutput:
...
@@ -104,6 +129,11 @@ class OBSOutput:
self
.
status
=
self
.
updateStatus
()
self
.
status
=
self
.
updateStatus
()
return
self
.
status
return
self
.
status
def
getInput
(
self
,
inp
):
if
inp
in
self
.
inputs
.
keys
():
return
self
.
obss
.
getInputStatus
(
self
.
scene
,
inp
)
return
False
class
OBSControl
:
class
OBSControl
:
def
__init__
(
self
,
obs_server
,
config_section
):
def
__init__
(
self
,
obs_server
,
config_section
):
...
@@ -186,6 +216,14 @@ def run_obs_controller():
...
@@ -186,6 +216,14 @@ def run_obs_controller():
logging
.
info
(
'OUTPUT '
+
config
.
get
(
k
,
'obs'
)
+
" -> "
+
k
.
split
(
":"
,
1
)[
1
])
logging
.
info
(
'OUTPUT '
+
config
.
get
(
k
,
'obs'
)
+
" -> "
+
k
.
split
(
":"
,
1
)[
1
])
logging
.
info
(
obs_outputs
[
k
.
split
(
":"
,
1
)[
1
]]
.
getStatus
())
logging
.
info
(
obs_outputs
[
k
.
split
(
":"
,
1
)[
1
]]
.
getStatus
())
obs_inputs
=
{}
for
k
in
[
x
for
x
in
config
.
sections
()
if
'INPUT:'
in
x
]:
obss
=
False
if
config
.
get
(
k
,
'obs'
)
in
obs_servers
.
keys
():
obss
=
obs_servers
[
config
.
get
(
k
,
'obs'
)]
obs_inputs
[
k
.
split
(
":"
,
1
)[
1
]]
=
OBSInput
(
k
.
split
(
":"
,
1
)[
1
],
k
,
obss
)
#cl = obs.EventClient(host='192.168.42.115', port=4455, password='motorol4')
#cl = obs.EventClient(host='192.168.42.115', port=4455, password='motorol4')
#cr = obs.ReqClient(host='192.168.42.115', port=4455, password='motorol4')
#cr = obs.ReqClient(host='192.168.42.115', port=4455, password='motorol4')
...
@@ -223,6 +261,12 @@ def run_obs_controller():
...
@@ -223,6 +261,12 @@ def run_obs_controller():
for
output
in
obs_outputs
.
values
():
for
output
in
obs_outputs
.
values
():
if
output
.
obss
.
server
==
data
[
'server'
]
and
output
.
scene
==
data
[
'scene'
]
and
str
(
data
[
'source'
])
in
output
.
inputs
.
keys
():
if
output
.
obss
.
server
==
data
[
'server'
]
and
output
.
scene
==
data
[
'scene'
]
and
str
(
data
[
'source'
])
in
output
.
inputs
.
keys
():
output
.
updateStatus
()
output
.
updateStatus
()
for
inp
in
obs_inputs
.
values
():
if
inp
.
obss
.
server
==
data
[
'server'
]
and
inp
.
scene
==
data
[
'scene'
]
and
str
(
data
[
'source'
])
==
str
(
inp
.
source
):
inp
.
updateStatus
()
if
event
==
'INPUTSTATUSCHANGE'
:
logging
.
info
(
"INPUTSTATUSCHANGE: input "
+
data
[
'input'
]
+
" on obs "
+
data
[
'server'
]
+
" is now "
+
str
(
data
[
'status'
]))
qcore
.
put
(
task
)
if
event
==
'OUTPUTCHANGE'
:
if
event
==
'OUTPUTCHANGE'
:
#{ 'event': 'OUTPUTCHANGE', 'data': {'server': self.obss.server, 'output': self.output, 'status': self.status }}
#{ 'event': 'OUTPUTCHANGE', 'data': {'server': self.obss.server, 'output': self.output, 'status': self.status }}
logging
.
info
(
"OUTPUTCHANGE: output "
+
data
[
'output'
]
+
" on obs "
+
data
[
'server'
]
+
" is now "
+
str
(
data
[
'status'
]))
logging
.
info
(
"OUTPUTCHANGE: output "
+
data
[
'output'
]
+
" on obs "
+
data
[
'server'
]
+
" is now "
+
str
(
data
[
'status'
]))
...
...
This diff is collapsed.
Click to expand it.
shmcs/panel.py
View file @
d273782e
...
@@ -94,6 +94,7 @@ def create_panel_gui():
...
@@ -94,6 +94,7 @@ def create_panel_gui():
row
=
1
row
=
1
bframes
=
{}
bframes
=
{}
outputs
=
{}
outputs
=
{}
inputs
=
{}
feedbacks
=
{}
feedbacks
=
{}
while
row
<=
numrows
:
while
row
<=
numrows
:
# create the frame for this row
# create the frame for this row
...
@@ -121,6 +122,9 @@ def create_panel_gui():
...
@@ -121,6 +122,9 @@ def create_panel_gui():
if
'output'
in
buttons
[
row
][
b
]
.
keys
():
if
'output'
in
buttons
[
row
][
b
]
.
keys
():
outputs
[
buttons
[
row
][
b
][
'output'
]]
=
{
'btn'
:
button
,
'cfg'
:
buttons
[
row
][
b
]}
outputs
[
buttons
[
row
][
b
][
'output'
]]
=
{
'btn'
:
button
,
'cfg'
:
buttons
[
row
][
b
]}
elif
'input'
in
buttons
[
row
][
b
]
.
keys
():
inputs
[
buttons
[
row
][
b
][
'input'
]]
=
{
'btn'
:
button
,
'cfg'
:
buttons
[
row
][
b
]}
elif
'feedback'
in
buttons
[
row
][
b
]
.
keys
():
elif
'feedback'
in
buttons
[
row
][
b
]
.
keys
():
if
not
buttons
[
row
][
b
][
'feedback'
]
in
feedbacks
.
keys
():
if
not
buttons
[
row
][
b
][
'feedback'
]
in
feedbacks
.
keys
():
feedbacks
[
buttons
[
row
][
b
][
'feedback'
]]
=
[{
'btn'
:
button
,
'cfg'
:
buttons
[
row
][
b
]}]
feedbacks
[
buttons
[
row
][
b
][
'feedback'
]]
=
[{
'btn'
:
button
,
'cfg'
:
buttons
[
row
][
b
]}]
...
@@ -158,6 +162,15 @@ def create_panel_gui():
...
@@ -158,6 +162,15 @@ def create_panel_gui():
btn
.
config
(
bg
=
bcfg
[
'color.'
+
str
(
data
[
'status'
])])
btn
.
config
(
bg
=
bcfg
[
'color.'
+
str
(
data
[
'status'
])])
if
'title.'
+
str
(
data
[
'status'
])
in
bcfg
.
keys
():
if
'title.'
+
str
(
data
[
'status'
])
in
bcfg
.
keys
():
btn
.
config
(
text
=
bcfg
[
'title.'
+
str
(
data
[
'status'
])])
btn
.
config
(
text
=
bcfg
[
'title.'
+
str
(
data
[
'status'
])])
if
event
==
'INPUTSTATUSCHANGE'
:
if
data
[
'input'
]
in
inputs
.
keys
():
logging
.
info
(
'CHANGE THE COLOR OF THE BUTTON FOR '
+
str
(
data
[
'input'
])
+
' ('
+
str
(
data
[
'status'
]))
btn
=
inputs
[
data
[
'input'
]][
'btn'
]
bcfg
=
inputs
[
data
[
'input'
]][
'cfg'
]
if
data
[
'status'
]:
btn
.
config
(
bg
=
bcfg
[
'color.enabled'
])
else
:
btn
.
config
(
bg
=
bcfg
[
'color'
])
elif
event
==
'STATUSCHANGE'
:
elif
event
==
'STATUSCHANGE'
:
if
'status'
in
feedbacks
.
keys
():
if
'status'
in
feedbacks
.
keys
():
for
b
in
feedbacks
[
'status'
]:
for
b
in
feedbacks
[
'status'
]:
...
...
This diff is collapsed.
Click to expand it.
shmcs/studio.py
View file @
d273782e
...
@@ -29,7 +29,7 @@ STATUSES=[
...
@@ -29,7 +29,7 @@ STATUSES=[
class
TaskEngine
():
class
TaskEngine
():
status
=
'manual'
status
=
'manual'
scene
=
'
open
'
scene
=
'
manual
'
def
set_manual
(
self
,
manual
=
True
):
def
set_manual
(
self
,
manual
=
True
):
nst
=
False
nst
=
False
...
@@ -57,7 +57,7 @@ class TaskEngine():
...
@@ -57,7 +57,7 @@ class TaskEngine():
# self.set_manual(False)
# self.set_manual(False)
#else:
#else:
# self.set_manual(True)
# self.set_manual(True)
elif
event
==
'OUTPUTCHANGE'
:
elif
event
in
[
'OUTPUTCHANGE'
,
'INPUTSTATUSCHANGE'
]
:
qpnl
.
put
(
task
)
qpnl
.
put
(
task
)
qweb
.
put
(
task
)
qweb
.
put
(
task
)
...
...
This diff is collapsed.
Click to expand it.
shmcs/webpanel.py
View file @
d273782e
...
@@ -41,17 +41,20 @@ socketio = SocketIO(flask_app)
...
@@ -41,17 +41,20 @@ socketio = SocketIO(flask_app)
buttons
,
numrows
=
get_buttons
()
buttons
,
numrows
=
get_buttons
()
outputs
=
{}
outputs
=
{}
feedbacks
=
{}
feedbacks
=
{}
inputs
=
{}
if
numrows
>
0
:
if
numrows
>
0
:
row
=
1
row
=
1
while
row
<=
numrows
:
while
row
<=
numrows
:
for
b
in
buttons
[
row
]
.
keys
():
for
b
in
buttons
[
row
]
.
keys
():
if
'output'
in
buttons
[
row
][
b
]
.
keys
():
if
'output'
in
buttons
[
row
][
b
]
.
keys
():
outputs
[
buttons
[
row
][
b
][
'output'
]]
=
{
'cfg'
:
buttons
[
row
][
b
]}
outputs
[
buttons
[
row
][
b
][
'output'
]]
=
{
'cfg'
:
buttons
[
row
][
b
]}
elif
'input'
in
buttons
[
row
][
b
]
.
keys
():
inputs
[
buttons
[
row
][
b
][
'input'
]]
=
{
'cfg'
:
buttons
[
row
][
b
]}
elif
'feedback'
in
buttons
[
row
][
b
]
.
keys
():
elif
'feedback'
in
buttons
[
row
][
b
]
.
keys
():
if
not
buttons
[
row
][
b
][
'feedback'
]
in
feedbacks
.
keys
():
if
not
buttons
[
row
][
b
][
'feedback'
]
in
feedbacks
.
keys
():
feedbacks
[
buttons
[
row
][
b
][
'feedback'
]]
=
[{
'cfg'
:
buttons
[
row
][
b
]}]
feedbacks
[
buttons
[
row
][
b
][
'feedback'
]]
=
[{
'cfg'
:
buttons
[
row
][
b
]}]
else
:
else
:
feedbacks
[
buttons
[
row
][
b
][
'feedback'
]]
.
append
({
'
btn'
:
button
,
'
cfg'
:
buttons
[
row
][
b
]})
feedbacks
[
buttons
[
row
][
b
][
'feedback'
]]
.
append
({
'cfg'
:
buttons
[
row
][
b
]})
row
=
row
+
1
row
=
row
+
1
...
@@ -113,6 +116,8 @@ def index():
...
@@ -113,6 +116,8 @@ def index():
pollclass
=
''
pollclass
=
''
if
'output'
in
buttons
[
row
][
b
]
.
keys
():
if
'output'
in
buttons
[
row
][
b
]
.
keys
():
pollclass
=
'output_'
+
buttons
[
row
][
b
][
'output'
]
pollclass
=
'output_'
+
buttons
[
row
][
b
][
'output'
]
if
'input'
in
buttons
[
row
][
b
]
.
keys
():
pollclass
=
'input_'
+
buttons
[
row
][
b
][
'input'
]
elif
'feedback'
in
buttons
[
row
][
b
]
.
keys
():
elif
'feedback'
in
buttons
[
row
][
b
]
.
keys
():
pollclass
=
'feedback_'
+
buttons
[
row
][
b
][
'feedback'
]
pollclass
=
'feedback_'
+
buttons
[
row
][
b
][
'feedback'
]
htmlbuttons
=
htmlbuttons
+
"""<button style="color:white;background-color:"""
+
color
+
""";"
htmlbuttons
=
htmlbuttons
+
"""<button style="color:white;background-color:"""
+
color
+
""";"
...
@@ -174,6 +179,14 @@ def get_queue():
...
@@ -174,6 +179,14 @@ def get_queue():
emit
(
'change_output'
,
{
'button'
:
data
[
'output'
],
'color'
:
bcfg
[
'color.'
+
str
(
data
[
'status'
])]
},
broadcast
=
True
)
emit
(
'change_output'
,
{
'button'
:
data
[
'output'
],
'color'
:
bcfg
[
'color.'
+
str
(
data
[
'status'
])]
},
broadcast
=
True
)
if
'title.'
+
str
(
data
[
'status'
])
in
bcfg
.
keys
():
if
'title.'
+
str
(
data
[
'status'
])
in
bcfg
.
keys
():
emit
(
'change_output'
,
{
'button'
:
data
[
'output'
],
'title'
:
bcfg
[
'title.'
+
str
(
data
[
'status'
])]
},
broadcast
=
True
)
emit
(
'change_output'
,
{
'button'
:
data
[
'output'
],
'title'
:
bcfg
[
'title.'
+
str
(
data
[
'status'
])]
},
broadcast
=
True
)
if
event
==
'INPUTSTATUSCHANGE'
:
if
data
[
'input'
]
in
inputs
.
keys
():
logging
.
info
(
'CHANGE THE COLOR OF THE WEB BUTTON FOR '
+
str
(
data
[
'input'
]))
bcfg
=
inputs
[
data
[
'input'
]][
'cfg'
]
if
data
[
'status'
]:
emit
(
'change_input'
,
{
'button'
:
data
[
'input'
],
'color'
:
bcfg
[
'color.enabled'
]
},
broadcast
=
True
)
else
:
emit
(
'change_input'
,
{
'button'
:
data
[
'input'
],
'color'
:
bcfg
[
'color'
]},
broadcast
=
True
)
elif
event
==
'STATUSCHANGE'
:
elif
event
==
'STATUSCHANGE'
:
if
'status'
in
feedbacks
.
keys
():
if
'status'
in
feedbacks
.
keys
():
for
b
in
feedbacks
[
'status'
]:
for
b
in
feedbacks
[
'status'
]:
...
...
This diff is collapsed.
Click to expand it.
templates/index.html
View file @
d273782e
...
@@ -308,6 +308,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
...
@@ -308,6 +308,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
$
(
'.output_'
+
msg
.
button
).
css
(
'background-color'
,
msg
.
color
);
$
(
'.output_'
+
msg
.
button
).
css
(
'background-color'
,
msg
.
color
);
});
});
socket
.
on
(
'change_input'
,
function
(
msg
,
cb
)
{
$
(
'.input_'
+
msg
.
button
).
css
(
'background-color'
,
msg
.
color
);
});
socket
.
on
(
'change_feedback'
,
function
(
msg
,
cb
)
{
socket
.
on
(
'change_feedback'
,
function
(
msg
,
cb
)
{
if
(
msg
.
hasOwnProperty
(
"color"
))
if
(
msg
.
hasOwnProperty
(
"color"
))
$
(
'.feedback_'
+
msg
.
feedback
).
css
(
'background-color'
,
msg
.
color
);
$
(
'.feedback_'
+
msg
.
feedback
).
css
(
'background-color'
,
msg
.
color
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment