| 1 | /* |
|---|
| 2 | * Hydrogen |
|---|
| 3 | * Copyright(c) 2002-2008 by Alex >Comix< Cominu [comix@users.sourceforge.net] |
|---|
| 4 | * |
|---|
| 5 | * http://www.hydrogen-music.org |
|---|
| 6 | * |
|---|
| 7 | * This program is free software; you can redistribute it and/or modify |
|---|
| 8 | * it under the terms of the GNU General Public License as published by |
|---|
| 9 | * the Free Software Foundation; either version 2 of the License, or |
|---|
| 10 | * (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 PLAYER_CONTROL_H |
|---|
| 24 | #define PLAYER_CONTROL_H |
|---|
| 25 | |
|---|
| 26 | #include <QtGui> |
|---|
| 27 | |
|---|
| 28 | #include "EventListener.h" |
|---|
| 29 | #include <hydrogen/Object.h> |
|---|
| 30 | |
|---|
| 31 | namespace H2Core |
|---|
| 32 | { |
|---|
| 33 | class Hydrogen; |
|---|
| 34 | } |
|---|
| 35 | |
|---|
| 36 | class LCDSpinBox; |
|---|
| 37 | class LCDDisplay; |
|---|
| 38 | class Button; |
|---|
| 39 | class ToggleButton; |
|---|
| 40 | class CpuLoadWidget; |
|---|
| 41 | class MidiActivityWidget; |
|---|
| 42 | class PixmapWidget; |
|---|
| 43 | |
|---|
| 44 | /// |
|---|
| 45 | /// |
|---|
| 46 | /// |
|---|
| 47 | class MetronomeWidget : public QWidget, public Object, public EventListener |
|---|
| 48 | { |
|---|
| 49 | Q_OBJECT |
|---|
| 50 | public: |
|---|
| 51 | MetronomeWidget(QWidget *pParent); |
|---|
| 52 | ~MetronomeWidget(); |
|---|
| 53 | |
|---|
| 54 | virtual void metronomeEvent( int nValue ); |
|---|
| 55 | virtual void paintEvent( QPaintEvent*); |
|---|
| 56 | |
|---|
| 57 | public slots: |
|---|
| 58 | void updateWidget(); |
|---|
| 59 | |
|---|
| 60 | private: |
|---|
| 61 | enum m_state { |
|---|
| 62 | METRO_FIRST, |
|---|
| 63 | METRO_ON, |
|---|
| 64 | METRO_OFF |
|---|
| 65 | }; |
|---|
| 66 | |
|---|
| 67 | int m_nValue; |
|---|
| 68 | int m_state; |
|---|
| 69 | |
|---|
| 70 | QPixmap m_metro_off; |
|---|
| 71 | QPixmap m_metro_on_firstbeat; |
|---|
| 72 | QPixmap m_metro_on; |
|---|
| 73 | |
|---|
| 74 | }; |
|---|
| 75 | |
|---|
| 76 | |
|---|
| 77 | /// |
|---|
| 78 | /// Player control panel |
|---|
| 79 | /// |
|---|
| 80 | class PlayerControl : public QLabel, public Object |
|---|
| 81 | { |
|---|
| 82 | Q_OBJECT |
|---|
| 83 | public: |
|---|
| 84 | PlayerControl(QWidget *parent); |
|---|
| 85 | ~PlayerControl(); |
|---|
| 86 | |
|---|
| 87 | void showMessage( const QString& msg, int msec ); |
|---|
| 88 | void showScrollMessage( const QString& msg, int msec, bool test ); |
|---|
| 89 | |
|---|
| 90 | private slots: |
|---|
| 91 | void playBtnClicked(Button* ref); |
|---|
| 92 | void stopBtnClicked(Button* ref); |
|---|
| 93 | void updatePlayerControl(); |
|---|
| 94 | void songModeBtnClicked(Button* ref); |
|---|
| 95 | void liveModeBtnClicked(Button* ref); |
|---|
| 96 | void switchModeBtnClicked(Button* ref); |
|---|
| 97 | void jackTransportBtnClicked(Button* ref); |
|---|
| 98 | //jack time master |
|---|
| 99 | void jackMasterBtnClicked(Button* ref); |
|---|
| 100 | //~ jack time master |
|---|
| 101 | void bpmChanged(); |
|---|
| 102 | void bpmButtonClicked( Button *pRef ); |
|---|
| 103 | void bpmButtonPressed( Button* pBtn); |
|---|
| 104 | void bpmClicked(); |
|---|
| 105 | void FFWDBtnClicked(Button *pRef); |
|---|
| 106 | void RewindBtnClicked(Button *pRef); |
|---|
| 107 | void songLoopBtnClicked(Button* ref); |
|---|
| 108 | void metronomeButtonClicked(Button* ref); |
|---|
| 109 | void onBpmTimerEvent(); |
|---|
| 110 | void onStatusTimerEvent(); |
|---|
| 111 | void onScrollTimerEvent(); |
|---|
| 112 | void showButtonClicked( Button* pRef ); |
|---|
| 113 | |
|---|
| 114 | //beatcounter |
|---|
| 115 | void bconoffBtnClicked( Button* ref); |
|---|
| 116 | void bcSetPlayBtnClicked(Button* ref); |
|---|
| 117 | void bcbButtonClicked(Button* bBtn); |
|---|
| 118 | void bctButtonClicked(Button* tBtn); |
|---|
| 119 | //~ beatcounter |
|---|
| 120 | |
|---|
| 121 | private: |
|---|
| 122 | H2Core::Hydrogen *m_pEngine; |
|---|
| 123 | QPixmap m_background; |
|---|
| 124 | |
|---|
| 125 | Button *m_pRwdBtn; |
|---|
| 126 | ToggleButton *m_pPlayBtn; |
|---|
| 127 | Button *m_pStopBtn; |
|---|
| 128 | Button *m_pFfwdBtn; |
|---|
| 129 | |
|---|
| 130 | ToggleButton *m_pSongLoopBtn; |
|---|
| 131 | |
|---|
| 132 | ToggleButton *m_pSongModeBtn; |
|---|
| 133 | ToggleButton *m_pLiveModeBtn; |
|---|
| 134 | Button *m_pSwitchModeBtn; |
|---|
| 135 | |
|---|
| 136 | //beatcounter |
|---|
| 137 | ToggleButton *m_pBConoffBtn; |
|---|
| 138 | ToggleButton *m_pBCSpaceBtn; |
|---|
| 139 | ToggleButton *m_pBCSetPlayBtn; |
|---|
| 140 | Button *m_pBCTUpBtn; |
|---|
| 141 | Button *m_pBCTDownBtn; |
|---|
| 142 | Button *m_pBCBUpBtn; |
|---|
| 143 | Button *m_pBCBDownBtn; |
|---|
| 144 | //~ beatcounter |
|---|
| 145 | |
|---|
| 146 | ToggleButton *m_pJackTransportBtn; |
|---|
| 147 | //jack time master |
|---|
| 148 | ToggleButton *m_pJackMasterBtn; |
|---|
| 149 | //~ jack time master |
|---|
| 150 | Button *m_pBPMUpBtn; |
|---|
| 151 | Button *m_pBPMDownBtn; |
|---|
| 152 | |
|---|
| 153 | CpuLoadWidget *m_pCpuLoadWidget; |
|---|
| 154 | MidiActivityWidget *m_pMidiActivityWidget; |
|---|
| 155 | |
|---|
| 156 | LCDSpinBox *m_pLCDBPMSpinbox; |
|---|
| 157 | |
|---|
| 158 | LCDDisplay *m_pTimeDisplayH; |
|---|
| 159 | LCDDisplay *m_pTimeDisplayM; |
|---|
| 160 | LCDDisplay *m_pTimeDisplayS; |
|---|
| 161 | LCDDisplay *m_pTimeDisplayMS; |
|---|
| 162 | |
|---|
| 163 | //beatcounter |
|---|
| 164 | PixmapWidget *m_pControlsBCPanel; |
|---|
| 165 | |
|---|
| 166 | LCDDisplay *m_pBCDisplayZ; |
|---|
| 167 | LCDDisplay *m_pBCDisplayB; |
|---|
| 168 | LCDDisplay *m_pBCDisplayT; |
|---|
| 169 | //~ beatcounter |
|---|
| 170 | |
|---|
| 171 | MetronomeWidget *m_pMetronomeWidget; |
|---|
| 172 | ToggleButton *m_pMetronomeBtn; |
|---|
| 173 | |
|---|
| 174 | QTimer *m_pBPMTimer; |
|---|
| 175 | |
|---|
| 176 | int m_nBPMIncrement; |
|---|
| 177 | |
|---|
| 178 | ToggleButton *m_pShowMixerBtn; |
|---|
| 179 | ToggleButton *m_pShowInstrumentRackBtn; |
|---|
| 180 | |
|---|
| 181 | LCDDisplay *m_pStatusLabel; |
|---|
| 182 | QTimer *m_pStatusTimer; |
|---|
| 183 | QTimer *m_pScrollTimer; |
|---|
| 184 | QString m_pScrollMessage; |
|---|
| 185 | }; |
|---|
| 186 | |
|---|
| 187 | |
|---|
| 188 | #endif |
|---|