diff --git a/app/server/libs/actions/types/obs.js b/app/server/libs/actions/types/obs.js index fc9e165e..d5c3b0eb 100644 --- a/app/server/libs/actions/types/obs.js +++ b/app/server/libs/actions/types/obs.js @@ -8,14 +8,20 @@ function create(action) { const actions = { ToggleAudio(action) { const { source } = action.widget.component.props; - return obs.send("ToggleMute", { source }); }, + AudioVolume(action) { + const { source } = action.widget.component.props; + const { volume, mute } = action.data || action.eventProps || "undefined"; + if (mute !== undefined) { + return obs.send("SetMute", { source, mute }); + } + return obs.send("SetVolume", { source, volume, useDecibel: false }); + }, ToggleScene(action) { const { currentScene } = obs.getState(); const { scene1, scene2 } = action.widget.component.props; const scene = currentScene === scene1 ? scene2 : scene1; - return obs.send("SetCurrentScene", { "scene-name": scene }); }, GoToScene(action) { diff --git a/app/server/libs/obs.js b/app/server/libs/obs.js index 714a279c..0731bfb1 100644 --- a/app/server/libs/obs.js +++ b/app/server/libs/obs.js @@ -25,6 +25,7 @@ let state = { recording: false, status: null, scenes: null, + sources: null, currentScene: null, }; diff --git a/app/server/libs/twitch/pushActions.js b/app/server/libs/twitch/pushActions.js index 74efa353..ecfe87a7 100644 --- a/app/server/libs/twitch/pushActions.js +++ b/app/server/libs/twitch/pushActions.js @@ -10,6 +10,7 @@ const types = { GoToScene: "obs", ToggleScene: "obs", ToggleAudio: "obs", + AudioVolume: "obs", AnimeTimeline: "anime", }; diff --git a/app/static/locales/en/app.json b/app/static/locales/en/app.json index 17b0de38..b9dd35fb 100644 --- a/app/static/locales/en/app.json +++ b/app/static/locales/en/app.json @@ -168,6 +168,7 @@ "go-to-scene": "OBS | Go to scene", "toggle-scene": "OBS | Toggle between two scenes", "toggle-audio": "OBS | Toggle audio source", + "audio-volume": "OBS | Audio volume", "no-scene-selected": "No scene selected", "connect-at-startup": "Connect OBS at startup", "first-start-install-sentence": "If you want to use OBS with Marv you need to install OBS WebSocket.", diff --git a/app/static/locales/es/app.json b/app/static/locales/es/app.json index b046a524..ae527393 100644 --- a/app/static/locales/es/app.json +++ b/app/static/locales/es/app.json @@ -167,6 +167,7 @@ "go-to-scene": "OBS | Ir a la escena", "toggle-scene": "OBS | Cambiar entre dos escenas", "toggle-audio": "OBS | Alternar fuente de audio", + "audio-volume": "OBS | Volumen de audio", "no-scene-selected": "Ninguna escena seleccionada", "connect-at-startup": "Conectar a OBS al inicio", "first-start-install-sentence": "Para conectar Marv a OBS, debes instalar OBS WebSocket.", diff --git a/app/static/locales/fr/app.json b/app/static/locales/fr/app.json index ca30764d..9fecfb08 100644 --- a/app/static/locales/fr/app.json +++ b/app/static/locales/fr/app.json @@ -168,6 +168,7 @@ "go-to-scene": "OBS | Aller à la scène", "toggle-scene": "OBS | Basculer entre deux scènes", "toggle-audio": "OBS | Basculer source audio", + "audio-volume": "OBS | Volume audio", "no-scene-selected": "Aucune scène sélectionnée", "connect-at-startup": "Connecter OBS au démarrage", "first-start-install-sentence": "Pour connecter Marv à OBS, tu dois installer OBS WebSocket.", diff --git a/front-src/client/components/Widgets/OBS/AudioVolume/Settings.svelte b/front-src/client/components/Widgets/OBS/AudioVolume/Settings.svelte new file mode 100644 index 00000000..f7f18aac --- /dev/null +++ b/front-src/client/components/Widgets/OBS/AudioVolume/Settings.svelte @@ -0,0 +1,32 @@ + + +