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

Annotation of /qsampler/trunk/src/qsamplerDeviceStatusForm.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2038 - (hide annotations) (download) (as text)
Thu Jan 7 18:42:26 2010 UTC (14 years, 2 months ago) by capela
File MIME type: text/x-c++hdr
File size: 2529 byte(s)
* MIDI Device Status menu is disabled when no MIDI device exists;
  a menu separator has been added.

* Window manager's close button was found missing from the Devices
  and Instruments widgets when on Qt >= 4.5, now fixed.

1 schoenebeck 1698 // qsamplerDeviceStatusForm.h
2     //
3     /****************************************************************************
4     Copyright (C) 2008, Christian Schoenebeck
5 capela 2038 Copyright (C) 2010, rncbc aka Rui Nuno Capela. All rights reserved.
6 schoenebeck 1698
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
18     along with this program; if not, write to the Free Software
19     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20    
21     *****************************************************************************/
22    
23     #ifndef __qsamplerDeviceStatusForm_h
24     #define __qsamplerDeviceStatusForm_h
25    
26     #include "qsamplerDevice.h"
27    
28     #include <QMainWindow>
29     #include <QAction>
30     #include <QCloseEvent>
31     #include <QLabel>
32     #include <QTimer>
33 capela 2038
34 schoenebeck 1698 #include <map>
35    
36 capela 2038
37 schoenebeck 1698 namespace QSampler {
38    
39 capela 2038 class MidiActivityLED : public QLabel
40     {
41 schoenebeck 1698 Q_OBJECT
42 capela 2038
43 schoenebeck 1698 public:
44    
45 capela 2038 MidiActivityLED(QString sText = QString(), QWidget *pParent = 0);
46     ~MidiActivityLED();
47    
48     void midiActivityLedOn();
49    
50 schoenebeck 1698 protected slots:
51    
52 capela 2038 void midiActivityLedOff();
53    
54 schoenebeck 1698 private:
55 capela 2038
56     QTimer m_timer;
57    
58     // MIDI activity pixmap common resources.
59     static int g_iMidiActivityRefCount;
60     static QPixmap *g_pMidiActivityLedOn;
61     static QPixmap *g_pMidiActivityLedOff;
62 schoenebeck 1698 };
63    
64 capela 2038
65     class DeviceStatusForm : public QWidget
66     {
67 schoenebeck 1698 Q_OBJECT
68 capela 2038
69 schoenebeck 1698 public:
70 capela 2038
71     DeviceStatusForm(int DeviceID,
72     QWidget* pParent = NULL, Qt::WindowFlags wflags = 0);
73 schoenebeck 1698 ~DeviceStatusForm();
74 capela 2038
75     QAction *visibleAction();
76    
77 schoenebeck 1698 void midiArrived(int iPort);
78    
79 capela 2038 static DeviceStatusForm *getInstance(int iDeviceID);
80     static const std::map<int, DeviceStatusForm *>& getInstances();
81    
82 schoenebeck 1698 static void onDevicesChanged();
83 schoenebeck 1699 static void onDeviceChanged(int iDeviceID);
84 capela 2038
85 schoenebeck 1699 static void deleteAllInstances();
86 schoenebeck 1698
87     protected:
88 capela 2038
89     void closeEvent(QCloseEvent *pCloseEvent);
90 schoenebeck 1699 void updateGUIPorts();
91 schoenebeck 1698
92     private:
93    
94 capela 2038 int m_DeviceID;
95     Device *m_pDevice;
96     QAction *m_pVisibleAction;
97    
98     std::vector<MidiActivityLED *> m_midiActivityLEDs;
99    
100     static std::map<int, DeviceStatusForm*> g_instances;
101 schoenebeck 1698 };
102    
103     } // namespace QSampler
104    
105 capela 2038
106 schoenebeck 1698 #endif // __qsamplerDeviceStatusForm_h
107    
108     // end of qsamplerDeviceStatusForm.h

  ViewVC Help
Powered by ViewVC