MuseScore  3.4
Music composition and notation
sparm_p.h
Go to the documentation of this file.
1 //=============================================================================
2 // MusE Score
3 // Linux Music Score Editor
4 //
5 // Copyright (C) 2010 Werner Schweer and others
6 //
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License version 2.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 //=============================================================================
19 
20 #ifndef __SPARM_P_H__
21 #define __SPARM_P_H__
22 
23 #include "sparm.h"
24 
25 //---------------------------------------------------------
26 // SParmId
27 //---------------------------------------------------------
28 
29 struct SParmId {
30  union {
31  struct {
32  unsigned syntiId:2;
33  unsigned subsystemId:4;
34  unsigned paramId:16;
35  };
36  unsigned val;
37  };
38  SParmId(int v) : val(v) {}
39  SParmId(int a, int b, int c) {
40  val = 0;
41  syntiId = a;
42  subsystemId = b;
43  paramId = c;
44  }
45  };
46 
47 enum {
48  FLUID_ID = 0,
50  };
51 
52 //---------------------------------------------------------
53 // SyntiParameterData
54 //---------------------------------------------------------
55 
56 class SyntiParameterData : public QSharedData {
57  protected:
58  int _id;
59  QString _name;
61  float _fval, _min, _max;
62  QString _sval;
63 
64  public:
66  virtual ~SyntiParameterData();
67  SyntiParameterData(const QString& name, float val);
68  SyntiParameterData(int id, const QString& name, float);
69  SyntiParameterData(const QString& name, const QString& val);
70  SyntiParameterData(int id, const QString& name, const QString& val);
72 
73  virtual void write(Ms::Xml&) const;
74  virtual bool operator==(const SyntiParameterData&) const;
75  virtual void print() const;
76 
77  friend class SyntiParameter;
78  };
79 
80 #endif
81 
QString _sval
Definition: sparm_p.h:62
Definition: sparm_p.h:49
SyntiParameterType
Definition: sparm.h:34
unsigned syntiId
Definition: sparm_p.h:32
unsigned subsystemId
Definition: sparm_p.h:33
float _min
Definition: sparm_p.h:61
SParmId(int v)
Definition: sparm_p.h:38
int _id
Definition: sparm_p.h:58
QString _name
Definition: sparm_p.h:59
Definition: sparm.h:42
Definition: sparm_p.h:29
Definition: sparm_p.h:48
SParmId(int a, int b, int c)
Definition: sparm_p.h:39
unsigned paramId
Definition: sparm_p.h:34
unsigned val
Definition: sparm_p.h:36
SyntiParameterType _type
Definition: sparm_p.h:60
Definition: sparm_p.h:56