| 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 EventListener, public H2Core::Object |
|---|
| 48 | { |
|---|
| 49 | H2_OBJECT |
|---|
| 50 | Q_OBJECT |
|---|
| 51 | public: |
|---|
| 52 | MetronomeWidget(QWidget *pParent); |
|---|
| 53 | ~MetronomeWidget(); |
|---|
| 54 | |
|---|
| 55 | virtual void metronomeEvent( int nValue ); |
|---|
| 56 | virtual void paintEvent( QPaintEvent*); |
|---|
| 57 | |
|---|
| 58 | |
|---|
| 59 | public slots: |
|---|
| 60 | void updateWidget(); |
|---|
| 61 | |
|---|
| 62 | |
|---|
| 63 | private: |
|---|
| 64 | enum m_state { |
|---|
| 65 | METRO_FIRST, |
|---|
| 66 | METRO_ON, |
|---|
| 67 | METRO_OFF |
|---|
| 68 | }; |
|---|
| 69 | |
|---|
| 70 | int m_nValue; |
|---|
| 71 | int m_state; |
|---|
| 72 | |
|---|
| 73 | QPixmap m_metro_off; |
|---|
| 74 | QPixmap m_metro_on_firstbeat; |
|---|
| 75 | QPixmap m_metro_on; |
|---|
| 76 | |
|---|
| 77 | }; |
|---|
| 78 | |
|---|
| 79 | |
|---|
| 80 | /// |
|---|
| 81 | /// Player control panel |
|---|
| 82 | /// |
|---|
| 83 | class PlayerControl : public QLabel, public H2Core::Object |
|---|
| 84 | { |
|---|
| 85 | H2_OBJECT |
|---|
| 86 | Q_OBJECT |
|---|
| 87 | public: |
|---|
| 88 | PlayerControl(QWidget *parent); |
|---|
| 89 | ~PlayerControl(); |
|---|
| 90 | |
|---|
| 91 | void showMessage( const QString& msg, int msec ); |
|---|
| 92 | void showScrollMessage( const QString& msg, int msec, bool test ); |
|---|
| 93 | |
|---|
| 94 | private slots: |
|---|
| 95 | void recBtnClicked(Button* ref); |
|---|
| 96 | void recBtnRightClicked(Button* ref); |
|---|
| 97 | void playBtnClicked(Button* ref); |
|---|
| 98 | void stopBtnClicked(Button* ref); |
|---|
| 99 | void updatePlayerControl(); |
|---|
| 100 | void songModeBtnClicked(Button* ref); |
|---|
| 101 | void liveModeBtnClicked(Button* ref); |
|---|
| 102 | void jackTransportBtnClicked(Button* ref); |
|---|
| 103 | //jack time master |
|---|
| 104 | void jackMasterBtnClicked(Button* ref); |
|---|
| 105 | //~ jack time master |
|---|
| 106 | void bpmChanged(); |
|---|
| 107 | void bpmButtonClicked( Button *pRef ); |
|---|
| 108 | void bpmButtonPressed( Button* pBtn); |
|---|
| 109 | void bpmClicked(); |
|---|
| 110 | void FFWDBtnClicked(Button *pRef); |
|---|
| 111 | void RewindBtnClicked(Button *pRef); |
|---|
| 112 | void songLoopBtnClicked(Button* ref); |
|---|
| 113 | void metronomeButtonClicked(Button* ref); |
|---|
| 114 | void onBpmTimerEvent(); |
|---|
| 115 | void onStatusTimerEvent(); |
|---|
| 116 | void onScrollTimerEvent(); |
|---|
| 117 | void showButtonClicked( Button* pRef ); |
|---|
| 118 | |
|---|
| 119 | //beatcounter |
|---|
| 120 | void bconoffBtnClicked( Button* ref); |
|---|
| 121 | void bcSetPlayBtnClicked(Button* ref); |
|---|
| 122 | void bcbButtonClicked(Button* bBtn); |
|---|
| 123 | void bctButtonClicked(Button* tBtn); |
|---|
| 124 | //~ beatcounter |
|---|
| 125 | |
|---|
| 126 | //rubberband |
|---|
| 127 | void rubberbandButtonToggle(Button* ref); |
|---|
| 128 | |
|---|
| 129 | private: |
|---|
| 130 | H2Core::Hydrogen *m_pEngine; |
|---|
| 131 | QPixmap m_background; |
|---|
| 132 | |
|---|
| 133 | Button *m_pRwdBtn; |
|---|
| 134 | ToggleButton *m_pRecBtn; |
|---|
| 135 | ToggleButton *m_pRecDelBtn; |
|---|
| 136 | ToggleButton *m_pPlayBtn; |
|---|
| 137 | Button *m_pStopBtn; |
|---|
| 138 | Button *m_pFfwdBtn; |
|---|
| 139 | |
|---|
| 140 | ToggleButton *m_pSongLoopBtn; |
|---|
| 141 | |
|---|
| 142 | ToggleButton *m_pSongModeBtn; |
|---|
| 143 | ToggleButton *m_pLiveModeBtn; |
|---|
| 144 | |
|---|
| 145 | //beatcounter |
|---|
| 146 | ToggleButton *m_pBConoffBtn; |
|---|
| 147 | ToggleButton *m_pBCSpaceBtn; |
|---|
| 148 | ToggleButton *m_pBCSetPlayBtn; |
|---|
| 149 | Button *m_pBCTUpBtn; |
|---|
| 150 | Button *m_pBCTDownBtn; |
|---|
| 151 | Button *m_pBCBUpBtn; |
|---|
| 152 | Button *m_pBCBDownBtn; |
|---|
| 153 | //~ beatcounter |
|---|
| 154 | |
|---|
| 155 | //rubberbandBPMChange |
|---|
| 156 | ToggleButton *m_pRubberBPMChange; |
|---|
| 157 | |
|---|
| 158 | ToggleButton *m_pJackTransportBtn; |
|---|
| 159 | //jack time master |
|---|
| 160 | ToggleButton *m_pJackMasterBtn; |
|---|
| 161 | //~ jack time master |
|---|
| 162 | Button *m_pBPMUpBtn; |
|---|
| 163 | Button *m_pBPMDownBtn; |
|---|
| 164 | |
|---|
| 165 | CpuLoadWidget *m_pCpuLoadWidget; |
|---|
| 166 | MidiActivityWidget *m_pMidiActivityWidget; |
|---|
| 167 | |
|---|
| 168 | LCDSpinBox *m_pLCDBPMSpinbox; |
|---|
| 169 | |
|---|
| 170 | LCDDisplay *m_pTimeDisplayH; |
|---|
| 171 | LCDDisplay *m_pTimeDisplayM; |
|---|
| 172 | LCDDisplay *m_pTimeDisplayS; |
|---|
| 173 | LCDDisplay *m_pTimeDisplayMS; |
|---|
| 174 | |
|---|
| 175 | //beatcounter |
|---|
| 176 | PixmapWidget *m_pControlsBCPanel; |
|---|
| 177 | |
|---|
| 178 | LCDDisplay *m_pBCDisplayZ; |
|---|
| 179 | LCDDisplay *m_pBCDisplayB; |
|---|
| 180 | LCDDisplay *m_pBCDisplayT; |
|---|
| 181 | //~ beatcounter |
|---|
| 182 | |
|---|
| 183 | MetronomeWidget *m_pMetronomeWidget; |
|---|
| 184 | ToggleButton *m_pMetronomeBtn; |
|---|
| 185 | |
|---|
| 186 | QTimer *m_pBPMTimer; |
|---|
| 187 | |
|---|
| 188 | int m_nBPMIncrement; |
|---|
| 189 | |
|---|
| 190 | ToggleButton *m_pShowMixerBtn; |
|---|
| 191 | ToggleButton *m_pShowInstrumentRackBtn; |
|---|
| 192 | |
|---|
| 193 | LCDDisplay *m_pStatusLabel; |
|---|
| 194 | QTimer *m_pStatusTimer; |
|---|
| 195 | QTimer *m_pScrollTimer; |
|---|
| 196 | QString m_pScrollMessage; |
|---|
| 197 | }; |
|---|
| 198 | |
|---|
| 199 | |
|---|
| 200 | #endif |
|---|