From: werner s. <wsc...@us...> - 2005-05-21 09:01:46
|
Update of /cvsroot/lmuse/muse/muse/mixer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7689/muse/mixer Modified Files: astrip.h mstrip.cpp mstrip.h strip.cpp strip.h Log Message: midi automation updates Index: astrip.h =================================================================== RCS file: /cvsroot/lmuse/muse/muse/mixer/astrip.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** astrip.h 8 May 2005 09:15:16 -0000 1.22 --- astrip.h 21 May 2005 09:01:34 -0000 1.23 *************** *** 81,85 **** void recordToggled(bool); void autoChanged(); ! void controllerChanged(int id); void autoReadToggled(bool); void autoWriteToggled(bool); --- 81,86 ---- void recordToggled(bool); void autoChanged(); ! virtual void controllerChanged(int id); ! virtual void songChanged(int); void autoReadToggled(bool); void autoWriteToggled(bool); *************** *** 88,94 **** virtual void heartBeat(); - public slots: - virtual void songChanged(int); - public: AudioStrip(Mixer*, QWidget* parent, AudioTrack*, bool align); --- 89,92 ---- Index: strip.cpp =================================================================== RCS file: /cvsroot/lmuse/muse/muse/mixer/strip.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** strip.cpp 8 May 2005 09:15:16 -0000 1.17 --- strip.cpp 21 May 2005 09:01:35 -0000 1.18 *************** *** 61,64 **** --- 61,65 ---- layout->addWidget(label); connect(muse, SIGNAL(configChanged()), SLOT(configChanged())); + connect(track, SIGNAL(controllerChanged(int)), SLOT(controllerChanged(int))); } Index: mstrip.h =================================================================== RCS file: /cvsroot/lmuse/muse/muse/mixer/mstrip.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** mstrip.h 18 May 2005 17:11:48 -0000 1.22 --- mstrip.h 21 May 2005 09:01:35 -0000 1.23 *************** *** 70,74 **** } controller[4]; // pan variation reverb chorus - int volume, pan, variSend, reverbSend, chorusSend; // cached values bool volumeTouched; bool panTouched; --- 70,73 ---- *************** *** 80,83 **** --- 79,83 ---- private slots: + virtual void controllerChanged(int id); void ctrlChanged(float val, int num); void muteToggled(bool); *************** *** 111,118 **** QToolButton* oR; - int volume; // cached value bool volumeTouched; private slots: void ctrlChanged(float val, int num); void muteToggled(bool); --- 111,118 ---- QToolButton* oR; bool volumeTouched; private slots: + virtual void controllerChanged(int id); void ctrlChanged(float val, int num); void muteToggled(bool); Index: mstrip.cpp =================================================================== RCS file: /cvsroot/lmuse/muse/muse/mixer/mstrip.cpp,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** mstrip.cpp 18 May 2005 17:11:48 -0000 1.42 --- mstrip.cpp 21 May 2005 09:01:35 -0000 1.43 *************** *** 109,118 **** chorusSendTouched = false; - volume = CTRL_VAL_UNKNOWN; - pan = CTRL_VAL_UNKNOWN; - variSend = CTRL_VAL_UNKNOWN; - chorusSend = CTRL_VAL_UNKNOWN; - reverbSend = CTRL_VAL_UNKNOWN; - addKnob(CTRL_VARIATION_SEND, KNOB_VAR_SEND, tr("VariationSend"), tr("Var"), SLOT(ctrlChanged(float,int)), true); addKnob(CTRL_REVERB_SEND, KNOB_REV_SEND, tr("ReverbSend"), tr("Rev"), SLOT(ctrlChanged(float,int)), true); --- 109,112 ---- *************** *** 238,289 **** slider->setMeterVal(a * 0.008); track->setMeter(0, a * 0.8); // hack ! // ! // move slider only if Automation Read is active ! // ! if (track->autoRead()) { ! int val; ! if (!volumeTouched) { ! val = track->hwCtrlState(CTRL_VOLUME); ! if (val != CTRL_VAL_UNKNOWN && val != volume) { slider->setValue(float(val)); sl->setValue(float(val)); - volume = val; } ! } ! if (!panTouched) { ! val = track->hwCtrlState(CTRL_PANPOT); ! if (val != CTRL_VAL_UNKNOWN && val != pan) { controller[KNOB_PAN].knob->setValue(float(val)); controller[KNOB_PAN].dl->setValue(float(val)); - pan = val; } ! } ! if (!variSendTouched) { ! val = track->hwCtrlState(CTRL_VARIATION_SEND); ! if (val != variSend) { controller[KNOB_VAR_SEND].knob->setValue(float(val)); controller[KNOB_VAR_SEND].dl->setValue(float(val)); - variSend = val; } ! } ! if (!reverbSendTouched) { ! val = track->hwCtrlState(CTRL_REVERB_SEND); ! if (val != reverbSend) { controller[KNOB_REV_SEND].knob->setValue(float(val)); controller[KNOB_REV_SEND].dl->setValue(float(val)); - reverbSend = val; } ! } ! if (!chorusSendTouched) { ! val = track->hwCtrlState(CTRL_CHORUS_SEND); ! if (val != chorusSend) { controller[KNOB_CHOR_SEND].knob->setValue(float(val)); controller[KNOB_CHOR_SEND].dl->setValue(float(val)); - chorusSend = val; } ! } } - slider->setMeterVal(a); } --- 232,277 ---- slider->setMeterVal(a * 0.008); track->setMeter(0, a * 0.8); // hack + } ! //--------------------------------------------------------- ! // controllerChanged ! //--------------------------------------------------------- ! ! void MidiChannelStrip::controllerChanged(int id) ! { ! int val = track->hwCtrlState(id); ! ! switch (id) { ! case CTRL_VOLUME: ! if (!volumeTouched) { slider->setValue(float(val)); sl->setValue(float(val)); } ! break; ! case CTRL_PANPOT: ! if (!panTouched) { controller[KNOB_PAN].knob->setValue(float(val)); controller[KNOB_PAN].dl->setValue(float(val)); } ! break; ! case CTRL_VARIATION_SEND: ! if (!variSendTouched) { controller[KNOB_VAR_SEND].knob->setValue(float(val)); controller[KNOB_VAR_SEND].dl->setValue(float(val)); } ! break; ! case CTRL_REVERB_SEND: ! if (!reverbSendTouched) { controller[KNOB_REV_SEND].knob->setValue(float(val)); controller[KNOB_REV_SEND].dl->setValue(float(val)); } ! break; ! case CTRL_CHORUS_SEND: ! if (!chorusSendTouched) { controller[KNOB_CHOR_SEND].knob->setValue(float(val)); controller[KNOB_CHOR_SEND].dl->setValue(float(val)); } ! break; } } *************** *** 295,305 **** { int ival = int(val); - switch (num) { - case CTRL_VOLUME: volume = ival; break; - case CTRL_PANPOT: pan = ival; break; - case CTRL_VARIATION_SEND: variSend = ival; break; - case CTRL_REVERB_SEND: reverbSend = ival; break; - case CTRL_CHORUS_SEND: chorusSend = ival; break; - } CVal cval; cval.i = ival; --- 283,286 ---- *************** *** 740,744 **** volumeTouched = false; - volume = CTRL_VAL_UNKNOWN; //--------------------------------------------------- --- 721,724 ---- *************** *** 748,751 **** --- 728,732 ---- slider = new Awl::MidiMeterSlider(this); slider->setId(CTRL_MASTER_VOLUME); + slider->setRange(0.0, 1024*16.0); slider->setFixedWidth(40); layout->addWidget(slider, 100, AlignRight); *************** *** 862,880 **** slider->setMeterVal(a * 0.008); track->setMeter(0, a * 0.8); // hack - - // - // move slider only if Automation Read is active - // - if (track->autoRead()) { - int val; - if (!volumeTouched) { - val = track->hwCtrlState(CTRL_MASTER_VOLUME); - if (val != CTRL_VAL_UNKNOWN && val != volume) { - slider->setValue(float(val)); - sl->setValue(float(val)); - volume = val; - } - } - } } --- 843,846 ---- *************** *** 886,892 **** { int ival = int(val); - switch (num) { - case CTRL_MASTER_VOLUME: volume = ival; break; - } CVal cval; cval.i = ival; --- 852,855 ---- *************** *** 973,976 **** --- 936,952 ---- //--------------------------------------------------------- + // controllerChanged + //--------------------------------------------------------- + + void MidiOutPortStrip::controllerChanged(int id) + { + if (id == CTRL_MASTER_VOLUME && !volumeTouched) { + int val = track->hwCtrlState(CTRL_MASTER_VOLUME); + slider->setValue(float(val)); + sl->setValue(float(val)); + } + } + + //--------------------------------------------------------- // oRoutePressed //--------------------------------------------------------- Index: strip.h =================================================================== RCS file: /cvsroot/lmuse/muse/muse/mixer/strip.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** strip.h 8 May 2005 09:15:16 -0000 1.13 --- strip.h 21 May 2005 09:01:35 -0000 1.14 *************** *** 47,50 **** --- 47,51 ---- void resetPeaks(); virtual void songChanged(int) = 0; + virtual void controllerChanged(int) {} void configChanged(); |