SpectMorph
smmorphwavsourcemodule.hh
1 // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl-2.1.html
2 
3 #ifndef SPECTMORPH_MORPH_WAV_SOURCE_MODULE_HH
4 #define SPECTMORPH_MORPH_WAV_SOURCE_MODULE_HH
5 
6 #include "smmorphoperatormodule.hh"
7 #include "smwavset.hh"
8 #include "smproject.hh"
9 #include "smmorphwavsource.hh"
10 #include <memory>
11 
12 namespace SpectMorph
13 {
14 
15 class MorphWavSourceModule;
16 
18 {
19  const MorphWavSource::Config *cfg = nullptr;
20 
21  class InstrumentSource : public LiveDecoderSource
22  {
23  Audio *active_audio = nullptr;
24  int object_id = 0;
25  Project *project = nullptr;
26  public:
27  MorphWavSourceModule *module = nullptr;
28 
29  void retrigger (int channel, float freq, int midi_velocity) override;
30  Audio *audio() override;
31  bool rt_audio_block (size_t index, RTAudioBlock& out_block) override;
32 
33  void update_project_and_object_id (Project *project, int object_id);
34  };
35 
36  InstrumentSource my_source;
37 
38 public:
41 
42  void set_config (const MorphOperatorConfig *op_cfg);
43  LiveDecoderSource *source();
44 };
45 
46 }
47 
48 #endif
Audio sample containing many blocks.
Definition: smaudio.hh:80
Definition: smlivedecodersource.hh:12
Definition: smmorphoperatormodule.hh:27
Definition: smmorphplanvoice.hh:16
Definition: smmorphwavsourcemodule.hh:18
Definition: smproject.hh:67
Definition: smrtmemory.hh:139
Definition: smmorphoperator.hh:18
Definition: smmorphwavsource.hh:27