Compare commits
26
Commits
main
..
8a3b535856
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a3b535856 | ||
|
|
5e5d3508f0 | ||
|
|
25460d77cd | ||
|
|
d2f41821c0 | ||
|
|
493bf7a6e8 | ||
|
|
c5ed966070 | ||
|
|
7e973af192 | ||
|
|
689138b282 | ||
|
|
2325645bb5 | ||
|
|
46cca11e00 | ||
|
|
90b2cfd984 | ||
|
|
2bbf2c5c6b | ||
|
|
4a075c3d1e | ||
|
|
9dd8cc0574 | ||
|
|
676ff7630e | ||
|
|
4a41d1f5d7 | ||
|
|
5db8843ce7 | ||
|
|
34a268f0bf | ||
|
|
e3a0d7973d | ||
|
|
c30913f823 | ||
|
|
c80d7643ca | ||
|
|
9d872eecc9 | ||
|
|
2ee3d71e78 | ||
|
|
80b73922ac | ||
|
|
de6f4b2a4d | ||
|
|
621b085381 |
@@ -1,7 +1,4 @@
|
||||
pub mod audio_mixer_config;
|
||||
pub mod media_pool_config;
|
||||
pub mod mix_effect_block_config;
|
||||
pub mod multiviewer_config;
|
||||
pub mod product_identifier;
|
||||
pub mod topology;
|
||||
pub mod version;
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use crate::{
|
||||
commands::command_base::{CommandDeserializer, DeserializedCommand},
|
||||
state::{audio::AtemClassicAudioState, info::AudioMixerInfo},
|
||||
};
|
||||
|
||||
pub const DESERIALIZE_AUDIO_MIXER_CONFIG_NAME: &str = "_AMC";
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct AudioMixerConfig {
|
||||
inputs: u8,
|
||||
monitors: u8,
|
||||
headphones: u8,
|
||||
}
|
||||
|
||||
impl DeserializedCommand for AudioMixerConfig {
|
||||
fn raw_name(&self) -> &'static str {
|
||||
DESERIALIZE_AUDIO_MIXER_CONFIG_NAME
|
||||
}
|
||||
|
||||
fn apply_to_state(&self, state: &mut crate::state::AtemState) {
|
||||
state.info.audio_mixer = Some(AudioMixerInfo::new(
|
||||
self.inputs,
|
||||
self.monitors,
|
||||
self.headphones,
|
||||
));
|
||||
state.audio = Some(AtemClassicAudioState::new(self.inputs, self.monitors != 0))
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct AudioMixerConfigDeserializer {}
|
||||
|
||||
impl CommandDeserializer for AudioMixerConfigDeserializer {
|
||||
fn deserialize(
|
||||
&self,
|
||||
buffer: &[u8],
|
||||
version: &crate::enums::ProtocolVersion,
|
||||
) -> std::sync::Arc<dyn DeserializedCommand> {
|
||||
Arc::new(AudioMixerConfig {
|
||||
inputs: buffer[0],
|
||||
monitors: buffer[1],
|
||||
headphones: buffer[2],
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use crate::{
|
||||
commands::command_base::{CommandDeserializer, DeserializedCommand},
|
||||
state::info::MediaPoolInfo,
|
||||
};
|
||||
|
||||
pub const DESERIALIZE_MEDIA_POOL_CONFIG_NAME: &str = "_mpl";
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct MediaPoolConfig {
|
||||
still_count: u8,
|
||||
clip_count: u8,
|
||||
}
|
||||
|
||||
impl DeserializedCommand for MediaPoolConfig {
|
||||
fn raw_name(&self) -> &'static str {
|
||||
DESERIALIZE_MEDIA_POOL_CONFIG_NAME
|
||||
}
|
||||
|
||||
fn apply_to_state(&self, state: &mut crate::state::AtemState) {
|
||||
state.info.media_pool = Some(MediaPoolInfo::new(self.still_count, self.clip_count))
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct MediaPoolConfigDeserializer {}
|
||||
|
||||
impl CommandDeserializer for MediaPoolConfigDeserializer {
|
||||
fn deserialize(
|
||||
&self,
|
||||
buffer: &[u8],
|
||||
_version: &crate::enums::ProtocolVersion,
|
||||
) -> std::sync::Arc<dyn DeserializedCommand> {
|
||||
Arc::new(MediaPoolConfig {
|
||||
still_count: buffer[0],
|
||||
clip_count: buffer[1],
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use crate::{
|
||||
commands::command_base::{CommandDeserializer, DeserializedCommand},
|
||||
enums::ProtocolVersion,
|
||||
state::info::MultiviewerInfo,
|
||||
};
|
||||
|
||||
pub const DESERIALIZE_MULTIVIEWER_NAME: &str = "_MvC";
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct MultiviewerConfig {
|
||||
count: Option<u8>,
|
||||
window_count: u8,
|
||||
}
|
||||
|
||||
impl DeserializedCommand for MultiviewerConfig {
|
||||
fn raw_name(&self) -> &'static str {
|
||||
DESERIALIZE_MULTIVIEWER_NAME
|
||||
}
|
||||
|
||||
fn apply_to_state(&self, state: &mut crate::state::AtemState) {
|
||||
// TODO: This can't be right...
|
||||
|
||||
let existing_count = match &state.info.multiviewer {
|
||||
Some(multiviewer) => multiviewer.count().as_ref().copied(),
|
||||
None => None,
|
||||
};
|
||||
let count = match self.count {
|
||||
Some(count) => Some(count),
|
||||
None => existing_count,
|
||||
};
|
||||
state.info.multiviewer = Some(MultiviewerInfo::new(count, self.window_count));
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct MultiviewerConfigDeserializer {}
|
||||
|
||||
impl CommandDeserializer for MultiviewerConfigDeserializer {
|
||||
fn deserialize(
|
||||
&self,
|
||||
buffer: &[u8],
|
||||
version: &crate::enums::ProtocolVersion,
|
||||
) -> std::sync::Arc<dyn DeserializedCommand> {
|
||||
if *version >= ProtocolVersion::V8_1_1 {
|
||||
Arc::new(MultiviewerConfig {
|
||||
count: None,
|
||||
window_count: buffer[1],
|
||||
})
|
||||
} else {
|
||||
Arc::new(MultiviewerConfig {
|
||||
count: Some(buffer[0]),
|
||||
window_count: buffer[1],
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -51,14 +51,15 @@ impl DeserializedCommand for Topology {
|
||||
self.advanced_chroma_keyers,
|
||||
self.only_configurable_outputs,
|
||||
));
|
||||
if let Some(multiviewers) = self.multiviewers {
|
||||
let window_count = if let Some(mv) = &state.info.multiviewer {
|
||||
*mv.window_count()
|
||||
} else {
|
||||
10
|
||||
};
|
||||
|
||||
let window_count = if let Some(mv) = &state.info.multiviewer {
|
||||
*mv.window_count()
|
||||
} else {
|
||||
10
|
||||
};
|
||||
|
||||
state.info.multiviewer = Some(MultiviewerInfo::new(self.multiviewers, window_count));
|
||||
state.info.multiviewer = Some(MultiviewerInfo::new(multiviewers, window_count))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,12 +8,9 @@ use crate::{
|
||||
use super::{
|
||||
command_base::{CommandDeserializer, DeserializedCommand},
|
||||
device_profile::{
|
||||
audio_mixer_config::{AudioMixerConfigDeserializer, DESERIALIZE_AUDIO_MIXER_CONFIG_NAME},
|
||||
media_pool_config::{MediaPoolConfigDeserializer, DESERIALIZE_MEDIA_POOL_CONFIG_NAME},
|
||||
mix_effect_block_config::{
|
||||
MixEffectBlockConfigDeserializer, DESERIALIZE_MIX_EFFECT_BLOCK_CONFIG_NAME,
|
||||
},
|
||||
multiviewer_config::{MultiviewerConfigDeserializer, DESERIALIZE_MULTIVIEWER_NAME},
|
||||
product_identifier::{
|
||||
ProductIdentifierDeserializer, DESERIALIZE_PRODUCT_IDENTIFIER_RAW_NAME,
|
||||
},
|
||||
@@ -80,9 +77,6 @@ fn command_deserializer_from_string(command_str: &str) -> Option<Box<dyn Command
|
||||
DESERIALIZE_PRODUCT_IDENTIFIER_RAW_NAME => {
|
||||
Some(Box::<ProductIdentifierDeserializer>::default())
|
||||
}
|
||||
DESERIALIZE_MEDIA_POOL_CONFIG_NAME => Some(Box::<MediaPoolConfigDeserializer>::default()),
|
||||
DESERIALIZE_MULTIVIEWER_NAME => Some(Box::<MultiviewerConfigDeserializer>::default()),
|
||||
DESERIALIZE_AUDIO_MIXER_CONFIG_NAME => Some(Box::<AudioMixerConfigDeserializer>::default()),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,28 +44,14 @@ pub struct ClassicAudioHeadphoneOutputChannel {
|
||||
pub talkback_gain: f64,
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Getters)]
|
||||
#[derive(Clone, PartialEq, Getters, new)]
|
||||
pub struct AtemClassicAudioState {
|
||||
number_of_channels: u8,
|
||||
has_monitor: bool,
|
||||
number_of_channels: Option<f64>,
|
||||
has_monitor: Option<bool>,
|
||||
pub channels: HashMap<u64, ClassicAudioChannel>,
|
||||
pub monitor: Option<ClassicAudioMonitorChannel>,
|
||||
pub headphones: Option<ClassicAudioHeadphoneOutputChannel>,
|
||||
pub master: Option<ClassicAudioMasterChannel>,
|
||||
|
||||
pub audio_follow_video_crossfade_transition_enabled: bool,
|
||||
}
|
||||
|
||||
impl AtemClassicAudioState {
|
||||
pub fn new(number_of_channels: u8, has_monitor: bool) -> Self {
|
||||
Self {
|
||||
number_of_channels,
|
||||
has_monitor,
|
||||
channels: Default::default(),
|
||||
monitor: Default::default(),
|
||||
headphones: Default::default(),
|
||||
master: Default::default(),
|
||||
audio_follow_video_crossfade_transition_enabled: false,
|
||||
}
|
||||
}
|
||||
pub audio_follow_video_crossfade_transition_enabled: Option<bool>,
|
||||
}
|
||||
|
||||
@@ -31,9 +31,9 @@ pub struct SuperSourceInfo {
|
||||
|
||||
#[derive(Clone, PartialEq, Getters, new)]
|
||||
pub struct AudioMixerInfo {
|
||||
inputs: u8,
|
||||
monitors: u8,
|
||||
headphones: u8,
|
||||
inputs: u64,
|
||||
monitors: u64,
|
||||
headphones: u64,
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Getters, new)]
|
||||
@@ -49,13 +49,13 @@ pub struct MacroPoolInfo {
|
||||
|
||||
#[derive(Clone, PartialEq, Getters, new)]
|
||||
pub struct MediaPoolInfo {
|
||||
still_count: u8,
|
||||
clip_count: u8,
|
||||
still_count: u64,
|
||||
clip_count: u64,
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Getters, new)]
|
||||
pub struct MultiviewerInfo {
|
||||
count: Option<u8>,
|
||||
count: u8,
|
||||
window_count: u8,
|
||||
}
|
||||
|
||||
|
||||
Generated
+98
-30
@@ -2,14 +2,15 @@
|
||||
"nodes": {
|
||||
"devshell": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1741473158,
|
||||
"narHash": "sha256-kWNaq6wQUbUMlPgw8Y+9/9wP0F8SHkjy24/mN3UAppg=",
|
||||
"lastModified": 1705332421,
|
||||
"narHash": "sha256-USpGLPme1IuqG78JNqSaRabilwkCyHmVWY0M9vYyqEA=",
|
||||
"owner": "numtide",
|
||||
"repo": "devshell",
|
||||
"rev": "7c9e793ebe66bcba8292989a68c0419b737a22a0",
|
||||
"rev": "83cb93d6d063ad290beee669f4badf9914cc16ec",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -18,16 +19,52 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1701680307,
|
||||
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils_2": {
|
||||
"inputs": {
|
||||
"systems": "systems_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1681202837,
|
||||
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"naersk": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1745925850,
|
||||
"narHash": "sha256-cyAAMal0aPrlb1NgzMxZqeN1mAJ2pJseDhm2m6Um8T0=",
|
||||
"lastModified": 1698420672,
|
||||
"narHash": "sha256-/TdeHMPRjjdJub7p7+w55vyABrsJlt5QkznPYy55vKA=",
|
||||
"owner": "nix-community",
|
||||
"repo": "naersk",
|
||||
"rev": "38bc60bbc157ae266d4a0c96671c6c742ee17a5f",
|
||||
"rev": "aeb58d5e8faead8980a807c840232697982d47b9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -38,11 +75,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1722073938,
|
||||
"narHash": "sha256-OpX0StkL8vpXyWOGUD6G+MA26wAXK6SpT94kLJXo6B4=",
|
||||
"lastModified": 1704161960,
|
||||
"narHash": "sha256-QGua89Pmq+FBAro8NriTuoO/wNaUtugt29/qqA8zeeM=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "e36e9f57337d0ff0cf77aceb58af4c805472bfae",
|
||||
"rev": "63143ac2c9186be6d9da6035fa22620018c85932",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -54,26 +91,26 @@
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1749401433,
|
||||
"narHash": "sha256-HXIQzULIG/MEUW2Q/Ss47oE3QrjxvpUX7gUl4Xp6lnc=",
|
||||
"lastModified": 1705883077,
|
||||
"narHash": "sha256-ByzHHX3KxpU1+V0erFy8jpujTufimh6KaS/Iv3AciHk=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "08fcb0dcb59df0344652b38ea6326a2d8271baff",
|
||||
"rev": "5f5210aa20e343b7e35f40c033000db0ef80d7b9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
"id": "nixpkgs",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 0,
|
||||
"narHash": "sha256-DDe16FJk18sadknQKKG/9FbwEro7A57tg9vB5kxZ8kY=",
|
||||
"path": "/nix/store/2d1ahim48jhzg4bbm97mvjlb4p7fpan3-source",
|
||||
"type": "path"
|
||||
"lastModified": 1705883077,
|
||||
"narHash": "sha256-ByzHHX3KxpU1+V0erFy8jpujTufimh6KaS/Iv3AciHk=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "5f5210aa20e343b7e35f40c033000db0ef80d7b9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
@@ -82,11 +119,11 @@
|
||||
},
|
||||
"nixpkgs_4": {
|
||||
"locked": {
|
||||
"lastModified": 1744536153,
|
||||
"narHash": "sha256-awS2zRgF4uTwrOKwwiJcByDzDOdo3Q1rPZbiHQg/N38=",
|
||||
"lastModified": 1681358109,
|
||||
"narHash": "sha256-eKyxW4OohHQx9Urxi7TQlFBTDWII+F+x2hklDOQPB50=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "18dd725c29603f582cf1900e0d25f9f1063dbf11",
|
||||
"rev": "96ba1c52e54e74c3197f4d43026b3f3d92e83ff9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -107,14 +144,15 @@
|
||||
},
|
||||
"rust-overlay": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils_2",
|
||||
"nixpkgs": "nixpkgs_4"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1749436897,
|
||||
"narHash": "sha256-OkDtaCGQQVwVFz5HWfbmrMJR99sFIMXHCHEYXzUJEJY=",
|
||||
"lastModified": 1705976279,
|
||||
"narHash": "sha256-Zx97bJ3+O8IP70uJPD//rRsr8bcxICISMTZUT/L9eFk=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "e7876c387e35dc834838aff254d8e74cf5bd4f19",
|
||||
"rev": "f889dc31ef97835834bdc3662394ebdb3c96b974",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -138,16 +176,46 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems_2": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems_3": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
"systems": "systems_3"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1731533236,
|
||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||
"lastModified": 1705309234,
|
||||
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
Reference in New Issue
Block a user