3 #ifndef SPECTMORPH_PROJECT_HH
4 #define SPECTMORPH_PROJECT_HH
6 #include "sminstrument.hh"
8 #include "smwavsetbuilder.hh"
9 #include "smbuilderthread.hh"
10 #include "smmorphplan.hh"
11 #include "smuserinstrumentindex.hh"
12 #include "smnotifybuffer.hh"
27 virtual void run_rt (
Project *project) = 0;
36 std::function<void(
Project *)> func;
37 std::function<void()> free_func;
40 const std::function<
void()>& free_func) :
58 std::vector<std::unique_ptr<SynthControlEvent>> events;
63 void destroy_all_events();
69 enum class StorageModel {
74 static constexpr
size_t WAV_SETS_RESERVE = 256;
76 std::vector<std::unique_ptr<WavSet>> wav_sets;
78 std::unique_ptr<MidiSynth> m_midi_synth;
79 double m_mix_freq = 0;
82 std::vector<unsigned char> m_last_plan_data;
83 bool m_state_changed_notify =
false;
84 StorageModel m_storage_model = StorageModel::COPY;
86 std::mutex m_synth_mutex;
89 bool m_state_changed =
false;
91 std::unique_ptr<SynthInterface> m_synth_interface;
96 std::map<int, std::unique_ptr<Instrument>> instrument_map;
98 std::vector<MorphWavSource *> list_wav_sources();
103 void on_plan_changed();
113 void add_rebuild_result (
int object_id, std::unique_ptr<WavSet>& wav_set);
114 void clear_wav_sets (std::vector<std::unique_ptr<WavSet>>& wav_sets);
115 bool rebuild_active (
int object_id);
117 WavSet *get_wav_set (
int object_id);
135 return m_synth_mutex;
137 bool try_update_synth();
138 void set_mix_freq (
double mix_freq);
139 void set_storage_model (StorageModel model);
140 void set_state_changed_notify (
bool notify);
141 void state_changed();
143 void set_volume (
double new_volume);
144 double volume()
const;
152 Error save (
const std::string& filename);
154 Error load (
const std::string& filename);
158 std::string save_plan_lv2 (std::function<std::string(std::string)> abstract_path);
159 void load_plan_lv2 (std::function<std::string(std::string)> absolute_path,
const std::string& plan);
160 void clear_lv2_filenames();
Definition: smbuilderthread.hh:19
Definition: smproject.hh:57
Definition: smutils.hh:102
Generic Input Stream.
Definition: smgenericin.hh:18
Definition: sminstrument.hh:83
Definition: smmidisynth.hh:27
Definition: smmorphoperator.hh:27
Definition: smmorphplan.hh:18
Definition: smmorphwavsource.hh:20
Definition: smnotifybuffer.hh:29
Definition: smproject.hh:67
Definition: smsignal.hh:35
Definition: smproject.hh:25
Definition: smsynthinterface.hh:14
Definition: smuserinstrumentindex.hh:12
Definition: smwavset.hh:29
Definition: smproject.hh:35