synthclone  0.3.0
zone.h
Go to the documentation of this file.
1 /*
2  * libsynthclone - a plugin API for `synthclone`
3  * Copyright (C) 2011 Devin Anderson
4  *
5  * This library is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU Lesser General Public License as published by the
7  * Free Software Foundation; either version 2.1 of the License, or (at your
8  * option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13  * for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this library; if not, write to the Free Software Foundation,
17  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
20 #ifndef __SYNTHCLONE_ZONE_H__
21 #define __SYNTHCLONE_ZONE_H__
22 
23 #include <QtCore/QMap>
24 
25 #include <synthclone/sample.h>
26 #include <synthclone/types.h>
27 
28 namespace synthclone {
29 
37  class Zone: public QObject {
38 
39  Q_OBJECT
40 
41  public:
42 
43  typedef QMap<MIDIData, MIDIData> ControlMap;
44 
85  enum Status {
94  };
95 
106  virtual MIDIData
107  getAftertouch() const = 0;
108 
118  virtual MIDIData
119  getChannel() const = 0;
120 
131  virtual MIDIData
132  getChannelPressure() const = 0;
133 
142  virtual const ControlMap &
143  getControlMap() const = 0;
144 
157  virtual MIDIData
158  getControlValue(MIDIData control) const = 0;
159 
168  virtual const Sample *
169  getDrySample() const = 0;
170 
179  virtual MIDIData
180  getNote() const = 0;
181 
192  virtual SampleTime
193  getReleaseTime() const = 0;
194 
203  virtual SampleTime
204  getSampleTime() const = 0;
205 
215  virtual Status
216  getStatus() const = 0;
217 
228  virtual MIDIData
229  getVelocity() const = 0;
230 
240  virtual const Sample *
241  getWetSample() const = 0;
242 
253  virtual bool
254  isDrySampleStale() const = 0;
255 
266  virtual bool
267  isWetSampleStale() const = 0;
268 
269  public slots:
270 
283  virtual void
284  setAftertouch(synthclone::MIDIData aftertouch) = 0;
285 
296  virtual void
297  setChannel(synthclone::MIDIData channel) = 0;
298 
310  virtual void
312 
327  virtual void
329  synthclone::MIDIData value) = 0;
330 
343  virtual void
344  setDrySample(synthclone::Sample *sample) = 0;
345 
356  virtual void
357  setNote(synthclone::MIDIData note) = 0;
358 
369  virtual void
370  setReleaseTime(SampleTime releaseTime) = 0;
371 
382  virtual void
383  setSampleTime(SampleTime sampleTime) = 0;
384 
395  virtual void
396  setVelocity(synthclone::MIDIData velocity) = 0;
397 
405  virtual void
406  setWetSampleStale() = 0;
407 
408  signals:
409 
417  void
419 
427  void
429 
437  void
439 
450  void
452  synthclone::MIDIData value);
453 
462  void
463  drySampleChanged(const synthclone::Sample *drySample);
464 
472  void
473  drySampleStaleChanged(bool stale);
474 
482  void
484 
492  void
494 
502  void
504 
512  void
514 
522  void
524 
533  void
534  wetSampleChanged(const synthclone::Sample *wetSample);
535 
543  void
544  wetSampleStaleChanged(bool stale);
545 
546  protected:
547 
556  explicit
557  Zone(QObject *parent=0);
558 
564  virtual
565  ~Zone();
566 
567  };
568 
569 }
570 
571 #endif
void controlValueChanged(synthclone::MIDIData control, synthclone::MIDIData value)
Emitted when a MIDI control value is changed.
void noteChanged(synthclone::MIDIData note)
Emitted when the MIDI note is changed.
virtual bool isWetSampleStale() const =0
Gets a flag indicating whether or not the wet Sample is stale.
virtual SampleTime getReleaseTime() const =0
Gets the release time.
void wetSampleChanged(const synthclone::Sample *wetSample)
Emitted when the wet Sample is changed.
void drySampleStaleChanged(bool stale)
Emitted when the dry Sample is (un)marked as stale.
virtual void setChannel(synthclone::MIDIData channel)=0
Sets the MIDI channel.
virtual void setReleaseTime(SampleTime releaseTime)=0
Sets the release time.
Status
A zone&#39;s status indicates whether or not the zone is being used within the session.
Definition: zone.h:85
void drySampleChanged(const synthclone::Sample *drySample)
Emitted when the dry Sample is changed.
virtual void setVelocity(synthclone::MIDIData velocity)=0
Sets the MIDI velocity.
virtual const Sample * getDrySample() const =0
Gets the dry Sample object, which has been retrieved from a Sampler.
virtual void setSampleTime(SampleTime sampleTime)=0
Sets the sample time.
Definition: component.h:26
void channelChanged(synthclone::MIDIData channel)
Emitted when the MIDI channel is changed.
virtual void setDrySample(synthclone::Sample *sample)=0
Sets the dry Sample.
void sampleTimeChanged(synthclone::SampleTime sampleTime)
Emitted when the sample time is changed.
virtual MIDIData getAftertouch() const =0
Gets the MIDI polyphonic aftertouch value.
void releaseTimeChanged(synthclone::SampleTime releaseTime)
Emitted when the release time is changed.
void channelPressureChanged(synthclone::MIDIData pressure)
Emitted when the MIDI channel pressure value is changed.
virtual void setAftertouch(synthclone::MIDIData aftertouch)=0
Sets the MIDI polyphonic aftertouch value.
float SampleTime
Holds a sample time (in seconds).
Definition: types.h:129
virtual MIDIData getControlValue(MIDIData control) const =0
Returns the MIDI value for a control.
virtual void setNote(synthclone::MIDIData note)=0
Sets the MIDI note.
void velocityChanged(synthclone::MIDIData velocity)
Emitted when the MIDI velocity is changed.
virtual Status getStatus() const =0
Gets the Zone object&#39;s Zone::Status.
Zone objects contains data about how Sample objects should be acquired from a Sampler.
Definition: zone.h:37
virtual void setControlValue(synthclone::MIDIData control, synthclone::MIDIData value)=0
Sets a MIDI control value.
virtual void setWetSampleStale()=0
Used to indicate that the wet Sample is now stale.
virtual SampleTime getSampleTime() const =0
Gets the sample time.
virtual MIDIData getVelocity() const =0
Gets the MIDI velocity.
Definition: zone.h:86
quint8 MIDIData
Holds a byte of MIDI data.
Definition: types.h:59
virtual void setChannelPressure(synthclone::MIDIData pressure)=0
Sets the MIDI channel pressure value.
QMap< MIDIData, MIDIData > ControlMap
Definition: zone.h:43
Contains sample data.
Definition: sample.h:37
virtual bool isDrySampleStale() const =0
Gets a flag indicating whether or not this Zone object&#39;s dry Sample is stale.
virtual MIDIData getNote() const =0
Gets the MIDI note value.
virtual ~Zone()
Destroys a Zone object.
virtual MIDIData getChannel() const =0
Gets the MIDI channel.
void wetSampleStaleChanged(bool stale)
Emitted when the wet Sample is (un)marked as stale.
Zone(QObject *parent=0)
Constructs a new Zone object.
virtual const Sample * getWetSample() const =0
Gets the wet Sample object, which is the result of applying registered Effect objects to the dry samp...
void statusChanged(synthclone::Zone::Status status)
Emitted when a zone&#39;s status is changed.
virtual const ControlMap & getControlMap() const =0
Gets the internal control map containing all of the current control values.
virtual MIDIData getChannelPressure() const =0
Gets the MIDI channel pressure value.
void aftertouchChanged(synthclone::MIDIData aftertouch)
Emitted when the MIDI polyphonic aftertouch value is changed.