UI: Add function to enable/disable outputs

master
jp9000 2017-04-28 03:58:53 -07:00
parent d1329d1798
commit b850bc6415
2 changed files with 13 additions and 0 deletions

View File

@ -3881,6 +3881,8 @@ void OBSBasic::StartStreaming()
{
if (outputHandler->StreamingActive())
return;
if (!enableOutputs)
return;
if (api)
api->on_event(OBS_FRONTEND_EVENT_STREAMING_STARTING);
@ -4158,6 +4160,8 @@ void OBSBasic::StartRecording()
{
if (outputHandler->RecordingActive())
return;
if (!enableOutputs)
return;
if (api)
api->on_event(OBS_FRONTEND_EVENT_RECORDING_STARTING);
@ -4258,6 +4262,8 @@ void OBSBasic::StartReplayBuffer()
return;
if (outputHandler->ReplayBufferActive())
return;
if (!enableOutputs)
return;
obs_output_t *output = outputHandler->replayBuffer;
obs_data_t *hotkeys = obs_hotkeys_save_output(output);

View File

@ -314,6 +314,8 @@ private:
int programCX = 0, programCY = 0;
float programScale = 0.0f;
bool enableOutputs = true;
inline bool IsPreviewProgramMode() const
{
return os_atomic_load_bool(&previewProgramMode);
@ -493,6 +495,11 @@ public:
void SaveService();
bool LoadService();
inline void EnableOutputs(bool enable)
{
enableOutputs = enable;
}
void ReorderSceneItem(obs_sceneitem_t *item, size_t idx);
QMenu *AddDeinterlacingMenu(obs_source_t *source);