0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00
obs-studio/obs/window-basic-main-outputs.hpp
jp9000 f592c33eec UI: Implement stream delay
When stream delay is active, the "Start/Stop Streaming" button is
changed in to a menu button, which allows the user to select either the
option to stop the stream (which causes it to count down), or forcibly
stop the stream (which immediately stops the stream and cuts off all
delayed data).

If the user decides they want to start the stream again while in the
process of counting down, they can safely do so without having to wait
for it to stop, and it will schedule it to start up again with the same
delay after the stop.

On the status bar, it will now show whether delay is active, and its
duration.  If the stream is in the process of stopping/starting, it will
count down to the stop/start.

If the option to preserve stream cutoff point on unexpected
disconnections/reconnections is enabled, it will update the current
delay duration accordingly.
2015-09-10 12:13:40 -07:00

42 lines
1.2 KiB
C++

#pragma once
class OBSBasic;
struct BasicOutputHandler {
OBSOutput fileOutput;
OBSOutput streamOutput;
bool streamingActive = false;
bool recordingActive = false;
bool delayActive = false;
OBSBasic *main;
OBSSignal startRecording;
OBSSignal stopRecording;
OBSSignal startStreaming;
OBSSignal stopStreaming;
OBSSignal streamDelayStarting;
OBSSignal streamDelayStopping;
inline BasicOutputHandler(OBSBasic *main_) : main(main_) {}
virtual ~BasicOutputHandler() {};
virtual bool StartStreaming(obs_service_t *service) = 0;
virtual bool StartRecording() = 0;
virtual void StopStreaming() = 0;
virtual void ForceStopStreaming() = 0;
virtual void StopRecording() = 0;
virtual bool StreamingActive() const = 0;
virtual bool RecordingActive() const = 0;
virtual void Update() = 0;
inline bool Active() const
{
return streamingActive || recordingActive || delayActive;
}
};
BasicOutputHandler *CreateSimpleOutputHandler(OBSBasic *main);
BasicOutputHandler *CreateAdvancedOutputHandler(OBSBasic *main);