diff options
Diffstat (limited to 'muse2/muse/mixer')
-rw-r--r-- | muse2/muse/mixer/amixer.cpp | 2 | ||||
-rw-r--r-- | muse2/muse/mixer/astrip.cpp | 38 | ||||
-rw-r--r-- | muse2/muse/mixer/mstrip.cpp | 6 | ||||
-rw-r--r-- | muse2/muse/mixer/strip.cpp | 24 | ||||
-rw-r--r-- | muse2/muse/mixer/strip.h | 1 |
5 files changed, 56 insertions, 15 deletions
diff --git a/muse2/muse/mixer/amixer.cpp b/muse2/muse/mixer/amixer.cpp index 731af9a4..439a92b9 100644 --- a/muse2/muse/mixer/amixer.cpp +++ b/muse2/muse/mixer/amixer.cpp @@ -169,7 +169,7 @@ AudioMixerApp::AudioMixerApp(QWidget* parent, MusEGlobal::MixerConfig* c) setWindowIcon(*museIcon); QMenu* menuConfig = menuBar()->addMenu(tr("&Create")); - MusEGui::populateAddTrack(menuConfig); + MusEGui::populateAddTrack(menuConfig,true); connect(menuConfig, SIGNAL(triggered(QAction *)), MusEGlobal::song, SLOT(addNewTrack(QAction *))); QMenu* menuView = menuBar()->addMenu(tr("&View")); diff --git a/muse2/muse/mixer/astrip.cpp b/muse2/muse/mixer/astrip.cpp index 10f281fb..9c393a1a 100644 --- a/muse2/muse/mixer/astrip.cpp +++ b/muse2/muse/mixer/astrip.cpp @@ -147,6 +147,7 @@ void AudioStrip::songChanged(int val) // Set the strip label's font. //label->setFont(MusEGlobal::config.fonts[1]); setLabelFont(); + setLabelText(); // Adjust minimum volume slider and label values. slider->setRange(MusEGlobal::config.minSlider-0.1, 10.0); @@ -203,7 +204,17 @@ void AudioStrip::songChanged(int val) pre->setChecked(src->prefader()); pre->blockSignals(false); } - } + + // Are there any Aux Track routing paths to this track? Then we cannot process aux for this track! + // Hate to do this, but as a quick visual reminder, seems most logical to disable Aux knobs and labels. + int rc = track->auxRefCount(); + int n = auxKnob.size(); + for (int idx = 0; idx < n; ++idx) + { + auxKnob[idx]->setEnabled( rc == 0 ); + auxLabel[idx]->setEnabled( rc == 0 ); + } + } if (val & SC_AUX) { int n = auxKnob.size(); for (int idx = 0; idx < n; ++idx) { @@ -333,11 +344,14 @@ void AudioStrip::updateOffState() stereo->setEnabled(val); label->setEnabled(val); + // Are there any Aux Track routing paths to this track? Then we cannot process aux for this track! + // Hate to do this, but as a quick visual reminder, seems most logical to disable Aux knobs and labels. + bool ae = track->auxRefCount() == 0 && val; int n = auxKnob.size(); for (int i = 0; i < n; ++i) { - auxKnob[i]->setEnabled(val); - auxLabel[i]->setEnabled(val); + auxKnob[i]->setEnabled(ae); + auxLabel[i]->setEnabled(ae); } if (pre) @@ -348,12 +362,12 @@ void AudioStrip::updateOffState() solo->setEnabled(val); if (mute) mute->setEnabled(val); - if (autoType) - autoType->setEnabled(val); - if (iR) - iR->setEnabled(val); - if (oR) - oR->setEnabled(val); + //if (autoType) + // autoType->setEnabled(val); + //if (iR) + // iR->setEnabled(val); + //if (oR) + // oR->setEnabled(val); if (off) { off->blockSignals(true); off->setChecked(track->off()); @@ -799,6 +813,12 @@ AudioStrip::AudioStrip(QWidget* parent, MusECore::AudioTrack* at) double val = MusECore::fast_log10(t->auxSend(idx))*20.0; ak->setValue(val); al->setValue(val); + + // Are there any Aux Track routing paths to this track? Then we cannot process aux for this track! + // Hate to do this, but as a quick visual reminder, seems most logical to disable Aux knobs and labels. + int rc = track->auxRefCount(); + ak->setEnabled( rc == 0 ); + al->setEnabled( rc == 0 ); } } else { diff --git a/muse2/muse/mixer/mstrip.cpp b/muse2/muse/mixer/mstrip.cpp index 2e51feb9..dc495aa6 100644 --- a/muse2/muse/mixer/mstrip.cpp +++ b/muse2/muse/mixer/mstrip.cpp @@ -448,9 +448,8 @@ void MidiStrip::updateOffState() // TODO: Disabled for now. //if (autoType) // autoType->setEnabled(val); - if (iR) - iR->setEnabled(val); - // TODO: Disabled for now. + //if (iR) + // iR->setEnabled(val); //if (oR) // oR->setEnabled(val); if (off) { @@ -504,6 +503,7 @@ void MidiStrip::songChanged(int val) // Set the strip label's font. //label->setFont(MusEGlobal::config.fonts[1]); setLabelFont(); + setLabelText(); } } diff --git a/muse2/muse/mixer/strip.cpp b/muse2/muse/mixer/strip.cpp index b87c4629..c26a9a15 100644 --- a/muse2/muse/mixer/strip.cpp +++ b/muse2/muse/mixer/strip.cpp @@ -29,6 +29,8 @@ #include <QColor> #include <QVBoxLayout> #include <QFrame> +#include <QMouseEvent> +#include <QMenu> #include "globals.h" #include "gconfig.h" @@ -161,7 +163,8 @@ void Strip::setLabelText() //gradient.setColorAt(0, c.darker()); //gradient.setColorAt(0, c); //gradient.setColorAt(1, c.darker()); - gradient.setColorAt(0, c.lighter()); + gradient.setColorAt(0, c); + gradient.setColorAt(0.5, c.lighter()); gradient.setColorAt(1, c); //palette.setBrush(QPalette::Button, gradient); //palette.setBrush(QPalette::Window, gradient); @@ -303,6 +306,23 @@ void Strip::resizeEvent(QResizeEvent* ev) setLabelText(); setLabelFont(); } - + +void Strip::mousePressEvent(QMouseEvent* ev) +{ + if (ev->button() == Qt::RightButton) { + QMenu* menu = new QMenu; + menu->addAction(tr("Remove track?")); + QPoint pt = QCursor::pos(); + QAction* act = menu->exec(pt, 0); + if (!act) + { + delete menu; + return; + } + MusEGlobal::song->removeTrack0(track); + MusEGlobal::audio->msgUpdateSoloStates(); + } +} + } // namespace MusEGui diff --git a/muse2/muse/mixer/strip.h b/muse2/muse/mixer/strip.h index 5b3b541b..d0cde1a6 100644 --- a/muse2/muse/mixer/strip.h +++ b/muse2/muse/mixer/strip.h @@ -73,6 +73,7 @@ class Strip : public QFrame { MusEGui::ComboBox* autoType; void setLabelText(); virtual void resizeEvent(QResizeEvent*); + virtual void mousePressEvent(QMouseEvent *); private slots: void recordToggled(bool); |