equalizer.hpp

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * equalizer.hpp
00003  *****************************************************************************
00004  * Copyright (C) 2003 the VideoLAN team
00005  * $Id: ae90966a0be87f9fb8b1930a856beb318a9ae04f $
00006  *
00007  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
00008  *
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License along
00020  * with this program; if not, write to the Free Software Foundation, Inc.,
00021  * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00022  *****************************************************************************/
00023 
00024 #ifndef EQUALIZER_HPP
00025 #define EQUALIZER_HPP
00026 
00027 #include "../utils/var_percent.hpp"
00028 #include <string>
00029 
00030 
00031 /// Variable for graphical equalizer
00032 class EqualizerBands: public SkinObject, public Observer<VarPercent>
00033 {
00034 public:
00035     /// Number of bands
00036     static const int kNbBands = 10;
00037 
00038     EqualizerBands( intf_thread_t *pIntf );
00039     virtual ~EqualizerBands();
00040 
00041     /// Set the equalizer bands from a configuration string,
00042     /// e.g. "1 5.2 -3.6 0 0 2.5 0 0 0 0"
00043     void set( string bands );
00044 
00045     /// Return the variable for a specific band
00046     VariablePtr getBand( int band );
00047 
00048 private:
00049     /// Array of equalizer bands
00050     VariablePtr m_cBands[kNbBands];
00051     /// Flag set when an update is in progress
00052     bool m_isUpdating;
00053 
00054     /// Callback for band updates
00055     virtual void onUpdate( Subject<VarPercent> &rBand , void *);
00056 };
00057 
00058 
00059 /// Variable for equalizer preamp
00060 class EqualizerPreamp: public VarPercent
00061 {
00062 public:
00063     EqualizerPreamp( intf_thread_t *pIntf );
00064     virtual ~EqualizerPreamp() { }
00065 
00066     virtual void set( float percentage, bool updateVLC );
00067 
00068     void set( float percentage ) { set( percentage, true ); }
00069 };
00070 
00071 
00072 #endif

Generated on Tue May 25 08:04:58 2010 for VLC by  doxygen 1.5.6