summaryrefslogtreecommitdiff
path: root/muse2/muse/audiotrack.cpp
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2011-12-14 15:08:02 +0000
committerFlorian Jung <flo@windfisch.org>2011-12-14 15:08:02 +0000
commitc36a5508aa42e596b005425208054af9a60734b4 (patch)
treefde0504e0c25b8f39ed6f5f7f7332943e4a95c7f /muse2/muse/audiotrack.cpp
parent42126f3b398802eb24c8d9acd2591ef4dbe7257d (diff)
pulled fixes from release into trunk
Diffstat (limited to 'muse2/muse/audiotrack.cpp')
-rw-r--r--muse2/muse/audiotrack.cpp36
1 files changed, 34 insertions, 2 deletions
diff --git a/muse2/muse/audiotrack.cpp b/muse2/muse/audiotrack.cpp
index b674e20c..aceacc75 100644
--- a/muse2/muse/audiotrack.cpp
+++ b/muse2/muse/audiotrack.cpp
@@ -107,7 +107,7 @@ AudioTrack::AudioTrack(TrackType t)
_automationType = AUTO_OFF;
//setChannels(1);
setChannels(2);
- addController(new CtrlList(AC_VOLUME,"Volume",0.0,3.16 /* roughly 10 db */, VAL_LOG));
+ addController(new CtrlList(AC_VOLUME,"Volume",0.001,3.163 /* roughly 10 db */, VAL_LOG));
addController(new CtrlList(AC_PAN, "Pan", -1.0, 1.0, VAL_LINEAR));
addController(new CtrlList(AC_MUTE,"Mute",0.0,1.0, VAL_LINEAR, true /*dont show in arranger */));
@@ -1610,8 +1610,40 @@ void AudioAux::read(Xml& xml)
// getData
//---------------------------------------------------------
-bool AudioAux::getData(unsigned /*pos*/, int ch, unsigned /*samples*/, float** data)
+bool AudioAux::getData(unsigned pos, int ch, unsigned samples, float** data)
{
+ // Make sure all the aux-supporting tracks are processed first so aux data is gathered. p4.0.37
+ TrackList* tl = MusEGlobal::song->tracks();
+ AudioTrack* track;
+ for(ciTrack it = tl->begin(); it != tl->end(); ++it)
+ {
+ if((*it)->isMidiTrack())
+ continue;
+ track = (AudioTrack*)(*it);
+ // If there are any Aux route paths to the track, defer processing until the second main track processing pass.
+ if(!track->processed() && track->hasAuxSend() && !track->auxRefCount())
+ {
+ int chans = track->channels();
+ // Just a dummy buffer.
+ float* buff[chans];
+ float buff_data[samples * chans];
+ for (int i = 0; i < chans; ++i)
+ buff[i] = buff_data + i * samples;
+
+ //printf("AudioAux::getData name:%s\n calling copyData on:%s auxRefCount:%d\n",
+ // name().toLatin1().constData(), track->name().toLatin1().constData(), track->auxRefCount());
+
+ track->copyData(pos, chans, -1, -1, samples, buff);
+
+ /* float* buff[ch];
+ float buff_data[samples * ch];
+ for (int i = 0; i < ch; ++i)
+ buff[i] = buff_data + i * samples;
+ //printf("Audio::process1 calling track->copyData for track:%s\n", track->name().toLatin1());
+ track->copyData(pos, ch, -1, -1, samples, buff); */
+ }
+ }
+
for (int i = 0; i < ch; ++i)
data[i] = buffer[i % channels()];
return true;