libpsynth 0.2.1
/home/raskolnikov/dev/psynth/trunk/src/psynth/sound/surround.hpp
Go to the documentation of this file.
00001 
00011 /*
00012  *  Copyright (C) 2010 Juan Pedro Bolivar 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_SOUND_SURROUND_H
00032 #define PSYNTH_SOUND_SURROUND_H
00033 
00034 #include <cstddef>
00035 #include <boost/mpl/contains.hpp>
00036 
00037 #include <psynth/base/compat.hpp>
00038 #include <psynth/sound/quad.hpp>
00039 
00040 namespace psynth
00041 {
00042 namespace sound
00043 {
00044 
00049 struct center_channel {};    
00050 
00051 typedef boost::mpl::vector5<
00052     left_channel, right_channel,
00053     center_channel,
00054     back_right_channel, back_left_channel> surround_space;
00055 
00057 typedef layout<surround_space> surround_layout;
00058 
00063 template <typename IC> inline
00064 typename type_from_iterator<planar_frame_iterator<IC, surround_space> >::range
00065 planar_surround_range (std::size_t size, IC l, IC r, IC c, IC bl, IC br)
00066 {
00067     typedef typename type_from_iterator<
00068         planar_frame_iterator<IC, surround_space> >::range RRange;
00069     return RRange (size, planar_frame_iterator<IC, surround_space>(
00070                       l, r, c, bl, br));
00071 }
00072 
00073 } /* namespace sound */
00074 } /* namespace psynth */
00075 
00076 #endif /* PSYNTH_SOUND_SURROUND */