libpsynth 0.2.1
/home/raskolnikov/dev/psynth/trunk/src/psynth/synth/audio_info.hpp
Go to the documentation of this file.
00001 /***************************************************************************
00002  *                                                                         *
00003  *   PSYCHOSYNTH                                                           *
00004  *   ===========                                                           *
00005  *                                                                         *
00006  *   Copyright (C) 2007 Juan Pedro Bolivar Puente                          *
00007  *                                                                         *
00008  *   This program is free software: you can redistribute it and/or modify  *
00009  *   it under the terms of the GNU General Public License as published by  *
00010  *   the Free Software Foundation, either version 3 of the License, or     *
00011  *   (at your option) any later version.                                   *
00012  *                                                                         *
00013  *   This program is distributed in the hope that it will be useful,       *
00014  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00015  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00016  *   GNU General Public License for more details.                          *
00017  *                                                                         *
00018  *   You should have received a copy of the GNU General Public License     *
00019  *   along with this program.  If not, see <http://www.gnu.org/licenses/>. *
00020  *                                                                         *
00021  ***************************************************************************/
00022 
00023 #ifndef PSYNTH_AUDIOINFO_H
00024 #define PSYNTH_AUDIOINFO_H
00025 
00026 #include <cstring>
00027 
00028 namespace psynth {
00029 
00033 typedef float sample;
00034 
00038 struct audio_info
00039 {
00040     size_t sample_rate;   
00041     size_t block_size;    
00042     size_t num_channels;  
00044     audio_info (const audio_info& i) :
00045         sample_rate(i.sample_rate), block_size(i.block_size), num_channels(i.num_channels) {}
00046 
00047     audio_info (size_t r = 0, size_t s = 0, size_t c = 0) :
00048         sample_rate(r), block_size(s), num_channels(c) {}
00049 
00050     bool operator== (const audio_info& i) {
00051         return
00052             sample_rate == i.sample_rate &&
00053             block_size == i.block_size &&
00054             num_channels == i.num_channels;
00055     }
00056 
00057     bool operator!= (const audio_info& i) {
00058         return
00059             sample_rate != i.sample_rate ||
00060             block_size != i.block_size ||
00061             num_channels != i.num_channels;
00062     }
00063 };
00064 
00065 } /* namespace psynth */
00066 
00067 #endif /* PSYNTH_AUDIOINFO_H */
00068