obs-studio/obs/window-basic-main-outputs.hpp
jp9000 2ebb6e60ce UI: Don't use activeRefs to determine if active
Due to certain design changes for delay, it's better to simply determine
whether outputs are active via booleans rather than an activeRefs
variable, which could get decremented more than once if say, the signal
for stopping the stream gets called more than once for whatever reason
(which may happen in the case of delay due to the way delay works)
2015-09-06 16:33:58 -07:00

38 lines
1011 B
C++

#pragma once
class OBSBasic;
struct BasicOutputHandler {
OBSOutput fileOutput;
OBSOutput streamOutput;
bool streamingActive = false;
bool recordingActive = false;
OBSBasic *main;
OBSSignal startRecording;
OBSSignal stopRecording;
OBSSignal startStreaming;
OBSSignal stopStreaming;
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 StopRecording() = 0;
virtual bool StreamingActive() const = 0;
virtual bool RecordingActive() const = 0;
virtual void Update() = 0;
inline bool Active() const
{
return streamingActive || recordingActive;
}
};
BasicOutputHandler *CreateSimpleOutputHandler(OBSBasic *main);
BasicOutputHandler *CreateAdvancedOutputHandler(OBSBasic *main);