mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
switch to rust 2024
This commit is contained in:
parent
74b497cf3a
commit
f87a5c14f9
7 changed files with 12 additions and 12 deletions
|
|
@ -820,7 +820,7 @@ impl App {
|
|||
// autocolor: new clip colors from scene and track color
|
||||
let color = track.color.base.mix(scene.color.base, 0.5);
|
||||
clip.write().unwrap().color = ItemColor::random_near(color, 0.2).into();
|
||||
if let Some(ref mut editor) = &mut self.project.editor {
|
||||
if let Some(editor) = &mut self.project.editor {
|
||||
editor.set_clip(Some(&clip));
|
||||
}
|
||||
*slot = Some(clip.clone());
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ audio!(
|
|||
let mut pitch: Option<u7> = None;
|
||||
for port in midi_in.iter() {
|
||||
for event in port.iter() {
|
||||
if let (_, Ok(LiveEvent::Midi {message: MidiMessage::NoteOn {ref key, ..}, ..}))
|
||||
if let (_, Ok(LiveEvent::Midi {message: MidiMessage::NoteOn {key, ..}, ..}))
|
||||
= event
|
||||
{
|
||||
pitch = Some(key.clone());
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ audio!(|self: Lv2, _client, scope|{
|
|||
audio_ins,
|
||||
audio_outs,
|
||||
lv2_features,
|
||||
ref mut lv2_instance,
|
||||
ref mut lv2_input_buffer,
|
||||
lv2_instance,
|
||||
lv2_input_buffer,
|
||||
..
|
||||
} = self;
|
||||
let urid = lv2_features.midi_urid();
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ impl Sampler {
|
|||
|
||||
/// Write playing voices to output buffer
|
||||
fn populate_output_buffer (&mut self, frames: usize) {
|
||||
let Sampler { ref mut buffer, voices, output_gain, mixing_mode, .. } = self;
|
||||
let Sampler { buffer, voices, output_gain, mixing_mode, .. } = self;
|
||||
let channel_count = buffer.len();
|
||||
match mixing_mode {
|
||||
MixingMode::Summing => voices.write().unwrap().retain_mut(|voice|{
|
||||
|
|
@ -95,7 +95,7 @@ impl Sampler {
|
|||
|
||||
/// Write output buffer to output ports.
|
||||
fn write_output_buffer (&mut self, scope: &ProcessScope) {
|
||||
let Sampler { ref mut audio_outs, buffer, .. } = self;
|
||||
let Sampler { audio_outs, buffer, .. } = self;
|
||||
for (i, port) in audio_outs.iter_mut().enumerate() {
|
||||
let buffer = &buffer[i];
|
||||
for (i, value) in port.port_mut().as_mut_slice(scope).iter_mut().enumerate() {
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ impl Sequencer {
|
|||
return true
|
||||
}
|
||||
// If there's a currently playing clip, output notes from it to buffer:
|
||||
if let Some(ref clip) = clip {
|
||||
if let Some(clip) = clip {
|
||||
// Source clip from which the MIDI events will be taken.
|
||||
let clip = clip.read().unwrap();
|
||||
// Clip with zero length is not processed
|
||||
|
|
|
|||
|
|
@ -54,10 +54,10 @@ impl<'j> Jack<'j> {
|
|||
/// Run something with the client.
|
||||
pub fn with_client <T> (&self, op: impl FnOnce(&Client)->T) -> T {
|
||||
match &*self.0.read().unwrap() {
|
||||
Inert => panic!("jack client not activated"),
|
||||
Inactive(ref client) => op(client),
|
||||
Activating => panic!("jack client has not finished activation"),
|
||||
Active(ref client) => op(client.as_client()),
|
||||
Inert => panic!("jack client not activated"),
|
||||
Inactive(client) => op(client),
|
||||
Activating => panic!("jack client has not finished activation"),
|
||||
Active(client) => op(client.as_client()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue