MuseScore  3.4
Music composition and notation
channel.h
Go to the documentation of this file.
1 //=============================================================================
2 // Zerberus
3 // Zample player
4 //
5 // Copyright (C) 2013 Werner Schweer
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 // as published by the Free Software Foundation and appearing in
10 // the file LICENCE.GPL
11 //=============================================================================
12 
13 #ifndef __MCHANNEL_H__
14 #define __MCHANNEL_H__
15 
16 class Zerberus;
17 class ZInstrument;
18 
19 //---------------------------------------------------------
20 // Channel
21 //---------------------------------------------------------
22 
23 class Channel {
26  float _gain;
27  float _panLeftGain;
29  float _midiVolume;
30  char ctrl[128];
31 
32  int _idx; // channel index
33 #if 0 // yet (?) unused
34  int _sustain;
35 #endif
36 
37  public:
38  Channel(Zerberus*, int idx);
39 
40  void pitchBend(int);
41  void controller(int ctrl, int val);
42  ZInstrument* instrument() const { return _instrument; }
43  void setInstrument(ZInstrument* i) { _instrument = i; resetCC(); }
44  Zerberus* msynth() const { return _msynth; }
45  int sustain() const;
46  float gain() const { return _gain * _midiVolume; }
47  float panLeftGain() const { return _panLeftGain; }
48  float panRightGain() const { return _panRightGain; }
49  int idx() const { return _idx; }
50  int getCtrl(int CTRL) const;
51  void resetCC();
52  };
53 
54 
55 #endif
56 
Definition: instrument.h:30
void pitchBend(int)
Definition: channel.cpp:43
float panRightGain() const
Definition: channel.h:48
int sustain() const
Definition: channel.cpp:107
Zerberus * _msynth
Definition: channel.h:24
float _panLeftGain
Definition: channel.h:27
void resetCC()
Definition: channel.cpp:118
ZInstrument * instrument() const
Definition: channel.h:42
void setInstrument(ZInstrument *i)
Definition: channel.h:43
Definition: zerberus.h:75
void controller(int ctrl, int val)
Definition: channel.cpp:52
float gain() const
Definition: channel.h:46
int idx() const
Definition: channel.h:49
float _panRightGain
Definition: channel.h:28
float _gain
Definition: channel.h:26
float _midiVolume
Definition: channel.h:29
char ctrl[128]
Definition: channel.h:30
int getCtrl(int CTRL) const
Definition: channel.cpp:112
float panLeftGain() const
Definition: channel.h:47
int _idx
Definition: channel.h:32
ZInstrument * _instrument
Definition: channel.h:25
Zerberus * msynth() const
Definition: channel.h:44
Channel(Zerberus *, int idx)
Definition: channel.cpp:26
Definition: channel.h:23