diff options
author | Werner Schweer <ws.seh.de> | 2006-10-20 14:41:23 +0000 |
---|---|---|
committer | Werner Schweer <ws.seh.de> | 2006-10-20 14:41:23 +0000 |
commit | c2d6008866220931f7a9fddcce4ca50b4355aac2 (patch) | |
tree | e3783808b747d33cb1bc807aa58a18a9fbecb75a | |
parent | 6c07d4bd4c8d473746ee8da4d010b5b40987e9b8 (diff) |
updates
-rw-r--r-- | muse/muse/audio.cpp | 1 | ||||
-rw-r--r-- | muse/muse/driver/alsamidi.cpp | 3 | ||||
-rw-r--r-- | muse/muse/midiinport.cpp | 1 | ||||
-rw-r--r-- | muse/muse/muse.cpp | 1 | ||||
-rw-r--r-- | muse/muse/route.cpp | 22 | ||||
-rw-r--r-- | muse/muse/route.h | 10 | ||||
-rw-r--r-- | muse/muse/song.cpp | 66 | ||||
-rw-r--r-- | muse/muse/song.h | 2 |
8 files changed, 24 insertions, 82 deletions
diff --git a/muse/muse/audio.cpp b/muse/muse/audio.cpp index 205068c8..9c384025 100644 --- a/muse/muse/audio.cpp +++ b/muse/muse/audio.cpp @@ -226,6 +226,7 @@ bool Audio::start() //--------------------------------------------------------- // stop // stop audio processing +// non realtime //--------------------------------------------------------- void Audio::stop() diff --git a/muse/muse/driver/alsamidi.cpp b/muse/muse/driver/alsamidi.cpp index 7a90b99d..744f0e67 100644 --- a/muse/muse/driver/alsamidi.cpp +++ b/muse/muse/driver/alsamidi.cpp @@ -368,8 +368,7 @@ void AlsaMidi::addConnection(snd_seq_connect_t* ev) RouteList* orl = oport->outRoutes(); iRoute ir; for (ir = orl->begin(); ir != orl->end(); ++ir) { - Port dst = ir->port; - if (equal(dst, rd)) + if (ir->port == rd) break; } if (ir == orl->end()) { diff --git a/muse/muse/midiinport.cpp b/muse/muse/midiinport.cpp index c73cd7a2..384ef418 100644 --- a/muse/muse/midiinport.cpp +++ b/muse/muse/midiinport.cpp @@ -159,6 +159,7 @@ void MidiInPort::deactivate() //--------------------------------------------------------- // midiReceived //--------------------------------------------------------- + #ifndef __APPLE__ void MidiInPort::eventReceived(snd_seq_event_t* ev) { diff --git a/muse/muse/muse.cpp b/muse/muse/muse.cpp index 5c080410..94c579e3 100644 --- a/muse/muse/muse.cpp +++ b/muse/muse/muse.cpp @@ -184,7 +184,6 @@ static void* watchdog(void*) bool MusE::seqStart() { -// audio->msgIdle(false); if (audioState != AUDIO_STOP) { printf("seqStart(): already running\n"); return true; diff --git a/muse/muse/route.cpp b/muse/muse/route.cpp index 2a90db9e..70499e05 100644 --- a/muse/muse/route.cpp +++ b/muse/muse/route.cpp @@ -283,28 +283,6 @@ void Song::readRoute(QDomNode n) } //--------------------------------------------------------- -// removeRoute -//--------------------------------------------------------- - -void RouteList::removeRoute(const Route& r) - { - for (iRoute i = begin(); i != end(); ++i) { - if (r == *i) { - erase(i); - return; - } - } - printf("RouteList::internal error: cannot remove Route\n "); - r.dump(); - printf(" found:\n"); - for (iRoute i = begin(); i != end(); ++i) { - printf(" "); - i->dump(); - } - printf(" -----\n"); - } - -//--------------------------------------------------------- // dump //--------------------------------------------------------- diff --git a/muse/muse/route.h b/muse/muse/route.h index a008a199..54b574bc 100644 --- a/muse/muse/route.h +++ b/muse/muse/route.h @@ -88,15 +88,7 @@ struct Route { Q_DECLARE_METATYPE(struct Route); -//--------------------------------------------------------- -// RouteList -//--------------------------------------------------------- - -class RouteList : public std::vector<Route> { - public: - void removeRoute(const Route& r); - }; - +typedef QList<Route> RouteList; typedef RouteList::iterator iRoute; typedef RouteList::const_iterator ciRoute; diff --git a/muse/muse/song.cpp b/muse/muse/song.cpp index 628ad661..33dc9346 100644 --- a/muse/muse/song.cpp +++ b/muse/muse/song.cpp @@ -105,25 +105,6 @@ void Song::setSig(const AL::TimeSignature& sig) } //--------------------------------------------------------- -// removeMarkedTracks -//--------------------------------------------------------- - -void Song::removeMarkedTracks() - { - bool loop; - do { - loop = false; - for (iTrack t = _tracks.begin(); t != _tracks.end(); ++t) { - if ((*t)->selected()) { - removeTrack2(*t); - loop = true; - break; - } - } - } while (loop); - } - -//--------------------------------------------------------- // deselectTracks //--------------------------------------------------------- @@ -1827,7 +1808,7 @@ void Song::removeTrack2(Track* track) _midiOutPorts.erase(track); break; case Track::MIDI_IN: - track->deactivate(); +//DEBUG track->deactivate(); _midiInPorts.erase(track); break; case Track::MIDI_CHANNEL: @@ -1861,34 +1842,25 @@ void Song::removeTrack2(Track* track) Route src(track, -1, Route::TRACK); if (track->type() == Track::AUDIO_SOFTSYNTH) src.type = Route::SYNTIPORT; - if (track->type() == Track::AUDIO_OUTPUT || track->type() == Track::MIDI_OUT) { - const RouteList* rl = track->inRoutes(); - for (ciRoute r = rl->begin(); r != rl->end(); ++r) { - src.channel = r->channel; - r->track->outRoutes()->removeRoute(src); - } - } - else if (track->type() == Track::AUDIO_INPUT || track->type() == Track::MIDI_IN) { - const RouteList* rl = track->outRoutes(); - for (ciRoute r = rl->begin(); r != rl->end(); ++r) { - src.channel = r->channel; - r->track->inRoutes()->removeRoute(src); - } + foreach (const Route r, *(track->inRoutes())) { + if (r.type != Route::TRACK && r.type != Route::SYNTIPORT) + continue; + src.channel = r.channel; + int idx = r.track->outRoutes()->indexOf(src); + if (idx != -1) + r.track->outRoutes()->removeAt(idx); + else + printf("Song::removeTrack2(): input route not found\n"); } - else { - const RouteList* rl = track->inRoutes(); - for (ciRoute r = rl->begin(); r != rl->end(); ++r) { -printf("remove route:\n"); -r->dump(); - - src.channel = r->channel; - r->track->outRoutes()->removeRoute(src); - } - rl = track->outRoutes(); - for (ciRoute r = rl->begin(); r != rl->end(); ++r) { - src.channel = r->channel; - r->track->inRoutes()->removeRoute(src); - } + foreach (const Route r, *(track->outRoutes())) { + if (r.type != Route::TRACK && r.type != Route::SYNTIPORT) + continue; + src.channel = r.channel; + int idx = r.track->inRoutes()->indexOf(src); + if (idx != -1) + r.track->inRoutes()->removeAt(idx); + else + printf("Song::removeTrack2(): output route not found\n"); } } diff --git a/muse/muse/song.h b/muse/muse/song.h index 3535b06c..798e61aa 100644 --- a/muse/muse/song.h +++ b/muse/muse/song.h @@ -319,7 +319,7 @@ class Song : public QObject { void removeTrack1(Track* track); void removeTrack2(Track* track); void removeTrack3(Track* track); - void removeMarkedTracks(); +// void removeMarkedTracks(); void changeTrackName(Track* track, const QString&); MidiTrack* findTrack(const Part* part) const; |