SpectMorph
|
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_LFO_HH 00019 #define SPECTMORPH_MORPH_LFO_HH 00020 00021 #include "smmorphoperator.hh" 00022 00023 #include <string> 00024 00025 namespace SpectMorph 00026 { 00027 00028 class MorphLFO : public MorphOperator 00029 { 00030 public: 00031 enum WaveType { 00032 WAVE_SINE = 1, 00033 WAVE_TRIANGLE = 2, 00034 }; 00035 protected: 00036 WaveType m_wave_type; 00037 float m_frequency; 00038 float m_depth; 00039 float m_center; 00040 float m_start_phase; 00041 bool m_sync_voices; 00042 00043 public: 00044 MorphLFO (MorphPlan *morph_plan); 00045 ~MorphLFO(); 00046 00047 // inherited from MorphOperator 00048 const char *type(); 00049 bool save (OutFile& out_file); 00050 bool load (InFile& in_file); 00051 void post_load(); 00052 OutputType output_type(); 00053 00054 WaveType wave_type(); 00055 void set_wave_type (WaveType new_wave_type); 00056 00057 float frequency() const; 00058 void set_frequency (float new_frequency); 00059 00060 float depth() const; 00061 void set_depth (float new_depth); 00062 00063 float center() const; 00064 void set_center (float new_center); 00065 00066 float start_phase() const; 00067 void set_start_phase (float new_start_phase); 00068 00069 bool sync_voices() const; 00070 void set_sync_voices (float new_sync_voices); 00071 }; 00072 00073 } 00074 00075 #endif