Rename next_midi_event() to next_event()
This commit is contained in:
parent
eb5b81fcac
commit
e4606918e7
4 changed files with 7 additions and 10 deletions
|
@ -139,7 +139,7 @@ impl Plugin for Sine {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn process(&mut self, buffer: &mut Buffer, context: &mut impl ProcessContext) -> ProcessStatus {
|
fn process(&mut self, buffer: &mut Buffer, context: &mut impl ProcessContext) -> ProcessStatus {
|
||||||
let mut next_event = context.next_midi_event();
|
let mut next_event = context.next_event();
|
||||||
for (sample_id, channel_samples) in buffer.iter_samples().enumerate() {
|
for (sample_id, channel_samples) in buffer.iter_samples().enumerate() {
|
||||||
// Smoothing is optionally built into the parameters themselves
|
// Smoothing is optionally built into the parameters themselves
|
||||||
let gain = self.params.gain.smoothed.next();
|
let gain = self.params.gain.smoothed.next();
|
||||||
|
@ -168,7 +168,7 @@ impl Plugin for Sine {
|
||||||
_ => break 'midi_events,
|
_ => break 'midi_events,
|
||||||
}
|
}
|
||||||
|
|
||||||
next_event = context.next_midi_event();
|
next_event = context.next_event();
|
||||||
}
|
}
|
||||||
|
|
||||||
// This gain envelope prevents clicks with new notes and with released notes
|
// This gain envelope prevents clicks with new notes and with released notes
|
||||||
|
|
|
@ -19,12 +19,9 @@ pub trait ProcessContext {
|
||||||
/// Get information about the current transport position and status.
|
/// Get information about the current transport position and status.
|
||||||
fn transport(&self) -> &Transport;
|
fn transport(&self) -> &Transport;
|
||||||
|
|
||||||
/// Return the next note event, if there is one. The event contains the timing
|
/// Return the next note event, if there is one. Use [`NoteEvent::timing()`] to get the event's
|
||||||
///
|
/// timing within the buffer.
|
||||||
/// TODO: Rethink this API, both in terms of ergonomics, and if we can do this in a way that
|
fn next_event(&mut self) -> Option<NoteEvent>;
|
||||||
/// doesn't require locks (because of the thread safe-ness, which we don't really need
|
|
||||||
/// here)
|
|
||||||
fn next_midi_event(&mut self) -> Option<NoteEvent>;
|
|
||||||
|
|
||||||
/// Update the current latency of the plugin. If the plugin is currently processing audio, then
|
/// Update the current latency of the plugin. If the plugin is currently processing audio, then
|
||||||
/// this may cause audio playback to be restarted.
|
/// this may cause audio playback to be restarted.
|
||||||
|
|
|
@ -95,7 +95,7 @@ impl<P: ClapPlugin> ProcessContext for WrapperProcessContext<'_, P> {
|
||||||
&self.transport
|
&self.transport
|
||||||
}
|
}
|
||||||
|
|
||||||
fn next_midi_event(&mut self) -> Option<NoteEvent> {
|
fn next_event(&mut self) -> Option<NoteEvent> {
|
||||||
self.input_events_guard.pop_front()
|
self.input_events_guard.pop_front()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,7 @@ impl<P: Vst3Plugin> ProcessContext for WrapperProcessContext<'_, P> {
|
||||||
&self.transport
|
&self.transport
|
||||||
}
|
}
|
||||||
|
|
||||||
fn next_midi_event(&mut self) -> Option<NoteEvent> {
|
fn next_event(&mut self) -> Option<NoteEvent> {
|
||||||
self.input_events_guard.pop_front()
|
self.input_events_guard.pop_front()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue