1 /*
2  * AutomationPatternView.h - declaration of class AutomationPatternView
3  *
4  * Copyright (c) 2008-2010 Tobias Doerffel <tobydox/at/users.sourceforge.net>
5  *
6  * This file is part of LMMS - https://lmms.io
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public
19  * License along with this program (see COPYING); if not, write to the
20  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21  * Boston, MA 02110-1301 USA.
22  *
23  */
24 
25 #ifndef AUTOMATION_PATTERN_VIEW_H
26 #define AUTOMATION_PATTERN_VIEW_H
27 
28 #include <QStaticText>
29 
30 #include "Track.h"
31 
32 class AutomationPattern;
33 
34 
35 class AutomationPatternView : public TrackContentObjectView
36 {
37 	Q_OBJECT
38 
39 
40 public:
41 	AutomationPatternView( AutomationPattern * _pat, TrackView * _parent );
42 	virtual ~AutomationPatternView();
43 
44 public slots:
45 	/// Opens this view's pattern in the global automation editor
46 	void openInAutomationEditor();
47 
48 
49 protected slots:
50 	void resetName();
51 	void changeName();
52 	void disconnectObject( QAction * _a );
53 	void toggleRecording();
54 	void flipY();
55 	void flipX();
56 
57 protected:
58 	virtual void constructContextMenu( QMenu * );
59 	virtual void mouseDoubleClickEvent(QMouseEvent * me );
60 	virtual void paintEvent( QPaintEvent * pe );
61 	virtual void dragEnterEvent( QDragEnterEvent * _dee );
62 	virtual void dropEvent( QDropEvent * _de );
63 
64 
65 private:
66 	AutomationPattern * m_pat;
67 	QPixmap m_paintPixmap;
68 
69 	QStaticText m_staticTextName;
70 
71 	static QPixmap * s_pat_rec;
72 
73 	void scaleTimemapToFit( float oldMin, float oldMax );
74 } ;
75 
76 
77 #endif
78