mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
OBSRemoteProtocol: rely only on event data when encoding an event
This commit is contained in:
parent
a0dce77a2f
commit
4338cf57e6
@ -67,13 +67,15 @@ std::string OBSRemoteProtocol::encodeEvent(const RpcEvent& event)
|
||||
QString updateType = event.updateType();
|
||||
obs_data_set_string(eventData, "update-type", updateType.toUtf8().constData());
|
||||
|
||||
if (obs_frontend_streaming_active()) {
|
||||
QString streamingTimecode = Utils::nsToTimestamp(event.streamTime().value());
|
||||
std::optional<uint64_t> streamTime = event.streamTime();
|
||||
if (streamTime.has_value()) {
|
||||
QString streamingTimecode = Utils::nsToTimestamp(streamTime.value());
|
||||
obs_data_set_string(eventData, "stream-timecode", streamingTimecode.toUtf8().constData());
|
||||
}
|
||||
|
||||
if (obs_frontend_recording_active()) {
|
||||
QString recordingTimecode = Utils::nsToTimestamp(event.recordingTime().value());
|
||||
std::optional<uint64_t> recordingTime = event.recordingTime();
|
||||
if (recordingTime.has_value()) {
|
||||
QString recordingTimecode = Utils::nsToTimestamp(recordingTime.value());
|
||||
obs_data_set_string(eventData, "rec-timecode", recordingTimecode.toUtf8().constData());
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user