Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions crates/faderframe-engine/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2105,12 +2105,8 @@ pub fn build_graph(
))
.audio_in(tap.layout)
.audio_out(layout);
let node = SendNode::cue(t.id, cue.id, s).with_layouts(
tap.layout,
layout,
None,
slots.mix()?,
);
let node =
SendNode::cue(t.id, cue.id, s).with_layouts(tap.layout, layout, None, slots.mix()?);
if tap.in_bb {
let n = bb.add_node(spec, Box::new(node.quiet()));
bb.connect_audio(tap.node, tap.port, n, 0)?;
Expand Down Expand Up @@ -2769,7 +2765,12 @@ fn cross(
let sub = u64::from(key.1) << 8;
let w = bb.add_node(
NodeSpec::new(format!("{name} · To Ring"))
.key(node_key(key.0, Role::CueAhead, sub | 1 ^ ring.identity(), &[layout]))
.key(node_key(
key.0,
Role::CueAhead,
sub | 1 ^ ring.identity(),
&[layout],
))
.audio_in(layout),
Box::new(AheadWriter::new(Arc::clone(&ring))),
);
Expand Down Expand Up @@ -2823,7 +2824,7 @@ fn cue_bus_order(project: &Project) -> Vec<usize> {
});
if left.len() == before {
// A loop (refused by the routing): whatever is left, in order.
order.extend(left.drain(..));
order.append(&mut left);
}
}
order
Expand Down
4 changes: 3 additions & 1 deletion crates/faderframe-engine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ pub use engine::{
};
pub use plugins::{ActivatedPlugin, OutputBus, PluginHost, decode_state, encode_state};
pub use record::{RecordBlock, RecordStreams, RecordTarget};
pub use slots::{ChainSlots, CueSendSlots, CueTalkSlots, SlotRegistry, SlotsExhausted, StripSlots, Talkback};
pub use slots::{
ChainSlots, CueSendSlots, CueTalkSlots, SlotRegistry, SlotsExhausted, StripSlots, Talkback,
};
pub use snapshot::{
AudioRegion, Lane, MidiRegion, Source, SourceMap, StreamPlan, StreamRegion, TimelineSnapshot,
WarpMode, WarpedRegion, render_generated_sources,
Expand Down
26 changes: 14 additions & 12 deletions crates/faderframe-engine/src/nodes/send.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,13 @@ impl Processor<EngineContext> for SendNode {

fn process(&mut self, cx: &ProcessContext<'_, EngineContext>, io: &mut NodeIo<'_>) {
let static_level = cx.data.params.get(self.level);
let static_on = self
.on
.map_or(1.0, |s| if cx.data.params.get(s) >= 0.5 { 1.0 } else { 0.0 });
let static_on = self.on.map_or(1.0, |s| {
if cx.data.params.get(s) >= 0.5 {
1.0
} else {
0.0
}
});
let auto = cx.data.timeline.automation(self.track);
let cue_lanes = self.cue.and_then(|c| auto.and_then(|a| a.cue_send(c)));
let lane = self
Expand Down Expand Up @@ -253,15 +257,13 @@ impl Processor<EngineContext> for SendNode {
} else {
out.copy_from(input);
}
let step = if lane.is_some()
|| on_lane.is_some()
|| pan_lanes.is_some()
|| balance_lane.is_some()
{
AUTOMATION_STEP
} else {
n.max(1)
};
let step =
if lane.is_some() || on_lane.is_some() || pan_lanes.is_some() || balance_lane.is_some()
{
AUTOMATION_STEP
} else {
n.max(1)
};
let mut off = 0;
while off < n {
let m = step.min(n - off);
Expand Down
9 changes: 8 additions & 1 deletion crates/faderframe-engine/src/nodes/strip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,14 @@ impl ChannelStrip {

/// The pre-fader output (1, track layout) for frames `off..off + m`,
/// reaching `audible` at the end of the range.
fn render_pre(&mut self, input: &AudioBuffer, outs: &mut [AudioBuffer], off: usize, m: usize, audible: f32) {
fn render_pre(
&mut self,
input: &AudioBuffer,
outs: &mut [AudioBuffer],
off: usize,
m: usize,
audible: f32,
) {
let Some(pre) = outs.get_mut(1) else {
return;
};
Expand Down
9 changes: 8 additions & 1 deletion crates/faderframe-engine/src/slots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,14 @@ impl SlotRegistry {
let s = self.cue_talk(c.id)?;
let talking = talk.on && talk.input.is_some() && c.talkback;
table.set(s.talk, if talking { talk.level.max(0.0) } else { 0.0 });
table.set(s.dim, if talking { talk.dim.clamp(0.0, 1.0) } else { 1.0 });
table.set(
s.dim,
if talking {
talk.dim.clamp(0.0, 1.0)
} else {
1.0
},
);
}
Ok(())
}
Expand Down
5 changes: 4 additions & 1 deletion crates/faderframe-engine/src/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,10 @@ impl TrackAutomation {
/// The lanes of the track's send to cue mix `cue`.
#[inline]
pub fn cue_send(&self, cue: faderframe_core::CueId) -> Option<&CueSendLanes> {
self.cue_sends.iter().find(|(c, _)| *c == cue).map(|(_, l)| l)
self.cue_sends
.iter()
.find(|(c, _)| *c == cue)
.map(|(_, l)| l)
}

#[inline]
Expand Down
Loading
Loading