summaryrefslogtreecommitdiff
path: root/muse2/muse/mplugins/midiitransform.h
blob: 30dabd13c5ab95d03faed4141089b13ecd22bae7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
//=========================================================
//  MusE
//  Linux Music Editor
//  $Id: midiitransform.h,v 1.1.1.1.2.1 2009/02/02 21:38:01 terminator356 Exp $
//
//  (C) Copyright 2001 Werner Schweer (ws@seh.de)
//
//  This program is free software; you can redistribute it and/or
//  modify it under the terms of the GNU General Public License
//  as published by the Free Software Foundation; version 2 of
//  the License, or (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
//
//=========================================================

#ifndef __MIDIITRANSFORM_H__
#define __MIDIITRANSFORM_H__

#include "ui_itransformbase.h"

#include <QCloseEvent>
#include "type_defs.h"

class QButtonGroup;
class Xml;

#include "miditransform.h"

namespace MusECore {
class MidiInputTransformation;
class MidiPart;
class MidiRecordEvent;
class MidiTransformation;

enum InputTransformProcEventOp { KeepType, FixType };

extern void writeMidiInputTransforms(int level, Xml& xml);
extern void readMidiInputTransform(Xml&);
extern bool applyMidiInputTransformation(MidiRecordEvent& event);
extern void clearMidiInputTransforms();
}

namespace MusEGui {

//---------------------------------------------------------
//   MidiInputTransform
//---------------------------------------------------------

class MidiInputTransformDialog : public QDialog, public Ui::MidiInputTransformDialogBase {
      Q_OBJECT
      MusECore::MidiInputTransformation* cmt;
      int cindex;                   // current index in preset list
      int cmodul;                   // current index in modules list

      virtual void accept();
      virtual void reject();
      void setValOp(QWidget* a, QWidget* b, MusECore::ValOp op);
      virtual void closeEvent(QCloseEvent*);
      
      void updatePresetList();
      QButtonGroup* modulGroup;
      
   signals:
      void hideWindow();

   private slots:
      void presetNew();
      void presetDelete();

      void changeModul(int k);
      void selEventOpSel(int);
      void selTypeSel(int);
      void selVal1OpSel(int);
      void selVal2OpSel(int);
      void procEventOpSel(int);
      void procEventTypeSel(int);
      void procVal1OpSel(int);
      void procVal2OpSel(int);
      void funcOpSel(int);
      void presetChanged(QListWidgetItem*);
      void nameChanged(const QString&);
      void commentChanged();
      void selVal1aChanged(int);
      void selVal1bChanged(int);
      void selVal2aChanged(int);
      void selVal2bChanged(int);
      void procVal1aChanged(int);
      void procVal1bChanged(int);
      void procVal2aChanged(int);
      void procVal2bChanged(int);
      void modul1enableChanged(bool);
      void modul2enableChanged(bool);
      void modul3enableChanged(bool);
      void modul4enableChanged(bool);

      void selPortOpSel(int);
      void selPortValaChanged(int);
      void selPortValbChanged(int);
      void selChannelOpSel(int);
      void selChannelValaChanged(int);
      void selChannelValbChanged(int);
      void procPortOpSel(int);
      void procPortValaChanged(int);
      void procPortValbChanged(int);
      void procChannelOpSel(int);
      void procChannelValaChanged(int);
      void procChannelValbChanged(int);

   public slots:
      void songChanged(MusECore::SongChangedFlags_t);

   public:
      MidiInputTransformDialog(QDialog* parent = 0, Qt::WFlags fl = 0);
      };

} // namespace MusEGui

#endif