summaryrefslogtreecommitdiffstats
path: root/src/gui/seqmanager/SequenceManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/seqmanager/SequenceManager.cpp')
-rw-r--r--src/gui/seqmanager/SequenceManager.cpp134
1 files changed, 67 insertions, 67 deletions
diff --git a/src/gui/seqmanager/SequenceManager.cpp b/src/gui/seqmanager/SequenceManager.cpp
index 02a37d9..b05a3d4 100644
--- a/src/gui/seqmanager/SequenceManager.cpp
+++ b/src/gui/seqmanager/SequenceManager.cpp
@@ -90,8 +90,8 @@ SequenceManager::SequenceManager(RosegardenGUIDoc *doc,
m_metronomeMmapper(SegmentMmapperFactory::makeMetronome(m_doc)),
m_tempoSegmentMmapper(SegmentMmapperFactory::makeTempo(m_doc)),
m_timeSigSegmentMmapper(SegmentMmapperFactory::makeTimeSig(m_doc)),
- m_transporttqStatus(STOPPED),
- m_soundDrivertqStatus(NO_DRIVER),
+ m_transportStatus(STOPPED),
+ m_soundDriverStatus(NO_DRIVER),
m_transport(transport),
m_lastRewoundAt(clock()),
m_countdownDialog(0),
@@ -133,7 +133,7 @@ SequenceManager::SequenceManager(RosegardenGUIDoc *doc,
m_doc->getComposition().addObserver(this);
// The owner of this sequence manager will need to call
- // checkSoundDrivertqStatus on it to set up its status appropriately
+ // checkSoundDriverStatus on it to set up its status appropriately
// immediately after construction; we used to do it from here but
// we're not well placed to handle reporting to the user if it
// throws an exception (and we don't want to leave the object half
@@ -228,9 +228,9 @@ void SequenceManager::setDocument(RosegardenGUIDoc* doc)
}
void
-SequenceManager::setTransporttqStatus(const TransporttqStatus &status)
+SequenceManager::setTransportStatus(const TransportStatus &status)
{
- m_transporttqStatus = status;
+ m_transportStatus = status;
}
void
@@ -256,14 +256,14 @@ SequenceManager::play()
// If already playing or recording then stop
//
- if (m_transporttqStatus == PLAYING ||
- m_transporttqStatus == RECORDING ) {
+ if (m_transportStatus == PLAYING ||
+ m_transportStatus == RECORDING ) {
stopping();
return true;
}
// This check may throw an exception
- checkSoundDrivertqStatus(false);
+ checkSoundDriverStatus(false);
// Align Instrument lists and send initial program changes
//
@@ -369,7 +369,7 @@ SequenceManager::play()
// Send Play to the Sequencer
if (!rgapp->sequencerCall("play(long int, long int, long int, long int, long int, long int, long int, long int, long int, long int, long int)",
replyType, replyData, data)) {
- m_transporttqStatus = STOPPED;
+ m_transportStatus = STOPPED;
return false;
}
@@ -380,9 +380,9 @@ SequenceManager::play()
if (result) {
// completed successfully
- m_transporttqStatus = STARTING_TO_PLAY;
+ m_transportStatus = STARTING_TO_PLAY;
} else {
- m_transporttqStatus = STOPPED;
+ m_transportStatus = STOPPED;
std::cerr << "ERROR: SequenceManager::play(): Failed to start playback!" << std::endl;
}
@@ -400,7 +400,7 @@ SequenceManager::stopping()
// Do this here rather than in stop() to avoid any potential
// race condition (we use setPointerPosition() during stop()).
//
- if (m_transporttqStatus == STOPPED) {
+ if (m_transportStatus == STOPPED) {
/*!!!
if (m_doc->getComposition().isLooping())
m_doc->slotSetPointerPosition(m_doc->getComposition().getLoopStart());
@@ -414,8 +414,8 @@ SequenceManager::stopping()
// Disarm recording and drop back to STOPPED
//
- if (m_transporttqStatus == RECORDING_ARMED) {
- m_transporttqStatus = STOPPED;
+ if (m_transportStatus == RECORDING_ARMED) {
+ m_transportStatus = STOPPED;
m_transport->RecordButton()->setOn(false);
m_transport->MetronomeButton()->
setOn(m_doc->getComposition().usePlayMetronome());
@@ -436,7 +436,7 @@ SequenceManager::stop()
{
// Toggle off the buttons - first record
//
- if (m_transporttqStatus == RECORDING) {
+ if (m_transportStatus == RECORDING) {
m_transport->RecordButton()->setOn(false);
m_transport->MetronomeButton()->
setOn(m_doc->getComposition().usePlayMetronome());
@@ -477,12 +477,12 @@ SequenceManager::stop()
// restore
TQApplication::restoreOverrideCursor();
- TransporttqStatus status = m_transporttqStatus;
+ TransportStatus status = m_transportStatus;
// set new transport status first, so that if we're stopping
// recording we don't risk the record segment being restored by a
// timer while the document is busy trying to do away with it
- m_transporttqStatus = STOPPED;
+ m_transportStatus = STOPPED;
// if we're recording MIDI or Audio then tidy up the recording Segment
if (status == RECORDING) {
@@ -515,7 +515,7 @@ SequenceManager::rewind()
std::pair<timeT, timeT> barRange =
composition.getBarRangeForTime(position - 1);
- if (m_transporttqStatus == PLAYING) {
+ if (m_transportStatus == PLAYING) {
// if we're playing and we had a rewind request less than 200ms
// ago and we're some way into the bar but less than half way
@@ -563,10 +563,10 @@ SequenceManager::fastforward()
}
void
-SequenceManager::notifySequencertqStatus(TransporttqStatus status)
+SequenceManager::notifySequencerStatus(TransportStatus status)
{
// for the moment we don't do anything fancy
- m_transporttqStatus = status;
+ m_transportStatus = status;
}
@@ -611,7 +611,7 @@ SequenceManager::record(bool toggled)
Instrument *instr = studio.getInstrumentById(instrId);
if (instr && instr->getType() == Instrument::Audio) {
- if (!m_doc || !(m_soundDrivertqStatus & AUDIO_OK)) {
+ if (!m_doc || !(m_soundDriverStatus & AUDIO_OK)) {
m_transport->RecordButton()->setOn(false);
throw(Exception("Audio subsystem is not available - can't record audio"));
}
@@ -623,9 +623,9 @@ SequenceManager::record(bool toggled)
if (toggled) { // preparing record or punch-in record
- if (m_transporttqStatus == RECORDING_ARMED) {
+ if (m_transportStatus == RECORDING_ARMED) {
SETQMAN_DEBUG << "SequenceManager::record - unarming record\n";
- m_transporttqStatus = STOPPED;
+ m_transportStatus = STOPPED;
// Toggle the buttons
m_transport->MetronomeButton()->setOn(comp.usePlayMetronome());
@@ -634,9 +634,9 @@ SequenceManager::record(bool toggled)
return ;
}
- if (m_transporttqStatus == STOPPED) {
+ if (m_transportStatus == STOPPED) {
SETQMAN_DEBUG << "SequenceManager::record - armed record\n";
- m_transporttqStatus = RECORDING_ARMED;
+ m_transportStatus = RECORDING_ARMED;
// Toggle the buttons
m_transport->MetronomeButton()->setOn(comp.useRecordMetronome());
@@ -645,7 +645,7 @@ SequenceManager::record(bool toggled)
return ;
}
- if (m_transporttqStatus == RECORDING) {
+ if (m_transportStatus == RECORDING) {
SETQMAN_DEBUG << "SequenceManager::record - stop recording and keep playing\n";
TQByteArray data;
@@ -659,7 +659,7 @@ SequenceManager::record(bool toggled)
// if we're stopping recording we don't risk the
// record segment being restored by a timer while the
// document is busy trying to do away with it
- m_transporttqStatus = STOPPED;
+ m_transportStatus = STOPPED;
m_doc->stopRecordingMidi();
m_doc->stopRecordingAudio();
@@ -667,7 +667,7 @@ SequenceManager::record(bool toggled)
}
// #1797873 - as above
- m_transporttqStatus = PLAYING;
+ m_transportStatus = PLAYING;
m_doc->stopRecordingMidi();
m_doc->stopRecordingAudio();
@@ -675,7 +675,7 @@ SequenceManager::record(bool toggled)
return ;
}
- if (m_transporttqStatus == PLAYING) {
+ if (m_transportStatus == PLAYING) {
SETQMAN_DEBUG << "SequenceManager::record - punch in recording\n";
punchIn = true;
goto punchin;
@@ -720,7 +720,7 @@ punchin:
}
// may throw an exception
- checkSoundDrivertqStatus(false);
+ checkSoundDriverStatus(false);
// toggle the Metronome button if it's in use
m_transport->MetronomeButton()->setOn(comp.useRecordMetronome());
@@ -738,7 +738,7 @@ punchin:
if (comp.isLooping())
m_doc->slotSetPointerPosition(comp.getLoopStart());
else {
- if (m_transporttqStatus != RECORDING_ARMED && punchIn == false) {
+ if (m_transportStatus != RECORDING_ARMED && punchIn == false) {
int startBar = comp.getBarNumber(comp.getPosition());
startBar -= config->readUnsignedNumEntry("countinbars", 0);
m_doc->slotSetPointerPosition(comp.getBarRange(startBar).first);
@@ -853,7 +853,7 @@ punchin:
if (!rgapp->sequencerCall("record(long int, long int, long int, long int, long int, long int, long int, long int, long int, long int, long int, long int)",
replyType, replyData, data)) {
// failed
- m_transporttqStatus = STOPPED;
+ m_transportStatus = STOPPED;
return ;
}
@@ -865,7 +865,7 @@ punchin:
if (result) {
// completed successfully
- m_transporttqStatus = STARTING_TO_RECORD;
+ m_transportStatus = STARTING_TO_RECORD;
// Create the countdown timer dialog to show recording time
// remaining. (Note (dmm) this has changed, and it now reports
@@ -900,7 +900,7 @@ punchin:
} else {
// Stop immediately - turn off buttons in parent
//
- m_transporttqStatus = STOPPED;
+ m_transportStatus = STOPPED;
if (haveAudioInstrument) {
throw(Exception("Couldn't start recording audio.\nPlease set a valid file path in the Document Properties\n(Composition menu -> Edit Document Properties -> Audio)."));
@@ -990,8 +990,8 @@ SequenceManager::processAsynchronousMidi(const MappedComposition &mC,
restoreRecordSubscriptions();
}
- if (m_transporttqStatus == PLAYING ||
- m_transporttqStatus == RECORDING) {
+ if (m_transportStatus == PLAYING ||
+ m_transportStatus == RECORDING) {
if ((*i)->getType() == MappedEvent::SystemFailure) {
SETQMAN_DEBUG << "Failure of some sort..." << endl;
@@ -1201,8 +1201,8 @@ SequenceManager::processAsynchronousMidi(const MappedComposition &mC,
// out any incoming external controller events
for (i = mC.begin(); i != mC.end(); ++i ) {
- if (m_transporttqStatus == STOPPED ||
- m_transporttqStatus == RECORDING_ARMED) {
+ if (m_transportStatus == STOPPED ||
+ m_transportStatus == RECORDING_ARMED) {
if ((*i)->getType() == MappedEvent::MidiNote) {
if ((*i)->getVelocity() == 0) {
emit insertableNoteOffReceived((*i)->getPitch(), (*i)->getVelocity());
@@ -1269,7 +1269,7 @@ SequenceManager::setLoop(const timeT &lhs, const timeT &rhs)
}
void
-SequenceManager::checkSoundDrivertqStatus(bool warnUser)
+SequenceManager::checkSoundDriverStatus(bool warnUser)
{
TQByteArray data;
TQCString replyType;
@@ -1281,25 +1281,25 @@ SequenceManager::checkSoundDrivertqStatus(bool warnUser)
if (! rgapp->sequencerCall("getSoundDriverStatus(TQString)",
replyType, replyData, data)) {
- m_soundDrivertqStatus = NO_DRIVER;
+ m_soundDriverStatus = NO_DRIVER;
} else {
TQDataStream streamIn(replyData, IO_ReadOnly);
unsigned int result;
streamIn >> result;
- m_soundDrivertqStatus = result;
+ m_soundDriverStatus = result;
}
- SETQMAN_DEBUG << "Sound driver status is: " << m_soundDrivertqStatus << endl;
+ SETQMAN_DEBUG << "Sound driver status is: " << m_soundDriverStatus << endl;
if (!warnUser) return;
#ifdef HAVE_LIBJACK
- if ((m_soundDrivertqStatus & (AUDIO_OK | MIDI_OK | VERSION_OK)) ==
+ if ((m_soundDriverStatus & (AUDIO_OK | MIDI_OK | VERSION_OK)) ==
(AUDIO_OK | MIDI_OK | VERSION_OK)) return;
#else
- if ((m_soundDrivertqStatus & (MIDI_OK | VERSION_OK)) ==
+ if ((m_soundDriverStatus & (MIDI_OK | VERSION_OK)) ==
(MIDI_OK | VERSION_OK)) return;
#endif
@@ -1308,24 +1308,24 @@ SequenceManager::checkSoundDrivertqStatus(bool warnUser)
TQString text = "";
- if (m_soundDrivertqStatus == NO_DRIVER) {
+ if (m_soundDriverStatus == NO_DRIVER) {
text = i18n("<p>Both MIDI and Audio subsystems have failed to initialize.</p><p>You may continue without the sequencer, but we suggest closing Rosegarden, running \"alsaconf\" as root, and starting Rosegarden again. If you wish to run with no sequencer by design, then use \"rosegarden --nosequencer\" to avoid seeing this error in the future.</p>");
- } else if (!(m_soundDrivertqStatus & MIDI_OK)) {
+ } else if (!(m_soundDriverStatus & MIDI_OK)) {
text = i18n("<p>The MIDI subsystem has failed to initialize.</p><p>You may continue without the sequencer, but we suggest closing Rosegarden, running \"modprobe snd-seq-midi\" as root, and starting Rosegarden again. If you wish to run with no sequencer by design, then use \"rosegarden --nosequencer\" to avoid seeing this error in the future.</p>");
- } else if (!(m_soundDrivertqStatus & VERSION_OK)) {
+ } else if (!(m_soundDriverStatus & VERSION_OK)) {
text = i18n("<p>The Rosegarden sequencer module version does not match the GUI module version.</p><p>You have probably mixed up files from two different versions of Rosegarden. Please check your installation.</p>");
}
if (text != "") {
RosegardenGUIApp::self()->awaitDialogClearance();
KMessageBox::error(RosegardenGUIApp::self(),
- i18n("<h3>Sequencer startup failed</h3>%1").tqarg(text));
+ i18n("<h3>Sequencer startup failed</h3>%1").arg(text));
CurrentProgressDialog::thaw();
return;
}
#ifdef HAVE_LIBJACK
- if (!(m_soundDrivertqStatus & AUDIO_OK)) {
+ if (!(m_soundDriverStatus & AUDIO_OK)) {
RosegardenGUIApp::self()->awaitDialogClearance();
KMessageBox::information(RosegardenGUIApp::self(), i18n("<h3>Failed to connect to JACK audio server.</h3><p>Rosegarden could not connect to the JACK audio server. This probably means the JACK server is not running.</p><p>If you want to be able to play or record audio files or use plugins, you should exit Rosegarden and start the JACK server before running Rosegarden again.</p>"),
i18n("Failed to connect to JACK"),
@@ -1675,7 +1675,7 @@ bool SequenceManager::event(TQEvent *e)
SETQMAN_DEBUG << "SequenceManager::event() with user event\n";
if (m_updateRequested) {
SETQMAN_DEBUG << "SequenceManager::event(): update requested\n";
- checkRefreshtqStatus();
+ checkRefreshStatus();
m_updateRequested = false;
}
return true;
@@ -1693,7 +1693,7 @@ void SequenceManager::update()
TQApplication::postEvent(this, e);
}
-void SequenceManager::checkRefreshtqStatus()
+void SequenceManager::checkRefreshStatus()
{
SETQMAN_DEBUG << "SequenceManager::checkRefreshStatus()\n";
@@ -1716,10 +1716,10 @@ void SequenceManager::checkRefreshtqStatus()
newTriggerMap[s] = m_triggerSegments[s];
}
- if (s->getRefreshtqStatus(newTriggerMap[s]).needsRefresh()) {
+ if (s->getRefreshStatus(newTriggerMap[s]).needsRefresh()) {
TriggerSegmentRec::SegmentRuntimeIdSet &thisSet = (*i)->getReferences();
ridset.insert(thisSet.begin(), thisSet.end());
- s->getRefreshtqStatus(newTriggerMap[s]).setNeedsRefresh(false);
+ s->getRefreshStatus(newTriggerMap[s]).setNeedsRefresh(false);
}
}
@@ -1747,10 +1747,10 @@ void SequenceManager::checkRefreshtqStatus()
// then the ones which are still there
for (SegmentRefreshMap::iterator i = m_segments.begin();
i != m_segments.end(); ++i) {
- if (i->first->getRefreshtqStatus(i->second).needsRefresh() ||
+ if (i->first->getRefreshStatus(i->second).needsRefresh() ||
ridset.find(i->first->getRuntimeId()) != ridset.end()) {
segmentModified(i->first);
- i->first->getRefreshtqStatus(i->second).setNeedsRefresh(false);
+ i->first->getRefreshStatus(i->second).setNeedsRefresh(false);
}
}
@@ -1770,7 +1770,7 @@ void SequenceManager::segmentModified(Segment* s)
SETQMAN_DEBUG << "SequenceManager::segmentModified() : size changed = "
<< sizeChanged << endl;
- if ((m_transporttqStatus == PLAYING) && sizeChanged) {
+ if ((m_transportStatus == PLAYING) && sizeChanged) {
TQByteArray data;
TQDataStream streamOut(data, IO_WriteOnly);
@@ -1815,7 +1815,7 @@ void SequenceManager::segmentEventsTimingChanged(const Composition*, Segment * s
{
SETQMAN_DEBUG << "SequenceManager::segmentEventsTimingChanged(" << s << ", " << t << ")\n";
segmentModified(s);
- if (s && s->getType() == Segment::Audio && m_transporttqStatus == PLAYING) {
+ if (s && s->getType() == Segment::Audio && m_transportStatus == PLAYING) {
TQByteArray data;
rgapp->sequencerSend("remapTracks()", data);
}
@@ -1831,7 +1831,7 @@ void SequenceManager::segmentTrackChanged(const Composition*, Segment *s, TrackI
{
SETQMAN_DEBUG << "SequenceManager::segmentTrackChanged(" << s << ", " << id << ")\n";
segmentModified(s);
- if (s && s->getType() == Segment::Audio && m_transporttqStatus == PLAYING) {
+ if (s && s->getType() == Segment::Audio && m_transportStatus == PLAYING) {
TQByteArray data;
rgapp->sequencerSend("remapTracks()", data);
}
@@ -1849,7 +1849,7 @@ void SequenceManager::processAddedSegment(Segment* s)
m_compositionMmapper->segmentAdded(s);
- if (m_transporttqStatus == PLAYING) {
+ if (m_transportStatus == PLAYING) {
TQByteArray data;
TQDataStream streamOut(data, IO_WriteOnly);
@@ -1857,7 +1857,7 @@ void SequenceManager::processAddedSegment(Segment* s)
streamOut << m_compositionMmapper->getSegmentFileName(s);
if (!rgapp->sequencerSend("addSegment(TQString)", data)) {
- m_transporttqStatus = STOPPED;
+ m_transportStatus = STOPPED;
}
}
@@ -1874,7 +1874,7 @@ void SequenceManager::processRemovedSegment(Segment* s)
TQString filename = m_compositionMmapper->getSegmentFileName(s);
m_compositionMmapper->segmentDeleted(s);
- if (m_transporttqStatus == PLAYING) {
+ if (m_transportStatus == PLAYING) {
TQByteArray data;
TQDataStream streamOut(data, IO_WriteOnly);
@@ -1883,7 +1883,7 @@ void SequenceManager::processRemovedSegment(Segment* s)
if (!rgapp->sequencerSend("deleteSegment(TQString)", data)) {
// failed
- m_transporttqStatus = STOPPED;
+ m_transportStatus = STOPPED;
}
}
@@ -1907,7 +1907,7 @@ void SequenceManager::trackChanged(const Composition *, Track* t)
SETQMAN_DEBUG << "SequenceManager::trackChanged(" << t << ", " << (t ? t->getPosition() : -1) << ")\n";
m_controlBlockMmapper->updateTrackData(t);
- if (m_transporttqStatus == PLAYING) {
+ if (m_transportStatus == PLAYING) {
TQByteArray data;
rgapp->sequencerSend("remapTracks()", data);
}
@@ -1933,7 +1933,7 @@ void SequenceManager::metronomeChanged(InstrumentId id,
resetMetronomeMmapper();
m_controlBlockMmapper->updateMetronomeData(id);
- if (m_transporttqStatus == PLAYING) {
+ if (m_transportStatus == PLAYING) {
m_controlBlockMmapper->updateMetronomeForPlayback();
} else {
m_controlBlockMmapper->updateMetronomeForRecord();
@@ -1957,7 +1957,7 @@ void SequenceManager::metronomeChanged(const Composition *)
m_controlBlockMmapper->updateMetronomeData
(m_metronomeMmapper->getMetronomeInstrument());
- if (m_transporttqStatus == PLAYING) {
+ if (m_transportStatus == PLAYING) {
m_controlBlockMmapper->updateMetronomeForPlayback();
} else {
m_controlBlockMmapper->updateMetronomeForRecord();
@@ -1973,7 +1973,7 @@ void SequenceManager::filtersChanged(MidiFilter thruFilter,
void SequenceManager::soloChanged(const Composition *, bool solo, TrackId selectedTrack)
{
if (m_controlBlockMmapper->updateSoloData(solo, selectedTrack)) {
- if (m_transporttqStatus == PLAYING) {
+ if (m_transportStatus == PLAYING) {
TQByteArray data;
rgapp->sequencerSend("remapTracks()", data);
}
@@ -1999,7 +1999,7 @@ void SequenceManager::tempoChanged(const Composition *c)
if (c->isLooping())
setLoop(c->getLoopStart(), c->getLoopEnd());
- else if (m_transporttqStatus == PLAYING) {
+ else if (m_transportStatus == PLAYING) {
// If the tempo changes during playback, reset the pointer
// position because the sequencer keeps track of position in
// real time and we want to maintain the same position in