1 //=============================================================================
2 //  MuseScore
3 //  Music Composition & Notation
4 //
5 //  Copyright (C) 2011 Werner Schweer
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 version 2
9 //  as published by the Free Software Foundation and appearing in
10 //  the file LICENCE.GPL
11 //=============================================================================
12 
13 #ifndef __WAVEVIEW_H__
14 #define __WAVEVIEW_H__
15 
16 #include "libmscore/pos.h"
17 
18 namespace Ms {
19 
20 class Audio;
21 class Score;
22 
23 //---------------------------------------------------------
24 //   WaveView
25 //---------------------------------------------------------
26 
27 class WaveView : public QWidget
28       {
29       Q_OBJECT
30       Pos _cursor;
31       Pos* _locator;
32       Score* _score;
33       QByteArray waves;
34 
35       TType _timeType;
36       int _magStep;
37       double _xmag;
38       int _xpos;
39 
40       int pos2pix(const Pos& p) const;
41       Pos pix2pos(int x) const;
42       virtual void paintEvent(QPaintEvent*);
sizeHint()43       virtual QSize sizeHint() const { return QSize(50, 50); }
44       int pegel(int frame1, int frame2);
45 
46    public slots:
47       void setMag(double,double);
48       void moveLocator(int);
49 
50    public:
51       WaveView(QWidget* parent = 0);
52       void setAudio(Audio*);
53       void setXpos(int);
54       void setScore(Score* s, Pos* lc);
55       };
56 }
57 
58 #endif
59 
60