diff options
-rw-r--r-- | muse/muse/driver/alsamidi.cpp | 12 | ||||
-rw-r--r-- | muse/muse/mixer/mstrip.cpp | 4 | ||||
-rw-r--r-- | muse/muse/route.cpp | 20 | ||||
-rw-r--r-- | muse/muse/route.h | 10 | ||||
-rw-r--r-- | muse/muse/song.cpp | 4 |
5 files changed, 19 insertions, 31 deletions
diff --git a/muse/muse/driver/alsamidi.cpp b/muse/muse/driver/alsamidi.cpp index 8b76534a..be64eb48 100644 --- a/muse/muse/driver/alsamidi.cpp +++ b/muse/muse/driver/alsamidi.cpp @@ -340,9 +340,9 @@ void AlsaMidi::addConnection(snd_seq_connect_t* ev) MidiOutPortList* opl = song->midiOutPorts(); for (iMidiOutPort i = opl->begin(); i != opl->end(); ++i) { MidiOutPort* oport = *i; - Port src = oport->alsaPort(0); + Port sPort = oport->alsaPort(0); - if (src == rs) { + if (sPort == rs) { RouteNode src(oport); RouteNode dst(rd, -1, RouteNode::MIDIPORT); Route r = Route(src, dst); @@ -355,14 +355,16 @@ void AlsaMidi::addConnection(snd_seq_connect_t* ev) MidiInPortList* ipl = song->midiInPorts(); for (iMidiInPort i = ipl->begin(); i != ipl->end(); ++i) { MidiInPort* iport = *i; - Port dst = iport->alsaPort(); + Port dPort = iport->alsaPort(0); - if (dst == rd) { + if (dPort == rd) { RouteNode src(rs, -1, RouteNode::MIDIPORT); RouteNode dst(iport); Route r = Route(src, dst); - if (iport->inRoutes()->indexOf(r) == -1) + if (iport->inRoutes()->indexOf(r) == -1) { +printf("add connection\n"); iport->inRoutes()->push_back(r); + } break; } } diff --git a/muse/muse/mixer/mstrip.cpp b/muse/muse/mixer/mstrip.cpp index 690a5b0c..49eac1f4 100644 --- a/muse/muse/mixer/mstrip.cpp +++ b/muse/muse/mixer/mstrip.cpp @@ -132,7 +132,7 @@ static void addMidiOutPorts(QMenu* menu, Track* strack, int channel) static void addSyntiPorts(QMenu* menu, Track* strack, int channel) { - RouteList* rl = strack->inRoutes(); + RouteList* rl = strack->outRoutes(); RouteNode src(strack, channel, RouteNode::TRACK); SynthIList* sl = song->syntis(); @@ -144,7 +144,7 @@ static void addSyntiPorts(QMenu* menu, Track* strack, int channel) for (int ch = 0; ch < MIDI_CHANNELS; ++ch) { QAction* a = m->addAction(QString("Channel %1").arg(ch+1)); a->setCheckable(true); - RouteNode dst(sy, channel, RouteNode::TRACK); + RouteNode dst(sy, ch, RouteNode::TRACK); Route r = Route(src, dst); a->setData(QVariant::fromValue(r)); a->setChecked(rl->indexOf(r) != -1); diff --git a/muse/muse/route.cpp b/muse/muse/route.cpp index f4e1509d..c75a00da 100644 --- a/muse/muse/route.cpp +++ b/muse/muse/route.cpp @@ -145,7 +145,7 @@ void removeRoute(const Route& r) // r.dst.tname(), r.dst.channel, r.dst.name().toLatin1().data()); if (r.src.type == RouteNode::AUDIOPORT || r.src.type == RouteNode::MIDIPORT || r.src.type == RouteNode::JACKMIDIPORT) { - if (r.dst.type != RouteNode::TRACK && r.dst.type != RouteNode::SYNTIPORT) { + if (r.dst.type != RouteNode::TRACK) { fprintf(stderr, "removeRoute: bad route 1\n"); goto error; } @@ -239,7 +239,6 @@ QString RouteNode::name() const { switch (type) { case TRACK: - case SYNTIPORT: return track2name(track); case AUDIOPORT: case JACKMIDIPORT: @@ -309,9 +308,8 @@ bool RouteNode::operator==(const RouteNode& a) const return false; switch(type) { case TRACK: - case SYNTIPORT: - return channel == a.channel && track == a.track; case MIDIPORT: + return (channel == a.channel) && (track == a.track); case JACKMIDIPORT: return port == a.port; case AUDIOPORT: @@ -329,8 +327,7 @@ bool RouteNode::operator==(const RouteNode& a) const const char* RouteNode::tname(RouteNodeType t) { static const char* names[] = { - "TRACK", "AUDIOPORT", "MIDIPORT", "JACKMIDIPORT", - "SYNTIPORT", "AUX" + "TRACK", "AUDIOPORT", "MIDIPORT", "JACKMIDIPORT", "AUX" }; if (t > (int)(sizeof(names)/sizeof(*names))) return "???"; @@ -399,17 +396,6 @@ void RouteNode::read(QDomNode node) if (port.isZero()) printf("Route::read(): midiport <%s> not found\n", s.toLatin1().data()); } - else if (st == "SYNTIPORT") { - type = RouteNode::SYNTIPORT; - SynthIList* tl = song->syntis(); - for (iSynthI i = tl->begin(); i != tl->end(); ++i) { - SynthI* t = *i; - if (t->name() == s) { - track = t; - break; - } - } - } else if (st == "AUX") { type = RouteNode::AUXPLUGIN; plugin = 0; diff --git a/muse/muse/route.h b/muse/muse/route.h index 05a506eb..037f9e64 100644 --- a/muse/muse/route.h +++ b/muse/muse/route.h @@ -38,19 +38,19 @@ using AL::Xml; // Track/Channel // AuxPlugin // Port -// SYNTI //--------------------------------------------------------- struct RouteNode { - enum RouteNodeType { TRACK, AUDIOPORT, MIDIPORT, JACKMIDIPORT, - SYNTIPORT, AUXPLUGIN}; + enum RouteNodeType { + TRACK, AUDIOPORT, MIDIPORT, JACKMIDIPORT, AUXPLUGIN + }; Port port; union { Track* track; AuxPluginIF* plugin; }; - int channel; // route to/from JACK can specify a channel to connect to + int channel; RouteNodeType type; RouteNode(); @@ -65,7 +65,7 @@ struct RouteNode { } bool isValid() const { return (isPortType() && !port.isZero()) - || ((type == TRACK || type == SYNTIPORT) && track) + || ((type == TRACK) && track) || ((type == AUXPLUGIN) && plugin); } QString name() const; diff --git a/muse/muse/song.cpp b/muse/muse/song.cpp index 9a287cb8..d74b1f3b 100644 --- a/muse/muse/song.cpp +++ b/muse/muse/song.cpp @@ -1773,7 +1773,7 @@ void Song::removeTrack2(Track* track) // remove routes // foreach (const Route r, *(track->inRoutes())) { - if (r.src.type != RouteNode::TRACK && r.src.type != RouteNode::SYNTIPORT) + if (r.src.type != RouteNode::TRACK) continue; int idx = r.src.track->outRoutes()->indexOf(r); if (idx != -1) @@ -1782,7 +1782,7 @@ void Song::removeTrack2(Track* track) printf("Song::removeTrack2(): input route not found\n"); } foreach (const Route r, *(track->outRoutes())) { - if (r.dst.type != RouteNode::TRACK && r.dst.type != RouteNode::SYNTIPORT) + if (r.dst.type != RouteNode::TRACK) continue; int idx = r.dst.track->inRoutes()->indexOf(r); if (idx != -1) |