pub struct PatchbayControl { /* private fields */ }Expand description
Главный контроллер патчбэя
Работает в потоке управления (soft RT) и отправляет команды
в аудиопоток через MpscQueue<ParameterCommand>.
Implementations§
Source§impl PatchbayControl
impl PatchbayControl
Sourcepub fn new(command_queue: Arc<MpscQueue<ParameterCommand>>) -> Self
pub fn new(command_queue: Arc<MpscQueue<ParameterCommand>>) -> Self
Создать новый контроллер
Sourcepub fn add_mapping(&mut self, mapping: Mapping)
pub fn add_mapping(&mut self, mapping: Mapping)
Добавить маппинг события
Sourcepub fn add_mapping_str(
&mut self,
pattern: &str,
target_node: NodeId,
target_param: &str,
min: f32,
max: f32,
transform: Transform,
) -> Result<(), &'static str>
pub fn add_mapping_str( &mut self, pattern: &str, target_node: NodeId, target_param: &str, min: f32, max: f32, transform: Transform, ) -> Result<(), &'static str>
Добавить маппинг из строк (удобно для скриптов)
Sourcepub fn add_servo<A: Automaton + 'static>(&mut self, servo: Servo<A>)
pub fn add_servo<A: Automaton + 'static>(&mut self, servo: Servo<A>)
Добавить сервопривод (автомат)
Sourcepub fn add_lfo(
&mut self,
id: &str,
frequency: f64,
amplitude: f64,
offset: f64,
waveform: LfoWaveform,
target_node: NodeId,
target_param: &str,
min: f64,
max: f64,
)
pub fn add_lfo( &mut self, id: &str, frequency: f64, amplitude: f64, offset: f64, waveform: LfoWaveform, target_node: NodeId, target_param: &str, min: f64, max: f64, )
Добавить LFO как сервопривод
Sourcepub fn add_envelope(
&mut self,
id: &str,
attack: f64,
decay: f64,
sustain: f64,
release: f64,
target_node: NodeId,
target_param: &str,
min: f64,
max: f64,
)
pub fn add_envelope( &mut self, id: &str, attack: f64, decay: f64, sustain: f64, release: f64, target_node: NodeId, target_param: &str, min: f64, max: f64, )
Добавить огибающую как сервопривод
Sourcepub fn handle_event(&mut self, event: ControlEvent)
pub fn handle_event(&mut self, event: ControlEvent)
Обработать внешнее событие (MIDI/OSC)
Sourcepub fn update(&mut self, dt: f32)
pub fn update(&mut self, dt: f32)
Обновить состояние (вызывается регулярно из потока управления)
Sourcepub fn get_servo_mut(&mut self, id: &str) -> Option<&mut BoxedServo>
pub fn get_servo_mut(&mut self, id: &str) -> Option<&mut BoxedServo>
Получить мутабельный сервопривод по ID
Sourcepub fn remove_servo(&mut self, id: &str) -> bool
pub fn remove_servo(&mut self, id: &str) -> bool
Удалить сервопривод
Sourcepub fn reset_time(&mut self)
pub fn reset_time(&mut self)
Сбросить время
Sourcepub fn current_time(&self) -> Time
pub fn current_time(&self) -> Time
Текущее время
Auto Trait Implementations§
impl Freeze for PatchbayControl
impl !RefUnwindSafe for PatchbayControl
impl Send for PatchbayControl
impl Sync for PatchbayControl
impl Unpin for PatchbayControl
impl UnsafeUnpin for PatchbayControl
impl !UnwindSafe for PatchbayControl
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more