libpsynth 0.2.1
/home/raskolnikov/dev/psynth/trunk/src/psynth/new_graph/core/mixer.hpp
Go to the documentation of this file.
00001 
00011 /*
00012  *  Copyright (C) 2011 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 #ifndef PSYNTH_GRAPH_CORE_MIXER_HPP_
00032 #define PSYNTH_GRAPH_CORE_MIXER_HPP_
00033 
00034 #include <psynth/new_graph/node.hpp>
00035 #include <psynth/new_graph/control.hpp>
00036 #include <psynth/new_graph/soft_buffer_port.hpp>
00037 
00038 namespace psynth
00039 {
00040 namespace graph
00041 {
00042 namespace core
00043 {
00044 
00045 template <class Buffer>
00046 class mixer : public node
00047 {
00048 public:
00049     mixer ();
00050     
00051 protected:
00052     void rt_do_process (rt_process_context& ctx);
00053 
00054     typedef soft_buffer_in_port<Buffer> in_port_type;
00055     typedef std::shared_ptr<in_port_type> in_port_ptr;
00056     typedef buffer_out_port<Buffer> out_port_type;
00057     typedef std::vector <in_port_ptr> in_port_vector;
00058 
00059     soft_sample_in_port _in_modulator;
00060     in_port_vector _in_inputs; 
00061     out_port_type _out_output;
00062 
00063     in_control<float> _ctl_gain;
00064     in_control<int>   _ctl_inputs;
00065 };
00066 
00067 typedef mixer<audio_buffer> audio_mixer;
00068 typedef mixer<sample_buffer> sample_mixer;
00069 
00070 } /* namespace core */
00071 } /* namespace graph */
00072 } /* namespace psynth */
00073 
00074 #endif /* PSYNTH_GRAPH_CORE_MIXER_HPP_ */
00075