3 #ifndef SPECTMORPH_MORPH_OPERATOR_HH
4 #define SPECTMORPH_MORPH_OPERATOR_HH
6 #include "smoutfile.hh"
9 #include "smproperty.hh"
22 class MorphOperatorView;
29 typedef std::map<std::string, MorphOperator *> OpNameMap;
36 std::map<std::string, std::unique_ptr<Property>> m_properties;
38 LogProperty *add_property_log (
float *value,
const std::string& identifier,
39 const std::string& label,
const std::string& value_label,
40 float def,
float mn,
float mx);
42 const std::string& label,
const std::string& value_label,
43 float def,
float mn,
float mx);
44 XParamProperty *add_property_xparam (
float *value,
const std::string& identifier,
45 const std::string& label,
const std::string& value_label,
46 float def,
float mn,
float mx,
float slope);
47 LinearProperty *add_property (
float *value,
const std::string& identifier,
48 const std::string& label,
const std::string& value_label,
49 float def,
float mn,
float mx);
51 const std::string& label,
const std::string& value_label,
52 float def,
float mn,
float mx);
53 IntProperty *add_property (
int *value,
const std::string& identifier,
54 const std::string& label,
const std::string& value_label,
55 int def,
int mn,
int mx);
56 IntVecProperty *add_property (
int *value,
const std::string& identifier,
57 const std::string& label,
const std::string& value_label,
58 int def,
const std::vector<int>& vec);
59 BoolProperty *add_property (
bool *value,
const std::string& identifier,
60 const std::string& label,
62 template<
typename Enum>
64 add_property_enum (Enum *value,
const std::string& identifier,
65 const std::string& label,
int def,
const EnumInfo& ei)
67 return add_property_enum (identifier, label, def, ei,
68 [value]() {
return *value; },
69 [value](
int new_value) { *value =
static_cast<Enum
> (new_value); });
73 add_property_enum (
const std::string& identifier,
74 const std::string& label,
int def,
const EnumInfo& ei,
75 std::function<
int()> read_func,
76 std::function<
void(
int)> write_func);
96 typedef uintptr_t PtrID;
101 virtual const char *type() = 0;
102 virtual int insert_order() = 0;
103 virtual bool save (
OutFile& out_file) = 0;
104 virtual bool load (
InFile& in_file) = 0;
105 virtual void post_load (OpNameMap& op_name_map);
106 virtual OutputType output_type() = 0;
107 virtual std::vector<MorphOperator *> dependencies();
110 void get_property_dependencies (std::vector<MorphOperator *>& deps,
const std::vector<std::string>& identifiers);
111 void register_property (
Property *property);
113 Property *property (
const std::string& identifier);
114 void write_properties (
OutFile& out_file);
115 bool read_property_event (
InFile& in_file);
116 void read_properties_post_load (OpNameMap& op_name_map);
120 std::string type_name();
123 void set_name (
const std::string& name);
125 bool can_rename (
const std::string& name);
128 void set_id (
const std::string&
id);
131 void set_folded (
bool folded);
151 operator bool()
const {
return m_ptr !=
nullptr; };
157 return MorphOperator::PtrID (m_ptr);
Definition: smproperty.hh:247
Definition: smproperty.hh:298
Definition: smproperty.hh:320
Class to read SpectMorph binary data.
Definition: sminfile.hh:27
Definition: smproperty.hh:97
Definition: smproperty.hh:167
Definition: smproperty.hh:524
Definition: smproperty.hh:496
Definition: smmodulationlist.hh:17
Definition: smmorphoperator.hh:147
Definition: smmorphoperator.hh:27
Definition: smmorphplan.hh:18
Definition: smoutfile.hh:19
Definition: smproperty.hh:25
Definition: smsignal.hh:35
Definition: smproperty.hh:551
Definition: smmorphoperator.hh:18