[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Traverso-commit] traverso/src/core Curve.cpp
From: |
Remon Sijrier |
Subject: |
[Traverso-commit] traverso/src/core Curve.cpp |
Date: |
Mon, 19 Nov 2007 22:13:25 +0000 |
CVSROOT: /sources/traverso
Module name: traverso
Changes by: Remon Sijrier <r_sijrier> 07/11/19 22:13:25
Modified files:
src/core : Curve.cpp
Log message:
* cleanup ::process() some more
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/Curve.cpp?cvsroot=traverso&r1=1.47&r2=1.48
Patches:
Index: Curve.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/core/Curve.cpp,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -b -r1.47 -r1.48
--- Curve.cpp 19 Nov 2007 22:07:06 -0000 1.47
+++ Curve.cpp 19 Nov 2007 22:13:25 -0000 1.48
@@ -189,31 +189,32 @@
float makeupgain
)
{
+ // Do nothing if there are no nodes!
if (m_nodes.isEmpty()) {
return 0;
}
- CurveNode* lastnode = (CurveNode*)m_nodes.last();
-
- float gain = lastnode->value * makeupgain;
-
+ // Check if we are beyond the last node and only apply gain if != 1.0
if (endlocation > qint64(get_range())) {
+ float gain = ((CurveNode*)m_nodes.last())->value * makeupgain;
+
if (gain == 1.0f) {
return 0;
}
+
for (uint chan=0; chan<channels; ++chan) {
Mixer::apply_gain_to_buffer(buffer[chan], nframes,
gain);
}
+
return 1;
}
- gain = makeupgain;
-
+ // Calculate the vector, an apply to the buffer including the makeup
gain.
get_vector(startlocation.universal_frame(),
endlocation.universal_frame(), m_song->mixdown, nframes);
for (uint chan=0; chan<channels; ++chan) {
for (nframes_t n = 0; n < nframes; ++n) {
- buffer[chan][n] *= (m_song->mixdown[n] * gain);
+ buffer[chan][n] *= (m_song->mixdown[n] * makeupgain);
}
}