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 
9 #include <map>
10 
11 #include <QObject>
12 
13 namespace SpectMorph
14 {
15 
16 class MorphOperatorView;
17 class MorphPlan;
18 
19 class MorphOperator : public QObject
20 {
21  Q_OBJECT
22 protected:
23  MorphPlan *m_morph_plan;
24  std::string m_name;
25  std::string m_id;
26 
27  typedef std::map<std::string, MorphOperator *> OpNameMap;
28 
29  void write_operator (OutFile& file, const std::string& name, MorphOperator *op);
30 
31 public:
32  enum OutputType {
33  OUTPUT_NONE,
34  OUTPUT_AUDIO,
35  OUTPUT_CONTROL
36  };
37  MorphOperator (MorphPlan *morph_plan);
38  virtual ~MorphOperator();
39 
40  virtual const char *type() = 0;
41  virtual int insert_order() = 0;
42  virtual bool save (OutFile& out_file) = 0;
43  virtual bool load (InFile& in_file) = 0;
44  virtual void post_load (OpNameMap& op_name_map);
45  virtual OutputType output_type() = 0;
46 
47  MorphPlan *morph_plan();
48 
49  std::string type_name();
50 
51  std::string name();
52  void set_name (const std::string& name);
53 
54  bool can_rename (const std::string& name);
55 
56  std::string id();
57  void set_id (const std::string& id);
58 
59  static MorphOperator *create (const std::string& type, MorphPlan *plan);
60 };
61 
62 }
63 
64 #endif
Definition: smoutfile.hh:15
Definition: smmorphplan.hh:14
Class to read SpectMorph binary data.
Definition: sminfile.hh:25
Definition: smmorphoperator.hh:19
Definition: smaudio.hh:15