|
libpsynth 0.2.1
|
00001 00011 /* 00012 * Copyright (C) 2007, 2008, 2009 Juan Pedro BolĂvar Puente 00013 * 00014 * This file is part of Psychosynth. 00015 * 00016 * Psychosynth is free software: you can redistribute it and/or modify 00017 * it under the terms of the GNU General Public License as published by 00018 * the Free Software Foundation, either version 3 of the License, or 00019 * (at your option) any later version. 00020 * 00021 * Psychosynth is distributed in the hope that it will be useful, 00022 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00023 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00024 * GNU General Public License for more details. 00025 * 00026 * You should have received a copy of the GNU General Public License 00027 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00028 * 00029 */ 00030 00031 00032 #ifndef PSYNTH_DIRECTOR_H 00033 #define PSYNTH_DIRECTOR_H 00034 00035 #include <psynth/base/config.hpp> 00036 #include <psynth/base/util.hpp> 00037 #include <psynth/world/world.hpp> 00038 #include <psynth/app/output_director.hpp> 00039 #include <psynth/app/file_manager_director.hpp> 00040 00041 namespace psynth 00042 { 00043 00044 class director : private boost::noncopyable 00045 { 00046 typedef std::map<std::string, output_director_factory*> odf_map; 00047 odf_map m_outdir; 00048 00049 std::string m_old_output; 00050 file_manager_director m_filemgr; 00051 output_director* m_output; 00052 world* m_world; 00053 00054 base::conf_node* m_config; 00055 audio_info m_info; 00056 00057 void on_config_nudge (base::conf_node& node); 00058 00059 #if 0 00060 bool on_sample_rate_change (base::conf_node& node); 00061 bool on_block_size_change (base::conf_node& node); 00062 bool on_num_channels_change (base::conf_node& node); 00063 bool on_output_change (base::conf_node& node); 00064 #endif 00065 00066 void register_config(); 00067 void unregister_config(); 00068 00069 void start_output(); 00070 void stop_output(); 00071 void update_info(); 00072 00073 public: 00074 director() 00075 : m_output(NULL) 00076 , m_world(NULL) {} 00077 00078 ~director(); 00079 00080 void attach_output_director_factory (output_director_factory* fact); 00081 void start (base::conf_node& conf, const boost::filesystem::path& home_path); 00082 void stop (); 00083 00084 world* get_world () { 00085 return m_world; 00086 } 00087 00088 graph::audio_async_output_ptr get_output() { 00089 if (m_output) 00090 return m_output->get_output (); 00091 return {}; 00092 } 00093 }; 00094 00095 } /* namespace psynth */ 00096 00097 #endif /* PSYNTH_DIRECTOR_H */ 00098
1.7.4