summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--muse/muse/arranger/tlwidget.cpp6
-rw-r--r--muse/muse/arranger/trackinfo.cpp41
-rw-r--r--muse/muse/instruments/minstrument.cpp2
-rw-r--r--muse/muse/miditrack.cpp49
-rw-r--r--muse/muse/miditrack.h2
5 files changed, 47 insertions, 53 deletions
diff --git a/muse/muse/arranger/tlwidget.cpp b/muse/muse/arranger/tlwidget.cpp
index 93da0906..b651a6ee 100644
--- a/muse/muse/arranger/tlwidget.cpp
+++ b/muse/muse/arranger/tlwidget.cpp
@@ -416,14 +416,12 @@ void TLWidget::configChanged()
outChannel = new QSpinBox(this);
outChannel->setFixedSize(45, trackRowHeight);
outChannel->setRange(1, 16);
-//TODOA MidiChannel* midiChannel = ((MidiTrack*)_track)->channel();
-// if (midiChannel)
-// outChannel->setValue(midiChannel->channelNo()+1);
+ outChannel->setValue(((MidiTrack*)_track)->channelNo() + 1);
outChannel->setToolTip(tr("Midi Output Channel"));
l->addWidget(outChannel);
wlist.push_back(outChannel);
connect(outChannel, SIGNAL(valueChanged(int)), SLOT(outChannelChanged(int)));
-//TD connect((MidiTrack*)_track, SIGNAL(outChannelChanged(int)), SLOT(setOutChannel(int)));
+ connect((MidiTrack*)_track, SIGNAL(outChannelChanged(int)), SLOT(setOutChannel(int)));
}
break;
diff --git a/muse/muse/arranger/trackinfo.cpp b/muse/muse/arranger/trackinfo.cpp
index 1930423b..3e88d991 100644
--- a/muse/muse/arranger/trackinfo.cpp
+++ b/muse/muse/arranger/trackinfo.cpp
@@ -127,9 +127,6 @@ MidiTrackInfo::MidiTrackInfo()
QWidget* midiTrackInfo = new QWidget;
mt.setupUi(midiTrackInfo);
-// QWidget* midiChannelInfo = new QWidget;
-// mc.setupUi(midiChannelInfo);
-
QWidget* midiPortInfo = new QWidget;
mp.setupUi(midiPortInfo);
@@ -143,7 +140,6 @@ MidiTrackInfo::MidiTrackInfo()
channel = new QComboBox;
grid->addWidget(channel, 4, 0, 1, 2);
-// grid->addWidget(midiChannelInfo, 5, 0, 1, 2);
label = new QLabel;
label->setText(tr("Midi Port"));
@@ -207,7 +203,7 @@ void MidiTrackInfo::init(Track* t)
int n = midiTrack->channelNo();
channel->setCurrentIndex(n < 0 ? 0 : n + 1);
-// connect(midic, SIGNAL(controllerChanged(int)), SLOT(controllerChanged(int)));
+ connect(track, SIGNAL(controllerChanged(int)), SLOT(controllerChanged(int)));
//TODO connect(op, SIGNAL(instrumentChanged()), SLOT(instrumentChanged()));
MidiInstrument* mi = midiTrack->instrument();
@@ -221,9 +217,9 @@ void MidiTrackInfo::init(Track* t)
mp.instrument->setCurrentIndex(curIdx);
mp.deviceId->setValue(midiTrack->deviceId());
#if 0
- autoChanged(midic, false); // update enable
- int val = midic->ctrlVal(CTRL_PROGRAM).i;
- int channelno = midic->channelNo();
+ autoChanged(track, false); // update enable
+ int val = track->ctrlVal(CTRL_PROGRAM).i;
+ int channelno = track->channelNo();
mt.patch->setText(mi->getPatchName(channelno, val));
}
else {
@@ -364,22 +360,20 @@ void MidiTrackInfo::transpositionChanged(int val)
void MidiTrackInfo::patchClicked()
{
-#if 0 //TODOA
- MidiChannel* midic = ((MidiTrack*)track)->channel();
- if (!midic)
+ MidiOut* op = ((MidiTrack*)track)->midiOut();
+ if (op == 0)
return;
-
- MidiOut* op = midic->port();
MidiInstrument* mi = op->instrument();
+ if (mi == 0)
+ return;
mi->populatePatchPopup(pop, 0);
QAction* rv = pop->exec(mt.patch->mapToGlobal(QPoint(10,5)));
if (rv != 0) {
CVal cval;
cval.i = rv->data().toInt();
- song->setControllerVal(midic, CTRL_PROGRAM, cval);
+ song->setControllerVal(track, CTRL_PROGRAM, cval);
}
-#endif
}
//---------------------------------------------------------
@@ -388,13 +382,10 @@ void MidiTrackInfo::patchClicked()
void MidiTrackInfo::instrumentSelected(int n)
{
-#if 0 //TODOA
- MidiChannel* midic = ((MidiTrack*)track)->channel();
- if (midic == 0)
+ MidiOut* op = ((MidiTrack*)track)->midiOut();
+ if (op == 0)
return;
- MidiOut* op = midic->port();
op->setInstrument(midiInstruments[n]);
-#endif
}
//---------------------------------------------------------
@@ -437,15 +428,9 @@ void MidiTrackInfo::iKomprChanged(int val)
// deviceIdChanged
//---------------------------------------------------------
-void MidiTrackInfo::deviceIdChanged(int /*val*/)
+void MidiTrackInfo::deviceIdChanged(int val)
{
-#if 0 //TODOA
- MidiChannel* midic = ((MidiTrack*)track)->channel();
- if (midic == 0)
- return;
-// MidiOut* op = midic->port();
-//TODO op->setDeviceId(val);
-#endif
+ ((MidiTrack*)track)->setDeviceId(val);
}
//---------------------------------------------------------
diff --git a/muse/muse/instruments/minstrument.cpp b/muse/muse/instruments/minstrument.cpp
index 9c766194..c6281552 100644
--- a/muse/muse/instruments/minstrument.cpp
+++ b/muse/muse/instruments/minstrument.cpp
@@ -295,7 +295,7 @@ void MidiInstrument::read(QDomNode node)
pg[0].patches.push_back(patch);
}
else if (tag == "Category")
- ; // TODO
+ ; // TODO "Category"
else if (tag == "drummap") {
Patch* patch = new Patch;
patch->read(node, true);
diff --git a/muse/muse/miditrack.cpp b/muse/muse/miditrack.cpp
index 9cc63c3e..31c6afae 100644
--- a/muse/muse/miditrack.cpp
+++ b/muse/muse/miditrack.cpp
@@ -35,29 +35,34 @@
MidiTrack::MidiTrack()
: MidiTrackBase()
{
- init();
- _events = new EventList;
- recordPart = 0;
- _drumMap = 0;
- _useDrumMap = false;
- }
-
-MidiTrack::~MidiTrack()
- {
- delete _events;
- }
-
-//---------------------------------------------------------
-// init
-//---------------------------------------------------------
-
-void MidiTrack::init()
- {
_transposition = 0;
_velocity = 0;
_delay = 0;
_len = 100; // percent
_compression = 100; // percent
+ _events = new EventList;
+
+ initMidiController();
+ recordPart = 0;
+ _drumMap = 0;
+ _useDrumMap = false;
+
+ //
+ // create minimal set of managed controllers
+ // to make midi mixer operational
+ //
+ MidiInstrument* mi = genericMidiInstrument;
+ addMidiController(mi, CTRL_PROGRAM);
+ addMidiController(mi, CTRL_VOLUME);
+ addMidiController(mi, CTRL_PANPOT);
+ addMidiController(mi, CTRL_REVERB_SEND);
+ addMidiController(mi, CTRL_CHORUS_SEND);
+ addMidiController(mi, CTRL_VARIATION_SEND);
+ }
+
+MidiTrack::~MidiTrack()
+ {
+ delete _events;
}
//---------------------------------------------------------
@@ -686,6 +691,12 @@ MidiOut* MidiTrack::midiOut() const
{
if (_outRoutes.isEmpty())
return 0;
- return (MidiOut*)_outRoutes[0].dst.track;
+ Track* track = _outRoutes[0].dst.track;
+ if (track->type() == AUDIO_SOFTSYNTH) {
+ SynthI* s = (SynthI*) track;
+ return s;
+ }
+ MidiOutPort* op = (MidiOutPort*) track;
+ return op;
}
diff --git a/muse/muse/miditrack.h b/muse/muse/miditrack.h
index 3ee2a9bc..7763a189 100644
--- a/muse/muse/miditrack.h
+++ b/muse/muse/miditrack.h
@@ -62,13 +62,13 @@ class MidiTrack : public MidiTrackBase {
signals:
void drumMapChanged() const;
void useDrumMapChanged(bool);
+ void outChannelChanged(int);
public:
MidiTrack();
virtual ~MidiTrack();
virtual TrackType type() const { return MIDI; }
void clone(MidiTrack*);
- void init();
int transposition() const { return _transposition; }
int velocity() const { return _velocity; }