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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2036 - (hide annotations) (download) (as text)
Wed Jan 6 09:52:32 2010 UTC (14 years, 3 months ago) by capela
File MIME type: text/x-c++hdr
File size: 4925 byte(s)
* MIDI activity indicator on channel strips is now implemented as
  a flashing green LED, instead of a lame solid background :).

- New year's bumping.

1 capela 1464 // qsamplerMainForm.h
2     //
3     /****************************************************************************
4 capela 2036 Copyright (C) 2004-2010, rncbc aka Rui Nuno Capela. All rights reserved.
5 schoenebeck 1698 Copyright (C) 2007, 2008 Christian Schoenebeck
6 schoenebeck 1461
7 capela 1464 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 __qsamplerMainForm_h
24     #define __qsamplerMainForm_h
25    
26 schoenebeck 1461 #include "ui_qsamplerMainForm.h"
27    
28 capela 1513 #include <lscp/client.h>
29 schoenebeck 1461
30 capela 1513 class QProcess;
31 capela 1499 class QWorkspace;
32 capela 1513 class QSpinBox;
33     class QSlider;
34     class QLabel;
35 capela 1499
36 schoenebeck 1461 namespace QSampler {
37    
38 capela 1558 class Options;
39     class Messages;
40     class Channel;
41 capela 1513 class ChannelStrip;
42 schoenebeck 1461 class DeviceForm;
43 capela 1513 class InstrumentListForm;
44 schoenebeck 1461
45 capela 1558 //-------------------------------------------------------------------------
46     // QSampler::MainForm -- Main window form implementation.
47     //
48 capela 1513
49 capela 1509 class MainForm : public QMainWindow
50     {
51     Q_OBJECT
52    
53 schoenebeck 1461 public:
54    
55 capela 1509 MainForm(QWidget *pParent = NULL);
56     ~MainForm();
57    
58 capela 1558 void setup(Options* pOptions);
59 capela 1509
60 capela 1558 Options* options() const;
61 capela 1509 lscp_client_t* client() const;
62    
63     QString sessionName(const QString& sFilename);
64    
65     void appendMessages(const QString& s);
66     void appendMessagesColor(const QString& s, const QString& c);
67     void appendMessagesText(const QString& s);
68     void appendMessagesError(const QString& s);
69     void appendMessagesClient(const QString& s);
70    
71 capela 1558 ChannelStrip* createChannelStrip(Channel *pChannel);
72 schoenebeck 1702 void destroyChannelStrip(ChannelStrip* pChannelStrip);
73 capela 1509 ChannelStrip* activeChannelStrip();
74     ChannelStrip* channelStripAt(int iChannel);
75     ChannelStrip* channelStrip(int iChannelID);
76    
77     void contextMenuEvent(QContextMenuEvent *pEvent);
78    
79     static MainForm* getInstance();
80    
81 schoenebeck 1461 public slots:
82    
83 capela 1509 void fileNew();
84     void fileOpen();
85     void fileOpenRecent();
86     void fileSave();
87     void fileSaveAs();
88     void fileReset();
89     void fileRestart();
90     void fileExit();
91     void editAddChannel();
92     void editRemoveChannel();
93     void editSetupChannel();
94     void editEditChannel();
95     void editResetChannel();
96     void editResetAllChannels();
97     void viewMenubar(bool bOn);
98     void viewToolbar(bool bOn);
99     void viewStatusbar(bool bOn);
100     void viewMessages(bool bOn);
101     void viewInstruments();
102     void viewDevices();
103     void viewOptions();
104     void channelsArrange();
105     void channelsAutoArrange(bool bOn);
106     void helpAboutQt();
107     void helpAbout();
108     void volumeChanged(int iVolume);
109     void channelStripChanged(ChannelStrip *pChannelStrip);
110     void channelsMenuAboutToShow();
111     void channelsMenuActivated();
112     void timerSlot();
113     void readServerStdout();
114     void processServerExit();
115     void sessionDirty();
116     void stabilizeForm();
117    
118 capela 1499 protected slots:
119    
120 capela 1509 void updateRecentFilesMenu();
121 capela 1499
122 capela 1514 // Channel strip activation/selection.
123     void activateStrip(QWidget *pWidget);
124    
125 schoenebeck 1461 protected:
126    
127 capela 1509 bool queryClose();
128     void closeEvent(QCloseEvent* pCloseEvent);
129     void dragEnterEvent(QDragEnterEvent *pDragEnterEvent);
130     void dropEvent(QDropEvent *pDropEvent);
131     void customEvent(QEvent* pCustomEvent);
132     bool newSession();
133     bool openSession();
134     bool saveSession(bool bPrompt);
135     bool closeSession(bool bForce);
136     bool loadSessionFile(const QString& sFilename);
137     bool saveSessionFile(const QString& sFilename);
138     void updateSession();
139     void updateRecentFiles(const QString& sFilename);
140     void updateInstrumentNames();
141     void updateDisplayFont();
142     void updateDisplayEffect();
143     void updateMaxVolume();
144     void updateMessagesFont();
145     void updateMessagesLimit();
146     void updateMessagesCapture();
147 schoenebeck 1698 void updateViewMidiDeviceStatusMenu();
148 schoenebeck 1702 void updateAllChannelStrips(bool bRemoveDeadStrips);
149 capela 1509 void startSchedule(int iStartDelay);
150     void stopSchedule();
151     void startServer();
152 schoenebeck 1626 void stopServer(bool bInteractive = false);
153 capela 1509 bool startClient();
154     void stopClient();
155    
156 schoenebeck 1461 private:
157    
158 capela 1509 Ui::qsamplerMainForm m_ui;
159 schoenebeck 1461
160 capela 1558 Options *m_pOptions;
161     Messages *m_pMessages;
162 capela 1509 QWorkspace *m_pWorkspace;
163     QString m_sFilename;
164     int m_iUntitled;
165     int m_iDirtyCount;
166     lscp_client_t *m_pClient;
167     QProcess *m_pServer;
168 schoenebeck 1626 bool bForceServerStop;
169 capela 1509 int m_iStartDelay;
170     int m_iTimerDelay;
171     int m_iTimerSlot;
172     QLabel *m_statusItem[5];
173     QList<ChannelStrip *> m_changedStrips;
174     InstrumentListForm *m_pInstrumentListForm;
175     DeviceForm *m_pDeviceForm;
176     static MainForm *g_pMainForm;
177     QSlider *m_pVolumeSlider;
178     QSpinBox *m_pVolumeSpinBox;
179     int m_iVolumeChanging;
180 schoenebeck 1461 };
181    
182     } // namespace QSampler
183    
184 capela 1464 #endif // __qsamplerMainForm_h
185    
186    
187 capela 1465 // end of qsamplerMainForm.h

  ViewVC Help
Powered by ViewVC