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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1513 - (hide annotations) (download) (as text)
Fri Nov 23 09:32:06 2007 UTC (12 years, 11 months ago) by capela
File MIME type: text/x-c++hdr
File size: 4570 byte(s)
* Qt4 migration: more cleanups and channel strip visual fixes.

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

  ViewVC Help
Powered by ViewVC