--- qsampler/trunk/src/qsamplerChannelStrip.h 2007/11/20 16:48:04 1499 +++ qsampler/trunk/src/qsamplerChannelStrip.h 2008/02/14 22:31:26 1691 @@ -2,7 +2,7 @@ // /**************************************************************************** Copyright (C) 2004-2007, rncbc aka Rui Nuno Capela. All rights reserved. - Copyright (C) 2007, Christian Schoenebeck + Copyright (C) 2007, 2008 Christian Schoenebeck This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -26,52 +26,84 @@ #include "ui_qsamplerChannelStrip.h" #include "qsamplerChannel.h" +#include class QDragEnterEvent; namespace QSampler { -class ChannelStrip : public QWidget { -Q_OBJECT +//------------------------------------------------------------------------- +// QSampler::ChannelStrip -- Channel strip form interface. +// + +class ChannelStrip : public QWidget +{ + Q_OBJECT + public: - ChannelStrip(QWidget* parent = 0, Qt::WFlags f = 0); - ~ChannelStrip(); - void setup(qsamplerChannel* pChannel); - qsamplerChannel* channel(); - QFont displayFont(); - void setDisplayFont(const QFont& font); - void setDisplayEffect(bool bDisplayEffect); - void setMaxVolume(int iMaxVolume); - bool updateInstrumentName(bool bForce); - bool updateChannelVolume(); - bool updateChannelInfo(); - bool updateChannelUsage(); - void resetErrorCount(); + ChannelStrip(QWidget* pParent = NULL, Qt::WindowFlags wflags = 0); + ~ChannelStrip(); + + void setup(Channel *pChannel); + + Channel *channel() const; + + void setDisplayFont(const QFont& font); + QFont displayFont() const; + + void setDisplayEffect(bool bDisplayEffect); + + void setMaxVolume(int iMaxVolume); + + bool updateInstrumentName(bool bForce); + bool updateChannelVolume(); + bool updateChannelInfo(); + bool updateChannelUsage(); + + void resetErrorCount(); + + // Channel strip activation/selection. + void setSelected(bool bSelected); + bool isSelected() const; signals: - void channelChanged(ChannelStrip*); + + void channelChanged(ChannelStrip*); public slots: - bool channelSetup(); - bool channelMute(bool bMute); - bool channelSolo(bool bSolo); - void channelEdit(); - bool channelReset(); - void volumeChanged(int iVolume); + + bool channelSetup(); + bool channelMute(bool bMute); + bool channelSolo(bool bSolo); + void channelEdit(); + bool channelFxEdit(); + bool channelReset(); + void volumeChanged(int iVolume); + void midiArrived(); protected: - void dragEnterEvent(QDragEnterEvent* pDragEnterEvent); - void dropEvent(QDropEvent* pDropEvent); - void contextMenuEvent(QContextMenuEvent* pEvent); + + void dragEnterEvent(QDragEnterEvent* pDragEnterEvent); + void dropEvent(QDropEvent* pDropEvent); + void contextMenuEvent(QContextMenuEvent* pEvent); + +protected slots: + + void midiDataCeased(); private: - Ui::qsamplerChannelStrip ui; - qsamplerChannel* m_pChannel; - int m_iDirtyChange; - int m_iErrorCount; + Ui::qsamplerChannelStrip m_ui; + + Channel* m_pChannel; + int m_iDirtyChange; + int m_iErrorCount; + QTimer* pMidiActivityTimer; + + // Channel strip activation/selection. + static ChannelStrip *g_pSelectedStrip; }; } // namespace QSampler