From 4811a6644aa7d75519edb37460a1c45493b61bd5 Mon Sep 17 00:00:00 2001 From: "Tim E. Real" Date: Thu, 28 Jan 2010 00:25:15 +0000 Subject: See ChangeLog --- muse/ChangeLog | 5 ++ muse/muse/arranger/arranger.cpp | 2 +- muse/muse/arranger/tlist.cpp | 26 ++++++--- muse/muse/audioprefetch.cpp | 5 ++ muse/muse/driver/jack.cpp | 8 ++- muse/muse/node.cpp | 5 +- muse/muse/sync.cpp | 2 +- muse/muse/wavetrack.cpp | 119 +++++++++++++++++++++------------------- 8 files changed, 104 insertions(+), 68 deletions(-) diff --git a/muse/ChangeLog b/muse/ChangeLog index d1796b87..2aa745d8 100644 --- a/muse/ChangeLog +++ b/muse/ChangeLog @@ -1,3 +1,8 @@ +27.01.2010 + * Changed: Don't process audio prefetch, or getData() in Audio::copyData(), if track is 'Off'. (T356) + * Added: Arranger track list: Quick 'right-click' or 'ctrl-click' or 'ctrl-mouse-wheel' toggling of Track On/Off. (T356) + - Note this includes midi tracks now! Remains to be seen whether allowing midi off is useful and will work, + or should be filtered out. **TODO: Turn off remaining controls in midi strips, turn off actual midi playback and record. 26.01.2010 * Fixed: Import midi 'replace' broken last fixes. (T356) * Fixed: External midi sync: Wait until first clock after start to start transport, and >= second clock to increment ticks. (T356) diff --git a/muse/muse/arranger/arranger.cpp b/muse/muse/arranger/arranger.cpp index b2fd53f0..4b0d7f38 100644 --- a/muse/muse/arranger/arranger.cpp +++ b/muse/muse/arranger/arranger.cpp @@ -68,7 +68,7 @@ QString TWhatsThis::text(const QPoint& pos) return QString::null; switch(section) { case COL_RECORD: return QHeader::tr("Enable recording. Click to toggle."); break; - case COL_MUTE: return QHeader::tr("Mute indicator. Click to toggle."); break; + case COL_MUTE: return QHeader::tr("Mute indicator. Click to toggle.\nRight-click to toggle track on/off.\nMute is designed for rapid, repeated action.\nOn/Off is not!"); break; case COL_SOLO: return QHeader::tr("Solo indicator. Click to toggle.\nConnected tracks are also 'phantom' soloed,\n indicated by a dark square."); break; case COL_CLASS: return QHeader::tr("Track type. Right-click to change\n midi and drum track types."); break; case COL_NAME: return QHeader::tr("Track name. Double-click to edit.\nRight-click for more options."); break; diff --git a/muse/muse/arranger/tlist.cpp b/muse/muse/arranger/tlist.cpp index 1c432711..2bd4c685 100644 --- a/muse/muse/arranger/tlist.cpp +++ b/muse/muse/arranger/tlist.cpp @@ -58,7 +58,7 @@ void THeaderTip::maybeTip(const QPoint &pos) QString p; switch (section) { case COL_RECORD: p = QHeader::tr("Enable Recording"); break; - case COL_MUTE: p = QHeader::tr("Mute Indicator"); break; + case COL_MUTE: p = QHeader::tr("Mute/Off Indicator"); break; case COL_SOLO: p = QHeader::tr("Solo Indicator"); break; case COL_CLASS: p = QHeader::tr("Track Type"); break; case COL_NAME: p = QHeader::tr("Track Name"); break; @@ -878,10 +878,16 @@ void TList::mousePressEvent(QMouseEvent* ev) break; case COL_MUTE: - if (t->off()) - t->setOff(false); + // p3.3.29 + if ((button == QMouseEvent::RightButton) || (ev->state() & ControlButton)) + t->setOff(!t->off()); else - t->setMute(!t->mute()); + { + if (t->off()) + t->setOff(false); + else + t->setMute(!t->mute()); + } song->update(SC_MUTE); break; case COL_SOLO: @@ -1145,10 +1151,16 @@ void TList::wheelEvent(QWheelEvent* ev) case COL_NAME: break; case COL_MUTE: - if (t->off()) - t->setOff(false); + // p3.3.29 + if (ev->state() & ControlButton) + t->setOff(!t->off()); else - t->setMute(!t->mute()); + { + if (t->off()) + t->setOff(false); + else + t->setMute(!t->mute()); + } song->update(SC_MUTE); break; diff --git a/muse/muse/audioprefetch.cpp b/muse/muse/audioprefetch.cpp index dbfbd614..26ae4237 100644 --- a/muse/muse/audioprefetch.cpp +++ b/muse/muse/audioprefetch.cpp @@ -180,6 +180,11 @@ void AudioPrefetch::prefetch(bool doSeek) WaveTrackList* tl = song->waves(); for (iWaveTrack it = tl->begin(); it != tl->end(); ++it) { WaveTrack* track = *it; + // p3.3.29 + // Save time. Don't bother if track is off. Track On/Off not designed for rapid repeated response (but mute is). + if(track->off()) + continue; + int ch = track->channels(); float* bp[ch]; // printf("prefetch %d\n", writePos); diff --git a/muse/muse/driver/jack.cpp b/muse/muse/driver/jack.cpp index 5e719e8d..396f6b35 100644 --- a/muse/muse/driver/jack.cpp +++ b/muse/muse/driver/jack.cpp @@ -187,10 +187,14 @@ static void timebase_callback(jack_transport_state_t /* state */, int /* new_pos */, void*) { + // p3.3.29 + //printf("Jack timebase_callback pos->frame:%u audio->tickPos:%d song->cpos:%d\n", pos->frame, audio->tickPos(), song->cpos()); + // P3.3.27 //Pos p(pos->frame, false); - //Pos p(extSyncFlag.value() ? audio->tickPos() : pos->frame, extSyncFlag.value() ? true : false); - Pos p(extSyncFlag.value() ? song->cpos() : pos->frame, extSyncFlag.value() ? true : false); + Pos p(extSyncFlag.value() ? audio->tickPos() : pos->frame, extSyncFlag.value() ? true : false); + // Can't use song pos - it is only updated every (slow) GUI heartbeat ! + //Pos p(extSyncFlag.value() ? song->cpos() : pos->frame, extSyncFlag.value() ? true : false); pos->valid = JackPositionBBT; p.mbt(&pos->bar, &pos->beat, &pos->tick); diff --git a/muse/muse/node.cpp b/muse/muse/node.cpp index 09e6b6d8..38d7d40b 100644 --- a/muse/muse/node.cpp +++ b/muse/muse/node.cpp @@ -360,7 +360,10 @@ void AudioTrack::copyData(unsigned pos, int dstChannels, unsigned nframes, float // getData can use the supplied buffers, or change buffer to point to its own local buffers or Jack buffers etc. // For ex. if this is an audio input, Jack will set the pointers for us in AudioInput::getData! - if(!getData(pos, srcChannels, nframes, buffer) || off() || (isMute() && !_prefader)) + // p3.3.29 1/27/10 Don't do any processing at all if off. Whereas, mute needs to be ready for action at all times, + // so still call getData before it. Off is NOT meant to be toggled rapidly, but mute is ! + //if(!getData(pos, srcChannels, nframes, buffer) || off() || (isMute() && !_prefader)) + if(off() || !getData(pos, srcChannels, nframes, buffer) || (isMute() && !_prefader)) { //Added by Tim. p3.3.16 #ifdef NODE_DEBUG diff --git a/muse/muse/sync.cpp b/muse/muse/sync.cpp index 74ab1c41..d9fdc35a 100644 --- a/muse/muse/sync.cpp +++ b/muse/muse/sync.cpp @@ -548,7 +548,7 @@ void MidiSeq::mtcInputQuarter(int port, unsigned char c) static int hour, min, sec, frame; // p3.3.28 - printf("MidiSeq::mtcInputQuarter c:%h\n", c); + //printf("MidiSeq::mtcInputQuarter c:%h\n", c); int valL = c & 0xf; int valH = valL << 4; diff --git a/muse/muse/wavetrack.cpp b/muse/muse/wavetrack.cpp index a8463479..5a0907bb 100644 --- a/muse/muse/wavetrack.cpp +++ b/muse/muse/wavetrack.cpp @@ -35,63 +35,70 @@ void WaveTrack::fetchData(unsigned pos, unsigned samples, float** bp, bool doSee // reset buffer to zero for (int i = 0; i < channels(); ++i) memset(bp[i], 0, samples * sizeof(float)); - PartList* pl = parts(); - - unsigned n = samples; - for (iPart ip = pl->begin(); ip != pl->end(); ++ip) { - WavePart* part = (WavePart*)(ip->second); - // Changed by Tim. p3.3.17 - //if (part->mute() || isMute()) - if (part->mute()) + + // p3.3.29 + // Process only if track is not off. + if(!off()) + { + + PartList* pl = parts(); + unsigned n = samples; + for (iPart ip = pl->begin(); ip != pl->end(); ++ip) { + WavePart* part = (WavePart*)(ip->second); + // Changed by Tim. p3.3.17 + //if (part->mute() || isMute()) + if (part->mute()) + continue; + + unsigned p_spos = part->frame(); + unsigned p_epos = p_spos + part->lenFrame(); + if (pos + n < p_spos) + break; + if (pos >= p_epos) continue; - - unsigned p_spos = part->frame(); - unsigned p_epos = p_spos + part->lenFrame(); - if (pos + n < p_spos) - break; - if (pos >= p_epos) - continue; - - EventList* events = part->events(); - for (iEvent ie = events->begin(); ie != events->end(); ++ie) { - Event& event = ie->second; - unsigned e_spos = event.frame() + p_spos; - unsigned nn = event.lenFrame(); - unsigned e_epos = e_spos + nn; - - if (pos + n < e_spos) - break; - if (pos >= e_epos) - continue; - - int offset = e_spos - pos; - - unsigned srcOffset, dstOffset; - if (offset > 0) { - nn = n - offset; - srcOffset = 0; - dstOffset = offset; - } - else { - srcOffset = -offset; - dstOffset = 0; - - nn += offset; - if (nn > n) - nn = n; - } - float* bpp[channels()]; - for (int i = 0; i < channels(); ++i) - bpp[i] = bp[i] + dstOffset; - - // By T356. Allow overlapping parts or events to mix together ! - // Since the buffers are cleared above, just read and add (don't overwrite) the samples. - //event.read(srcOffset, bpp, channels(), nn); - //event.read(srcOffset, bpp, channels(), nn, false); - event.readAudio(srcOffset, bpp, channels(), nn, doSeek, false); - - } - } + + EventList* events = part->events(); + for (iEvent ie = events->begin(); ie != events->end(); ++ie) { + Event& event = ie->second; + unsigned e_spos = event.frame() + p_spos; + unsigned nn = event.lenFrame(); + unsigned e_epos = e_spos + nn; + + if (pos + n < e_spos) + break; + if (pos >= e_epos) + continue; + + int offset = e_spos - pos; + + unsigned srcOffset, dstOffset; + if (offset > 0) { + nn = n - offset; + srcOffset = 0; + dstOffset = offset; + } + else { + srcOffset = -offset; + dstOffset = 0; + + nn += offset; + if (nn > n) + nn = n; + } + float* bpp[channels()]; + for (int i = 0; i < channels(); ++i) + bpp[i] = bp[i] + dstOffset; + + // By T356. Allow overlapping parts or events to mix together ! + // Since the buffers are cleared above, just read and add (don't overwrite) the samples. + //event.read(srcOffset, bpp, channels(), nn); + //event.read(srcOffset, bpp, channels(), nn, false); + event.readAudio(srcOffset, bpp, channels(), nn, doSeek, false); + + } + } + } + if(config.useDenormalBias) { // add denormal bias to outdata for (int i = 0; i < channels(); ++i) -- cgit v1.2.3