mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
Utils/Obs: Update StringHelper function names
I hated having `String` appended to half of the utils since it was extra
This commit is contained in:
parent
08eb2defbc
commit
0f17d3d6f8
@ -8,7 +8,7 @@
|
||||
RequestResult RequestHandler::GetVersion(const Request& request)
|
||||
{
|
||||
json responseData;
|
||||
responseData["obsVersion"] = Utils::Obs::StringHelper::GetObsVersionString();
|
||||
responseData["obsVersion"] = Utils::Obs::StringHelper::GetObsVersion();
|
||||
responseData["obsWebSocketVersion"] = OBS_WEBSOCKET_VERSION;
|
||||
responseData["rpcVersion"] = OBS_WEBSOCKET_RPC_VERSION;
|
||||
responseData["availableRequests"] = GetRequestList();
|
||||
|
@ -319,7 +319,7 @@ RequestResult RequestHandler::GetInputAudioMonitorType(const Request& request)
|
||||
return RequestResult::Error(statusCode, comment);
|
||||
|
||||
json responseData;
|
||||
responseData["monitorType"] = Utils::Obs::StringHelper::GetInputMonitorTypeString(input);
|
||||
responseData["monitorType"] = Utils::Obs::StringHelper::GetInputMonitorType(input);
|
||||
|
||||
return RequestResult::Success(responseData);
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ RequestResult RequestHandler::GetMediaInputStatus(const Request& request)
|
||||
return RequestResult::Error(statusCode, comment);
|
||||
|
||||
json responseData;
|
||||
responseData["mediaState"] = Utils::Obs::StringHelper::GetMediaInputStateString(input);
|
||||
responseData["mediaState"] = Utils::Obs::StringHelper::GetMediaInputState(input);
|
||||
|
||||
auto mediaState = obs_source_media_get_state(input);
|
||||
if (mediaState == OBS_MEDIA_STATE_PLAYING || mediaState == OBS_MEDIA_STATE_PAUSED) {
|
||||
|
@ -30,7 +30,7 @@ std::vector<std::string> ConvertStringArray(char **array)
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::string Utils::Obs::StringHelper::GetObsVersionString()
|
||||
std::string Utils::Obs::StringHelper::GetObsVersion()
|
||||
{
|
||||
uint32_t version = obs_get_version();
|
||||
|
||||
@ -77,7 +77,7 @@ std::string Utils::Obs::StringHelper::GetCurrentRecordOutputPath()
|
||||
return "";
|
||||
}
|
||||
|
||||
std::string Utils::Obs::StringHelper::GetSourceTypeString(obs_source_t *source)
|
||||
std::string Utils::Obs::StringHelper::GetSourceType(obs_source_t *source)
|
||||
{
|
||||
obs_source_type sourceType = obs_source_get_type(source);
|
||||
|
||||
@ -90,7 +90,7 @@ std::string Utils::Obs::StringHelper::GetSourceTypeString(obs_source_t *source)
|
||||
}
|
||||
}
|
||||
|
||||
std::string Utils::Obs::StringHelper::GetInputMonitorTypeString(obs_source_t *input)
|
||||
std::string Utils::Obs::StringHelper::GetInputMonitorType(obs_source_t *input)
|
||||
{
|
||||
obs_monitoring_type monitorType = obs_source_get_monitoring_type(input);
|
||||
|
||||
@ -102,7 +102,7 @@ std::string Utils::Obs::StringHelper::GetInputMonitorTypeString(obs_source_t *in
|
||||
}
|
||||
}
|
||||
|
||||
std::string Utils::Obs::StringHelper::GetMediaInputStateString(obs_source_t *input)
|
||||
std::string Utils::Obs::StringHelper::GetMediaInputState(obs_source_t *input)
|
||||
{
|
||||
obs_media_state mediaState = obs_source_media_get_state(input);
|
||||
|
||||
@ -130,7 +130,7 @@ std::string Utils::Obs::StringHelper::GetLastReplayBufferFilePath()
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::string Utils::Obs::StringHelper::GetSceneItemBoundsTypeString(enum obs_bounds_type type)
|
||||
std::string Utils::Obs::StringHelper::GetSceneItemBoundsType(enum obs_bounds_type type)
|
||||
{
|
||||
switch (type) {
|
||||
default:
|
||||
@ -280,7 +280,7 @@ std::vector<json> Utils::Obs::ListHelper::GetSceneItemList(obs_scene_t *scene, b
|
||||
if (!enumData->second) {
|
||||
OBSSource itemSource = obs_sceneitem_get_source(sceneItem);
|
||||
item["sourceName"] = obs_source_get_name(itemSource);
|
||||
item["sourceType"] = StringHelper::GetSourceTypeString(itemSource);
|
||||
item["sourceType"] = StringHelper::GetSourceType(itemSource);
|
||||
if (obs_source_get_type(itemSource) == OBS_SOURCE_TYPE_INPUT)
|
||||
item["inputKind"] = obs_source_get_id(itemSource);
|
||||
else if (obs_source_get_type(itemSource) == OBS_SOURCE_TYPE_SCENE)
|
||||
@ -425,7 +425,7 @@ json Utils::Obs::DataHelper::GetSceneItemTransform(obs_sceneitem_t *item)
|
||||
|
||||
ret["alignment"] = osi.alignment;
|
||||
|
||||
ret["boundsType"] = StringHelper::GetSceneItemBoundsTypeString(osi.bounds_type);
|
||||
ret["boundsType"] = StringHelper::GetSceneItemBoundsType(osi.bounds_type);
|
||||
ret["boundsAlignment"] = osi.bounds_alignment;
|
||||
ret["boundsWidth"] = osi.bounds.x;
|
||||
ret["boundsHeight"] = osi.bounds.y;
|
||||
|
@ -27,16 +27,16 @@ enum ObsMediaInputAction {
|
||||
namespace Utils {
|
||||
namespace Obs {
|
||||
namespace StringHelper {
|
||||
std::string GetObsVersionString();
|
||||
std::string GetObsVersion();
|
||||
std::string GetCurrentSceneCollection();
|
||||
std::string GetCurrentProfile();
|
||||
std::string GetCurrentProfilePath();
|
||||
std::string GetCurrentRecordOutputPath();
|
||||
std::string GetSourceTypeString(obs_source_t *source);
|
||||
std::string GetInputMonitorTypeString(obs_source_t *input);
|
||||
std::string GetMediaInputStateString(obs_source_t *input);
|
||||
std::string GetSourceType(obs_source_t *source);
|
||||
std::string GetInputMonitorType(obs_source_t *input);
|
||||
std::string GetMediaInputState(obs_source_t *input);
|
||||
std::string GetLastReplayBufferFilePath();
|
||||
std::string GetSceneItemBoundsTypeString(enum obs_bounds_type type);
|
||||
std::string GetSceneItemBoundsType(enum obs_bounds_type type);
|
||||
std::string DurationToTimecode(uint64_t);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user