1 //=========================================================
2 //  MusE
3 //  Linux Music Editor
4 //    $Id: legato.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 __LEGATO_H__
24 #define __LEGATO_H__
25 
26 #include "ui_legatobase.h"
27 #include "function_dialog_base.h"
28 
29 namespace MusECore {
30 class Xml;
31 }
32 
33 namespace MusEGui {
34 
35 class Legato : public FunctionDialogBase, public Ui::LegatoBase
36 {
37  	Q_OBJECT
38 
39 	protected slots:
40 		void pull_values();
41 
42 	public:
43 		Legato(QWidget* parent = 0);
44 
45 		static int _range;
46 		static int _parts;
47 		static int min_len;
48 		static bool allow_shortening;
49 		static FunctionReturnDialogFlags_t _ret_flags;
50 		static FunctionDialogElements_t _elements;
51 
52 		static void setElements(FunctionDialogElements_t elements =
53 			FunctionAllEventsButton | FunctionSelectedEventsButton |
54 			FunctionLoopedButton | FunctionSelectedLoopedButton) { _elements = elements; }
55 
56 		static void read_configuration(MusECore::Xml& xml);
57 		void write_configuration(int level, MusECore::Xml& xml);
58 
59     void setupDialog();
60 
curRange()61     int curRange() const { return _range; }
setCurRange(int range)62     void setCurRange(int range) { _range = range; }
curParts()63     int curParts() const { return _parts; }
setCurParts(int parts)64     void setCurParts(int parts) { _parts = parts; }
setReturnFlags(FunctionReturnDialogFlags_t f)65     void setReturnFlags(FunctionReturnDialogFlags_t f) { _ret_flags = f; }
elements()66     FunctionDialogElements_t elements() const { return _elements; }
67 };
68 
69 } // namespace MusEGui
70 
71 #endif
72 
73