mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-06-14 12:51:43 -05:00
Add backward compatibility check to support OBS 25
This commit is contained in:
parent
55ca146a82
commit
76fa1f8942
|
|
@ -100,14 +100,29 @@ if(BUILD_OUT_OF_TREE)
|
|||
|
||||
find_package(CURL REQUIRED)
|
||||
include_directories("${CURL_INCLUDE_DIRS}")
|
||||
|
||||
# Backwards compatability with older OBS versions
|
||||
if(LibObs_VERSION_MAJOR GREATER_EQUAL 27)
|
||||
add_definitions(-DVCAM_SUPPORTED)
|
||||
else()
|
||||
message(
|
||||
WARNING
|
||||
"OBS version ${LibObs_VERSION_MAJOR} found - disabling virtual camera functionality"
|
||||
)
|
||||
endif()
|
||||
if(LibObs_VERSION_MAJOR GREATER_EQUAL 26)
|
||||
add_definitions(-DREPLAYBUFFER_SUPPORTED)
|
||||
else()
|
||||
message(
|
||||
WARNING
|
||||
"OBS version ${LibObs_VERSION_MAJOR} found - disabling replay buffer functionality"
|
||||
)
|
||||
endif()
|
||||
else()
|
||||
find_package(Libcurl REQUIRED)
|
||||
include_directories("${LIBCURL_INCLUDE_DIRS}")
|
||||
endif()
|
||||
|
||||
# Backwards compatability with older OBS versions
|
||||
if(LibObs_VERSION_MAJOR GREATER_EQUAL 27 OR NOT LibObs_VERSION_MAJOR)
|
||||
add_definitions(-DVCAM_SUPPORTED)
|
||||
add_definitions(-DREPLAYBUFFER_SUPPORTED)
|
||||
endif()
|
||||
|
||||
# Platform specific settings
|
||||
|
|
|
|||
|
|
@ -579,9 +579,11 @@ static void OBSEvent(enum obs_frontend_event event, void *switcher)
|
|||
case OBS_FRONTEND_EVENT_STREAMING_STOPPED:
|
||||
resetLiveTime();
|
||||
break;
|
||||
#ifdef REPLAYBUFFER_SUPPORTED
|
||||
case OBS_FRONTEND_EVENT_REPLAY_BUFFER_SAVED:
|
||||
setReplayBufferSaved();
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
#ifdef REPLAYBUFFER_SUPPORTED
|
||||
|
||||
#pragma once
|
||||
#include "macro-action-edit.hpp"
|
||||
#include "duration-control.hpp"
|
||||
|
|
@ -65,3 +67,5 @@ private:
|
|||
QHBoxLayout *_mainLayout;
|
||||
bool _loading = true;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
#ifdef REPLAYBUFFER_SUPPORTED
|
||||
|
||||
#pragma once
|
||||
#include "macro.hpp"
|
||||
#include <QWidget>
|
||||
|
|
@ -54,3 +56,5 @@ protected:
|
|||
private:
|
||||
bool _loading = true;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
#ifdef REPLAYBUFFER_SUPPORTED
|
||||
|
||||
#include "headers/macro-action-replay-buffer.hpp"
|
||||
#include "headers/advanced-scene-switcher.hpp"
|
||||
#include "headers/utility.hpp"
|
||||
|
|
@ -119,3 +121,5 @@ void MacroActionReplayBufferEdit::ActionChanged(int value)
|
|||
std::lock_guard<std::mutex> lock(switcher->m);
|
||||
_entryData->_action = static_cast<ReplayBufferAction>(value);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
#ifdef REPLAYBUFFER_SUPPORTED
|
||||
|
||||
#include "headers/macro-condition-edit.hpp"
|
||||
#include "headers/macro-condition-replay-buffer.hpp"
|
||||
#include "headers/utility.hpp"
|
||||
|
|
@ -106,3 +108,5 @@ void MacroConditionReplayBufferEdit::UpdateEntryData()
|
|||
|
||||
_state->setCurrentIndex(static_cast<int>(_entryData->_state));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -185,18 +185,22 @@ void frontEndActionThread(sceneTriggerAction action, double delay)
|
|||
case sceneTriggerAction::STOP_STREAMING:
|
||||
obs_frontend_streaming_stop();
|
||||
break;
|
||||
#ifdef REPLAYBUFFER_SUPPORTED
|
||||
case sceneTriggerAction::START_REPLAY_BUFFER:
|
||||
obs_frontend_replay_buffer_start();
|
||||
break;
|
||||
case sceneTriggerAction::STOP_REPLAY_BUFFER:
|
||||
obs_frontend_replay_buffer_stop();
|
||||
break;
|
||||
#endif
|
||||
#ifdef VCAM_SUPPORTED
|
||||
case sceneTriggerAction::START_VCAM:
|
||||
obs_frontend_start_virtualcam();
|
||||
break;
|
||||
case sceneTriggerAction::STOP_VCAM:
|
||||
obs_frontend_stop_virtualcam();
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
blog(LOG_WARNING, "ignoring unexpected frontend action '%d'",
|
||||
static_cast<int>(action));
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user