Allow plugins to toggle the default transition via the API
This commit is contained in:
parent
473ca5ee31
commit
c054777d66
@ -64,6 +64,10 @@ Scene* OBSGetScene() {return API->GetScene();}
|
|||||||
CTSTR OBSGetSceneName() {return API->GetSceneName();}
|
CTSTR OBSGetSceneName() {return API->GetSceneName();}
|
||||||
XElement* OBSGetSceneElement() {return API->GetSceneElement();}
|
XElement* OBSGetSceneElement() {return API->GetSceneElement();}
|
||||||
|
|
||||||
|
void OBSDisableTransitions() { API->DisableTransitions(); }
|
||||||
|
void OBSEnableTransitions() { API->EnableTransitions(); }
|
||||||
|
bool OBSTransitionsEnabled() { return API->TransitionsEnabled(); }
|
||||||
|
|
||||||
bool OBSSetSceneCollection(CTSTR lpCollection, CTSTR lpScene)
|
bool OBSSetSceneCollection(CTSTR lpCollection, CTSTR lpScene)
|
||||||
{
|
{
|
||||||
return API->SetSceneCollection(lpCollection, lpScene);
|
return API->SetSceneCollection(lpCollection, lpScene);
|
||||||
|
@ -197,6 +197,10 @@ public:
|
|||||||
virtual bool SetSceneCollection(CTSTR lpCollection, CTSTR lpScene) = 0;
|
virtual bool SetSceneCollection(CTSTR lpCollection, CTSTR lpScene) = 0;
|
||||||
virtual CTSTR GetSceneCollectionName() const = 0;
|
virtual CTSTR GetSceneCollectionName() const = 0;
|
||||||
virtual void GetSceneCollectionNames(StringList &list) const = 0;
|
virtual void GetSceneCollectionNames(StringList &list) const = 0;
|
||||||
|
|
||||||
|
virtual void DisableTransitions() = 0;
|
||||||
|
virtual void EnableTransitions() = 0;
|
||||||
|
virtual bool TransitionsEnabled() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
BASE_EXPORT extern APIInterface *API;
|
BASE_EXPORT extern APIInterface *API;
|
||||||
@ -226,6 +230,10 @@ BASE_EXPORT bool OBSSetSceneCollection(CTSTR lpCollection, CTSTR lpScene);
|
|||||||
BASE_EXPORT CTSTR OBSGetSceneCollectionName();
|
BASE_EXPORT CTSTR OBSGetSceneCollectionName();
|
||||||
BASE_EXPORT void OBSGetSceneCollectionNames(StringList &list);
|
BASE_EXPORT void OBSGetSceneCollectionNames(StringList &list);
|
||||||
|
|
||||||
|
BASE_EXPORT void OBSDisableTransitions();
|
||||||
|
BASE_EXPORT void OBSEnableTransitions();
|
||||||
|
BASE_EXPORT bool OBSTransitionsEnabled();
|
||||||
|
|
||||||
//low-order word is VK, high-order word is modifier. equivalent to the value given by hotkey controls
|
//low-order word is VK, high-order word is modifier. equivalent to the value given by hotkey controls
|
||||||
BASE_EXPORT UINT OBSCreateHotkey(DWORD hotkey, OBSHOTKEYPROC hotkeyProc, UPARAM param);
|
BASE_EXPORT UINT OBSCreateHotkey(DWORD hotkey, OBSHOTKEYPROC hotkeyProc, UPARAM param);
|
||||||
BASE_EXPORT void OBSDeleteHotkey(UINT hotkeyID);
|
BASE_EXPORT void OBSDeleteHotkey(UINT hotkeyID);
|
||||||
|
@ -264,7 +264,7 @@ bool OBS::SetScene(CTSTR lpScene)
|
|||||||
bChangingSources = true;
|
bChangingSources = true;
|
||||||
ListView_DeleteAllItems(hwndSources);
|
ListView_DeleteAllItems(hwndSources);
|
||||||
|
|
||||||
bool bSkipTransition = false;
|
bool bSkipTransition = !performTransition;
|
||||||
|
|
||||||
XElement *sources = sceneElement->GetElement(TEXT("sources"));
|
XElement *sources = sceneElement->GetElement(TEXT("sources"));
|
||||||
if(sources)
|
if(sources)
|
||||||
@ -679,6 +679,9 @@ public:
|
|||||||
}
|
}
|
||||||
virtual CTSTR GetSceneCollectionName() const { return App->GetCurrentSceneCollection(); }
|
virtual CTSTR GetSceneCollectionName() const { return App->GetCurrentSceneCollection(); }
|
||||||
virtual void GetSceneCollectionNames(StringList &list) const { return App->GetSceneCollection(list); }
|
virtual void GetSceneCollectionNames(StringList &list) const { return App->GetSceneCollection(list); }
|
||||||
|
virtual void DisableTransitions() { App->performTransition = false; }
|
||||||
|
virtual void EnableTransitions() { App->performTransition = true; }
|
||||||
|
virtual bool TransitionsEnabled() const { return App->performTransition; }
|
||||||
};
|
};
|
||||||
|
|
||||||
APIInterface* CreateOBSApiInterface()
|
APIInterface* CreateOBSApiInterface()
|
||||||
|
@ -130,6 +130,8 @@ OBS::OBS()
|
|||||||
{
|
{
|
||||||
App = this;
|
App = this;
|
||||||
|
|
||||||
|
performTransition = true; //Default to true and don't set the conf.
|
||||||
|
//We don't want to let plugins disable standard behavior permanently.
|
||||||
hSceneMutex = OSCreateMutex();
|
hSceneMutex = OSCreateMutex();
|
||||||
hAuxAudioMutex = OSCreateMutex();
|
hAuxAudioMutex = OSCreateMutex();
|
||||||
hVideoEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
|
hVideoEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
|
||||||
|
@ -643,6 +643,7 @@ class OBS
|
|||||||
Texture *lastRenderTexture;
|
Texture *lastRenderTexture;
|
||||||
Texture *transitionTexture;
|
Texture *transitionTexture;
|
||||||
|
|
||||||
|
bool performTransition;
|
||||||
bool bTransitioning;
|
bool bTransitioning;
|
||||||
float transitionAlpha;
|
float transitionAlpha;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user