1 //=========================================================
2 //  MusE
3 //  Linux Music Editor
4 //    $Id: crescendo.h,v 1.1.1.1 2011/05/05 18:51:04 flo93 Exp $
5 //  (C) Copyright 2011 Florian Jung (flo93@sourceforge.net)
6 //
7 //  This program is free software; you can redistribute it and/or
8 //  modify it under the terms of the GNU General Public License
9 //  as published by the Free Software Foundation; version 2 of
10 //  the License, or (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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20 //
21 //=========================================================
22 
23 #ifndef __CRESCENDO_H__
24 #define __CRESCENDO_H__
25 
26 #include "ui_crescendobase.h"
27 #include "function_dialog_base.h"
28 
29 
30 // Forward declarations:
31 namespace MusECore {
32 class Xml;
33 }
34 
35 namespace MusEGui {
36 
37 class Crescendo : public FunctionDialogBase, public Ui::CrescendoBase
38 {
39  	Q_OBJECT
40 
41 	protected slots:
42 		void pull_values();
43 
44 	public:
45 		Crescendo(QWidget* parent = 0);
46 
47 		static int _range;
48 		static int _parts;
49 		static int start_val;
50 		static int end_val;
51 		static bool absolute;
52 		static FunctionReturnDialogFlags_t _ret_flags;
53 		static FunctionDialogElements_t _elements;
54 
55 		static void setElements(FunctionDialogElements_t elements =
56 			FunctionLoopedButton | FunctionSelectedLoopedButton) { _elements = elements; }
57 
58 		static void read_configuration(MusECore::Xml& xml);
59 		void write_configuration(int level, MusECore::Xml& xml);
60 
61     void setupDialog();
62 
curRange()63     int curRange() const { return _range; }
setCurRange(int range)64     void setCurRange(int range) { _range = range; }
curParts()65     int curParts() const { return _parts; }
setCurParts(int parts)66     void setCurParts(int parts) { _parts = parts; }
setReturnFlags(FunctionReturnDialogFlags_t f)67     void setReturnFlags(FunctionReturnDialogFlags_t f) { _ret_flags = f; }
elements()68     FunctionDialogElements_t elements() const { return _elements; }
69 
70 	private slots:
71 		void absolute_changed(bool);
72 };
73 
74 } // namespace MusEGui
75 
76 #endif
77 
78