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 MAIN_SAMPLE_WAVE_DISPLAY 24 #define MAIN_SAMPLE_WAVE_DISPLAY 25 26 #include <QtGui> 27 #if QT_VERSION >= 0x050000 28 # include <QtWidgets> 29 #endif 30 #include <hydrogen/object.h> 31 #include "SampleEditor.h" 32 class SampleEditor; 33 34 class MainSampleWaveDisplay : public QWidget, public H2Core::Object 35 { 36 H2_OBJECT 37 Q_OBJECT 38 39 public: 40 MainSampleWaveDisplay(QWidget* pParent); 41 ~MainSampleWaveDisplay(); 42 43 void updateDisplay( const QString& filename ); 44 void updateDisplayPointer(); 45 46 void paintLocatorEvent( int pos, bool last_event); 47 void paintEvent(QPaintEvent *ev); 48 int m_pStartFramePosition; 49 int m_pLoopFramePosition; 50 int m_pEndFramePosition; 51 bool m_pmove; 52 void testPositionFromSampleeditor(); 53 bool __startsliderismoved; 54 bool __loopsliderismoved; 55 bool __endsliderismoved; 56 57 58 private: 59 QPixmap m_background; 60 int *m_pPeakDatal; 61 int *m_pPeakDatar; 62 virtual void mouseMoveEvent(QMouseEvent *ev); 63 virtual void mousePressEvent(QMouseEvent *ev); 64 virtual void mouseReleaseEvent(QMouseEvent *ev); 65 void testPosition( QMouseEvent *ev ); 66 int m_pSampleLength; 67 int m_plocator; 68 bool m_pupdateposi; 69 70 }; 71 72 73 #endif 74 75