Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

audio_filters.h

Go to the documentation of this file.
00001 /*
00002  * audio_filters.h -- audio filters
00003  * Copyright (C) 2002 Charles Yates <charles.yates@pandora.be>
00004  * Copyright (C) 2002-2007 Dan Dennedy <dan@dennedy.org>
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software Foundation,
00018  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00019  */
00020 
00021 #ifndef _AUDIO_FILTERS_H_
00022 #define _AUDIO_FILTERS_H_
00023 
00024 // C++ Includes
00025 
00026 #include <vector>
00027 using std::vector;
00028 
00029 // C Includes
00030 
00031 #include <stdint.h>
00032 #include <gtk/gtk.h>
00033 
00043 class AudioFilter 
00044 {
00045     public:
00046         virtual ~AudioFilter() {}
00047         virtual char *GetDescription( ) const = 0;
00048         virtual void GetFrame( int16_t **buffer, int frequency, int channels, int& samples, double position, double frame_delta ) = 0;
00049         virtual bool IsUsable( ) { return true; }
00050         virtual bool IsAFrameConsumer( ) const { return true; }
00051 };
00052 
00069 class GDKAudioFilter : public AudioFilter
00070 {
00071     public:
00072         virtual ~GDKAudioFilter() {}
00073         virtual void AttachWidgets( GtkBin *bin ) { }
00074         virtual void InterpretWidgets( GtkBin *bin ) { }
00075         virtual void DetachWidgets( GtkBin *bin ) { }
00076 };
00077 
00084 class GDKAudioFilterAdapter : public GDKAudioFilter
00085 {
00086     private:
00087         AudioFilter *filter;
00088 
00089     public:
00090         GDKAudioFilterAdapter( AudioFilter *filter ) { this->filter = filter; }
00091         virtual ~GDKAudioFilterAdapter( ) { delete filter; }
00092         char *GetDescription( ) const { return this->filter->GetDescription( ); }
00093         void GetFrame( int16_t **buffer, int frequency, int channels, int& samples, double position, double frame_delta ) {
00094             return this->filter->GetFrame( buffer, frequency, channels, samples, position, frame_delta );
00095         }
00096 };
00097 
00111 class GDKAudioFilterRepository
00112 {
00113     private:
00114         vector <GDKAudioFilter *> filters;
00115         GDKAudioFilter *selected_filter;
00116         GtkOptionMenu *menu;
00117         GtkBin *container;
00118     public:
00119         GDKAudioFilterRepository();
00120         ~GDKAudioFilterRepository();
00121         void Register( GDKAudioFilter *filter );
00122         void Initialise( GtkOptionMenu *menu, GtkBin *container );
00123         GDKAudioFilter *Get( ) const;
00124         void SelectionChange( );
00125 };
00126 
00127 #endif

Generated on Sun Mar 11 22:11:44 2007 for Kino by  doxygen 1.4.2