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

audio_transitions.h

Go to the documentation of this file.
00001 /*
00002  * audio_transitions.h -- audio transitions
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_TRANSITIONS_H_
00022 #define _AUDIO_TRANSITIONS_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 
00059 class AudioTransition 
00060 {
00061     public:
00062         virtual ~AudioTransition() {}
00063         virtual char *GetDescription( ) const = 0;
00064         virtual void GetFrame( int16_t **aframe, int16_t **bframe, int frequency, int channels, int& samples, double position, double frame_delta ) = 0;
00065         virtual bool IsUsable( ) { return true; }
00066         virtual bool IsBFrameConsumer( ) const { return true; }
00067 };
00068 
00084 class GDKAudioTransition : public AudioTransition
00085 {
00086     public:
00087         virtual ~GDKAudioTransition() {}
00088         virtual void AttachWidgets( GtkBin *bin ) { }
00089         virtual void InterpretWidgets( GtkBin *bin ) { }
00090         virtual void DetachWidgets( GtkBin *bin ) { }
00091 };
00092 
00099 class GDKAudioTransitionAdapter : public GDKAudioTransition
00100 {
00101     private:
00102         AudioTransition *transition;
00103 
00104     public:
00105         GDKAudioTransitionAdapter( AudioTransition *transition ) { this->transition = transition; }
00106         virtual ~GDKAudioTransitionAdapter( ) { delete transition; }
00107         char *GetDescription( ) const { return this->transition->GetDescription( ); }
00108         void GetFrame( int16_t **aframe, int16_t **bframe, int frequency,
00109                        int channels, int& samples, double position, double frame_delta ) {
00110             return this->transition->GetFrame( aframe, bframe, frequency, channels, samples, position, frame_delta );
00111         }
00112 };
00113 
00127 class GDKAudioTransitionRepository
00128 {
00129     private:
00130         vector <GDKAudioTransition *> transitions;
00131         GDKAudioTransition *selected_transition;
00132         GtkOptionMenu *menu;
00133         GtkBin *container;
00134     public:
00135         GDKAudioTransitionRepository();
00136         ~GDKAudioTransitionRepository();
00137         void Register( GDKAudioTransition *transition );
00138         void Initialise( GtkOptionMenu *menu, GtkBin *container );
00139         GDKAudioTransition *Get( ) const;
00140         void SelectionChange( );
00141 };
00142 
00143 #endif

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