diff options
author | Florian Jung <flo@windfisch.org> | 2011-12-26 18:30:21 +0000 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2011-12-26 18:30:21 +0000 |
commit | 0d8e763949e498c1baf3a2fac7b0b3a406eb0068 (patch) | |
tree | 2d4360945d386cf6f34f3e619e4e23e8cb52b3ef /muse2/muse/mixer | |
parent | 1fe51e45eebbfc2ac198ed4778c9afdb9eaf2ed0 (diff) |
Diffstat (limited to 'muse2/muse/mixer')
-rw-r--r-- | muse2/muse/mixer/amixer.cpp | 22 | ||||
-rw-r--r-- | muse2/muse/mixer/astrip.cpp | 78 | ||||
-rw-r--r-- | muse2/muse/mixer/mstrip.cpp | 40 | ||||
-rw-r--r-- | muse2/muse/mixer/mstrip.h | 1 | ||||
-rw-r--r-- | muse2/muse/mixer/strip.cpp | 1 | ||||
-rw-r--r-- | muse2/muse/mixer/strip.h | 1 |
6 files changed, 87 insertions, 56 deletions
diff --git a/muse2/muse/mixer/amixer.cpp b/muse2/muse/mixer/amixer.cpp index 25171450..d03cc81e 100644 --- a/muse2/muse/mixer/amixer.cpp +++ b/muse2/muse/mixer/amixer.cpp @@ -236,7 +236,9 @@ AudioMixerApp::AudioMixerApp(QWidget* parent, MusEGlobal::MixerConfig* c) connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); connect(MusEGlobal::muse, SIGNAL(configChanged()), SLOT(configChanged())); - MusEGlobal::song->update(); // calls update mixer + + //MusEGlobal::song->update(); // calls update mixer + updateMixer(UPDATE_ALL); // Build the mixer, add the strips. p4.0.45 } /* @@ -392,7 +394,6 @@ void AudioMixerApp::updateMixer(UpdateAction action) return; } - // Added by Tim. p3.3.7 else if (action == UPDATE_MIDI) { int i = 0; @@ -538,7 +539,10 @@ void AudioMixerApp::updateMixer(UpdateAction action) void AudioMixerApp::configChanged() { - songChanged(-1); // Catch when fonts change, do full rebuild. + //songChanged(-1); // SC_CONFIG // Catch when fonts change, do full rebuild. + StripList::iterator si = stripList.begin(); // Catch when fonts change, viewable tracks, etc. No full rebuild. p4.0.45 + for (; si != stripList.end(); ++si) + (*si)->configChanged(); } //--------------------------------------------------------- @@ -552,7 +556,8 @@ void AudioMixerApp::songChanged(int flags) return; UpdateAction action = NO_UPDATE; - if (flags == -1) + + if (flags == -1) action = UPDATE_ALL; else if (flags & SC_TRACK_REMOVED) action = STRIP_REMOVED; @@ -560,15 +565,18 @@ void AudioMixerApp::songChanged(int flags) action = STRIP_INSERTED; else if (flags & SC_MIDI_TRACK_PROP) action = UPDATE_MIDI; + //if (action != NO_UPDATE) - if (action != NO_UPDATE && action != UPDATE_MIDI) // p4.0.14 Fix for very slow track prop adjusting. + if (action != NO_UPDATE && action != UPDATE_MIDI) // Fix for very slow track prop adjusting. updateMixer(action); - if (action != UPDATE_ALL) { + + if (action != UPDATE_ALL) + { StripList::iterator si = stripList.begin(); for (; si != stripList.end(); ++si) { (*si)->songChanged(flags); } - } + } } //--------------------------------------------------------- diff --git a/muse2/muse/mixer/astrip.cpp b/muse2/muse/mixer/astrip.cpp index ecb2f507..ccd47661 100644 --- a/muse2/muse/mixer/astrip.cpp +++ b/muse2/muse/mixer/astrip.cpp @@ -116,11 +116,38 @@ void AudioStrip::heartBeat() //--------------------------------------------------------- // configChanged +// Catch when label font, or configuration min slider and meter values change, or viewable tracks etc. //--------------------------------------------------------- void AudioStrip::configChanged() { - songChanged(SC_CONFIG); + // Set the whole strip's font, except for the label. + if(font() != MusEGlobal::config.fonts[1]) + setFont(MusEGlobal::config.fonts[1]); + + // Set the strip label's font. + setLabelFont(); + setLabelText(); + + // Adjust minimum volume slider and label values. + slider->setRange(MusEGlobal::config.minSlider-0.1, 10.0); + sl->setRange(MusEGlobal::config.minSlider, 10.0); + + // Adjust minimum aux knob and label values. + int n = auxKnob.size(); + for (int idx = 0; idx < n; ++idx) + { + auxKnob[idx]->blockSignals(true); + auxLabel[idx]->blockSignals(true); + auxKnob[idx]->setRange(MusEGlobal::config.minSlider-0.1, 10.0); + auxLabel[idx]->setRange(MusEGlobal::config.minSlider, 10.1); + auxKnob[idx]->blockSignals(false); + auxLabel[idx]->blockSignals(false); + } + + // Adjust minimum meter values. + for(int c = 0; c < channel; ++c) + meter[c]->setRange(MusEGlobal::config.minMeter, 10.0); } //--------------------------------------------------------- @@ -142,32 +169,7 @@ void AudioStrip::songChanged(int val) // Catch when label font, or configuration min slider and meter values change. if (val & SC_CONFIG) { - // Added by Tim. p3.3.9 - - // 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); - sl->setRange(MusEGlobal::config.minSlider, 10.0); - - // Adjust minimum aux knob and label values. - int n = auxKnob.size(); - for (int idx = 0; idx < n; ++idx) - { - auxKnob[idx]->blockSignals(true); - auxLabel[idx]->blockSignals(true); - auxKnob[idx]->setRange(MusEGlobal::config.minSlider-0.1, 10.0); - auxLabel[idx]->setRange(MusEGlobal::config.minSlider, 10.1); - auxKnob[idx]->blockSignals(false); - auxLabel[idx]->blockSignals(false); - } - - // Adjust minimum meter values. - for(int c = 0; c < channel; ++c) - meter[c]->setRange(MusEGlobal::config.minMeter, 10.0); + // So far only 1 instance of sending SC_CONFIG in the entire app, in instrument editor when a new instrument is saved. } if (mute && (val & SC_MUTE)) { // mute && off @@ -677,7 +679,7 @@ MusEGui::Knob* AudioStrip::addKnob(int type, int id, MusEGui::DoubleLabel** dlab if (dlabel) *dlabel = pl; pl->setSlider(knob); - pl->setFont(MusEGlobal::config.fonts[1]); + ///pl->setFont(MusEGlobal::config.fonts[1]); pl->setBackgroundRole(QPalette::Mid); pl->setFrame(true); if (type == 0) @@ -694,7 +696,7 @@ MusEGui::Knob* AudioStrip::addKnob(int type, int id, MusEGui::DoubleLabel** dlab label.sprintf("Aux%d", id+1); QLabel* plb = new QLabel(label, this); - plb->setFont(MusEGlobal::config.fonts[1]); + ///plb->setFont(MusEGlobal::config.fonts[1]); plb->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum)); plb->setAlignment(Qt::AlignCenter); @@ -751,6 +753,10 @@ AudioStrip::AudioStrip(QWidget* parent, MusECore::AudioTrack* at) record = 0; off = 0; + // Set the whole strip's font, except for the label. p4.0.45 + setFont(MusEGlobal::config.fonts[1]); + + MusECore::AudioTrack* t = (MusECore::AudioTrack*)track; channel = at->channels(); ///setMinimumWidth(STRIP_WIDTH); @@ -774,7 +780,7 @@ AudioStrip::AudioStrip(QWidget* parent, MusECore::AudioTrack* at) //--------------------------------------------------- stereo = new QToolButton(); - stereo->setFont(MusEGlobal::config.fonts[1]); + ///stereo->setFont(MusEGlobal::config.fonts[1]); stereo->setCheckable(true); stereo->setToolTip(tr("1/2 channel")); stereo->setChecked(channel == 2); @@ -788,7 +794,7 @@ AudioStrip::AudioStrip(QWidget* parent, MusECore::AudioTrack* at) stereo->setEnabled(false); pre = new QToolButton(); - pre->setFont(MusEGlobal::config.fonts[1]); + ///pre->setFont(MusEGlobal::config.fonts[1]); pre->setCheckable(true); pre->setText(tr("Pre")); pre->setToolTip(tr("pre fader - post fader")); @@ -841,7 +847,7 @@ AudioStrip::AudioStrip(QWidget* parent, MusECore::AudioTrack* at) slider->setCursorHoming(true); slider->setRange(MusEGlobal::config.minSlider-0.1, 10.0); slider->setFixedWidth(20); - slider->setFont(MusEGlobal::config.fonts[1]); + ///slider->setFont(MusEGlobal::config.fonts[1]); slider->setValue(MusECore::fast_log10(t->volume())*20.0); sliderGrid->addWidget(slider, 0, 0, Qt::AlignHCenter); @@ -859,7 +865,7 @@ AudioStrip::AudioStrip(QWidget* parent, MusECore::AudioTrack* at) sl = new MusEGui::DoubleLabel(0.0, MusEGlobal::config.minSlider, 10.0, this); sl->setSlider(slider); - sl->setFont(MusEGlobal::config.fonts[1]); + ///sl->setFont(MusEGlobal::config.fonts[1]); sl->setBackgroundRole(QPalette::Mid); sl->setSuffix(tr("dB")); sl->setFrame(true); @@ -954,7 +960,7 @@ AudioStrip::AudioStrip(QWidget* parent, MusECore::AudioTrack* at) if (type != MusECore::Track::AUDIO_AUX) { iR = new QToolButton(); - iR->setFont(MusEGlobal::config.fonts[1]); + ///iR->setFont(MusEGlobal::config.fonts[1]); iR->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum)); ///iR->setText(tr("iR")); iR->setIcon(QIcon(*routesInIcon)); @@ -966,7 +972,7 @@ AudioStrip::AudioStrip(QWidget* parent, MusECore::AudioTrack* at) } oR = new QToolButton(); - oR->setFont(MusEGlobal::config.fonts[1]); + ///oR->setFont(MusEGlobal::config.fonts[1]); oR->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum)); ///oR->setText(tr("oR")); oR->setIcon(QIcon(*routesOutIcon)); @@ -981,7 +987,7 @@ AudioStrip::AudioStrip(QWidget* parent, MusECore::AudioTrack* at) //--------------------------------------------------- autoType = new MusEGui::ComboBox(); - autoType->setFont(MusEGlobal::config.fonts[1]); + ///autoType->setFont(MusEGlobal::config.fonts[1]); autoType->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum)); //autoType->setAutoFillBackground(true); diff --git a/muse2/muse/mixer/mstrip.cpp b/muse2/muse/mixer/mstrip.cpp index 031eaa4b..80663c29 100644 --- a/muse2/muse/mixer/mstrip.cpp +++ b/muse2/muse/mixer/mstrip.cpp @@ -110,7 +110,7 @@ void MidiStrip::addKnob(int idx, const QString& tt, const QString& label, dl->setSpecialText(tr("off")); dl->setToolTip(tr("double click on/off")); controller[idx].dl = dl; - dl->setFont(MusEGlobal::config.fonts[1]); + ///dl->setFont(MusEGlobal::config.fonts[1]); dl->setBackgroundRole(QPalette::Mid); dl->setFrame(true); dl->setPrecision(0); @@ -153,7 +153,7 @@ void MidiStrip::addKnob(int idx, const QString& tt, const QString& label, QLabel* lb = new QLabel(label, this); controller[idx].lb = lb; - lb->setFont(MusEGlobal::config.fonts[1]); + ///lb->setFont(MusEGlobal::config.fonts[1]); lb->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum)); lb->setAlignment(Qt::AlignCenter); lb->setEnabled(enabled); @@ -178,6 +178,9 @@ MidiStrip::MidiStrip(QWidget* parent, MusECore::MidiTrack* t) { inHeartBeat = true; + // Set the whole strip's font, except for the label. p4.0.45 + setFont(MusEGlobal::config.fonts[1]); + // Clear so the meters don't start off by showing stale values. t->setActivity(0); t->setLastActivity(0); @@ -211,7 +214,7 @@ MidiStrip::MidiStrip(QWidget* parent, MusECore::MidiTrack* t) slider->setCursorHoming(true); slider->setRange(double(mn), double(mx), 1.0); slider->setFixedWidth(20); - slider->setFont(MusEGlobal::config.fonts[1]); + ///slider->setFont(MusEGlobal::config.fonts[1]); slider->setId(MusECore::CTRL_VOLUME); meter[0] = new MusEGui::Meter(this, MusEGui::Meter::LinMeter); @@ -226,7 +229,7 @@ MidiStrip::MidiStrip(QWidget* parent, MusECore::MidiTrack* t) grid->addLayout(sliderGrid, _curGridRow++, 0, 1, 2); sl = new MusEGui::DoubleLabel(0.0, -98.0, 0.0, this); - sl->setFont(MusEGlobal::config.fonts[1]); + ///sl->setFont(MusEGlobal::config.fonts[1]); sl->setBackgroundRole(QPalette::Mid); sl->setSpecialText(tr("off")); sl->setSuffix(tr("dB")); @@ -381,7 +384,7 @@ MidiStrip::MidiStrip(QWidget* parent, MusECore::MidiTrack* t) //--------------------------------------------------- iR = new QToolButton(); - iR->setFont(MusEGlobal::config.fonts[1]); + ///iR->setFont(MusEGlobal::config.fonts[1]); iR->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum)); ///iR->setText(tr("iR")); iR->setIcon(QIcon(*routesMidiInIcon)); @@ -391,7 +394,7 @@ MidiStrip::MidiStrip(QWidget* parent, MusECore::MidiTrack* t) grid->addWidget(iR, _curGridRow, 0); connect(iR, SIGNAL(pressed()), SLOT(iRoutePressed())); oR = new QToolButton(); - oR->setFont(MusEGlobal::config.fonts[1]); + ///oR->setFont(MusEGlobal::config.fonts[1]); oR->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum)); ///oR->setText(tr("oR")); oR->setIcon(QIcon(*routesMidiOutIcon)); @@ -409,7 +412,7 @@ MidiStrip::MidiStrip(QWidget* parent, MusECore::MidiTrack* t) //--------------------------------------------------- autoType = new MusEGui::ComboBox(); - autoType->setFont(MusEGlobal::config.fonts[1]); + ///autoType->setFont(MusEGlobal::config.fonts[1]); autoType->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum)); autoType->setEnabled(false); @@ -466,6 +469,22 @@ void MidiStrip::updateOffState() } //--------------------------------------------------------- +// configChanged +// Catch when config label font changes, viewable tracks etc. +//--------------------------------------------------------- + +void MidiStrip::configChanged() +{ + // Set the whole strip's font, except for the label. p4.0.45 + if(font() != MusEGlobal::config.fonts[1]) + setFont(MusEGlobal::config.fonts[1]); + + // Set the strip label's font. + setLabelFont(); + setLabelText(); +} + +//--------------------------------------------------------- // songChanged //--------------------------------------------------------- @@ -501,13 +520,10 @@ void MidiStrip::songChanged(int val) } - // Catch when label font changes. Tim. p3.3.9 + // Catch when label font changes. if (val & SC_CONFIG) { - // Set the strip label's font. - //label->setFont(MusEGlobal::config.fonts[1]); - setLabelFont(); - setLabelText(); + // So far only 1 instance of sending SC_CONFIG in the entire app, in instrument editor when a new instrument is saved. } } diff --git a/muse2/muse/mixer/mstrip.h b/muse2/muse/mixer/mstrip.h index bb095363..d5bf5a9f 100644 --- a/muse2/muse/mixer/mstrip.h +++ b/muse2/muse/mixer/mstrip.h @@ -90,6 +90,7 @@ class MidiStrip : public Strip { public slots: virtual void songChanged(int); + virtual void configChanged(); public: MidiStrip(QWidget* parent, MusECore::MidiTrack*); diff --git a/muse2/muse/mixer/strip.cpp b/muse2/muse/mixer/strip.cpp index c26a9a15..e8b52887 100644 --- a/muse2/muse/mixer/strip.cpp +++ b/muse2/muse/mixer/strip.cpp @@ -101,7 +101,6 @@ void Strip::heartBeat() //--------------------------------------------------------- // setLabelFont //--------------------------------------------------------- -// Added by Tim. p3.3.9 void Strip::setLabelFont() { diff --git a/muse2/muse/mixer/strip.h b/muse2/muse/mixer/strip.h index d0cde1a6..5e788484 100644 --- a/muse2/muse/mixer/strip.h +++ b/muse2/muse/mixer/strip.h @@ -87,6 +87,7 @@ class Strip : public QFrame { public slots: void resetPeaks(); virtual void songChanged(int) = 0; + virtual void configChanged() = 0; public: Strip(QWidget* parent, MusECore::Track* t); |