Skip to content

Commit 2afafe1

Browse files
committed
Deck tweaks, automate more things, s01e05
1 parent 2074f62 commit 2afafe1

File tree

6 files changed

+103
-43
lines changed

6 files changed

+103
-43
lines changed

sleuth-tv-live-s01e04.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
title: "Should you measure developer productivity?"
2+
guest:
3+
name: Dylan
4+
title: CEO/Co-founder
5+
sections:
6+
- title: Welcome!
7+
byline: "Ask questions at any time in chat"
8+
- title: "Why this is important now"
9+
byline: "Productivity in the news"
10+
- title: "Introducing Dylan Etkin"
11+
byline: "CEO/Co-founder of Sleuth"
12+
- title: "Closing thoughts"
13+
byline: "Measure teams, not people"
14+
- title: "Up next: Does accuracy matter?"
15+
byline: "Is the answer 'No!' again?"

sleuth-tv-live-s01e05.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
title: "Does accuracy matter with DORA metrics?"
2+
guest:
3+
name: Kate
4+
title: Head of Engineering
5+
sections:
6+
- title: Welcome!
7+
byline: "Ask questions at any time in chat"
8+
- title: "Does accuracy matter?"
9+
byline: "No! ... and yes."
10+
- title: "Introducing Kate Bierbaum"
11+
byline: "Head of Engineering at Sleuth"
12+
- title: "Closing thoughts"
13+
byline: "DORA metrics are just the beginning"
14+
- title: "Up next: Stages of DORA metrics adoption"
15+
byline: "Where are you? Where do you want to go next?"

sleuth-tv-live.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
title: "Should you measure developer productivity?"
1+
title: "Does accuracy matter with DORA metrics?"
22
guest:
3-
name: Dylan
4-
title: CEO/Co-founder
3+
name: Kate
4+
title: Head of Engineering
55
sections:
66
- title: Welcome!
77
byline: "Ask questions at any time in chat"
8-
- title: "Why this is important now"
9-
byline: "Things are a-changing"
10-
- title: "Introducing Dylan Etkin"
11-
byline: "CEO/Co-founder of Sleuth"
8+
- title: "Does accuracy matter?"
9+
byline: "No! ... and yes."
10+
- title: "Introducing Kate Bierbaum"
11+
byline: "Head of Engineering at Sleuth"
1212
- title: "Closing thoughts"
13-
byline: "Measure teams, not people"
14-
- title: "Up next: Does accuracy matter?"
15-
byline: "Is the answer 'No!' again?"
13+
byline: "DORA metrics are just the beginning"
14+
- title: "Up next: Stages of DORA metrics adoption"
15+
byline: "Where are you? Where do you want to go next?"

src/sleuthdeck/actions.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,18 @@ def __call__(self, scene: KeyScene, key: Key, click: ClickType):
3737
subprocess.run([self.command] + list(self.args))
3838

3939

40+
class Wait(Action):
41+
def __init__(self, seconds: int = 1):
42+
self.seconds = seconds
43+
44+
def __call__(self, scene: KeyScene, key: Key, click: ClickType):
45+
sleep(self.seconds)
46+
47+
4048
class Toggle(Action):
41-
def __init__(self, on_enable: Action, on_disable: Action, initial: bool = False) -> None:
42-
self._on_enable = on_enable
43-
self._on_disable = on_disable
49+
def __init__(self, on_enable: Union[list[Action], Action], on_disable: Union[list[Action], Action], initial: bool = False) -> None:
50+
self._on_enable = on_enable if not isinstance(on_enable, list) else Sequential(*on_enable)
51+
self._on_disable = on_disable if not isinstance(on_disable, list) else Sequential(*on_disable)
4452
self._state = initial
4553

4654
def __call__(self, scene: KeyScene, key: IconKey, click: ClickType):

src/sleuthdeck/plugins/obs/actions.py

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
from os import path
22
from os.path import dirname
33
from time import sleep
4-
from typing import Any
4+
from typing import Any, Callable
55
from typing import List
66
from typing import Optional
77

88
from obswebsocket import obsws
99
from obswebsocket import requests
1010
from obswebsocket.base_classes import Baserequests
11+
from obswebsocket.requests import StopRecording, StartRecording
1112
from websocket import WebSocketConnectionClosedException
1213

1314
from sleuthdeck.actions import SendHotkey
@@ -36,6 +37,12 @@ def close(self):
3637
def toggle_source(self, name: str, show: bool = None, scene: Optional[str] = None):
3738
return ToggleSource(self, name, show, scene=scene)
3839

40+
def stop_recording(self):
41+
return ObsAction(self, lambda obs: obs.obs(StopRecording()))
42+
43+
def start_recording(self):
44+
return ObsAction(self, lambda obs: obs.obs(StartRecording()))
45+
3946
def _ensure_connected(self):
4047
if self._started:
4148
return self.ws
@@ -90,6 +97,15 @@ def __call__(self, scene: KeyScene, key: OBSKey, click: ClickType):
9097
self.obs.obs(requests.SetCurrentScene(self.name))
9198

9299

100+
class ObsAction(Action):
101+
def __init__(self, obs: OBS, callable: Callable[[OBS], None]):
102+
self.obs = obs
103+
self.callable = callable
104+
105+
def __call__(self, scene: KeyScene, key: OBSKey, click: ClickType):
106+
self.callable(self.obs)
107+
108+
93109
class ToggleSource(Action):
94110
def __init__(self, obs: OBS, name: str, show: bool = None, scene = None):
95111
self.name = name

src/work.py

+35-29
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from os.path import dirname
44

55
from sleuthdeck.actions import MaximizeWindow, Toggle, UnMaximizeWindow, DeckBrightness, Sequential, ChangeScene, \
6-
PreviousScene
6+
PreviousScene, Wait
77
from sleuthdeck.actions import MoveWindow
88
from sleuthdeck.actions import SendHotkey, Command, CloseWindow, Pause
99
from sleuthdeck.deck import Deck
@@ -33,7 +33,7 @@ def run(deck: Deck):
3333
title_scene_item="Title",
3434
byline_scene_item="Byline",
3535
title_scene="Me full (title)",
36-
overlay_scene="[Scene] Lower-third")
36+
overlay_scene="[Scene] Lower-third (labels)")
3737

3838
scene1.add(
3939
(0, 0),
@@ -144,7 +144,13 @@ def run(deck: Deck):
144144

145145
webinar_scene.add(
146146
(0, 0),
147-
OBSKey(text="Intro", actions=[obs.change_scene("Starting soon")]),
147+
OBSKey(text="Intro", actions=[presso.reset(),
148+
obs.change_scene("Starting soon"),
149+
Wait(62),
150+
obs.start_recording(),
151+
obs.change_scene("Intro video"),
152+
Wait(6),
153+
obs.change_scene("Me full")]),
148154
)
149155
webinar_scene.add(
150156
(0, 1),
@@ -196,52 +202,52 @@ def run(deck: Deck):
196202

197203
webinar_scene.add(
198204
(1, 2),
199-
OBSKey(text="Chat", actions=[obs.toggle_source("Title", False, "[Scene] Lower-third"),
200-
obs.toggle_source("Byline", False, "[Scene] Lower-third"),
201-
obs.toggle_source("Chat highlight", True, "[Scene] Lower-third"),
202-
]),
203-
)
204-
webinar_scene.add(
205-
(1, 3),
206-
OBSKey(text="Section", actions=[
207-
obs.toggle_source("Chat highlight", False, "[Scene] Lower-third"),
208-
obs.toggle_source("Title", True, "[Scene] Lower-third"),
209-
obs.toggle_source("Byline", True, "[Scene] Lower-third"),
205+
FontAwesomeKey("brands/rocketchat", text="Chat", actions=[
206+
Toggle(on_enable=[obs.toggle_source("Title", False, "[Scene] Lower-third (labels)"),
207+
obs.toggle_source("Byline", False, "[Scene] Lower-third (labels)"),
208+
obs.toggle_source("Chat highlight", True, "[Scene] Lower-third (labels)"),
209+
],
210+
on_disable=[
211+
obs.toggle_source("Chat highlight", False, "[Scene] Lower-third (labels)"),
212+
obs.toggle_source("Title", True, "[Scene] Lower-third (labels)"),
213+
obs.toggle_source("Byline", True, "[Scene] Lower-third (labels)"),
210214

211-
]),
215+
])])
212216
)
213217
webinar_scene.add(
214218
(1, 4),
215219
FontAwesomeKey("solid/camera", text="T Cam", actions=[obs.toggle_source("[Scene] Me corner (shadowed)"),
216-
]),
220+
]),
217221
)
218222

219223
webinar_scene.add(
220224
(2, 0),
221225
OBSKey(text="Both", actions=[obs.change_scene("Me and Guest")]),
222226
)
223227

224-
# webinar_scene.add(
225-
# (2, 1),
226-
# OBSKey(text="Guest", actions=[obs.change_scene("Guest full")]),
227-
# )
228-
#
229-
# webinar_scene.add(
230-
# (2, 2),
231-
# OBSKey(text="Share", actions=[obs.change_scene("Guest screenshare")]),
232-
# )
233228
webinar_scene.add(
234229
(2, 1),
235-
OBSKey(text="Commercial", actions=[obs.change_scene("Commercial")]),
230+
OBSKey(text="Guest", actions=[obs.change_scene("Guest full")]),
236231
)
237232

233+
# webinar_scene.add(
234+
# (2, 2),
235+
# OBSKey(text="Share", actions=[obs.change_scene("Guest screenshare")]),
236+
# )
238237
webinar_scene.add(
239238
(2, 2),
240-
OBSKey(text="News", actions=[obs.change_scene("News")]),
239+
OBSKey(text="Commercial", actions=[obs.change_scene("Commercial")]),
241240
)
241+
#
242+
# webinar_scene.add(
243+
# (2, 2),
244+
# OBSKey(text="News", actions=[obs.change_scene("News")]),
245+
# )
242246
webinar_scene.add(
243-
(2, 0),
244-
OBSKey(text="End", actions=[obs.change_scene("Ending")]),
247+
(2, 3),
248+
OBSKey(text="End", actions=[obs.change_scene("Ending"),
249+
Wait(2),
250+
obs.stop_recording()]),
245251
)
246252

247253
webinar_scene.add(

0 commit comments

Comments
 (0)