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  bool m_folded;
27 
28  typedef std::map<std::string, MorphOperator *> OpNameMap;
29 
30  void write_operator (OutFile& file, const std::string& name, MorphOperator *op);
31 
32 public:
33  enum OutputType {
34  OUTPUT_NONE,
35  OUTPUT_AUDIO,
36  OUTPUT_CONTROL
37  };
38  MorphOperator (MorphPlan *morph_plan);
39  virtual ~MorphOperator();
40 
41  virtual const char *type() = 0;
42  virtual int insert_order() = 0;
43  virtual bool save (OutFile& out_file) = 0;
44  virtual bool load (InFile& in_file) = 0;
45  virtual void post_load (OpNameMap& op_name_map);
46  virtual OutputType output_type() = 0;
47 
48  MorphPlan *morph_plan();
49 
50  std::string type_name();
51 
52  std::string name();
53  void set_name (const std::string& name);
54 
55  bool can_rename (const std::string& name);
56 
57  std::string id();
58  void set_id (const std::string& id);
59 
60  bool folded() const;
61  void set_folded (bool folded);
62 
63  static MorphOperator *create (const std::string& type, MorphPlan *plan);
64 };
65 
66 }
67 
68 #endif
Definition: smoutfile.hh:15
Definition: smmorphplan.hh:15
Class to read SpectMorph binary data.
Definition: sminfile.hh:25
Definition: smmorphoperator.hh:19
Definition: smalignedarray.cc:7