SpectMorph

lib/smmorphlinear.hh

00001 /*
00002  * Copyright (C) 2011 Stefan Westerfeld
00003  *
00004  * This library is free software; you can redistribute it and/or modify it
00005  * under the terms of the GNU Lesser General Public License as published by the
00006  * Free Software Foundation; either version 3 of the License, or (at your
00007  * option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful, but WITHOUT
00010  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00011  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
00012  * for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public License
00015  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016  */
00017 
00018 #ifndef SPECTMORPH_MORPH_LINEAR_HH
00019 #define SPECTMORPH_MORPH_LINEAR_HH
00020 
00021 #include "smmorphoperator.hh"
00022 
00023 #include <string>
00024 
00025 namespace SpectMorph
00026 {
00027 
00028 class MorphLinear : public MorphOperator
00029 {
00030 public:
00031   enum ControlType {
00032     CONTROL_GUI      = 1,
00033     CONTROL_SIGNAL_1 = 2,
00034     CONTROL_SIGNAL_2 = 3,
00035     CONTROL_OP       = 4
00036   };
00037 protected:
00038   std::string    load_left, load_right, load_control;
00039 
00040   MorphOperator *m_left_op;
00041   MorphOperator *m_right_op;
00042   MorphOperator *m_control_op;
00043   double         m_morphing;
00044   ControlType    m_control_type;
00045   bool           m_db_linear;
00046   bool           m_use_lpc;
00047 
00048 public:
00049   MorphLinear (MorphPlan *morph_plan);
00050   ~MorphLinear();
00051 
00052   // inherited from MorphOperator
00053   const char        *type();
00054   bool               save (OutFile& out_file);
00055   bool               load (InFile&  in_file);
00056   void               post_load();
00057   OutputType         output_type();
00058 
00059   MorphOperator *left_op();
00060   void set_left_op (MorphOperator *op);
00061 
00062   MorphOperator *right_op();
00063   void set_right_op (MorphOperator *op);
00064 
00065   MorphOperator *control_op();
00066   void set_control_op (MorphOperator *op);
00067 
00068   double morphing();
00069   void set_morphing (double new_morphing);
00070 
00071   ControlType control_type();
00072   void set_control_type (ControlType new_control_type);
00073 
00074   bool db_linear();
00075   void set_db_linear (bool new_db_linear);
00076 
00077   bool use_lpc();
00078   void set_use_lpc (bool new_use_lpc);
00079 
00080   void on_operator_removed (MorphOperator *op);
00081 };
00082 
00083 }
00084 
00085 #endif
 All Classes Functions Variables Enumerations Enumerator