Explicitly set serde name on all fields

This allows to rename fields without accidentally breaking the API.
v5-api
Dominik Nakamura 2 years ago
parent 3093734a4e
commit 819d8ccfe1
No known key found for this signature in database
GPG Key ID: E4C6A749B2491910

@ -39,7 +39,7 @@ impl<'a> SceneItems<'a> {
self.client
.send_message::<_, responses::SceneItemId>(Request::Id(get))
.await
.map(|sii| sii.scene_item_id)
.map(|sii| sii.id)
}
/// Creates a new scene item using a source.
@ -47,7 +47,7 @@ impl<'a> SceneItems<'a> {
self.client
.send_message::<_, responses::SceneItemId>(Request::Create(create))
.await
.map(|sii| sii.scene_item_id)
.map(|sii| sii.id)
}
/// Removes a scene item from a scene.
@ -62,7 +62,7 @@ impl<'a> SceneItems<'a> {
self.client
.send_message::<_, responses::SceneItemId>(Request::Duplicate(duplicate))
.await
.map(|sii| sii.scene_item_id)
.map(|sii| sii.id)
}
/// Gets the transform and crop info of a scene item.
@ -77,7 +77,7 @@ impl<'a> SceneItems<'a> {
item_id,
})
.await
.map(|gsit| gsit.scene_item_transform)
.map(|gsit| gsit.transform)
}
/// Sets the transform and crop info of a scene item.
@ -92,7 +92,7 @@ impl<'a> SceneItems<'a> {
self.client
.send_message::<_, responses::SceneItemEnabled>(Request::Enabled { scene, item_id })
.await
.map(|sie| sie.scene_item_enabled)
.map(|sie| sie.enabled)
}
/// Sets the enable state of a scene item.
@ -105,7 +105,7 @@ impl<'a> SceneItems<'a> {
self.client
.send_message::<_, responses::SceneItemLocked>(Request::Locked { scene, item_id })
.await
.map(|sil| sil.scene_item_locked)
.map(|sil| sil.locked)
}
/// Sets the lock state of a scene item.
@ -120,7 +120,7 @@ impl<'a> SceneItems<'a> {
self.client
.send_message::<_, responses::SceneItemIndex>(Request::Index { scene, item_id })
.await
.map(|sii| sii.scene_item_index)
.map(|sii| sii.index)
}
/// Sets the index position of a scene item in a scene.
@ -139,7 +139,7 @@ impl<'a> SceneItems<'a> {
item_id,
})
.await
.map(|sis| sis.scene_item_settings)
.map(|sis| sis.settings)
}
/// Sets private scene item settings.

@ -57,29 +57,34 @@ pub enum Event {
name: String,
},
/// The profile list has changed.
#[serde(rename_all = "camelCase")]
ProfileListChanged {
/// Updated list of profiles.
#[serde(rename = "profiles")]
profiles: Vec<String>,
},
// --------------------------------
// Filters
// --------------------------------
/// A filter has been added to a source.
#[serde(rename_all = "camelCase")]
SourceFilterCreated {
/// Name of the source the filter was added to.
source_name: String,
#[serde(rename = "sourceName")]
source: String,
/// Name of the filter.
filter_name: String,
#[serde(rename = "filterName")]
filter: String,
/// The kind of the filter.
filter_kind: String,
#[serde(rename = "filterKind")]
kind: String,
/// Index position of the filter.
filter_index: u32,
#[serde(rename = "filterIndex")]
index: u32,
/// The settings configured to the filter when it was created.
filter_settings: serde_json::Value,
#[serde(rename = "filterSettings")]
settings: serde_json::Value,
/// The default settings for the filter.
default_filter_settings: serde_json::Value,
#[serde(rename = "defaultFilterSettings")]
default_settings: serde_json::Value,
},
/// A filter has been removed from a source.
SourceFilterRemoved {
@ -137,31 +142,37 @@ pub enum Event {
/// A vendor is a unique name registered by a third-party plugin or script, which allows for
/// custom requests and events to be added to obs-websocket. If a plugin or script implements
/// vendor requests or events, documentation is expected to be provided with them.
#[serde(rename_all = "camelCase")]
VendorEvent {
/// Name of the vendor emitting the event.
#[serde(rename = "vendorName")]
vendor_name: String,
/// Vendor-provided event type definition.
#[serde(rename = "eventType")]
event_type: String,
/// Vendor-provided event data. `{}` if event does not provide any data.
#[serde(rename = "eventData")]
event_data: serde_json::Value,
},
// --------------------------------
// Inputs
// --------------------------------
/// An input has been created.
#[serde(rename_all = "camelCase")]
InputCreated {
/// Name of the input.
input_name: String,
#[serde(rename = "inputName")]
name: String,
/// The kind of the input.
input_kind: String,
#[serde(rename = "inputKind")]
kind: String,
/// The unversioned kind of input (aka no `_v2` stuff).
unversioned_input_kind: String,
#[serde(rename = "unversionedInputKind")]
unversioned_kind: String,
/// The settings configured to the input when it was created.
input_settings: serde_json::Value,
#[serde(rename = "inputSettings")]
settings: serde_json::Value,
/// The default settings for the input.
default_input_settings: serde_json::Value,
#[serde(rename = "defaultInputSettings")]
default_settings: serde_json::Value,
},
/// An input has been removed.
InputRemoved {
@ -210,7 +221,6 @@ pub enum Event {
muted: bool,
},
/// An input's volume level has changed.
#[serde(rename_all = "camelCase")]
InputVolumeChanged {
/// Name of the input.
#[serde(rename = "inputName")]
@ -262,9 +272,9 @@ pub enum Event {
monitor_type: MonitorType,
},
/// A high-volume event providing volume levels of all active inputs every 50 milliseconds.
#[serde(rename_all = "camelCase")]
InputVolumeMeters {
/// Array of active inputs with their associated volume levels.
#[serde(rename = "inputs")]
inputs: Vec<InputVolumeMeter>,
},
// --------------------------------

@ -84,29 +84,31 @@ impl<'a> Serialize for ClientRequest<'a> {
/// session parameters.
#[skip_serializing_none]
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct Identify {
/// Version number that the client would like the obs-websocket server to use.
#[serde(rename = "rpcVersion")]
pub rpc_version: u32,
#[serde(rename = "authentication")]
pub authentication: Option<String>,
/// Bit mask of event subscription items to subscribe to events and event categories at will. By
/// default, all event categories are subscribed, except for events marked as high volume. High
/// volume events must be explicitly subscribed to.
#[serde(rename = "eventSubscriptions")]
pub event_subscriptions: Option<EventSubscription>,
}
/// Sent at any time after initial identification to update the provided session parameters.
#[skip_serializing_none]
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct Reidentify {
#[serde(rename = "eventSubscriptions")]
pub event_subscriptions: Option<EventSubscription>,
}
/// Client is making a request to obs-websocket. For example get current scene, create source.
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct Request<'a> {
#[serde(rename = "requestId")]
pub request_id: &'a str,
#[serde(flatten)]
pub ty: RequestType<'a>,
@ -116,14 +118,17 @@ pub(crate) struct Request<'a> {
/// (in order) by the server.
#[skip_serializing_none]
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct RequestBatch<'a> {
#[serde(rename = "requestId")]
pub request_id: &'a str,
/// When true, the processing of requests will be halted on first failure. Returns only the
/// processed requests in
/// [`crate::responses::ServerMessage::RequestBatchResponse`].
#[serde(rename = "haltOnFailure")]
pub halt_on_failure: Option<bool>,
#[serde(rename = "requests")]
pub requests: &'a [RequestType<'a>],
#[serde(rename = "executionType")]
pub execution_type: Option<ExecutionType>,
}

@ -4,25 +4,29 @@ use serde::Deserialize;
/// Response value for [`crate::client::Config::video_settings`].
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct VideoSettings {
/// Numerator of the fractional FPS value.
#[serde(rename = "fpsNumerator")]
pub fps_numerator: u32,
/// Denominator of the fractional FPS value.
#[serde(rename = "fpsDenominator")]
pub fps_denominator: u32,
/// Width of the base (canvas) resolution in pixels.
#[serde(rename = "baseWidth")]
pub base_width: u32,
/// Height of the base (canvas) resolution in pixels.
#[serde(rename = "baseHeight")]
pub base_height: u32,
/// Width of the output resolution in pixels.
#[serde(rename = "outputWidth")]
pub output_width: u32,
/// Height of the output resolution in pixels.
#[serde(rename = "outputHeight")]
pub output_height: u32,
}
/// Response value for [`crate::client::Config::stream_service_settings`].
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct StreamServiceSettings<T> {
/// Stream service type, like `rtmp_custom` or `rtmp_common`.
#[serde(rename = "streamServiceType")]
@ -33,8 +37,8 @@ pub struct StreamServiceSettings<T> {
}
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct RecordDirectory {
/// Output directory.
#[serde(rename = "recordDirectory")]
pub record_directory: String,
}

@ -4,9 +4,9 @@ use serde::Deserialize;
/// Response value for [`crate::client::Filters::get_source_filter_list`].
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct Filters {
/// Array of filters.
#[serde(rename = "filters")]
pub filters: Vec<SourceFilter>,
}
@ -33,8 +33,8 @@ pub struct SourceFilter {
/// Response value for
/// [`crate::client::Filters::get_source_filter_default_settings`].
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct DefaultFilterSettings<T> {
/// Object of default settings for the filter kind.
#[serde(rename = "defaultFilterSettings")]
pub default_filter_settings: T,
}

@ -4,61 +4,79 @@ use serde::Deserialize;
/// Response value for [`crate::client::General::version`].
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Version {
/// Current OBS Studio version.
#[serde(rename = "obsVersion")]
pub obs_version: semver::Version,
/// Current obs-websocket version.
#[serde(rename = "obsWebSocketVersion")]
pub obs_web_socket_version: semver::Version,
/// Current latest obs-websocket RPC version.
#[serde(rename = "rpcVersion")]
pub rpc_version: u32,
/// Array of available RPC requests for the currently negotiated RPC version.
#[serde(rename = "availableRequests")]
pub available_requests: Vec<String>,
/// Image formats available in `GetSourceScreenshot` and `SaveSourceScreenshot` requests.
#[serde(rename = "supportedImageFormats")]
pub supported_image_formats: Vec<String>,
/// Name of the platform. Usually `windows`, `macos`, or `ubuntu` (Linux flavor). Not guaranteed
/// to be any of those.
#[serde(rename = "platform")]
pub platform: String,
/// Description of the platform, like `Windows 10 (10.0)`.
#[serde(rename = "platformDescription")]
pub platform_description: String,
}
/// Response value for [`crate::client::General::stats`].
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Stats {
/// Current CPU usage in percent.
#[serde(rename = "cpuUsage")]
pub cpu_usage: f64,
/// Amount of memory in MB currently being used by OBS.
#[serde(rename = "memoryUsage")]
pub memory_usage: f64,
/// Available disk space on the device being used for recording storage.
#[serde(rename = "availableDiskSpace")]
pub available_disk_space: f64,
/// Current FPS being rendered.
#[serde(rename = "activeFps")]
pub active_fps: f64,
/// Average time in milliseconds that OBS is taking to render a frame.
#[serde(rename = "averageFrameRenderTime")]
pub average_frame_render_time: f64,
/// Number of frames skipped by OBS in the render thread.
#[serde(rename = "renderSkippedFrames")]
pub render_skipped_frames: u32,
/// Total number of frames outputted by the render thread.
#[serde(rename = "renderTotalFrames")]
pub render_total_frames: u32,
/// Number of frames skipped by OBS in the output thread.
#[serde(rename=""outputSkippedFrames)]
pub output_skipped_frames: u32,
/// Total number of frames outputted by the output thread.
#[serde(rename = "outputTotalFrames")]
pub output_total_frames: u32,
/// Total number of messages received by obs-websocket from the client.
#[serde(rename = "webSocketSessionIncomingMessages")]
pub web_socket_session_incoming_messages: u64,
/// Total number of messages sent by obs-websocket to the client.
#[serde(rename = "webSocketSessionOutgoingMessages")]
pub web_socket_session_outgoing_messages: u64,
}
/// Response value for [`crate::client::General::call_vendor_request`].
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct VendorResponse<T> {
/// Name of the vendor.
#[serde(rename = "vendorName")]
pub vendor_name: String,
/// Type of request.
#[serde(rename = "requestType")]
pub request_type: String,
/// Object containing appropriate response data.
#[serde(rename = "responseData")]
pub response_data: T,
}

@ -4,8 +4,8 @@ use serde::Deserialize;
/// Response value for [`crate::client::General::get_hotkey_list`].
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct Hotkeys {
/// Array of hotkey names.
#[serde(rename = "hotkeys")]
pub hotkeys: Vec<String>,
}

@ -7,9 +7,9 @@ use crate::common::MonitorType;
/// Response value for [`crate::client::Inputs::get_input_list`].
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct Inputs {
/// Array of inputs.
#[serde(rename = "inputs")]
pub inputs: Vec<Input>,
}
@ -29,18 +29,18 @@ pub struct Input {
/// Response value for [`crate::client::Inputs::get_input_kind_list`].
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct InputKinds {
/// Array of input kinds.
#[serde(rename = "inputKinds")]
pub input_kinds: Vec<String>,
}
/// Response value for
/// [`crate::client::Inputs::get_input_default_settings`].
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct DefaultInputSettings<T> {
/// Object of default settings for the input kind.
#[serde(rename = "defaultInputSettings")]
pub default_input_settings: T,
}
@ -77,26 +77,28 @@ pub struct InputVolume {
/// Response value for [`crate::client::Inputs::get_audio_sync_offset`].
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct AudioSyncOffset {
/// Audio sync offset in milliseconds.
#[serde(with = "crate::serde::duration_millis")]
#[serde(
rename = "inputAudioSyncOffset",
with = "crate::serde::duration_millis"
)]
pub input_audio_sync_offset: Duration,
}
/// Response value for [`crate::client::Inputs::get_audio_monitor_type`].
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct AudioMonitorType {
/// Audio monitor type.
#[serde(rename = "monitorType")]
pub monitor_type: MonitorType,
}
/// Response value for [`crate::client::Inputs::get_properties_list_property_items`].
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct ListPropertyItems {
/// Array of items in the list property.
#[serde(rename = "propertyItems")]
pub property_items: Vec<ListPropertyItem>,
}
@ -115,8 +117,8 @@ pub struct ListPropertyItem {
}
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct SceneItemId {
/// Numeric ID of the scene item.
#[serde(rename = "sceneItemId")]
pub scene_item_id: i64,
}

@ -106,23 +106,25 @@ impl<'de> Deserialize<'de> for ServerMessage {
/// First message sent from the server immediately on client connection. Contains authentication
/// information if authentication is required. Also contains RPC version for version negotiation.
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct Hello {
#[allow(dead_code)]
#[serde(rename = "obsWebSocketVersion")]
pub obs_web_socket_version: semver::Version,
/// version number which gets incremented on each **breaking change** to the obs-websocket
/// protocol. Its usage in this context is to provide the current RPC version that the server
/// would like to use.
#[serde(rename = "rpcVersion")]
pub rpc_version: u32,
#[serde(rename = "authentication")]
pub authentication: Option<Authentication>,
}
/// The identify request was received and validated, and the connection is now ready for normal
/// operation.
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct Identified {
/// The RPC (remote procedure call) version to be used.
#[serde(rename = "negotiatedRpcVersion")]
pub negotiated_rpc_version: u32,
}

@ -5,25 +5,24 @@ use serde::Deserialize;
use crate::common::{Alignment, BoundsType};
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct SceneItemId {
/// Numeric ID of the scene item.
pub scene_item_id: i64,
#[serde(rename = "sceneItemId")]
pub id: i64,
}
/// Response value for [`crate::client::SceneItems::get_list`] and
/// [`crate::client::SceneItems::get_group_list`].
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct SceneItemList {
/// Array of scene items in the scene or group.
#[serde(rename = "sceneItems")]
pub scene_items: Vec<SceneItem>,
}
/// Response value for [`crate::client::SceneItems::list`] and
/// [`crate::client::SceneItems::list_group`].
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SceneItem {
/// Identifier of the scene item.
#[serde(rename = "sceneItemId")]
@ -32,12 +31,16 @@ pub struct SceneItem {
#[serde(rename = "sceneItemIndex")]
pub index: u32,
/// Name of this source.
#[serde(rename = "sourceName")]
pub source_name: String,
/// The kind of source this item represents.
#[serde(rename = "sourceType")]
pub source_type: SourceType,
/// Kind of input. Only present if this is a [`SourceType::Input`].
#[serde(rename = "inputKind")]
pub input_kind: Option<String>,
/// Whether this item is a group. Only present if this is a [`SourceType::Scene`].
#[serde(rename = "isGroup")]
pub is_group: Option<bool>,
}
@ -61,82 +64,97 @@ pub enum SourceType {
/// Response value for
/// [`crate::client::SceneItems::get_scene_item_transform`].
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct GetSceneItemTransform {
pub scene_item_transform: SceneItemTransform,
#[serde(rename = "sceneItemTransform")]
pub transform: SceneItemTransform,
}
/// Response value for [`crate::client::SceneItems::transform`].
#[derive(Clone, Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SceneItemTransform {
/// Base width (without scaling) of the source.
#[serde(rename = "sourceWidth")]
pub source_width: f32,
/// Base height (without scaling) of the source.
#[serde(rename = "sourceHeight")]
pub source_height: f32,
/// The x position of the source from the left.
#[serde(rename = "positionX")]
pub position_x: f32,
/// The y position of the source from the top.
#[serde(rename = "positionY")]
pub position_y: f32,
/// The clockwise rotation of the scene item in degrees around the point of alignment.
#[serde(rename = "rotation")]
pub rotation: f32,
/// The x-scale factor of the source.
#[serde(rename = "scaleX")]
pub scale_x: f32,
/// The y-scale factor of the source.
#[serde(rename = "scaleY")]
pub scale_y: f32,
/// Scene item width (base source width multiplied by the horizontal scaling factor).
#[serde(rename = "width")]
pub width: f32,
/// Scene item height (base source height multiplied by the vertical scaling factor).
#[serde(rename = "height")]
pub height: f32,
/// The point on the source that the item is manipulated from.
#[serde(with = "crate::serde::bitflags_u8")]
#[serde(rename = "alignment", with = "crate::serde::bitflags_u8")]
pub alignment: Alignment,
/// Type of bounding box.
#[serde(rename = "boundsType")]
pub bounds_type: BoundsType,
/// Alignment of the bounding box.
#[serde(with = "crate::serde::bitflags_u8")]
#[serde(rename = "boundsAlignment", with = "crate::serde::bitflags_u8")]
pub bounds_alignment: Alignment,
/// Width of the bounding box.
#[serde(rename = "boundsWidth")]
pub bounds_width: f32,
/// Height of the bounding box.
#[serde(rename = "boundsHeight")]
pub bounds_height: f32,
/// The number of pixels cropped off the left of the source before scaling.
#[serde(rename = "cropLeft")]
pub crop_left: u32,
/// The number of pixels cropped off the right of the source before scaling.
#[serde(rename = "cropRight")]
pub crop_right: u32,
/// The number of pixels cropped off the top of the source before scaling.
#[serde(rename = "cropTop")]
pub crop_top: u32,
/// The number of pixels cropped off the bottom of the source before scaling.
#[serde(rename = "cropBottom")]
pub crop_bottom: u32,
}
/// Response value for [`crate::client::SceneItems::get_enabled`].
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct SceneItemEnabled {
/// Whether the scene item is enabled.
pub scene_item_enabled: bool,
#[serde(rename = "sceneItemEnabled")]
pub enabled: bool,
}
/// Response value for [`crate::client::SceneItems::get_locked`].
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct SceneItemLocked {
/// Whether the scene item is locked.
pub scene_item_locked: bool,
#[serde(rename = "sceneItemLocked")]
pub locked: bool,
}
/// Response value for [`crate::client::SceneItems::get_index`].
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct SceneItemIndex {
/// Index position of the scene item.
pub scene_item_index: u32,
#[serde(rename = "sceneItemIndex")]
pub index: u32,
}
/// Response value for [`crate::client::SceneItems::get_private_settings`].
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct SceneItemSettings<T> {
pub scene_item_settings: T,
#[serde(rename = "sceneItemSettings")]
pub settings: T,
}

@ -5,19 +5,20 @@ use time::Duration;
/// Response value for [`crate::client::Scenes::list`].
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Scenes {
/// Current program scene.
#[serde(rename = "currentProgramSceneName")]
pub current_program_scene_name: Option<String>,
/// Current preview scene. [`None`] if not in studio mode.
#[serde(rename = "currentPreviewSceneName")]
pub current_preview_scene_name: Option<String>,
/// Array of scenes in OBS.
#[serde(rename = "scenes")]
pub scenes: Vec<Scene>,
}
/// Response value for [`crate::client::Scenes::list`] as part of [`Scenes`].
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Scene {
/// Name of the scene.
#[serde(rename = "sceneName")]
@ -29,27 +30,27 @@ pub struct Scene {
/// Response value for [`crate::client::Scenes::get_group_list`].
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct Groups {
/// Array of group names.
#[serde(rename = "groups")]
pub groups: Vec<String>,
}
/// Response value for
/// [`crate::client::Scenes::get_current_program_scene`].
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct CurrentProgramScene {
/// Current program scene.
#[serde(rename = "currentProgramSceneName")]
pub current_program_scene_name: String,
}
/// Response value for
/// [`crate::client::Scenes::get_current_preview_scene`].
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct CurrentPreviewScene {
/// Current preview scene.
#[serde(rename = "currentPreviewSceneName")]
pub current_preview_scene_name: String,
}

@ -4,7 +4,6 @@ use serde::Deserialize;
/// Response value for [`crate::client::Sources::active`].
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SourceActive {
/// Whether the source is showing in program.
#[serde(rename = "videoActive")]
@ -16,8 +15,8 @@ pub struct SourceActive {
/// Response value for [`crate::client::Sources::get_screenshot`].
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct ImageData {
/// Base64-encoded screenshot.
#[serde(rename = "imageData")]
pub image_data: String,
}

@ -6,21 +6,23 @@ use time::Duration;
/// Response value for
/// [`crate::client::Transitions::get_transition_kind_list`].
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct TransitionKinds {
/// Array of transition kinds.
#[serde(rename = "transitionKinds")]
pub transition_kinds: Vec<String>,
}
/// Response value for [`crate::client::Transitions::list`].
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SceneTransitionList {
/// Name of the current scene transition.
#[serde(rename = "currentSceneTransitionName")]
pub current_scene_transition_name: Option<String>,
/// Kind of the current scene transition.
#[serde(rename = "currentSceneTransitionKind")]
pub current_scene_transition_kind: Option<String>,
/// Array of transitions.
#[serde(rename = "transitions")]
pub transitions: Vec<Transition>,
}
@ -70,8 +72,8 @@ pub struct CurrentSceneTransition {
/// Response value for
/// [`crate::client::Transitions::get_current_scene_transition_cursor`].
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct TransitionCursor {
/// Cursor position, between `0.0` and `1.0`.
#[serde(rename = "transitionCursor")]
pub transition_cursor: f32,
}

@ -4,7 +4,6 @@ use serde::Deserialize;
/// Response value for [`crate::client::Ui::get_studio_mode_enabled`].
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct StudioModeEnabled {
/// Whether studio mode is enabled.
#[serde(rename = "studioModeEnabled")]
@ -13,8 +12,8 @@ pub(crate) struct StudioModeEnabled {
/// Response value for [`crate::client::Ui::get_monitor_list`].
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct MonitorList {
#[serde(rename = "monitors")]
pub monitors: Vec<Monitor>,
}

@ -3,7 +3,6 @@
use serde::Deserialize;
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct OutputActive {
/// New state of the stream output.
#[serde(rename = "outputActive")]

Loading…
Cancel
Save