summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--muse2/muse/arranger/arranger.cpp1
-rw-r--r--muse2/muse/arranger/tlist.cpp6
-rw-r--r--muse2/muse/audiotrack.cpp1
-rw-r--r--muse2/muse/midiedit/pianoroll.cpp15
-rw-r--r--muse2/muse/mixer/amixer.cpp2
-rw-r--r--muse2/muse/song.h2
-rw-r--r--muse2/muse/widgets/mtrackinfo.cpp68
-rw-r--r--muse2/muse/widgets/mtrackinfo.h3
8 files changed, 57 insertions, 41 deletions
diff --git a/muse2/muse/arranger/arranger.cpp b/muse2/muse/arranger/arranger.cpp
index 76d2dab7..6af69f8d 100644
--- a/muse2/muse/arranger/arranger.cpp
+++ b/muse2/muse/arranger/arranger.cpp
@@ -966,7 +966,6 @@ void Arranger::genTrackInfo(QWidget* parent)
trackInfo->addWidget(0, 2);
/// genMidiTrackInfo();
- connect(midiTrackInfo, SIGNAL(outputPortChanged(int)), list, SLOT(redraw()));
}
//---------------------------------------------------------
diff --git a/muse2/muse/arranger/tlist.cpp b/muse2/muse/arranger/tlist.cpp
index 44e9f2b5..d419866a 100644
--- a/muse2/muse/arranger/tlist.cpp
+++ b/muse2/muse/arranger/tlist.cpp
@@ -93,7 +93,7 @@ TList::TList(Header* hdr, QWidget* parent, const char* name)
void TList::songChanged(int flags)
{
if (flags & (SC_MUTE | SC_SOLO | SC_RECFLAG | SC_TRACK_INSERTED
- | SC_TRACK_REMOVED | SC_TRACK_MODIFIED | SC_ROUTE | SC_CHANNELS | SC_MIDI_CHANNEL))
+ | SC_TRACK_REMOVED | SC_TRACK_MODIFIED | SC_ROUTE | SC_CHANNELS | SC_MIDI_TRACK_PROP))
redraw();
if (flags & (SC_TRACK_INSERTED | SC_TRACK_REMOVED | SC_TRACK_MODIFIED))
adjustScrollbar();
@@ -1068,7 +1068,7 @@ void TList::mousePressEvent(QMouseEvent* ev)
// may result in adding/removing mixer strip:
//song->update(-1);
//song->update(SC_CHANNELS);
- song->update(SC_MIDI_CHANNEL);
+ song->update(SC_MIDI_TRACK_PROP);
}
}
else
@@ -1327,7 +1327,7 @@ void TList::wheelEvent(QWheelEvent* ev)
// may result in adding/removing mixer strip:
//song->update(-1);
- song->update(SC_MIDI_CHANNEL);
+ song->update(SC_MIDI_TRACK_PROP);
}
}
else {
diff --git a/muse2/muse/audiotrack.cpp b/muse2/muse/audiotrack.cpp
index 959ce7f2..1d92e811 100644
--- a/muse2/muse/audiotrack.cpp
+++ b/muse2/muse/audiotrack.cpp
@@ -1628,6 +1628,7 @@ bool AudioTrack::prepareRecording()
return false;
}
+ return true;
}
double AudioTrack::auxSend(int idx) const
{
diff --git a/muse2/muse/midiedit/pianoroll.cpp b/muse2/muse/midiedit/pianoroll.cpp
index d2bc27b6..7561cc37 100644
--- a/muse2/muse/midiedit/pianoroll.cpp
+++ b/muse2/muse/midiedit/pianoroll.cpp
@@ -354,7 +354,7 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i
midiTrackInfo = new MidiTrackInfo(mainw);
int mtiw = midiTrackInfo->width(); // Save this.
- //midiTrackInfo->setMinimumWidth(105);
+ midiTrackInfo->setMinimumWidth(100);
//midiTrackInfo->setMaximumWidth(150);
midiTrackInfo->setSizePolicy(QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Expanding));
@@ -462,7 +462,6 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i
connect(tools2, SIGNAL(toolChanged(int)), canvas, SLOT(setTool(int)));
- //connect(midiTrackInfo, SIGNAL(outputPortChanged(int)), list, SLOT(redraw()));
connect(ctrl, SIGNAL(clicked()), SLOT(addCtrl()));
//connect(trackInfoButton, SIGNAL(clicked()), SLOT(toggleTrackInfo())); Tim.
connect(info, SIGNAL(valueChanged(NoteInfo::ValType, int)), SLOT(noteinfoChanged(NoteInfo::ValType, int)));
@@ -559,7 +558,9 @@ void PianoRoll::songChanged1(int bits)
}
songChanged(bits);
//trackInfo->songChanged(bits);
- updateTrackInfo(); // ccharrett
+ // We'll receive SC_SELECTION if a different part is selected.
+ if (bits & SC_SELECTION)
+ updateTrackInfo();
}
//---------------------------------------------------------
@@ -592,12 +593,12 @@ void PianoRoll::updateHScrollRange()
hscroll->setRange(s, e);
}
-void PianoRoll::updateTrackInfo() // ccharrett
+void PianoRoll::updateTrackInfo()
{
selected = curCanvasPart()->track();
if (selected->isMidiTrack()) {
midiTrackInfo->setTrack(selected);
- midiTrackInfo->updateTrackInfo(-1);
+ ///midiTrackInfo->updateTrackInfo(-1);
}
}
@@ -1355,8 +1356,9 @@ void PianoRoll::execUserScript(int id)
// newCanvasWidth
//---------------------------------------------------------
-void PianoRoll::newCanvasWidth(int w)
+void PianoRoll::newCanvasWidth(int /*w*/)
{
+/*
int nw = w + (vscroll->width() - 18); // 18 is the fixed width of the CtlEdit VScale widget.
if(nw < 1)
nw = 1;
@@ -1369,6 +1371,7 @@ void PianoRoll::newCanvasWidth(int w)
}
updateHScrollRange();
+*/
}
//---------------------------------------------------------
diff --git a/muse2/muse/mixer/amixer.cpp b/muse2/muse/mixer/amixer.cpp
index a9345b8a..7fb406f3 100644
--- a/muse2/muse/mixer/amixer.cpp
+++ b/muse2/muse/mixer/amixer.cpp
@@ -536,7 +536,7 @@ void AudioMixerApp::songChanged(int flags)
action = STRIP_REMOVED;
else if (flags & SC_TRACK_INSERTED)
action = STRIP_INSERTED;
- else if (flags & SC_MIDI_CHANNEL)
+ else if (flags & SC_MIDI_TRACK_PROP)
action = UPDATE_MIDI;
if (action != NO_UPDATE)
updateMixer(action);
diff --git a/muse2/muse/song.h b/muse2/muse/song.h
index da987e90..632d60c4 100644
--- a/muse2/muse/song.h
+++ b/muse2/muse/song.h
@@ -73,7 +73,7 @@ class AudioDevice;
#define SC_RACK 0x2000000 // mixer rack changed
#define SC_CLIP_MODIFIED 0x4000000
#define SC_MIDI_CONTROLLER_ADD 0x8000000 // a hardware midi controller was added or deleted
-#define SC_MIDI_CHANNEL 0x10000000 // a midi track's channel changed
+#define SC_MIDI_TRACK_PROP 0x10000000 // a midi track's properties changed (channel, compression etc)
#define SC_SONG_TYPE 0x20000000 // the midi song type (mtype) changed
#define REC_NOTE_FIFO_SIZE 16
diff --git a/muse2/muse/widgets/mtrackinfo.cpp b/muse2/muse/widgets/mtrackinfo.cpp
index 66222519..3c358765 100644
--- a/muse2/muse/widgets/mtrackinfo.cpp
+++ b/muse2/muse/widgets/mtrackinfo.cpp
@@ -172,12 +172,12 @@ void MidiTrackInfo::heartBeat()
MidiPort* mp = &midiPorts[outPort];
// Set record echo.
- if(recEchoButton->isChecked() != track->recEcho())
- {
- recEchoButton->blockSignals(true);
- recEchoButton->setChecked(track->recEcho());
- recEchoButton->blockSignals(false);
- }
+ //if(recEchoButton->isChecked() != track->recEcho())
+ //{
+ // recEchoButton->blockSignals(true);
+ // recEchoButton->setChecked(track->recEcho());
+ // recEchoButton->blockSignals(false);
+ //}
// Check for detection of midi general activity on chosen channels...
int mpt = 0;
@@ -524,7 +524,7 @@ void MidiTrackInfo::iOutputChannelChanged(int channel)
// may result in adding/removing mixer strip:
//song->update(-1);
- song->update(SC_MIDI_CHANNEL);
+ song->update(SC_MIDI_TRACK_PROP);
}
}
@@ -546,8 +546,7 @@ void MidiTrackInfo::iOutputPortChanged(int index)
track->setOutPortAndUpdate(index);
audio->msgIdle(false);
- ///list->redraw();
- emit outputPortChanged(index);
+ song->update(SC_MIDI_TRACK_PROP);
}
//---------------------------------------------------------
@@ -915,6 +914,7 @@ void MidiTrackInfo::iTranspChanged(int val)
return;
MidiTrack* track = (MidiTrack*)selected;
track->transposition = val;
+ song->update(SC_MIDI_TRACK_PROP);
}
//---------------------------------------------------------
@@ -927,6 +927,7 @@ void MidiTrackInfo::iAnschlChanged(int val)
return;
MidiTrack* track = (MidiTrack*)selected;
track->velocity = val;
+ song->update(SC_MIDI_TRACK_PROP);
}
//---------------------------------------------------------
@@ -939,6 +940,7 @@ void MidiTrackInfo::iVerzChanged(int val)
return;
MidiTrack* track = (MidiTrack*)selected;
track->delay = val;
+ song->update(SC_MIDI_TRACK_PROP);
}
//---------------------------------------------------------
@@ -951,6 +953,7 @@ void MidiTrackInfo::iLenChanged(int val)
return;
MidiTrack* track = (MidiTrack*)selected;
track->len = val;
+ song->update(SC_MIDI_TRACK_PROP);
}
//---------------------------------------------------------
@@ -963,6 +966,7 @@ void MidiTrackInfo::iKomprChanged(int val)
return;
MidiTrack* track = (MidiTrack*)selected;
track->compression = val;
+ song->update(SC_MIDI_TRACK_PROP);
}
//---------------------------------------------------------
@@ -1041,8 +1045,7 @@ void MidiTrackInfo::recEchoToggled(bool v)
return;
MidiTrack* track = (MidiTrack*)selected;
track->setRecEcho(v);
-
- //song->update(SC_???);
+ song->update(SC_MIDI_TRACK_PROP);
}
//---------------------------------------------------------
@@ -1229,6 +1232,8 @@ void MidiTrackInfo::updateTrackInfo(int flags)
// Is it simply a midi controller value adjustment? Forget it.
if(flags == SC_MIDI_CONTROLLER)
return;
+ if(flags == SC_SELECTION)
+ return;
if(!selected)
return;
@@ -1246,13 +1251,31 @@ void MidiTrackInfo::updateTrackInfo(int flags)
setLabelText();
setLabelFont();
- //{
+ if(flags & (SC_MIDI_TRACK_PROP))
+ {
+ iTransp->blockSignals(true);
+ iAnschl->blockSignals(true);
+ iVerz->blockSignals(true);
+ iLen->blockSignals(true);
+ iKompr->blockSignals(true);
+ iTransp->setValue(track->transposition);
+ iAnschl->setValue(track->velocity);
+ iVerz->setValue(track->delay);
+ iLen->setValue(track->len);
+ iKompr->setValue(track->compression);
+ iTransp->blockSignals(false);
+ iAnschl->blockSignals(false);
+ iVerz->blockSignals(false);
+ iLen->blockSignals(false);
+ iKompr->blockSignals(false);
+
int outChannel = track->outChannel();
///int inChannel = track->inChannelMask();
int outPort = track->outPort();
//int inPort = track->inPortMask();
///unsigned int inPort = track->inPortMask();
+ iOutput->blockSignals(true);
//iInput->clear();
iOutput->clear();
@@ -1263,6 +1286,8 @@ void MidiTrackInfo::updateTrackInfo(int flags)
if (i == outPort)
iOutput->setCurrentIndex(i);
}
+ iOutput->blockSignals(false);
+
//iInput->setText(bitmap2String(inPort));
///iInput->setText(u32bitmap2String(inPort));
@@ -1274,7 +1299,9 @@ void MidiTrackInfo::updateTrackInfo(int flags)
// iName->home(false);
// }
+ iOutputChannel->blockSignals(true);
iOutputChannel->setValue(outChannel+1);
+ iOutputChannel->blockSignals(false);
///iInputChannel->setText(bitmap2String(inChannel));
// Set record echo.
@@ -1284,7 +1311,10 @@ void MidiTrackInfo::updateTrackInfo(int flags)
recEchoButton->setChecked(track->recEcho());
recEchoButton->blockSignals(false);
}
+ }
+ int outChannel = track->outChannel();
+ int outPort = track->outPort();
MidiPort* mp = &midiPorts[outPort];
int nprogram = mp->hwCtrlState(outChannel, CTRL_PROGRAM);
if(nprogram == CTRL_VAL_UNKNOWN)
@@ -1387,20 +1417,6 @@ void MidiTrackInfo::updateTrackInfo(int flags)
iPan->blockSignals(false);
//}
-
- // Does it include a midi controller value adjustment? Then handle it...
- //if(flags & SC_MIDI_CONTROLLER)
- // seek();
-
- // Is it simply a midi controller value adjustment? Forget it.
- //if(flags != SC_MIDI_CONTROLLER)
- //{
- iTransp->setValue(track->transposition);
- iAnschl->setValue(track->velocity);
- iVerz->setValue(track->delay);
- iLen->setValue(track->len);
- iKompr->setValue(track->compression);
- //}
}
//---------------------------------------------------------
diff --git a/muse2/muse/widgets/mtrackinfo.h b/muse2/muse/widgets/mtrackinfo.h
index 8db91797..4e06f1d0 100644
--- a/muse2/muse/widgets/mtrackinfo.h
+++ b/muse2/muse/widgets/mtrackinfo.h
@@ -52,9 +52,6 @@ class MidiTrackInfo : public QWidget, public Ui::MidiTrackInfoBase
protected slots:
virtual void heartBeat();
- signals:
- void outputPortChanged(int);
-
public slots:
void setTrack(Track*);
void configChanged();