SpectMorph
smmorphplan.hh
1 // Licensed GNU LGPL v3 or later: http://www.gnu.org/licenses/lgpl.html
2 
3 #ifndef SPECTMORPH_MORPH_PLAN_HH
4 #define SPECTMORPH_MORPH_PLAN_HH
5 
6 #include "smindex.hh"
7 #include "smmorphoperator.hh"
8 #include "smobject.hh"
9 #include "smaudio.hh"
10 
11 namespace SpectMorph
12 {
13 
14 class MorphPlan : public Object
15 {
16  Q_OBJECT
17  Index m_index;
18  std::vector<MorphOperator *> m_operators;
19  int m_structure_version;
20 
21  std::string index_filename;
22  bool in_restore;
23 
24 public:
25  MorphPlan();
26  ~MorphPlan();
27 
28  bool load_index (const std::string& filename);
29  const Index *index();
30 
31  enum AddPos {
32  ADD_POS_AUTO,
33  ADD_POS_END
34  };
35 
36  void add_operator (MorphOperator *op, AddPos = ADD_POS_END, const std::string& name = "", const std::string& id = "");
37  const std::vector<MorphOperator *>& operators();
38  void remove (MorphOperator *op);
39  void move (MorphOperator *op, MorphOperator *op_next);
40 
41  void set_plan_str (const std::string& plan_str);
42  void emit_plan_changed();
43  void emit_index_changed();
44 
45  Bse::Error save (GenericOut *file);
46  Bse::Error load (GenericIn *in);
47  void clear();
48 
49  int structure_version();
50 
51  static std::string id_chars();
52  static std::string generate_id();
53 
54 signals:
55  void plan_changed();
56  void index_changed();
57  void operator_removed (MorphOperator *op);
58 };
59 
61 
62 }
63 
64 #endif
Generic Input Stream.
Definition: smgenericin.hh:17
Bse::Error load(GenericIn *in)
Definition: smmorphplan.cc:153
Definition: smmorphplan.hh:14
void clear()
Definition: smmorphplan.cc:41
const std::vector< MorphOperator * > & operators()
Definition: smmorphplan.cc:291
Definition: smmorphoperator.hh:19
Definition: smindex.hh:12
Definition: smaudio.hh:15
Generic Output Stream.
Definition: smgenericout.hh:17
Definition: smobject.hh:12
bool load_index(const std::string &filename)
Definition: smmorphplan.cc:65