mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 04:36:45 +01:00
clone ports as unowned and pass outwards
This commit is contained in:
parent
394355331d
commit
ddaf870271
9 changed files with 123 additions and 112 deletions
|
|
@ -74,21 +74,21 @@ handle!(Sampler = crate::control::sampler::handle);
|
|||
//}
|
||||
//});
|
||||
process!(Sampler = Sampler::process);
|
||||
ports!(Sampler {
|
||||
audio: {
|
||||
ins: |s|Ok(s.ports.audio_ins.values().collect()),
|
||||
outs: |s|Ok(s.ports.audio_outs.values().collect()),
|
||||
}
|
||||
midi: {
|
||||
ins: |s|Ok(s.ports.midi_ins.values().collect()),
|
||||
outs: |s|Ok(s.ports.midi_outs.values().collect()),
|
||||
}
|
||||
});
|
||||
//ports!(Sampler {
|
||||
//audio: {
|
||||
//ins: |s|Ok(s.ports.audio_ins.values().collect()),
|
||||
//outs: |s|Ok(s.ports.audio_outs.values().collect()),
|
||||
//}
|
||||
//midi: {
|
||||
//ins: |s|Ok(s.ports.midi_ins.values().collect()),
|
||||
//outs: |s|Ok(s.ports.midi_outs.values().collect()),
|
||||
//}
|
||||
//});
|
||||
|
||||
impl Sampler {
|
||||
pub fn new (
|
||||
name: &str, samples: Option<BTreeMap<u7, Arc<Sample>>>,
|
||||
) -> Usually<Arc<Mutex<Box<dyn Device>>>> {
|
||||
) -> Usually<JackDevice> {
|
||||
Jack::new(name)?
|
||||
.register_midi_in("midi")?
|
||||
.register_audio_in("recL")?
|
||||
|
|
@ -104,7 +104,7 @@ impl Sampler {
|
|||
}))
|
||||
}
|
||||
|
||||
pub fn process (&mut self, _: &Client, scope: &ProcessScope) -> Control {
|
||||
pub fn process (&mut self, _: &Client, scope: &ProcessScope) -> Control {
|
||||
// Output buffer: this will be copied to the audio outs.
|
||||
let channel_count = self.ports.audio_outs.len();
|
||||
let mut mixed = vec![vec![0.0;scope.n_frames() as usize];channel_count];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue