~ubuntu-branches/ubuntu/feisty/muse/feisty

« back to all changes in this revision

Viewing changes to synti/vam/vamgui.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Kobras
  • Date: 2002-04-23 17:28:23 UTC
  • Revision ID: james.westby@ubuntu.com-20020423172823-w8yplzr81a759xa3
Tags: upstream-0.5.2
Import upstream version 0.5.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//=========================================================
 
2
//  MusE
 
3
//  Linux Music Editor
 
4
//  vamgui.h
 
5
//
 
6
//  (C) Copyright 2002 Jotsif Lindman H�rnlund (jotsif@linux.nu)
 
7
//
 
8
// This program is free software; you can redistribute it and/or
 
9
// modify it under the terms of the GNU General Public License
 
10
// as published by the Free Software Foundation; either version 2
 
11
// of the License, or (at your option) any later version.
 
12
//
 
13
// This program is distributed in the hope that it will be useful,
 
14
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
// GNU General Public License for more details.
 
17
//
 
18
// You should have received a copy of the GNU General Public License
 
19
// along with this program; if not, write to the Free Software
 
20
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
21
// 02111-1307, USA or point your web browser to http://www.gnu.org.
 
22
//=========================================================
 
23
 
 
24
#ifndef __VAMGUI_H
 
25
#define __VAMGUI_H
 
26
 
 
27
#include "vamguibase.h"
 
28
#include "driver/midirawin.h"
 
29
#include "vam.h"
 
30
 
 
31
class QLineEdit;
 
32
class MidiDecoder;
 
33
class QListBoxItem;
 
34
class Preset;
 
35
class QString;
 
36
class QSignalMapper;
 
37
 
 
38
struct SynthGuiCtrl  {
 
39
      enum EditorType { SLIDER, COMBOBOX, SWITCH };
 
40
      QWidget* editor;
 
41
      QWidget* label;
 
42
      EditorType type;
 
43
      SynthGuiCtrl() {}
 
44
      SynthGuiCtrl(QWidget* w, QWidget* l, const EditorType t)
 
45
         : editor(w), label(l), type(t) {}
 
46
         
 
47
      };
 
48
 
 
49
//---------------------------------------------------------
 
50
//   VAMGui
 
51
//---------------------------------------------------------
 
52
 
 
53
class VAMGui : public VAMGuiBase, public MidiRawIn {
 
54
      QSignalMapper* map;
 
55
      int ctrlHi;
 
56
      int ctrlLo;
 
57
      int dataHi;
 
58
      int dataLo;
 
59
      SynthGuiCtrl dctrl[NUM_CONTROLLER];
 
60
      QString * presetFileName;
 
61
 
 
62
      Q_OBJECT
 
63
      void sendControllerChange(int ctrl, int val);
 
64
      void initParameter();
 
65
      void setParam(int, int);
 
66
      void setPreset(Preset* preset);
 
67
      void addNewPreset(const QString&);
 
68
      void deleteNamedPreset(const QString&);
 
69
      void activatePreset(Preset* preset);
 
70
 
 
71
   private slots:
 
72
      void closeEvent(QCloseEvent*);
 
73
      void readStdin(int);
 
74
      void ctrlChanged(int idx);
 
75
 
 
76
      void presetClicked(QListBoxItem*);
 
77
      void setPreset();
 
78
      void loadPresetsPressed();
 
79
      void savePresetsPressed();
 
80
      void deletePresetPressed();
 
81
      void doSavePresets(const QString&, bool);
 
82
      void savePresetsToFilePressed();
 
83
 
 
84
   protected:
 
85
      virtual void sysexReceived(const unsigned char*, int);
 
86
      virtual void eventReceived(int, int, int);
 
87
 
 
88
   public:
 
89
      VAMGui();
 
90
      };
 
91
 
 
92
#endif /* __VAMGUI_H */
 
93
 
 
94