/[svn]/qsampler/trunk/src/qsamplerChannelStrip.h
ViewVC logotype

Diff of /qsampler/trunk/src/qsamplerChannelStrip.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1461 by schoenebeck, Sun Oct 28 23:30:36 2007 UTC revision 2978 by capela, Mon Aug 15 19:10:16 2016 UTC
# Line 1  Line 1 
1  #ifndef QSAMPLER_CHANNEL_STRIP_H  // qsamplerChannelStrip.h
2  #define QSAMPLER_CHANNEL_STRIP_H  //
3    /****************************************************************************
4       Copyright (C) 2004-201, rncbc aka Rui Nuno Capela. All rights reserved.
5       Copyright (C) 2007, 2008, 2014 Christian Schoenebeck
6    
7       This program is free software; you can redistribute it and/or
8       modify it under the terms of the GNU General Public License
9       as published by the Free Software Foundation; either version 2
10       of the License, or (at your option) any later version.
11    
12       This program is distributed in the hope that it will be useful,
13       but WITHOUT ANY WARRANTY; without even the implied warranty of
14       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15       GNU General Public License for more details.
16    
17       You should have received a copy of the GNU General Public License along
18       with this program; if not, write to the Free Software Foundation, Inc.,
19       51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20    
21    *****************************************************************************/
22    
23    #ifndef __qsamplerChannelStrip_h
24    #define __qsamplerChannelStrip_h
25    
26  #include "ui_qsamplerChannelStrip.h"  #include "ui_qsamplerChannelStrip.h"
27    
28  #include "qsamplerChannel.h"  #include "qsamplerChannel.h"
29    
30  #include <QDragEnterEvent>  class QDragEnterEvent;
31    class QTimer;
32    class QMenu;
33    
34    
35  namespace QSampler {  namespace QSampler {
36    
37  class ChannelStrip : public QWidget {  //-------------------------------------------------------------------------
38  Q_OBJECT  // QSampler::ChannelStrip -- Channel strip form interface.
39    //
40    
41    class ChannelStrip : public QWidget
42    {
43            Q_OBJECT
44    
45  public:  public:
     ChannelStrip(QWidget* parent = 0, Qt::WFlags f = 0);  
    ~ChannelStrip();  
46    
47      void setup(qsamplerChannel* pChannel);          ChannelStrip(QWidget* pParent = NULL, Qt::WindowFlags wflags = 0);
48      qsamplerChannel* channel();          ~ChannelStrip();
49      QFont displayFont();  
50      void setDisplayFont(const QFont& font);          void setup(Channel *pChannel);
51      void setDisplayEffect(bool bDisplayEffect);  
52      void setDisplayBackground(const QPixmap& pm);          Channel *channel() const;
53      void setMaxVolume(int iMaxVolume);  
54      bool updateInstrumentName(bool bForce);          void setDisplayFont(const QFont& font);
55      bool updateChannelVolume();          QFont displayFont() const;
56      bool updateChannelInfo();  
57      bool updateChannelUsage();          void setDisplayEffect(bool bDisplayEffect);
58      void resetErrorCount();  
59            void setMaxVolume(int iMaxVolume);
60    
61            bool updateInstrumentName(bool bForce);
62            bool updateChannelVolume();
63            bool updateChannelInfo();
64            bool updateChannelUsage();
65    
66            void resetErrorCount();
67    
68            // Channel strip activation/selection.
69            void setSelected(bool bSelected);
70            bool isSelected() const;
71    
72  signals:  signals:
73      void channelChanged(ChannelStrip*);  
74            void channelChanged(ChannelStrip*);
75    
76  public slots:  public slots:
77      bool channelSetup();  
78      bool channelMute(bool bMute);          bool channelSetup();
79      bool channelSolo(bool bSolo);          bool channelMute(bool bMute);
80      void channelEdit();          bool channelSolo(bool bSolo);
81      bool channelReset();          void channelEdit();
82      void volumeChanged(int iVolume);          bool channelFxEdit();
83            bool channelReset();
84            void volumeChanged(int iVolume);
85    
86            void midiActivityLedOn();
87    
88  protected:  protected:
89      bool decodeDragFile(const QMimeSource* pEvent, QString& sInstrumentFile);  
90      void dragEnterEvent(QDragEnterEvent* pDragEnterEvent);          void dragEnterEvent(QDragEnterEvent* pDragEnterEvent);
91      void dropEvent(QDropEvent* pDropEvent);          void dropEvent(QDropEvent* pDropEvent);
92      void contextMenuEvent(QContextMenuEvent* pEvent);          void contextMenuEvent(QContextMenuEvent* pEvent);
93    
94    protected slots:
95    
96            void midiActivityLedOff();
97            void instrumentListPopupItemClicked(QAction* action);
98    
99  private:  private:
     Ui::qsamplerChannelStrip ui;  
100    
101      qsamplerChannel* m_pChannel;          Ui::qsamplerChannelStrip m_ui;
102      int m_iDirtyChange;  
103      int m_iErrorCount;          Channel *m_pChannel;
104            int m_iDirtyChange;
105            int m_iErrorCount;
106            QMenu* m_instrumentListPopupMenu;
107    
108            QTimer  *m_pMidiActivityTimer;
109    
110            // MIDI activity pixmap common resources.
111            static int      g_iMidiActivityRefCount;
112            static QPixmap *g_pMidiActivityLedOn;
113            static QPixmap *g_pMidiActivityLedOff;
114    
115            // Channel strip activation/selection.
116            static ChannelStrip *g_pSelectedStrip;
117  };  };
118    
119  } // namespace QSampler  } // namespace QSampler
120    
121  #endif // QSAMPLER_CHANNEL_STRIP_H  #endif // __qsamplerChannelStrip_h
122    
123    
124    // end of qsamplerChannelStrip.h

Legend:
Removed from v.1461  
changed lines
  Added in v.2978

  ViewVC Help
Powered by ViewVC