yolobs-studio/UI/window-basic-main-outputs.hpp

73 lines
2 KiB
C++
Raw Normal View History

2016-02-23 23:16:51 +00:00
#pragma once
2018-02-19 19:54:37 +00:00
#include <string>
2016-02-23 23:16:51 +00:00
class OBSBasic;
struct BasicOutputHandler {
2019-09-22 21:19:10 +00:00
OBSOutput fileOutput;
OBSOutput streamOutput;
OBSOutput replayBuffer;
2020-10-01 20:15:25 +00:00
OBSOutput virtualCam;
2019-09-22 21:19:10 +00:00
bool streamingActive = false;
bool recordingActive = false;
bool delayActive = false;
bool replayBufferActive = false;
2020-10-01 20:15:25 +00:00
bool virtualCamActive = false;
2019-09-22 21:19:10 +00:00
OBSBasic *main;
std::string outputType;
std::string lastError;
2020-10-01 20:15:25 +00:00
std::string lastRecordingPath;
2019-09-22 21:19:10 +00:00
OBSSignal startRecording;
OBSSignal stopRecording;
OBSSignal startReplayBuffer;
OBSSignal stopReplayBuffer;
OBSSignal startStreaming;
OBSSignal stopStreaming;
2020-10-01 20:15:25 +00:00
OBSSignal startVirtualCam;
OBSSignal stopVirtualCam;
2019-09-22 21:19:10 +00:00
OBSSignal streamDelayStarting;
OBSSignal streamStopping;
OBSSignal recordStopping;
OBSSignal replayBufferStopping;
2016-02-23 23:16:51 +00:00
2020-10-01 20:15:25 +00:00
inline BasicOutputHandler(OBSBasic *main_);
2016-02-23 23:16:51 +00:00
2019-09-22 21:19:10 +00:00
virtual ~BasicOutputHandler(){};
2016-02-23 23:16:51 +00:00
2020-10-01 20:15:25 +00:00
virtual bool SetupStreaming(obs_service_t *service) = 0;
2016-02-23 23:16:51 +00:00
virtual bool StartStreaming(obs_service_t *service) = 0;
virtual bool StartRecording() = 0;
2019-09-22 21:19:10 +00:00
virtual bool StartReplayBuffer() { return false; }
2020-10-01 20:15:25 +00:00
virtual bool StartVirtualCam();
2016-10-10 19:01:40 +00:00
virtual void StopStreaming(bool force = false) = 0;
virtual void StopRecording(bool force = false) = 0;
2019-09-22 21:19:10 +00:00
virtual void StopReplayBuffer(bool force = false) { (void)force; }
2020-10-01 20:15:25 +00:00
virtual void StopVirtualCam();
2016-02-23 23:16:51 +00:00
virtual bool StreamingActive() const = 0;
virtual bool RecordingActive() const = 0;
2019-09-22 21:19:10 +00:00
virtual bool ReplayBufferActive() const { return false; }
2020-10-01 20:15:25 +00:00
virtual bool VirtualCamActive() const;
2016-02-23 23:16:51 +00:00
virtual void Update() = 0;
2020-10-01 20:15:25 +00:00
virtual void SetupOutputs() = 0;
2016-02-23 23:16:51 +00:00
inline bool Active() const
{
2017-04-19 19:54:15 +00:00
return streamingActive || recordingActive || delayActive ||
2020-10-01 20:15:25 +00:00
replayBufferActive || virtualCamActive;
2016-02-23 23:16:51 +00:00
}
2020-10-01 20:15:25 +00:00
protected:
bool SetupAutoRemux(const char *&ext);
std::string GetRecordingFilename(const char *path, const char *ext,
bool noSpace, bool overwrite,
const char *format, bool ffmpeg);
2016-02-23 23:16:51 +00:00
};
BasicOutputHandler *CreateSimpleOutputHandler(OBSBasic *main);
BasicOutputHandler *CreateAdvancedOutputHandler(OBSBasic *main);