mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
Merge pull request #658 from Palakis/fix/tab-formatting
Misc: Fix indentation of src files
This commit is contained in:
commit
a1cf7f8d32
@ -19,16 +19,16 @@ with this program. If not, see <https://www.gnu.org/licenses/>
|
|||||||
#include "ConnectionProperties.h"
|
#include "ConnectionProperties.h"
|
||||||
|
|
||||||
ConnectionProperties::ConnectionProperties()
|
ConnectionProperties::ConnectionProperties()
|
||||||
: _authenticated(false)
|
: _authenticated(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ConnectionProperties::isAuthenticated()
|
bool ConnectionProperties::isAuthenticated()
|
||||||
{
|
{
|
||||||
return _authenticated.load();
|
return _authenticated.load();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConnectionProperties::setAuthenticated(bool authenticated)
|
void ConnectionProperties::setAuthenticated(bool authenticated)
|
||||||
{
|
{
|
||||||
_authenticated.store(authenticated);
|
_authenticated.store(authenticated);
|
||||||
}
|
}
|
@ -23,9 +23,9 @@ with this program. If not, see <https://www.gnu.org/licenses/>
|
|||||||
class ConnectionProperties
|
class ConnectionProperties
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit ConnectionProperties();
|
explicit ConnectionProperties();
|
||||||
bool isAuthenticated();
|
bool isAuthenticated();
|
||||||
void setAuthenticated(bool authenticated);
|
void setAuthenticated(bool authenticated);
|
||||||
private:
|
private:
|
||||||
std::atomic<bool> _authenticated;
|
std::atomic<bool> _authenticated;
|
||||||
};
|
};
|
12
src/Utils.h
12
src/Utils.h
@ -88,10 +88,10 @@ namespace Utils {
|
|||||||
const char* GetCurrentRecordingFilename();
|
const char* GetCurrentRecordingFilename();
|
||||||
|
|
||||||
QString nsToTimestamp(uint64_t ns);
|
QString nsToTimestamp(uint64_t ns);
|
||||||
struct AddSourceData {
|
struct AddSourceData {
|
||||||
obs_source_t *source;
|
obs_source_t *source;
|
||||||
obs_sceneitem_t *sceneItem;
|
obs_sceneitem_t *sceneItem;
|
||||||
bool setVisible;
|
bool setVisible;
|
||||||
};
|
};
|
||||||
void AddSourceHelper(void *_data, obs_scene_t *scene);
|
void AddSourceHelper(void *_data, obs_scene_t *scene);
|
||||||
};
|
};
|
||||||
|
@ -29,19 +29,19 @@ RpcResponse ifCanPause(const RpcRequest& request, std::function<RpcResponse()> c
|
|||||||
* @since unreleased
|
* @since unreleased
|
||||||
*/
|
*/
|
||||||
RpcResponse WSRequestHandler::GetRecordingStatus(const RpcRequest& request) {
|
RpcResponse WSRequestHandler::GetRecordingStatus(const RpcRequest& request) {
|
||||||
auto events = GetEventsSystem();
|
auto events = GetEventsSystem();
|
||||||
|
|
||||||
OBSDataAutoRelease data = obs_data_create();
|
OBSDataAutoRelease data = obs_data_create();
|
||||||
obs_data_set_bool(data, "isRecording", obs_frontend_recording_active());
|
obs_data_set_bool(data, "isRecording", obs_frontend_recording_active());
|
||||||
obs_data_set_bool(data, "isRecordingPaused", obs_frontend_recording_paused());
|
obs_data_set_bool(data, "isRecordingPaused", obs_frontend_recording_paused());
|
||||||
|
|
||||||
if (obs_frontend_recording_active()) {
|
if (obs_frontend_recording_active()) {
|
||||||
QString recordingTimecode = events->getRecordingTimecode();
|
QString recordingTimecode = events->getRecordingTimecode();
|
||||||
obs_data_set_string(data, "recordTimecode", recordingTimecode.toUtf8().constData());
|
obs_data_set_string(data, "recordTimecode", recordingTimecode.toUtf8().constData());
|
||||||
obs_data_set_string(data, "recordingFilename", Utils::GetCurrentRecordingFilename());
|
obs_data_set_string(data, "recordingFilename", Utils::GetCurrentRecordingFilename());
|
||||||
}
|
}
|
||||||
|
|
||||||
return request.success(data);
|
return request.success(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -16,10 +16,10 @@
|
|||||||
* @since unreleased
|
* @since unreleased
|
||||||
*/
|
*/
|
||||||
RpcResponse WSRequestHandler::GetReplayBufferStatus(const RpcRequest& request) {
|
RpcResponse WSRequestHandler::GetReplayBufferStatus(const RpcRequest& request) {
|
||||||
OBSDataAutoRelease data = obs_data_create();
|
OBSDataAutoRelease data = obs_data_create();
|
||||||
obs_data_set_bool(data, "isReplayBufferActive", obs_frontend_replay_buffer_active());
|
obs_data_set_bool(data, "isReplayBufferActive", obs_frontend_replay_buffer_active());
|
||||||
|
|
||||||
return request.success(data);
|
return request.success(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -975,10 +975,10 @@ RpcResponse WSRequestHandler::GetTextFreetype2Properties(const RpcRequest& reque
|
|||||||
*/
|
*/
|
||||||
RpcResponse WSRequestHandler::SetTextFreetype2Properties(const RpcRequest& request)
|
RpcResponse WSRequestHandler::SetTextFreetype2Properties(const RpcRequest& request)
|
||||||
{
|
{
|
||||||
const char* sourceName = obs_data_get_string(request.parameters(), "source");
|
const char* sourceName = obs_data_get_string(request.parameters(), "source");
|
||||||
if (!sourceName) {
|
if (!sourceName) {
|
||||||
return request.failed("invalid request parameters");
|
return request.failed("invalid request parameters");
|
||||||
}
|
}
|
||||||
|
|
||||||
OBSSourceAutoRelease source = obs_get_source_by_name(sourceName);
|
OBSSourceAutoRelease source = obs_get_source_by_name(sourceName);
|
||||||
if (!source) {
|
if (!source) {
|
||||||
@ -1681,8 +1681,8 @@ RpcResponse WSRequestHandler::SetAudioMonitorType(const RpcRequest& request)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Takes a picture snapshot of a source and then can either or both:
|
* Takes a picture snapshot of a source and then can either or both:
|
||||||
* - Send it over as a Data URI (base64-encoded data) in the response (by specifying `embedPictureFormat` in the request)
|
* - Send it over as a Data URI (base64-encoded data) in the response (by specifying `embedPictureFormat` in the request)
|
||||||
* - Save it to disk (by specifying `saveToFilePath` in the request)
|
* - Save it to disk (by specifying `saveToFilePath` in the request)
|
||||||
*
|
*
|
||||||
* At least `embedPictureFormat` or `saveToFilePath` must be specified.
|
* At least `embedPictureFormat` or `saveToFilePath` must be specified.
|
||||||
*
|
*
|
||||||
|
@ -44,7 +44,7 @@ WSServer::WSServer()
|
|||||||
_connections(),
|
_connections(),
|
||||||
_clMutex(QMutex::Recursive)
|
_clMutex(QMutex::Recursive)
|
||||||
{
|
{
|
||||||
_server.get_alog().clear_channels(websocketpp::log::alevel::frame_header | websocketpp::log::alevel::frame_payload | websocketpp::log::alevel::control);
|
_server.get_alog().clear_channels(websocketpp::log::alevel::frame_header | websocketpp::log::alevel::frame_payload | websocketpp::log::alevel::control);
|
||||||
_server.init_asio();
|
_server.init_asio();
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
_server.set_reuse_addr(true);
|
_server.set_reuse_addr(true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user