SpectMorph
smmorphoperator.hh
1 // Licensed GNU LGPL v3 or later: http://www.gnu.org/licenses/lgpl.html
2 
3 #ifndef SPECTMORPH_MORPH_OPERATOR_HH
4 #define SPECTMORPH_MORPH_OPERATOR_HH
5 
6 #include "smoutfile.hh"
7 #include "sminfile.hh"
8 #include "smsignal.hh"
9 
10 #include <map>
11 
12 namespace SpectMorph
13 {
14 
15 class MorphOperatorView;
16 class MorphPlan;
17 
19 {
20 protected:
21  MorphPlan *m_morph_plan;
22  std::string m_name;
23  std::string m_id;
24  bool m_folded;
25 
26  typedef std::map<std::string, MorphOperator *> OpNameMap;
27 
28  void write_operator (OutFile& file, const std::string& name, MorphOperator *op);
29 
30 public:
31  enum OutputType {
32  OUTPUT_NONE,
33  OUTPUT_AUDIO,
34  OUTPUT_CONTROL
35  };
36  MorphOperator (MorphPlan *morph_plan);
37  virtual ~MorphOperator();
38 
39  virtual const char *type() = 0;
40  virtual int insert_order() = 0;
41  virtual bool save (OutFile& out_file) = 0;
42  virtual bool load (InFile& in_file) = 0;
43  virtual void post_load (OpNameMap& op_name_map);
44  virtual OutputType output_type() = 0;
45 
46  MorphPlan *morph_plan();
47 
48  std::string type_name();
49 
50  std::string name();
51  void set_name (const std::string& name);
52 
53  bool can_rename (const std::string& name);
54 
55  std::string id();
56  void set_id (const std::string& id);
57 
58  bool folded() const;
59  void set_folded (bool folded);
60 
61  static MorphOperator *create (const std::string& type, MorphPlan *plan);
62 };
63 
64 }
65 
66 #endif
Definition: smoutfile.hh:15
Definition: smmorphplan.hh:16
Class to read SpectMorph binary data.
Definition: sminfile.hh:25
Definition: smmorphoperator.hh:18
Definition: smadsrenvelope.hh:8
Definition: smsignal.hh:34