generated from StreamController/PluginTemplate
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmain.py
More file actions
50 lines (44 loc) · 1.91 KB
/
main.py
File metadata and controls
50 lines (44 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Import StreamController modules
from src.backend.PluginManager.PluginBase import PluginBase
from src.backend.PluginManager.ActionHolder import ActionHolder
from src.backend.DeckManagement.InputIdentifier import Input
from src.backend.PluginManager.ActionInputSupport import ActionInputSupport
# Import actions
from .actions.SetOutput.SetOutput import SetOutput
from .actions.ToggleOutput.ToggleOutput import ToggleOutput
class AudioSwitcher(PluginBase):
def __init__(self):
super().__init__()
self.lm = self.locale_manager
## Register actions
self.set_output_holder = ActionHolder(
plugin_base = self,
action_base = SetOutput,
action_id_suffix = "SetOutput", # Change this to your own plugin id
action_name = self.lm.get("actions.set-output.name"),
action_support={
Input.Key: ActionInputSupport.SUPPORTED,
Input.Dial: ActionInputSupport.SUPPORTED,
Input.Touchscreen: ActionInputSupport.UNTESTED
}
)
self.add_action_holder(self.set_output_holder)
self.toggle_output_holder = ActionHolder(
plugin_base = self,
action_base = ToggleOutput,
action_id_suffix = "ToggleOutput", # Change this to your own plugin id
action_name = self.lm.get("actions.toggle-output.name"),
action_support={
Input.Key: ActionInputSupport.SUPPORTED,
Input.Dial: ActionInputSupport.SUPPORTED,
Input.Touchscreen: ActionInputSupport.UNTESTED
}
)
self.add_action_holder(self.toggle_output_holder)
# Register plugin
self.register(
plugin_name = self.lm.get("plugin.name"),
github_repo = "https://github.com/StreamController/AudioSwitcher",
plugin_version = "1.0.0",
app_version = "1.4.5-beta"
)