mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-09 01:56:00 -05:00
Move audio fade threads to generic _helperThreads of macro
This will allow waiting for and stopping audio fades when calling Stop() for a particular macro
This commit is contained in:
@@ -16,7 +16,6 @@ enum class AudioAction {
|
||||
class MacroActionAudio : public MacroAction {
|
||||
public:
|
||||
MacroActionAudio(Macro *m) : MacroAction(m) {}
|
||||
virtual ~MacroActionAudio();
|
||||
bool PerformAction();
|
||||
void LogAction();
|
||||
bool Save(obs_data_t *obj);
|
||||
@@ -40,7 +39,6 @@ private:
|
||||
void StartMasterFade();
|
||||
void FadeSourceVolume();
|
||||
void FadeMasterVolume();
|
||||
std::thread _fadeThread;
|
||||
|
||||
static bool _registered;
|
||||
static const std::string id;
|
||||
|
||||
@@ -88,6 +88,7 @@ public:
|
||||
bool MatchOnChange() { return _matchOnChange; }
|
||||
int GetCount() { return _count; };
|
||||
void ResetCount() { _count = 0; };
|
||||
void AddHelperThread(std::thread &&);
|
||||
bool GetStop() { return _stop; }
|
||||
void Stop();
|
||||
std::deque<std::shared_ptr<MacroCondition>> &Conditions()
|
||||
@@ -136,7 +137,8 @@ private:
|
||||
bool _die = false;
|
||||
bool _stop = false;
|
||||
bool _done = true;
|
||||
std::thread _thread;
|
||||
std::thread _backgroundThread;
|
||||
std::vector<std::thread> _helperThreads;
|
||||
};
|
||||
|
||||
Macro *GetMacroByName(const char *name);
|
||||
|
||||
Reference in New Issue
Block a user