1 // Licensed GNU LGPL v3 or later: http://www.gnu.org/licenses/lgpl.html
2 
3 #ifndef SPECTMORPH_MORPH_LINEAR_HH
4 #define SPECTMORPH_MORPH_LINEAR_HH
5 
6 #include "smmorphoperator.hh"
7 
8 #include <string>
9 
10 namespace SpectMorph
11 {
12 
13 class MorphLinear : public MorphOperator
14 {
15 protected:
16   std::string    load_left, load_right, load_control;
17 
18   MorphOperator *m_left_op;
19   std::string    m_left_smset;
20   MorphOperator *m_right_op;
21   std::string    m_right_smset;
22   MorphOperator *m_control_op;
23   double         m_morphing;
24   ControlType    m_control_type;
25   bool           m_db_linear;
26 
27 public:
28   MorphLinear (MorphPlan *morph_plan);
29   ~MorphLinear();
30 
31   // inherited from MorphOperator
32   const char        *type() override;
33   int                insert_order() override;
34   bool               save (OutFile& out_file) override;
35   bool               load (InFile&  in_file) override;
36   void               post_load (OpNameMap& op_name_map) override;
37   OutputType         output_type() override;
38 
39   std::vector<MorphOperator *> dependencies() override;
40 
41   MorphOperator *left_op();
42   void set_left_op (MorphOperator *op);
43 
44   std::string left_smset();
45   void set_left_smset (const std::string& smset);
46 
47   MorphOperator *right_op();
48   void set_right_op (MorphOperator *op);
49 
50   std::string right_smset();
51   void set_right_smset (const std::string& smset);
52 
53   MorphOperator *control_op();
54   void set_control_op (MorphOperator *op);
55 
56   void set_control_type_and_op (ControlType control_type, MorphOperator *op);
57 
58   double morphing();
59   void set_morphing (double new_morphing);
60 
61   ControlType control_type();
62   void set_control_type (ControlType new_control_type);
63 
64   bool db_linear();
65   void set_db_linear (bool new_db_linear);
66 
67 /* slots: */
68   void on_operator_removed (MorphOperator *op);
69 };
70 
71 }
72 
73 #endif
74