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
|
|
@ -1,5 +1,5 @@
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
edition = "2021"
|
edition = "2024"
|
||||||
version = "0.2.1"
|
version = "0.2.1"
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
|
|
|
||||||
|
|
@ -820,7 +820,7 @@ impl App {
|
||||||
// autocolor: new clip colors from scene and track color
|
// autocolor: new clip colors from scene and track color
|
||||||
let color = track.color.base.mix(scene.color.base, 0.5);
|
let color = track.color.base.mix(scene.color.base, 0.5);
|
||||||
clip.write().unwrap().color = ItemColor::random_near(color, 0.2).into();
|
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));
|
editor.set_clip(Some(&clip));
|
||||||
}
|
}
|
||||||
*slot = Some(clip.clone());
|
*slot = Some(clip.clone());
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ audio!(
|
||||||
let mut pitch: Option<u7> = None;
|
let mut pitch: Option<u7> = None;
|
||||||
for port in midi_in.iter() {
|
for port in midi_in.iter() {
|
||||||
for event in port.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
|
= event
|
||||||
{
|
{
|
||||||
pitch = Some(key.clone());
|
pitch = Some(key.clone());
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@ audio!(|self: Lv2, _client, scope|{
|
||||||
audio_ins,
|
audio_ins,
|
||||||
audio_outs,
|
audio_outs,
|
||||||
lv2_features,
|
lv2_features,
|
||||||
ref mut lv2_instance,
|
lv2_instance,
|
||||||
ref mut lv2_input_buffer,
|
lv2_input_buffer,
|
||||||
..
|
..
|
||||||
} = self;
|
} = self;
|
||||||
let urid = lv2_features.midi_urid();
|
let urid = lv2_features.midi_urid();
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ impl Sampler {
|
||||||
|
|
||||||
/// Write playing voices to output buffer
|
/// Write playing voices to output buffer
|
||||||
fn populate_output_buffer (&mut self, frames: usize) {
|
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();
|
let channel_count = buffer.len();
|
||||||
match mixing_mode {
|
match mixing_mode {
|
||||||
MixingMode::Summing => voices.write().unwrap().retain_mut(|voice|{
|
MixingMode::Summing => voices.write().unwrap().retain_mut(|voice|{
|
||||||
|
|
@ -95,7 +95,7 @@ impl Sampler {
|
||||||
|
|
||||||
/// Write output buffer to output ports.
|
/// Write output buffer to output ports.
|
||||||
fn write_output_buffer (&mut self, scope: &ProcessScope) {
|
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() {
|
for (i, port) in audio_outs.iter_mut().enumerate() {
|
||||||
let buffer = &buffer[i];
|
let buffer = &buffer[i];
|
||||||
for (i, value) in port.port_mut().as_mut_slice(scope).iter_mut().enumerate() {
|
for (i, value) in port.port_mut().as_mut_slice(scope).iter_mut().enumerate() {
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ impl Sequencer {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// If there's a currently playing clip, output notes from it to buffer:
|
// 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.
|
// Source clip from which the MIDI events will be taken.
|
||||||
let clip = clip.read().unwrap();
|
let clip = clip.read().unwrap();
|
||||||
// Clip with zero length is not processed
|
// Clip with zero length is not processed
|
||||||
|
|
|
||||||
|
|
@ -54,10 +54,10 @@ impl<'j> Jack<'j> {
|
||||||
/// Run something with the client.
|
/// Run something with the client.
|
||||||
pub fn with_client <T> (&self, op: impl FnOnce(&Client)->T) -> T {
|
pub fn with_client <T> (&self, op: impl FnOnce(&Client)->T) -> T {
|
||||||
match &*self.0.read().unwrap() {
|
match &*self.0.read().unwrap() {
|
||||||
Inert => panic!("jack client not activated"),
|
Inert => panic!("jack client not activated"),
|
||||||
Inactive(ref client) => op(client),
|
Inactive(client) => op(client),
|
||||||
Activating => panic!("jack client has not finished activation"),
|
Activating => panic!("jack client has not finished activation"),
|
||||||
Active(ref client) => op(client.as_client()),
|
Active(client) => op(client.as_client()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue