wip: More command handling

This commit is contained in:
Baud 2024-03-10 02:08:35 +00:00
parent 4a075c3d1e
commit 2bbf2c5c6b
24 changed files with 146 additions and 483 deletions

View File

@ -139,6 +139,7 @@ impl Atem {
status: &mut AtemConnectionStatus, status: &mut AtemConnectionStatus,
commands: VecDeque<Arc<dyn DeserializedCommand>>, commands: VecDeque<Arc<dyn DeserializedCommand>>,
) { ) {
let new_state = state.clone();
for command in commands { for command in commands {
match command.raw_name() { match command.raw_name() {
DESERIALIZE_VERSION_RAW_NAME => { DESERIALIZE_VERSION_RAW_NAME => {
@ -149,8 +150,15 @@ impl Atem {
DESERIALIZE_TIME_RAW_NAME => { DESERIALIZE_TIME_RAW_NAME => {
todo!("Time command") todo!("Time command")
} }
_ => {} _ => {
command.apply_to_state(state);
}
} }
} }
if new_state != *state {
*state = new_state;
todo!("Emit change");
}
} }
} }

View File

@ -4,7 +4,7 @@ use crate::{enums::ProtocolVersion, state::AtemState};
pub trait DeserializedCommand: Send + Sync + Debug { pub trait DeserializedCommand: Send + Sync + Debug {
fn raw_name(&self) -> &'static str; fn raw_name(&self) -> &'static str;
fn apply_to_state(&self, state: &mut AtemState) -> Vec<String>; fn apply_to_state(&self, state: &mut AtemState) -> bool;
} }
pub trait CommandDeserializer: Send + Sync { pub trait CommandDeserializer: Send + Sync {

View File

@ -16,8 +16,8 @@ impl DeserializedCommand for VersionCommand {
DESERIALIZE_VERSION_RAW_NAME DESERIALIZE_VERSION_RAW_NAME
} }
fn apply_to_state(&self, state: &mut crate::state::AtemState) -> Vec<String> { fn apply_to_state(&self, state: &mut crate::state::AtemState) -> bool {
todo!() todo!("Apply to state: Version")
} }
} }

View File

@ -12,8 +12,8 @@ impl DeserializedCommand for InitComplete {
DESERIALIZE_INIT_COMPLETE_RAW_NAME DESERIALIZE_INIT_COMPLETE_RAW_NAME
} }
fn apply_to_state(&self, state: &mut crate::state::AtemState) -> Vec<String> { fn apply_to_state(&self, state: &mut crate::state::AtemState) -> bool {
todo!() todo!("Apply to state: Init Complete")
} }
} }

View File

@ -37,8 +37,8 @@ impl DeserializedCommand for ProgramInput {
DESERIALIZE_PROGRAM_INPUT_RAW_NAME DESERIALIZE_PROGRAM_INPUT_RAW_NAME
} }
fn apply_to_state(&self, state: &mut crate::state::AtemState) -> Vec<String> { fn apply_to_state(&self, state: &mut crate::state::AtemState) -> bool {
todo!() todo!("Apply to state: Program Input")
} }
} }

View File

@ -20,8 +20,8 @@ impl DeserializedCommand for TallyBySource {
DESERIALIZE_TALLY_BY_SOURCE_RAW_NAME DESERIALIZE_TALLY_BY_SOURCE_RAW_NAME
} }
fn apply_to_state(&self, state: &mut crate::state::AtemState) -> Vec<String> { fn apply_to_state(&self, state: &mut crate::state::AtemState) -> bool {
todo!() todo!("Apply to state: Tally By Source")
} }
} }

View File

@ -23,8 +23,8 @@ impl DeserializedCommand for Time {
DESERIALIZE_TIME_RAW_NAME DESERIALIZE_TIME_RAW_NAME
} }
fn apply_to_state(&self, state: &mut crate::state::AtemState) -> Vec<String> { fn apply_to_state(&self, state: &mut crate::state::AtemState) -> bool {
todo!() false
} }
} }

View File

@ -1,4 +1,4 @@
#[derive(Default)] #[derive(Clone, Default, PartialEq)]
pub enum Model { pub enum Model {
#[default] #[default]
Unknown = 0x00, Unknown = 0x00,
@ -21,7 +21,7 @@ pub enum Model {
MiniExtremeISO = 0x11, MiniExtremeISO = 0x11,
} }
#[derive(Debug, Default)] #[derive(Debug, Default, Clone, PartialEq)]
pub enum ProtocolVersion { pub enum ProtocolVersion {
#[default] #[default]
Unknown = 0, Unknown = 0,
@ -48,6 +48,7 @@ impl TryFrom<u32> for ProtocolVersion {
} }
} }
#[derive(Clone, PartialEq)]
pub enum TransitionStyle { pub enum TransitionStyle {
MIX = 0x00, MIX = 0x00,
DIP = 0x01, DIP = 0x01,
@ -56,6 +57,7 @@ pub enum TransitionStyle {
STING = 0x04, STING = 0x04,
} }
#[derive(Clone, PartialEq)]
pub enum TransitionSelection { pub enum TransitionSelection {
Background = 1 << 0, Background = 1 << 0,
Key1 = 1 << 1, Key1 = 1 << 1,
@ -64,6 +66,7 @@ pub enum TransitionSelection {
Key4 = 1 << 4, Key4 = 1 << 4,
} }
#[derive(Clone, PartialEq)]
pub enum DVEEffect { pub enum DVEEffect {
SwooshTopLeft = 0, SwooshTopLeft = 0,
SwooshTop = 1, SwooshTop = 1,
@ -106,6 +109,7 @@ pub enum DVEEffect {
GraphicLogoWipe = 34, GraphicLogoWipe = 34,
} }
#[derive(Clone, PartialEq)]
pub enum MacroAction { pub enum MacroAction {
Run = 0, Run = 0,
Stop = 1, Stop = 1,
@ -115,6 +119,7 @@ pub enum MacroAction {
Delete = 5, Delete = 5,
} }
#[derive(Clone, PartialEq)]
pub enum ExternalPortType { pub enum ExternalPortType {
Unknown = 0, Unknown = 0,
SDI = 1, SDI = 1,
@ -131,6 +136,7 @@ pub enum ExternalPortType {
TRSJack = 2048, TRSJack = 2048,
} }
#[derive(Clone, PartialEq)]
pub enum InternalPortType { pub enum InternalPortType {
External = 0, External = 0,
Black = 1, Black = 1,
@ -157,6 +163,8 @@ const SOURCE_AVAILABILITY_SUPERSOURCE_BOX: isize = 1 << 3;
const SOURCE_AVAILABILITY_KEY_SOURCE: isize = 1 << 4; const SOURCE_AVAILABILITY_KEY_SOURCE: isize = 1 << 4;
const SOURCE_AVAILABILITY_AUXILIARY_1: isize = 1 << 5; const SOURCE_AVAILABILITY_AUXILIARY_1: isize = 1 << 5;
const SOURCE_AVAILABILITY_AUXILIARY_2: isize = 1 << 6; const SOURCE_AVAILABILITY_AUXILIARY_2: isize = 1 << 6;
#[derive(Clone, PartialEq)]
pub enum SourceAvailability { pub enum SourceAvailability {
None = SOURCE_AVAILABILITY_NONE, None = SOURCE_AVAILABILITY_NONE,
Auxiliary = SOURCE_AVAILABILITY_AUXILIARY, Auxiliary = SOURCE_AVAILABILITY_AUXILIARY,
@ -180,6 +188,8 @@ const ME_AVAILABILITY_ME_1: isize = 1 << 0;
const ME_AVAILABILITY_ME_2: isize = 1 << 1; const ME_AVAILABILITY_ME_2: isize = 1 << 1;
const ME_AVAILABILITY_ME_3: isize = 1 << 2; const ME_AVAILABILITY_ME_3: isize = 1 << 2;
const ME_AVAILABILITY_ME_4: isize = 1 << 3; const ME_AVAILABILITY_ME_4: isize = 1 << 3;
#[derive(Clone, PartialEq)]
pub enum MeAvailability { pub enum MeAvailability {
None = ME_AVAILABILITY_NONE, None = ME_AVAILABILITY_NONE,
Me1 = ME_AVAILABILITY_ME_1, Me1 = ME_AVAILABILITY_ME_1,
@ -189,6 +199,7 @@ pub enum MeAvailability {
All = ME_AVAILABILITY_ME_1 | ME_AVAILABILITY_ME_2 | ME_AVAILABILITY_ME_3 | ME_AVAILABILITY_ME_4, All = ME_AVAILABILITY_ME_1 | ME_AVAILABILITY_ME_2 | ME_AVAILABILITY_ME_3 | ME_AVAILABILITY_ME_4,
} }
#[derive(Clone, PartialEq)]
pub enum BorderBevel { pub enum BorderBevel {
None = 0, None = 0,
InOut = 1, InOut = 1,
@ -196,6 +207,7 @@ pub enum BorderBevel {
Out = 3, Out = 3,
} }
#[derive(Clone, PartialEq)]
pub enum IsAtKeyFrame { pub enum IsAtKeyFrame {
None = 0, None = 0,
A = 1 << 0, A = 1 << 0,
@ -203,6 +215,7 @@ pub enum IsAtKeyFrame {
RunToInfinite = 1 << 2, RunToInfinite = 1 << 2,
} }
#[derive(Clone, PartialEq)]
pub enum Pattern { pub enum Pattern {
LeftToRightBar = 0, LeftToRightBar = 0,
TopToBottomBar = 1, TopToBottomBar = 1,
@ -224,7 +237,7 @@ pub enum Pattern {
TopRightDiagonal = 17, TopRightDiagonal = 17,
} }
#[derive(Clone, Copy)] #[derive(Clone, Copy, PartialEq)]
pub enum MixEffectKeyType { pub enum MixEffectKeyType {
Luma = 0, Luma = 0,
Chroma = 1, Chroma = 1,
@ -232,6 +245,7 @@ pub enum MixEffectKeyType {
DVE = 3, DVE = 3,
} }
#[derive(Clone, PartialEq)]
pub enum FlyKeyKeyFrame { pub enum FlyKeyKeyFrame {
None = 0, None = 0,
A = 1, A = 1,
@ -240,6 +254,7 @@ pub enum FlyKeyKeyFrame {
RunToInfinite = 4, RunToInfinite = 4,
} }
#[derive(Clone, PartialEq)]
pub enum FlyKeyDirection { pub enum FlyKeyDirection {
CentreOfKey = 0, CentreOfKey = 0,
TopLeft = 1, TopLeft = 1,
@ -253,11 +268,13 @@ pub enum FlyKeyDirection {
BottomRight = 9, BottomRight = 9,
} }
#[derive(Clone, PartialEq)]
pub enum SuperSourceArtOption { pub enum SuperSourceArtOption {
Background, Background,
Foreground, Foreground,
} }
#[derive(Clone, PartialEq)]
pub enum TransferMode { pub enum TransferMode {
NoOp, NoOp,
Write, Write,
@ -265,7 +282,7 @@ pub enum TransferMode {
WriteAudio = 256, WriteAudio = 256,
} }
#[derive(Default)] #[derive(Clone, Default, PartialEq)]
pub enum VideoMode { pub enum VideoMode {
#[default] #[default]
N525i5994NTSC = 0, N525i5994NTSC = 0,
@ -303,6 +320,7 @@ pub enum VideoMode {
N1080p60 = 27, N1080p60 = 27,
} }
#[derive(Clone, PartialEq)]
pub enum TransferState { pub enum TransferState {
Queued, Queued,
Locked, Locked,
@ -310,29 +328,34 @@ pub enum TransferState {
Finished, Finished,
} }
#[derive(Clone, PartialEq)]
pub enum MediaSourceType { pub enum MediaSourceType {
Still = 1, Still = 1,
Clip, Clip,
} }
#[derive(Clone, PartialEq)]
pub enum AudioMixOption { pub enum AudioMixOption {
Off = 0, Off = 0,
On = 1, On = 1,
AudioFollowVideo = 2, AudioFollowVideo = 2,
} }
#[derive(Clone, PartialEq)]
pub enum AudioSourceType { pub enum AudioSourceType {
ExternalVideo, ExternalVideo,
MediaPlayer, MediaPlayer,
ExternalAudio, ExternalAudio,
} }
#[derive(Clone, PartialEq)]
pub enum StreamingError { pub enum StreamingError {
None, None,
InvalidState = 1 << 4, InvalidState = 1 << 4,
Unknown = 1 << 15, Unknown = 1 << 15,
} }
#[derive(Clone, PartialEq)]
pub enum StreamingStatus { pub enum StreamingStatus {
Idle = 1 << 0, Idle = 1 << 0,
Connecting = 1 << 1, Connecting = 1 << 1,
@ -340,6 +363,7 @@ pub enum StreamingStatus {
Stopping = 1 << 5, // + Streaming Stopping = 1 << 5, // + Streaming
} }
#[derive(Clone, PartialEq)]
pub enum RecordingError { pub enum RecordingError {
None = 1 << 1, None = 1 << 1,
NoMedia = 0, NoMedia = 0,
@ -350,12 +374,14 @@ pub enum RecordingError {
Unknown = 1 << 15, Unknown = 1 << 15,
} }
#[derive(Clone, PartialEq)]
pub enum RecordingStatus { pub enum RecordingStatus {
Idle = 0, Idle = 0,
Recording = 1 << 0, Recording = 1 << 0,
Stopping = 1 << 7, Stopping = 1 << 7,
} }
#[derive(Clone, PartialEq)]
pub enum RecordingDiskStatus { pub enum RecordingDiskStatus {
Idle = 1 << 0, Idle = 1 << 0,
Unformatted = 1 << 1, Unformatted = 1 << 1,
@ -365,18 +391,21 @@ pub enum RecordingDiskStatus {
Removed = 1 << 5, Removed = 1 << 5,
} }
#[derive(Clone, PartialEq)]
pub enum FairlightAudioMixOption { pub enum FairlightAudioMixOption {
Off = 1, Off = 1,
On = 2, On = 2,
AudioFollowVideo = 4, AudioFollowVideo = 4,
} }
#[derive(Clone, PartialEq)]
pub enum FairlightInputConfiguration { pub enum FairlightInputConfiguration {
Mono = 1, Mono = 1,
Stereo = 2, Stereo = 2,
DualMono = 4, DualMono = 4,
} }
#[derive(Clone, PartialEq)]
pub enum FairlightAnalogInputLevel { pub enum FairlightAnalogInputLevel {
Microphone = 1, Microphone = 1,
ConsumerLine = 2, ConsumerLine = 2,
@ -384,11 +413,13 @@ pub enum FairlightAnalogInputLevel {
ProLine = 4, ProLine = 4,
} }
#[derive(Clone, PartialEq)]
pub enum FairlightAudioSourceType { pub enum FairlightAudioSourceType {
Mono = 0, Mono = 0,
Stereo = 1, Stereo = 1,
} }
#[derive(Clone, PartialEq)]
pub enum FairlightInputType { pub enum FairlightInputType {
EmbeddedWithVideo = 0, EmbeddedWithVideo = 0,
MediaPlayer = 1, MediaPlayer = 1,
@ -401,6 +432,8 @@ const MULTI_VIEWER_LAYOUT_TOP_LEFT_SMALL: isize = 1;
const MULTI_VIEWER_LAYOUT_TOP_RIGHT_SMALL: isize = 2; const MULTI_VIEWER_LAYOUT_TOP_RIGHT_SMALL: isize = 2;
const MULTI_VIEWER_LAYOUT_BOTTOM_LEFT_SMALL: isize = 4; const MULTI_VIEWER_LAYOUT_BOTTOM_LEFT_SMALL: isize = 4;
const MULTI_VIEWER_LAYOUT_BOTTOM_RIGHT_SMALL: isize = 8; const MULTI_VIEWER_LAYOUT_BOTTOM_RIGHT_SMALL: isize = 8;
#[derive(Clone, PartialEq)]
pub enum MultiViewerLayout { pub enum MultiViewerLayout {
Default = MULTI_VIEWER_LAYOUT_DEFAULT, Default = MULTI_VIEWER_LAYOUT_DEFAULT,
TopLeftSmall = MULTI_VIEWER_LAYOUT_TOP_LEFT_SMALL, TopLeftSmall = MULTI_VIEWER_LAYOUT_TOP_LEFT_SMALL,

View File

@ -1,4 +1,4 @@
#[derive(Getters, new, Default)] #[derive(Clone, PartialEq, Getters, new, Default)]
pub struct MacroPlayerState { pub struct MacroPlayerState {
pub is_running: bool, pub is_running: bool,
pub is_waiting: bool, pub is_waiting: bool,
@ -6,13 +6,13 @@ pub struct MacroPlayerState {
pub macro_index: u64, pub macro_index: u64,
} }
#[derive(Getters, new, Default)] #[derive(Clone, PartialEq, Getters, new, Default)]
pub struct MacroRecorderState { pub struct MacroRecorderState {
pub is_recording: bool, pub is_recording: bool,
pub macro_index: u64, pub macro_index: u64,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct MacroPropertiesState { pub struct MacroPropertiesState {
is_used: bool, is_used: bool,
has_unsupported_ops: bool, has_unsupported_ops: bool,
@ -20,7 +20,7 @@ pub struct MacroPropertiesState {
pub description: String, pub description: String,
} }
#[derive(Getters, new, Default)] #[derive(Clone, PartialEq, Getters, new, Default)]
pub struct MacroState { pub struct MacroState {
pub macro_player: MacroPlayerState, pub macro_player: MacroPlayerState,
pub macro_recorder: MacroRecorderState, pub macro_recorder: MacroRecorderState,

View File

@ -6,7 +6,7 @@ pub type AudioChannel = ClassicAudioChannel;
pub type AudioMasterChannel = ClassicAudioMasterChannel; pub type AudioMasterChannel = ClassicAudioMasterChannel;
pub type AtemAudioState = AtemClassicAudioState; pub type AtemAudioState = AtemClassicAudioState;
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct ClassicAudioChannel { pub struct ClassicAudioChannel {
source_type: AudioSourceType, source_type: AudioSourceType,
pub port_type: ExternalPortType, pub port_type: ExternalPortType,
@ -18,14 +18,14 @@ pub struct ClassicAudioChannel {
pub rca_to_xlr_enabled: bool, pub rca_to_xlr_enabled: bool,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct ClassicAudioMasterChannel { pub struct ClassicAudioMasterChannel {
pub gain: f64, pub gain: f64,
pub balance: f64, pub balance: f64,
pub follow_fade_to_black: bool, pub follow_fade_to_black: bool,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct ClassicAudioMonitorChannel { pub struct ClassicAudioMonitorChannel {
pub enabled: bool, pub enabled: bool,
pub gain: f64, pub gain: f64,
@ -36,7 +36,7 @@ pub struct ClassicAudioMonitorChannel {
pub dim_level: f64, pub dim_level: f64,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct ClassicAudioHeadphoneOutputChannel { pub struct ClassicAudioHeadphoneOutputChannel {
pub gain: f64, pub gain: f64,
pub program_out_gain: f64, pub program_out_gain: f64,
@ -44,11 +44,11 @@ pub struct ClassicAudioHeadphoneOutputChannel {
pub talkback_gain: f64, pub talkback_gain: f64,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct AtemClassicAudioState { pub struct AtemClassicAudioState {
number_of_channels: Option<f64>, number_of_channels: Option<f64>,
has_monitor: Option<bool>, has_monitor: Option<bool>,
pub channels: HashMap<f64, ClassicAudioChannel>, pub channels: HashMap<u64, ClassicAudioChannel>,
pub monitor: Option<ClassicAudioMonitorChannel>, pub monitor: Option<ClassicAudioMonitorChannel>,
pub headphones: Option<ClassicAudioHeadphoneOutputChannel>, pub headphones: Option<ClassicAudioHeadphoneOutputChannel>,
pub master: Option<ClassicAudioMasterChannel>, pub master: Option<ClassicAudioMasterChannel>,

View File

@ -1,4 +1,4 @@
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct ColorGeneratorState { pub struct ColorGeneratorState {
pub hue: u64, pub hue: u64,
pub saturation: u64, pub saturation: u64,

View File

@ -1,4 +1,4 @@
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct Timecode { pub struct Timecode {
pub hours: u64, pub hours: u64,
pub minutes: u64, pub minutes: u64,

View File

@ -5,7 +5,7 @@ use crate::enums::{
FairlightInputConfiguration, FairlightInputType, FairlightInputConfiguration, FairlightInputType,
}; };
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct FairlightAudioDynamicsState { pub struct FairlightAudioDynamicsState {
pub make_up_gain: Option<u64>, pub make_up_gain: Option<u64>,
@ -14,7 +14,7 @@ pub struct FairlightAudioDynamicsState {
pub expander: Option<FairlightAudioExpanderState>, pub expander: Option<FairlightAudioExpanderState>,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct FairlightAudioLimiterState { pub struct FairlightAudioLimiterState {
pub limiter_enabled: bool, pub limiter_enabled: bool,
pub threshold: u64, pub threshold: u64,
@ -23,7 +23,7 @@ pub struct FairlightAudioLimiterState {
pub release: u64, pub release: u64,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct FairlightAudioCompressorState { pub struct FairlightAudioCompressorState {
pub compressor_enabled: bool, pub compressor_enabled: bool,
pub threshold: u64, pub threshold: u64,
@ -33,7 +33,7 @@ pub struct FairlightAudioCompressorState {
pub release: u64, pub release: u64,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct FairlightAudioExpanderState { pub struct FairlightAudioExpanderState {
pub expander_enabled: bool, pub expander_enabled: bool,
pub gate_enabled: bool, pub gate_enabled: bool,
@ -45,7 +45,7 @@ pub struct FairlightAudioExpanderState {
pub release: u64, pub release: u64,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct FairlightAudioEqualizerBandState { pub struct FairlightAudioEqualizerBandState {
pub band_enabled: bool, pub band_enabled: bool,
@ -61,14 +61,14 @@ pub struct FairlightAudioEqualizerBandState {
pub q_factor: u64, pub q_factor: u64,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct FairlightAudioMasterChannelPropertiesState { pub struct FairlightAudioMasterChannelPropertiesState {
// Gain in decibel, -Infinity to +6dB // Gain in decibel, -Infinity to +6dB
pub fader_gain: u64, pub fader_gain: u64,
pub follow_fade_to_black: bool, pub follow_fade_to_black: bool,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct FairlightAudioMasterChannel { pub struct FairlightAudioMasterChannel {
pub properties: Option<FairlightAudioSourcePropertiesState>, pub properties: Option<FairlightAudioSourcePropertiesState>,
@ -76,7 +76,7 @@ pub struct FairlightAudioMasterChannel {
pub dynamicss: Option<FairlightAudioDynamicsState>, pub dynamicss: Option<FairlightAudioDynamicsState>,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct FairlightAudioMonitorChannel { pub struct FairlightAudioMonitorChannel {
pub gain: u64, pub gain: u64,
pub input_master_gain: u64, pub input_master_gain: u64,
@ -84,21 +84,21 @@ pub struct FairlightAudioMonitorChannel {
pub input_sidetone_gain: u64, pub input_sidetone_gain: u64,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct FairlightAudioSource { pub struct FairlightAudioSource {
pub properties: Option<FairlightAudioSourcePropertiesState>, pub properties: Option<FairlightAudioSourcePropertiesState>,
pub equalizer: Option<FairlightAudioEqualizerState>, pub equalizer: Option<FairlightAudioEqualizerState>,
pub dynamics: Option<FairlightAudioDynamicsState>, pub dynamics: Option<FairlightAudioDynamicsState>,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct FairlightAudioEqualizerState { pub struct FairlightAudioEqualizerState {
pub enabled: bool, pub enabled: bool,
pub gain: u64, pub gain: u64,
bands: Vec<FairlightAudioEqualizerBandState>, bands: Vec<FairlightAudioEqualizerBandState>,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct FairlightAudioSourcePropertiesState { pub struct FairlightAudioSourcePropertiesState {
source_type: FairlightAudioSourceType, source_type: FairlightAudioSourceType,
@ -116,13 +116,13 @@ pub struct FairlightAudioSourcePropertiesState {
pub mix_option: FairlightAudioMixOption, pub mix_option: FairlightAudioMixOption,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct FairlightAudioInput { pub struct FairlightAudioInput {
pub properties: Option<FairlightAudioInputProperties>, pub properties: Option<FairlightAudioInputProperties>,
pub sources: HashMap<String, FairlightAudioSource>, pub sources: HashMap<String, FairlightAudioSource>,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct FairlightAudioInputProperties { pub struct FairlightAudioInputProperties {
input_type: FairlightInputType, input_type: FairlightInputType,
external_port_type: ExternalPortType, external_port_type: ExternalPortType,
@ -134,7 +134,7 @@ pub struct FairlightAudioInputProperties {
pub active_input_level: FairlightAnalogInputLevel, pub active_input_level: FairlightAnalogInputLevel,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct AtemFairlightAudioState { pub struct AtemFairlightAudioState {
pub inputs: HashMap<u64, FairlightAudioInput>, pub inputs: HashMap<u64, FairlightAudioInput>,
pub master: Option<FairlightAudioMasterChannel>, pub master: Option<FairlightAudioMasterChannel>,

View File

@ -1,6 +1,6 @@
use crate::enums::{Model, ProtocolVersion}; use crate::enums::{Model, ProtocolVersion};
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct AtemCapabilites { pub struct AtemCapabilites {
mix_effects: u64, mix_effects: u64,
sources: u64, sources: u64,
@ -19,47 +19,47 @@ pub struct AtemCapabilites {
only_configurable_outputs: bool, only_configurable_outputs: bool,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct MixEffectInfo { pub struct MixEffectInfo {
key_count: u64, key_count: u64,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct SuperSourceInfo { pub struct SuperSourceInfo {
box_count: u64, box_count: u64,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct AudioMixerInfo { pub struct AudioMixerInfo {
inputs: u64, inputs: u64,
monitors: u64, monitors: u64,
headphones: u64, headphones: u64,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct FairlightAudioMixerInfo { pub struct FairlightAudioMixerInfo {
inputs: u64, inputs: u64,
monitors: u64, monitors: u64,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct MacroPoolInfo { pub struct MacroPoolInfo {
macro_count: u64, macro_count: u64,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct MediaPoolInfo { pub struct MediaPoolInfo {
still_count: u64, still_count: u64,
clip_count: u64, clip_count: u64,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct MultiviewerInfo { pub struct MultiviewerInfo {
count: u64, count: u64,
window_count: u64, window_count: u64,
} }
#[derive(new)] #[derive(Clone, PartialEq, new)]
pub struct TimeInfo { pub struct TimeInfo {
pub hour: u64, pub hour: u64,
pub minute: u64, pub minute: u64,
@ -68,7 +68,7 @@ pub struct TimeInfo {
pub drop_frame: bool, pub drop_frame: bool,
} }
#[derive(new, Default)] #[derive(Clone, PartialEq, Getters, new, Default)]
pub struct DeviceInfo { pub struct DeviceInfo {
pub api_version: ProtocolVersion, pub api_version: ProtocolVersion,
pub capabilities: Option<AtemCapabilites>, pub capabilities: Option<AtemCapabilites>,

View File

@ -1,6 +1,6 @@
use crate::enums::{ExternalPortType, InternalPortType, MeAvailability, SourceAvailability}; use crate::enums::{ExternalPortType, InternalPortType, MeAvailability, SourceAvailability};
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct InputChannel { pub struct InputChannel {
input_id: u64, input_id: u64,
pub long_name: String, pub long_name: String,

View File

@ -1,6 +1,6 @@
use crate::enums; use crate::enums;
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct MediaPlayer { pub struct MediaPlayer {
pub playing: bool, pub playing: bool,
pub is_loop: bool, pub is_loop: bool,
@ -8,7 +8,7 @@ pub struct MediaPlayer {
pub clip_frame: u64, pub clip_frame: u64,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct MediaPlayerSource { pub struct MediaPlayerSource {
pub source_type: enums::MediaSourceType, pub source_type: enums::MediaSourceType,
pub clip_index: u64, pub clip_index: u64,
@ -17,21 +17,21 @@ pub struct MediaPlayerSource {
pub type MediaPlayerState = (MediaPlayer, MediaPlayerSource); pub type MediaPlayerState = (MediaPlayer, MediaPlayerSource);
#[derive(Getters, new, Default)] #[derive(Clone, PartialEq, Getters, new, Default)]
pub struct MediaState { pub struct MediaState {
still_pool: Vec<StillFrame>, still_pool: Vec<StillFrame>,
clip_pool: Vec<ClipBank>, clip_pool: Vec<ClipBank>,
players: Vec<MediaPlayerState>, players: Vec<MediaPlayerState>,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct StillFrame { pub struct StillFrame {
pub is_used: bool, pub is_used: bool,
pub hash: String, pub hash: String,
pub file_name: String, pub file_name: String,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct ClipBank { pub struct ClipBank {
pub is_used: bool, pub is_used: bool,
pub name: String, pub name: String,

View File

@ -14,7 +14,7 @@ pub mod streaming;
pub mod util; pub mod util;
pub mod video; pub mod video;
#[derive(Default)] #[derive(Default, Clone, PartialEq)]
pub struct AtemState { pub struct AtemState {
info: info::DeviceInfo, info: info::DeviceInfo,
video: video::AtemVideoState, video: video::AtemVideoState,

View File

@ -4,7 +4,7 @@ use crate::enums::{RecordingDiskStatus, RecordingError, RecordingStatus};
use super::common::Timecode; use super::common::Timecode;
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct RecordingState { pub struct RecordingState {
pub status: Option<RecordingStateStatus>, pub status: Option<RecordingStateStatus>,
pub properties: RecordingStateProperties, pub properties: RecordingStateProperties,
@ -14,7 +14,7 @@ pub struct RecordingState {
pub disks: HashMap<u64, RecordingDiskProperties>, pub disks: HashMap<u64, RecordingDiskProperties>,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct RecordingDiskProperties { pub struct RecordingDiskProperties {
pub disk_id: u64, pub disk_id: u64,
pub volume_name: String, pub volume_name: String,
@ -22,7 +22,7 @@ pub struct RecordingDiskProperties {
pub status: RecordingDiskStatus, pub status: RecordingDiskStatus,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct RecordingStateStatus { pub struct RecordingStateStatus {
pub state: RecordingStatus, pub state: RecordingStatus,
pub error: RecordingError, pub error: RecordingError,
@ -30,7 +30,7 @@ pub struct RecordingStateStatus {
pub recording_time_available: u64, pub recording_time_available: u64,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct RecordingStateProperties { pub struct RecordingStateProperties {
pub filename: String, pub filename: String,

View File

@ -9,7 +9,7 @@ pub trait MultiViewerSourceState {
fn get_supports_safe_area(&self) -> bool; fn get_supports_safe_area(&self) -> bool;
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct MultiViewerWindowState { pub struct MultiViewerWindowState {
pub safe_title: Option<bool>, pub safe_title: Option<bool>,
pub audio_meter: Option<bool>, pub audio_meter: Option<bool>,
@ -40,13 +40,13 @@ impl MultiViewerSourceState for MultiViewerWindowState {
} }
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct MultiViewerPropertiesState { pub struct MultiViewerPropertiesState {
pub layout: MultiViewerLayout, pub layout: MultiViewerLayout,
pub program_preview_swapped: bool, pub program_preview_swapped: bool,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct MultiViewer { pub struct MultiViewer {
index: u64, index: u64,
windows: Vec<MultiViewerWindowState>, windows: Vec<MultiViewerWindowState>,
@ -54,7 +54,7 @@ pub struct MultiViewer {
pub vu_opacity: Option<u64>, pub vu_opacity: Option<u64>,
} }
#[derive(Getters, new, Default)] #[derive(Clone, PartialEq, Getters, new, Default)]
pub struct SettingsState { pub struct SettingsState {
multi_viewers: Vec<MultiViewer>, multi_viewers: Vec<MultiViewer>,
pub video_mode: VideoMode, pub video_mode: VideoMode,

View File

@ -2,7 +2,7 @@ use crate::enums::{StreamingError, StreamingStatus};
use super::common::Timecode; use super::common::Timecode;
#[derive(Getters)] #[derive(Clone, PartialEq, Getters)]
pub struct StreamingState { pub struct StreamingState {
pub status: Option<StreamingStateStatus>, pub status: Option<StreamingStateStatus>,
pub stats: Option<StreamingStateStats>, pub stats: Option<StreamingStateStats>,
@ -11,18 +11,19 @@ pub struct StreamingState {
pub duration: Option<Timecode>, pub duration: Option<Timecode>,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct StreamingStateStatus { pub struct StreamingStateStatus {
state: StreamingStatus, state: StreamingStatus,
error: StreamingError, error: StreamingError,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct StreamingStateStats { pub struct StreamingStateStats {
cache_used: u64, cache_used: u64,
encoding_bitrate: u64, encoding_bitrate: u64,
} }
#[derive(Clone, PartialEq)]
pub struct StreamingServiceProperties { pub struct StreamingServiceProperties {
pub service_name: String, pub service_name: String,
pub url: String, pub url: String,

View File

@ -9,7 +9,7 @@ pub trait DownstreamKeyerBase {
fn set_is_towards_on_air(&mut self, on_air: Option<bool>); fn set_is_towards_on_air(&mut self, on_air: Option<bool>);
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct DownstreamKeyer { pub struct DownstreamKeyer {
pub sources: Option<DownstreamKeyerSources>, pub sources: Option<DownstreamKeyerSources>,
pub properties: Option<DownstreamKeyerProperties>, pub properties: Option<DownstreamKeyerProperties>,
@ -57,7 +57,7 @@ pub trait DownstreamKeyerGeneral {
fn set_invert(&mut self, invert: bool); fn set_invert(&mut self, invert: bool);
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct DownstreamKeyerMask { pub struct DownstreamKeyerMask {
pub enabled: bool, pub enabled: bool,
pub top: f64, pub top: f64,
@ -66,7 +66,7 @@ pub struct DownstreamKeyerMask {
pub right: f64, pub right: f64,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct DownstreamKeyerProperties { pub struct DownstreamKeyerProperties {
pub tie: bool, pub tie: bool,
pub rate: f64, pub rate: f64,
@ -104,7 +104,7 @@ impl DownstreamKeyerGeneral for DownstreamKeyerProperties {
} }
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct DownstreamKeyerSources { pub struct DownstreamKeyerSources {
pub fill_source: f64, pub fill_source: f64,
pub cut_source: f64, pub cut_source: f64,

View File

@ -4,13 +4,13 @@ mod downstream_keyers;
mod super_source; mod super_source;
mod upstream_keyers; mod upstream_keyers;
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct DipTransitionSettings { pub struct DipTransitionSettings {
pub rate: f64, pub rate: f64,
pub input: f64, pub input: f64,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct DVETransitionSettings { pub struct DVETransitionSettings {
pub rate: f64, pub rate: f64,
pub logo_rate: f64, pub logo_rate: f64,
@ -27,12 +27,12 @@ pub struct DVETransitionSettings {
pub flip_flop: bool, pub flip_flop: bool,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct MixTransitionSettings { pub struct MixTransitionSettings {
pub rate: f64, pub rate: f64,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct StingerTransitionSettings { pub struct StingerTransitionSettings {
pub source: f64, pub source: f64,
pub pre_multiplied_key: bool, pub pre_multiplied_key: bool,
@ -47,7 +47,7 @@ pub struct StingerTransitionSettings {
pub mix_rate: f64, pub mix_rate: f64,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct WipeTransitionSettings { pub struct WipeTransitionSettings {
pub rate: f64, pub rate: f64,
pub pattern: f64, pub pattern: f64,
@ -61,7 +61,7 @@ pub struct WipeTransitionSettings {
pub flip_flop: bool, pub flip_flop: bool,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct TransitionProperties { pub struct TransitionProperties {
style: enums::TransitionStyle, style: enums::TransitionStyle,
selection: Vec<enums::TransitionSelection>, selection: Vec<enums::TransitionSelection>,
@ -69,7 +69,7 @@ pub struct TransitionProperties {
pub next_selection: Vec<enums::TransitionSelection>, pub next_selection: Vec<enums::TransitionSelection>,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct TransitionSettings { pub struct TransitionSettings {
pub dip: Option<DipTransitionSettings>, pub dip: Option<DipTransitionSettings>,
pub dve: Option<DVETransitionSettings>, pub dve: Option<DVETransitionSettings>,
@ -78,14 +78,14 @@ pub struct TransitionSettings {
pub wipe: Option<WipeTransitionSettings>, pub wipe: Option<WipeTransitionSettings>,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct TransitionPosition { pub struct TransitionPosition {
in_transition: bool, in_transition: bool,
remaining_frames: f64, remaining_frames: f64,
pub handle_position: f64, pub handle_position: f64,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct MixEffect { pub struct MixEffect {
index: f64, index: f64,
pub program_input: f64, pub program_input: f64,
@ -98,7 +98,7 @@ pub struct MixEffect {
upstream_keyers: Vec<upstream_keyers::UpstreamKeyer>, upstream_keyers: Vec<upstream_keyers::UpstreamKeyer>,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct FadeToBlackProperties { pub struct FadeToBlackProperties {
is_fully_black: bool, is_fully_black: bool,
in_transition: bool, in_transition: bool,
@ -106,7 +106,7 @@ pub struct FadeToBlackProperties {
pub rate: f64, pub rate: f64,
} }
#[derive(Getters, new, Default)] #[derive(Clone, PartialEq, Getters, new, Default)]
pub struct AtemVideoState { pub struct AtemVideoState {
mix_effects: Vec<MixEffect>, mix_effects: Vec<MixEffect>,
downstream_keyers: Vec<downstream_keyers::DownstreamKeyer>, downstream_keyers: Vec<downstream_keyers::DownstreamKeyer>,

View File

@ -1,6 +1,6 @@
use crate::enums; use crate::enums;
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct SuperSourceBox { pub struct SuperSourceBox {
pub enabled: bool, pub enabled: bool,
pub source: f64, pub source: f64,
@ -14,7 +14,7 @@ pub struct SuperSourceBox {
pub crop_right: f64, pub crop_right: f64,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct SuperSourceProperties { pub struct SuperSourceProperties {
pub art_fill_source: f64, pub art_fill_source: f64,
pub art_cut_source: f64, pub art_cut_source: f64,
@ -25,7 +25,7 @@ pub struct SuperSourceProperties {
pub art_invert_key: bool, pub art_invert_key: bool,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct SuperSourceBorder { pub struct SuperSourceBorder {
pub border_enabled: bool, pub border_enabled: bool,
pub border_bevel: enums::BorderBevel, pub border_bevel: enums::BorderBevel,
@ -42,7 +42,7 @@ pub struct SuperSourceBorder {
pub border_light_source_altitude: f64, pub border_light_source_altitude: f64,
} }
#[derive(Getters, new)] #[derive(Clone, PartialEq, Getters, new)]
pub struct SuperSource { pub struct SuperSource {
index: f64, index: f64,
boxes: [Option<SuperSourceBox>; 4], boxes: [Option<SuperSourceBox>; 4],

View File

@ -16,57 +16,7 @@ pub trait UpstreamKeyerTypeSettings {
fn set_fly_enabled(&mut self, enabled: bool); fn set_fly_enabled(&mut self, enabled: bool);
} }
pub trait UpstreamKeyerMaskSettings: Send { #[derive(Clone, PartialEq)]
fn get_mask_enabled(&self) -> bool;
fn set_mask_enabled(&mut self, enabled: bool);
fn get_mask_top(&self) -> f64;
fn set_mask_top(&mut self, mask: f64);
fn get_mask_bottom(&self) -> f64;
fn set_mask_bottom(&mut self, mask: f64);
fn get_mask_left(&self) -> f64;
fn set_mask_right(&mut self, mask: f64);
}
pub trait UpstreamKeyerDVEBase: UpstreamKeyerMaskSettings {
fn get_size_x(&self) -> f64;
fn set_size_x(&mut self, size_x: f64);
fn get_size_y(&self) -> f64;
fn set_size_y(&mut self, size_y: f64);
fn get_position_x(&self) -> f64;
fn set_position_x(&mut self, position_x: f64);
fn get_position_y(&self) -> f64;
fn set_position_y(&mut self, position_y: f64);
fn get_rotation(&self) -> f64;
fn set_rotation(&mut self, rotation: f64);
fn get_border_outer_width(&self) -> f64;
fn set_border_outer_width(&mut self, width: f64);
fn get_border_inner_width(&self) -> f64;
fn set_border_inner_width(&mut self, width: f64);
fn get_border_outer_softness(&self) -> f64;
fn set_border_outer_softness(&mut self, softness: f64);
fn get_border_inner_softness(&self) -> f64;
fn set_border_inner_softness(&mut self, softness: f64);
fn get_border_bevel_softness(&self) -> f64;
fn set_border_bevel_softness(&mut self, softness: f64);
fn get_border_bevel_position(&self) -> f64;
fn set_border_bevel_position(&mut self, position: f64);
fn get_border_opacity(&self) -> f64;
fn set_border_opacity(&mut self, opacity: f64);
fn get_border_hue(&self) -> f64;
fn set_border_hue(&mut self, hue: f64);
fn get_border_saturation(&self) -> f64;
fn set_border_saturation(&mut self, saturation: f64);
fn get_border_luma(&self) -> f64;
fn set_border_luma(&mut self, luma: f64);
fn get_light_source_direction(&self) -> f64;
fn set_light_source_direction(&mut self, direction: f64);
fn get_light_source_altitude(&self) -> f64;
fn set_light_source_altitude(&mut self, altitude: f64);
}
pub struct UpstreamKeyerDVESettings { pub struct UpstreamKeyerDVESettings {
pub border_enabled: bool, pub border_enabled: bool,
pub shadow_enabled: bool, pub shadow_enabled: bool,
@ -101,178 +51,7 @@ pub struct UpstreamKeyerDVESettings {
pub light_source_altitude: f64, pub light_source_altitude: f64,
} }
impl UpstreamKeyerMaskSettings for UpstreamKeyerDVESettings { #[derive(Clone, PartialEq)]
fn get_mask_enabled(&self) -> bool {
self.mask_enabled
}
fn set_mask_enabled(&mut self, enabled: bool) {
self.mask_enabled = enabled
}
fn get_mask_top(&self) -> f64 {
self.mask_top
}
fn set_mask_top(&mut self, mask: f64) {
self.mask_top = mask
}
fn get_mask_bottom(&self) -> f64 {
self.mask_bottom
}
fn set_mask_bottom(&mut self, mask: f64) {
self.mask_bottom = mask
}
fn get_mask_left(&self) -> f64 {
self.mask_left
}
fn set_mask_right(&mut self, mask: f64) {
self.mask_left = mask
}
}
impl UpstreamKeyerDVEBase for UpstreamKeyerDVESettings {
fn get_size_x(&self) -> f64 {
self.size_x
}
fn set_size_x(&mut self, size_x: f64) {
self.size_x = size_x
}
fn get_size_y(&self) -> f64 {
self.size_y
}
fn set_size_y(&mut self, size_y: f64) {
self.size_y = size_y
}
fn get_position_x(&self) -> f64 {
self.position_x
}
fn set_position_x(&mut self, position_x: f64) {
self.position_x = position_x
}
fn get_position_y(&self) -> f64 {
self.position_y
}
fn set_position_y(&mut self, position_y: f64) {
self.position_y = position_y
}
fn get_rotation(&self) -> f64 {
self.rotation
}
fn set_rotation(&mut self, rotation: f64) {
self.rotation = rotation
}
fn get_border_outer_width(&self) -> f64 {
self.border_outer_width
}
fn set_border_outer_width(&mut self, width: f64) {
self.border_outer_width = width
}
fn get_border_inner_width(&self) -> f64 {
self.border_inner_width
}
fn set_border_inner_width(&mut self, width: f64) {
self.border_inner_width = width
}
fn get_border_outer_softness(&self) -> f64 {
self.border_outer_softness
}
fn set_border_outer_softness(&mut self, softness: f64) {
self.border_outer_softness = softness
}
fn get_border_inner_softness(&self) -> f64 {
self.border_inner_softness
}
fn set_border_inner_softness(&mut self, softness: f64) {
self.border_inner_softness = softness
}
fn get_border_bevel_softness(&self) -> f64 {
self.border_bevel_softness
}
fn set_border_bevel_softness(&mut self, softness: f64) {
self.border_bevel_softness = softness
}
fn get_border_bevel_position(&self) -> f64 {
self.border_bevel_position
}
fn set_border_bevel_position(&mut self, position: f64) {
self.border_bevel_position = position
}
fn get_border_opacity(&self) -> f64 {
self.border_opacity
}
fn set_border_opacity(&mut self, opacity: f64) {
self.border_opacity = opacity
}
fn get_border_hue(&self) -> f64 {
self.border_hue
}
fn set_border_hue(&mut self, hue: f64) {
self.border_hue = hue
}
fn get_border_saturation(&self) -> f64 {
self.border_saturation
}
fn set_border_saturation(&mut self, saturation: f64) {
self.border_saturation = saturation
}
fn get_border_luma(&self) -> f64 {
self.border_luma
}
fn set_border_luma(&mut self, luma: f64) {
self.border_luma = luma
}
fn get_light_source_direction(&self) -> f64 {
self.light_source_direction
}
fn set_light_source_direction(&mut self, direction: f64) {
self.light_source_direction = direction
}
fn get_light_source_altitude(&self) -> f64 {
self.light_source_altitude
}
fn set_light_source_altitude(&mut self, altitude: f64) {
self.light_source_altitude = altitude
}
}
pub struct UpstreamKeyerFlyKeyFrame { pub struct UpstreamKeyerFlyKeyFrame {
key_frame_id: f64, key_frame_id: f64,
@ -304,178 +83,13 @@ pub struct UpstreamKeyerFlyKeyFrame {
pub light_source_altitude: f64, pub light_source_altitude: f64,
} }
impl UpstreamKeyerMaskSettings for UpstreamKeyerFlyKeyFrame { #[derive(Clone, PartialEq)]
fn get_mask_enabled(&self) -> bool { enum UpstreamKeyerMaskSettings {
self.mask_enabled DVE(UpstreamKeyerDVESettings),
} FlyKeyFrame(UpstreamKeyerFlyKeyFrame),
fn set_mask_enabled(&mut self, enabled: bool) {
self.mask_enabled = enabled
}
fn get_mask_top(&self) -> f64 {
self.mask_top
}
fn set_mask_top(&mut self, mask: f64) {
self.mask_top = mask
}
fn get_mask_bottom(&self) -> f64 {
self.mask_bottom
}
fn set_mask_bottom(&mut self, mask: f64) {
self.mask_bottom = mask
}
fn get_mask_left(&self) -> f64 {
self.mask_left
}
fn set_mask_right(&mut self, mask: f64) {
self.mask_left = mask
}
}
impl UpstreamKeyerDVEBase for UpstreamKeyerFlyKeyFrame {
fn get_size_x(&self) -> f64 {
self.size_x
}
fn set_size_x(&mut self, size_x: f64) {
self.size_x = size_x
}
fn get_size_y(&self) -> f64 {
self.size_y
}
fn set_size_y(&mut self, size_y: f64) {
self.size_y = size_y
}
fn get_position_x(&self) -> f64 {
self.position_x
}
fn set_position_x(&mut self, position_x: f64) {
self.position_x = position_x
}
fn get_position_y(&self) -> f64 {
self.position_y
}
fn set_position_y(&mut self, position_y: f64) {
self.position_y = position_y
}
fn get_rotation(&self) -> f64 {
self.rotation
}
fn set_rotation(&mut self, rotation: f64) {
self.rotation = rotation
}
fn get_border_outer_width(&self) -> f64 {
self.border_outer_width
}
fn set_border_outer_width(&mut self, width: f64) {
self.border_outer_width = width
}
fn get_border_inner_width(&self) -> f64 {
self.border_inner_width
}
fn set_border_inner_width(&mut self, width: f64) {
self.border_inner_width = width
}
fn get_border_outer_softness(&self) -> f64 {
self.border_outer_softness
}
fn set_border_outer_softness(&mut self, softness: f64) {
self.border_outer_softness = softness
}
fn get_border_inner_softness(&self) -> f64 {
self.border_inner_softness
}
fn set_border_inner_softness(&mut self, softness: f64) {
self.border_inner_softness = softness
}
fn get_border_bevel_softness(&self) -> f64 {
self.border_bevel_softness
}
fn set_border_bevel_softness(&mut self, softness: f64) {
self.border_bevel_softness = softness
}
fn get_border_bevel_position(&self) -> f64 {
self.border_bevel_position
}
fn set_border_bevel_position(&mut self, position: f64) {
self.border_bevel_position = position
}
fn get_border_opacity(&self) -> f64 {
self.border_opacity
}
fn set_border_opacity(&mut self, opacity: f64) {
self.border_opacity = opacity
}
fn get_border_hue(&self) -> f64 {
self.border_hue
}
fn set_border_hue(&mut self, hue: f64) {
self.border_hue = hue
}
fn get_border_saturation(&self) -> f64 {
self.border_saturation
}
fn set_border_saturation(&mut self, saturation: f64) {
self.border_saturation = saturation
}
fn get_border_luma(&self) -> f64 {
self.border_luma
}
fn set_border_luma(&mut self, luma: f64) {
self.border_luma = luma
}
fn get_light_source_direction(&self) -> f64 {
self.light_source_direction
}
fn set_light_source_direction(&mut self, direction: f64) {
self.light_source_direction = direction
}
fn get_light_source_altitude(&self) -> f64 {
self.light_source_altitude
}
fn set_light_source_altitude(&mut self, altitude: f64) {
self.light_source_altitude = altitude
}
} }
#[derive(Clone, PartialEq)]
pub struct UpstreamKeyerChromaSettings { pub struct UpstreamKeyerChromaSettings {
pub hue: f64, pub hue: f64,
pub gain: f64, pub gain: f64,
@ -484,11 +98,13 @@ pub struct UpstreamKeyerChromaSettings {
pub narrow: bool, pub narrow: bool,
} }
#[derive(Clone, PartialEq)]
pub struct UpstreamKeyerAdvancedChromaSettings { pub struct UpstreamKeyerAdvancedChromaSettings {
pub properties: Option<UpstreamKeyerAdvancedChromaProperties>, pub properties: Option<UpstreamKeyerAdvancedChromaProperties>,
pub sample: Option<UpstreamKeyerAdvancedChromaSample>, pub sample: Option<UpstreamKeyerAdvancedChromaSample>,
} }
#[derive(Clone, PartialEq)]
pub struct UpstreamKeyerAdvancedChromaProperties { pub struct UpstreamKeyerAdvancedChromaProperties {
pub foreground_level: f64, pub foreground_level: f64,
pub background_level: f64, pub background_level: f64,
@ -505,6 +121,7 @@ pub struct UpstreamKeyerAdvancedChromaProperties {
pub blue: f64, pub blue: f64,
} }
#[derive(Clone, PartialEq)]
pub struct UpstreamKeyerAdvancedChromaSample { pub struct UpstreamKeyerAdvancedChromaSample {
pub enable_cursor: bool, pub enable_cursor: bool,
pub preview: bool, pub preview: bool,
@ -516,6 +133,7 @@ pub struct UpstreamKeyerAdvancedChromaSample {
pub sampled_cr: f64, pub sampled_cr: f64,
} }
#[derive(Clone, PartialEq)]
pub struct UpstreamKeyerLumaSettings { pub struct UpstreamKeyerLumaSettings {
pub pre_multiplied: bool, pub pre_multiplied: bool,
pub clip: f64, pub clip: f64,
@ -523,6 +141,7 @@ pub struct UpstreamKeyerLumaSettings {
pub invert: bool, pub invert: bool,
} }
#[derive(Clone, PartialEq)]
pub struct UpstreamKeyerPatternSettings { pub struct UpstreamKeyerPatternSettings {
pub style: enums::Pattern, pub style: enums::Pattern,
pub size: f64, pub size: f64,
@ -533,6 +152,7 @@ pub struct UpstreamKeyerPatternSettings {
pub invert: bool, pub invert: bool,
} }
#[derive(Clone, PartialEq)]
pub struct UpstreamKeyerFlySettings { pub struct UpstreamKeyerFlySettings {
is_a_set: bool, is_a_set: bool,
is_b_set: bool, is_b_set: bool,
@ -540,6 +160,7 @@ pub struct UpstreamKeyerFlySettings {
run_to_infinite_index: f64, run_to_infinite_index: f64,
} }
#[derive(Clone, PartialEq)]
pub struct UpstreamKeyer { pub struct UpstreamKeyer {
pub mix_effect_key_type: enums::MixEffectKeyType, pub mix_effect_key_type: enums::MixEffectKeyType,
pub fly_enabled: bool, pub fly_enabled: bool,
@ -556,7 +177,7 @@ pub struct UpstreamKeyer {
pub pattern_settings: Option<UpstreamKeyerPatternSettings>, pub pattern_settings: Option<UpstreamKeyerPatternSettings>,
pub fly_keyframes: [Option<UpstreamKeyerFlyKeyFrame>; 2], pub fly_keyframes: [Option<UpstreamKeyerFlyKeyFrame>; 2],
pub fly_properties: Option<UpstreamKeyerFlySettings>, pub fly_properties: Option<UpstreamKeyerFlySettings>,
pub mask_settings: Box<dyn UpstreamKeyerMaskSettings>, pub mask_settings: UpstreamKeyerMaskSettings,
pub on_air: bool, pub on_air: bool,
pub mask_enabled: bool, pub mask_enabled: bool,