1 /*
2 Copyright (C) 2006 Remon Sijrier
3 
4 This file is part of Traverso
5 
6 Traverso is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10 
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
19 
20 $Id: FadeView.h,v 1.2 2008/05/24 17:27:49 r_sijrier Exp $
21 */
22 
23 #ifndef FADE_VIEW_H
24 #define FADE_VIEW_H
25 
26 #include "ViewItem.h"
27 
28 class Curve;
29 class FadeCurve;
30 class AudioClipView;
31 
32 class FadeView : public ViewItem
33 {
34 	Q_OBJECT
35 
36 	Q_CLASSINFO("bend", tr("Adjust Bend"))
37 	Q_CLASSINFO("strength", tr("Adjust Strength"))
38 	Q_CLASSINFO("select_fade_shape", tr("Select Preset"))
39 
40 public:
41 	FadeView(SheetView* sv, AudioClipView* parent, FadeCurve* fadeCuve);
42 	~FadeView();
43 
44 	void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
45 	int get_vector(int xstart, int pixelcount, float * arg);
46 	void calculate_bounding_rect();
47 	void set_holding(bool hold);
48 
get_fade()49 	FadeCurve* get_fade() const {return m_fadeCurve;}
50 
51 	void load_theme_data();
52 
53 private:
54 	FadeCurve*	m_fadeCurve;
55 	Curve*		m_guicurve;
56 	bool		m_holdactive;
57 
58 public slots:
59 	void state_changed();
60 
61 	Command* bend();
62 	Command* strength();
63 	Command* select_fade_shape();
64 // 	Command* edit_properties();
65 
66 signals :
67 	// emit from the gui so that we can stop following the playhead only
68 	// when the user manually edits, not on undo/redo
69 	void fadeModified();
70 };
71 
72 
73 #endif
74 
75 //eof
76 
77 
78