1 //=========================================================
2 //  MusE
3 //  Linux Music Editor
4 //    $Id: gatetime.h,v 1.1.1.1.2.1 2008/01/19 13:33:47 wschweer Exp $
5 //  (C) Copyright 2001 Werner Schweer (ws@seh.de)
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 __GATETIME_H__
24 #define __GATETIME_H__
25 
26 #include "ui_gatetimebase.h"
27 #include "function_dialog_base.h"
28 
29 namespace MusECore {
30 class Xml;
31 }
32 
33 namespace MusEGui {
34 
35 //---------------------------------------------------------
36 //   GateTime
37 //---------------------------------------------------------
38 
39 class GateTime : public FunctionDialogBase, public Ui::GateTimeBase {
40  	Q_OBJECT
41 
42    protected slots:
43       void pull_values();
44 
45    public:
46       GateTime(QWidget* parent=0);
47 
48       static int _range;
49       static int _parts;
50       static int rateVal;
51       static int offsetVal;
52       static FunctionReturnDialogFlags_t _ret_flags;
53       static FunctionDialogElements_t _elements;
54 
55       static void setElements(FunctionDialogElements_t elements =
56         FunctionAllEventsButton | FunctionSelectedEventsButton |
57         FunctionLoopedButton | FunctionSelectedLoopedButton) { _elements = elements; }
58 
59       static void read_configuration(MusECore::Xml& xml);
60       void write_configuration(int level, MusECore::Xml& xml);
61 
62       void setupDialog();
63 
curRange()64       int curRange() const { return _range; }
setCurRange(int range)65       void setCurRange(int range) { _range = range; }
curParts()66       int curParts() const { return _parts; }
setCurParts(int parts)67       void setCurParts(int parts) { _parts = parts; }
setReturnFlags(FunctionReturnDialogFlags_t f)68       void setReturnFlags(FunctionReturnDialogFlags_t f) { _ret_flags = f; }
elements()69       FunctionDialogElements_t elements() const { return _elements; }
70       };
71 
72 } // namespace MusEGui
73 
74 #endif
75 
76