diff --git a/UI/data/locale/en-US.ini b/UI/data/locale/en-US.ini index 016f2245138a9b..f2479179420037 100644 --- a/UI/data/locale/en-US.ini +++ b/UI/data/locale/en-US.ini @@ -782,10 +782,6 @@ Basic.AdvAudio.Volume="Volume (%)" Basic.AdvAudio.Mono="Downmix to Mono" Basic.AdvAudio.Panning="Panning" Basic.AdvAudio.SyncOffset="Sync Offset (ms)" -Basic.AdvAudio.Monitoring="Audio Monitoring" -Basic.AdvAudio.Monitoring.None="Monitor Off" -Basic.AdvAudio.Monitoring.MonitorOnly="Monitor Only (mute output)" -Basic.AdvAudio.Monitoring.Both="Monitor and Output" Basic.AdvAudio.AudioTracks="Tracks" # basic mode 'hotkeys' settings diff --git a/UI/volume-control.cpp b/UI/volume-control.cpp index 40ca605ae70596..c29ed966d32b54 100644 --- a/UI/volume-control.cpp +++ b/UI/volume-control.cpp @@ -45,37 +45,6 @@ void VolControl::OBSVolumeMuted(void *data, calldata_t *calldata) Q_ARG(bool, muted)); } - -void VolControl::MonitoringEnabled(bool checked) -{ - if (mon->isChecked() != checked) - mon->setChecked(checked); - SetMon(checked); -} - -void VolControl::OBSMonitoringEnabled(void *data, calldata_t *calldata) -{ - VolControl *volControl = static_cast(data); - bool monitoring = calldata_bool(calldata, "monitor"); - - QMetaObject::invokeMethod(volControl, "MonitoringEnabled", - Q_ARG(bool, monitoring)); -} - -void VolControl::SendEnabled(bool checked) { - if (send->isChecked() != checked) - send->setChecked(checked); - SetSends(checked); -} - -void VolControl::OBSSend(void *data, calldata_t *calldata) { - VolControl *volControl = static_cast(data); - bool send = calldata_bool(calldata, "send"); - - QMetaObject::invokeMethod(volControl, "SendEnabled", - Q_ARG(bool, send)); -} - void VolControl::VolumeChanged() { slider->blockSignals(true); @@ -473,9 +442,6 @@ VolControl::VolControl(OBSSource source_, bool *mutePtr, bool showConfig, bool v SetMon(monON); mon->setAccessibleName(QTStr("VolControl.Mon")); mon->setToolTip(QTStr("VolControl.Mon.Tooltip")); - if (source != nullptr) - signal_handler_connect(obs_source_get_signal_handler(source), "monitor", - OBSMonitoringEnabled, this); QWidget::connect(mon, SIGNAL(clicked(bool)), this, SLOT(SetMon(bool))); /* The send button toggles the sends of the source to output tracks. @@ -501,9 +467,6 @@ VolControl::VolControl(OBSSource source_, bool *mutePtr, bool showConfig, bool v send->setAccessibleName(QTStr("VolControl.Sends")); send->setToolTip(QTStr("VolControl.Sends.Tooltip")); - if (source != nullptr) - signal_handler_connect(obs_source_get_signal_handler(source), - "send", OBSSend, this); QWidget::connect(send, SIGNAL(clicked(bool)), this, SLOT(SetSends(bool))); } @@ -568,10 +531,6 @@ VolControl::~VolControl() if (source != nullptr) { signal_handler_disconnect(obs_source_get_signal_handler(source), "mute", OBSVolumeMuted, this); - signal_handler_disconnect(obs_source_get_signal_handler(source), - "monitor", OBSMonitoringEnabled, this); - signal_handler_disconnect(obs_source_get_signal_handler(source), - "sends", OBSSend, this); } obs_fader_destroy(obs_fader); obs_volmeter_destroy(obs_volmeter); diff --git a/UI/volume-control.hpp b/UI/volume-control.hpp index a4874143fb5f43..57f99872721b08 100644 --- a/UI/volume-control.hpp +++ b/UI/volume-control.hpp @@ -264,15 +264,11 @@ class VolControl : public QWidget { const float peak[MAX_AUDIO_CHANNELS], const float inputPeak[MAX_AUDIO_CHANNELS]); static void OBSVolumeMuted(void *data, calldata_t *calldata); - static void OBSMonitoringEnabled(void *data, calldata_t *calldata); - static void OBSSend(void *data, calldata_t *calldata); void EmitConfigClicked(); private slots: void VolumeMuted(bool muted); - void MonitoringEnabled(bool checked); - void SendEnabled(bool checked); void SetMuted(bool checked); void SetStream(bool checked); void SetRec(bool checked); diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index 83c8b2e3897db3..4bed1e83b5ba3e 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -1924,8 +1924,6 @@ void OBSBasic::InitHotkeys() obs_hotkeys_set_translations(&t); obs_hotkeys_set_audio_hotkeys_translations(Str("Mute"), Str("Unmute"), - Str("Monitor"), Str("Unmonitor"), - Str("Send"), Str("Unsend"), Str("Push-to-mute"), Str("Push-to-talk")); obs_hotkeys_set_sceneitem_hotkeys_translations( diff --git a/libobs/obs-hotkey.c b/libobs/obs-hotkey.c index 733fbcaa393a58..b150d29751a8ec 100644 --- a/libobs/obs-hotkey.c +++ b/libobs/obs-hotkey.c @@ -1591,17 +1591,11 @@ void obs_hotkey_update_atomic(obs_hotkey_atomic_update_func func, void *data) void obs_hotkeys_set_audio_hotkeys_translations( const char *mute, const char *unmute, - const char *monitor, const char *unmonitor, - const char *send, const char *unsend, const char *push_to_mute, const char *push_to_talk) { #define SET_T(n) bfree(obs->hotkeys.n); obs->hotkeys.n = bstrdup(n) SET_T(mute); SET_T(unmute); - SET_T(monitor); - SET_T(unmonitor); - SET_T(send); - SET_T(unsend); SET_T(push_to_mute); SET_T(push_to_talk); #undef SET_T diff --git a/libobs/obs-hotkey.h b/libobs/obs-hotkey.h index 487c05e5ebb055..4e4a86ab605265 100644 --- a/libobs/obs-hotkey.h +++ b/libobs/obs-hotkey.h @@ -143,8 +143,6 @@ EXPORT void obs_hotkeys_set_translations_s( EXPORT void obs_hotkeys_set_audio_hotkeys_translations( const char *mute, const char *unmute, - const char *monitor, const char *unmonitor, - const char *send, const char *unsend, const char *push_to_mute, const char *push_to_talk); EXPORT void obs_hotkeys_set_sceneitem_hotkeys_translations( diff --git a/libobs/obs-internal.h b/libobs/obs-internal.h index 2e4c8f60e7e125..bf10775b9827a9 100644 --- a/libobs/obs-internal.h +++ b/libobs/obs-internal.h @@ -383,10 +383,6 @@ struct obs_core_hotkeys { char *push_to_talk; char *sceneitem_show; char *sceneitem_hide; - char *monitor; - char *unmonitor; - char *send; - char *unsend; }; struct obs_core { @@ -535,8 +531,6 @@ enum audio_action_type { AUDIO_ACTION_MUTE, AUDIO_ACTION_PTT, AUDIO_ACTION_PTM, - AUDIO_ACTION_MON, - AUDIO_ACTION_SEND, }; struct audio_action { @@ -681,7 +675,6 @@ struct obs_source { /* sources specific hotkeys */ obs_hotkey_pair_id mute_unmute_key; - obs_hotkey_pair_id monitor_unmonitor_key; obs_hotkey_id push_to_mute_key; obs_hotkey_id push_to_talk_key; bool push_to_mute_enabled; @@ -728,7 +721,6 @@ struct obs_source { */ bool monitoring; bool sends; - obs_hotkey_pair_id send_unsend_key; }; extern struct obs_source_info *get_source_info(const char *id); diff --git a/libobs/obs-source.c b/libobs/obs-source.c index f1d7a196532593..805fb99b664d33 100644 --- a/libobs/obs-source.c +++ b/libobs/obs-source.c @@ -60,8 +60,6 @@ static const char *source_signals[] = { "void show(ptr source)", "void hide(ptr source)", "void mute(ptr source, bool muted)", - "void monitor(ptr source, bool monitoring)", - "void send(ptr source, bool send)", "void push_to_mute_changed(ptr source, bool enabled)", "void push_to_mute_delay(ptr source, int delay)", "void push_to_talk_changed(ptr source, bool enabled)", @@ -233,71 +231,6 @@ static bool obs_source_hotkey_unmute(void *data, return true; } -static bool obs_source_hotkey_monitor(void *data, - obs_hotkey_pair_id id, obs_hotkey_t *key, bool pressed) -{ - UNUSED_PARAMETER(id); - UNUSED_PARAMETER(key); - bool monON; - struct obs_source *source = data; - - enum obs_monitoring_type type = obs_source_get_monitoring_type(source); - monON = type == OBS_MONITORING_TYPE_NONE ? false : true; - if (!pressed || monON) - return false; - - source->monitoring = true; - obs_source_set_monitoring(source, true); - - return true; -} - -static bool obs_source_hotkey_unmonitor(void *data, - obs_hotkey_pair_id id, obs_hotkey_t *key, bool pressed) -{ - UNUSED_PARAMETER(id); - UNUSED_PARAMETER(key); - bool monOFF; - struct obs_source *source = data; - - enum obs_monitoring_type type = obs_source_get_monitoring_type(source); - monOFF = type == OBS_MONITORING_TYPE_NONE ? true : false; - if (!pressed || monOFF) - return false; - - source->monitoring = false; - obs_source_set_monitoring(source, false); - return true; -} - -static bool obs_source_hotkey_send(void *data, - obs_hotkey_pair_id id, obs_hotkey_t *key, bool pressed) -{ - UNUSED_PARAMETER(id); - UNUSED_PARAMETER(key); - struct obs_source *source = data; - - if (!pressed || source->sends) - return false; - - obs_source_set_send_hotkey(source, true); - return true; -} - -static bool obs_source_hotkey_unsend(void *data, - obs_hotkey_pair_id id, obs_hotkey_t *key, bool pressed) -{ - UNUSED_PARAMETER(id); - UNUSED_PARAMETER(key); - struct obs_source *source = data; - - if (!pressed || !source->sends) - return false; - - obs_source_set_send_hotkey(source, false); - return true; -} - static void obs_source_hotkey_push_to_mute(void *data, obs_hotkey_id id, obs_hotkey_t *key, bool pressed) { @@ -345,8 +278,6 @@ static void obs_source_init_audio_hotkeys(struct obs_source *source) if (!(source->info.output_flags & OBS_SOURCE_AUDIO) || source->info.type != OBS_SOURCE_TYPE_INPUT) { source->mute_unmute_key = OBS_INVALID_HOTKEY_ID; - source->monitor_unmonitor_key = OBS_INVALID_HOTKEY_PAIR_ID; - source->send_unsend_key = OBS_INVALID_HOTKEY_PAIR_ID; source->push_to_talk_key = OBS_INVALID_HOTKEY_ID; return; } @@ -357,19 +288,7 @@ static void obs_source_init_audio_hotkeys(struct obs_source *source) obs_source_hotkey_mute, obs_source_hotkey_unmute, source, source); - source->monitor_unmonitor_key = obs_hotkey_pair_register_source(source, - "libobs.monitor", obs->hotkeys.monitor, - "libobs.unmonitor", obs->hotkeys.unmonitor, - obs_source_hotkey_monitor, obs_source_hotkey_unmonitor, - source, source); - if (!(source->info.output_flags & OBS_SOURCE_TRACK)) { - source->send_unsend_key = obs_hotkey_pair_register_source(source, - "libobs.send", obs->hotkeys.send, - "libobs.unsend", obs->hotkeys.unsend, - obs_source_hotkey_send, obs_source_hotkey_unsend, - source, source); - source->push_to_mute_key = obs_hotkey_register_source(source, "libobs.push-to-mute", obs->hotkeys.push_to_mute, obs_source_hotkey_push_to_mute, source); @@ -404,8 +323,6 @@ static obs_source_t *obs_source_create_internal(const char *id, } source->mute_unmute_key = OBS_INVALID_HOTKEY_PAIR_ID; - source->monitor_unmonitor_key = OBS_INVALID_HOTKEY_PAIR_ID; - source->send_unsend_key = OBS_INVALID_HOTKEY_PAIR_ID; source->push_to_mute_key = OBS_INVALID_HOTKEY_ID; source->push_to_talk_key = OBS_INVALID_HOTKEY_ID; @@ -654,8 +571,6 @@ void obs_source_destroy(struct obs_source *source) obs_hotkey_unregister(source->push_to_talk_key); obs_hotkey_unregister(source->push_to_mute_key); obs_hotkey_pair_unregister(source->mute_unmute_key); - obs_hotkey_pair_unregister(source->monitor_unmonitor_key); - obs_hotkey_pair_unregister(source->send_unsend_key); for (i = 0; i < source->async_cache.num; i++) obs_source_frame_decref(source->async_cache.array[i].frame); @@ -3718,55 +3633,6 @@ void obs_source_set_muted(obs_source_t *source, bool muted) pthread_mutex_unlock(&source->audio_actions_mutex); } -void obs_source_set_monitoring(obs_source_t *source, bool monitoring) { - struct calldata data; - uint8_t stack[128]; - struct audio_action action = { - .timestamp = os_gettime_ns(), - .type = AUDIO_ACTION_MON, - .set = monitoring - }; - - if (!obs_source_valid(source, "obs_source_set_monitoring")) - return; - - source->monitoring = monitoring; - - calldata_init_fixed(&data, stack, sizeof(stack)); - calldata_set_ptr(&data, "source", source); - calldata_set_bool(&data, "monitor", monitoring); - - signal_handler_signal(source->context.signals, "monitor", &data); - - pthread_mutex_lock(&source->audio_actions_mutex); - da_push_back(source->audio_actions, &action); - pthread_mutex_unlock(&source->audio_actions_mutex); -} - -void obs_source_set_send_hotkey(obs_source_t *source, bool send) -{ - struct calldata data; - uint8_t stack[128]; - struct audio_action action = { - .timestamp = os_gettime_ns(), - .type = AUDIO_ACTION_SEND, - .set = send - }; - - if (!obs_source_valid(source, "obs_source_set_send_hotkey")) - return; - - calldata_init_fixed(&data, stack, sizeof(stack)); - calldata_set_ptr(&data, "source", source); - calldata_set_bool(&data, "send", send); - - signal_handler_signal(source->context.signals, "send", &data); - - pthread_mutex_lock(&source->audio_actions_mutex); - da_push_back(source->audio_actions, &action); - pthread_mutex_unlock(&source->audio_actions_mutex); -} - static void source_signal_push_to_changed(obs_source_t *source, const char *signal, bool enabled) { @@ -3973,14 +3839,10 @@ static inline void apply_audio_action(obs_source_t *source, source->volume = action->vol; break; case AUDIO_ACTION_MUTE: source->muted = action->set; break; - case AUDIO_ACTION_MON: - source->monitoring = action->set; break; case AUDIO_ACTION_PTT: source->push_to_talk_pressed = action->set; break; case AUDIO_ACTION_PTM: source->push_to_mute_pressed = action->set; break; - case AUDIO_ACTION_SEND: - source->sends = action->set; break; } } diff --git a/libobs/obs.c b/libobs/obs.c index 2a2a82d9d4e43d..8879c76ef22b4a 100644 --- a/libobs/obs.c +++ b/libobs/obs.c @@ -689,10 +689,6 @@ static inline bool obs_init_hotkeys(void) hotkeys->name_map_init_token = obs_pthread_once_init_token; hotkeys->mute = bstrdup("Mute"); hotkeys->unmute = bstrdup("Unmute"); - hotkeys->monitor = bstrdup("Monitor"); - hotkeys->unmonitor= bstrdup("Unmonitor"); - hotkeys->send = bstrdup("Send"); - hotkeys->unsend = bstrdup("Unsend"); hotkeys->push_to_mute = bstrdup("Push-to-mute"); hotkeys->push_to_talk = bstrdup("Push-to-talk"); hotkeys->sceneitem_show = bstrdup("Show '%1'"); @@ -744,10 +740,6 @@ static inline void obs_free_hotkeys(void) bfree(hotkeys->mute); bfree(hotkeys->unmute); - bfree(hotkeys->monitor); - bfree(hotkeys->unmonitor); - bfree(hotkeys->send); - bfree(hotkeys->unsend); bfree(hotkeys->push_to_mute); bfree(hotkeys->push_to_talk); bfree(hotkeys->sceneitem_show);