--- qsampler/trunk/src/qsamplerChannelStrip.cpp 2008/02/04 23:24:19 1667 +++ qsampler/trunk/src/qsamplerChannelStrip.cpp 2008/02/19 09:18:45 1704 @@ -31,6 +31,9 @@ #include #include +#define MIDI_OFF_COLOR Qt::darkGreen +#define MIDI_ON_COLOR Qt::green + // Channel status/usage usage limit control. #define QSAMPLER_ERROR_LIMIT 3 @@ -92,6 +95,21 @@ SIGNAL(clicked()), SLOT(channelFxEdit())); + pMidiActivityTimer = new QTimer(this); + pMidiActivityTimer->setSingleShot(true); + QObject::connect( + pMidiActivityTimer, SIGNAL(timeout()), + this, SLOT(midiDataCeased()) + ); + +#if CONFIG_EVENT_CHANNEL_MIDI + m_ui.MidiActivityLabel->setPalette(MIDI_OFF_COLOR); + m_ui.MidiActivityLabel->setAutoFillBackground(true); +#else + m_ui.MidiActivityLabel->setText("X"); + m_ui.MidiActivityLabel->setToolTip("MIDI Activity Disabled"); +#endif + setSelected(false); } @@ -303,7 +321,7 @@ #if CONFIG_FXSEND ChannelFxForm *pChannelFxForm = - new ChannelFxForm(channel()->channelID(), parentWidget()); + new ChannelFxForm(channel(), parentWidget()); if (pChannelFxForm) { //pChannelForm->setup(this); bResult = pChannelFxForm->exec(); @@ -531,6 +549,10 @@ } } +void ChannelStrip::midiArrived() { + m_ui.MidiActivityLabel->setPalette(MIDI_ON_COLOR); + pMidiActivityTimer->start(50); +} // Context menu event handler. void ChannelStrip::contextMenuEvent( QContextMenuEvent *pEvent ) @@ -542,6 +564,9 @@ m_pChannel->contextMenuEvent(pEvent); } +void ChannelStrip::midiDataCeased() { + m_ui.MidiActivityLabel->setPalette(MIDI_OFF_COLOR); +} // Error count hackish accessors. void ChannelStrip::resetErrorCount (void)