1 /** 2 \file audioencoderInternal.h 3 \brief interface to audio encoder plugins 4 5 */ 6 7 /*************************************************************************** 8 * * 9 * This program is free software; you can redistribute it and/or modify * 10 * it under the terms of the GNU General Public License as published by * 11 * the Free Software Foundation; either version 2 of the License, or * 12 * (at your option) any later version. * 13 * * 14 ***************************************************************************/ 15 #ifndef AUDIOENCODERINTERNAL_H 16 #define AUDIOENCODERINTERNAL_H 17 18 #define ADM_AUDIO_ENCODER_API_VERSION 7 19 #include <stddef.h> 20 21 #include "ADM_coreAudioEncoder6_export.h" 22 #include "audioencoder.h" 23 #include "ADM_paramList.h" 24 #include "ADM_confCouple.h" 25 #include "BVector.h" 26 27 class AUDMEncoder; 28 class ADM_AudioEncoder; 29 30 /*! 31 This structure defines an audio encoder 32 \param encoder Encoder attached to this descriptor 33 \param name The name of the codec 34 \param bitrate The bitrate in kb/s 35 \param configure Function to call to configure the codec 36 \param maxChannels The maximum # of channels this codec supports 37 \param param : An opaque structure that contains the codec specific configuration datas 38 */ 39 typedef struct 40 { 41 uint32_t apiVersion; // const 42 ADM_AudioEncoder *(*create)(AUDMAudioFilter *head, bool globalHeader, CONFcouple *setup); 43 void (*destroy)(ADM_AudioEncoder *codec); 44 bool (*configure)(CONFcouple **setup); 45 const char *codecName; // Internal name (tag) 46 const char *menuName; // Displayed name (in menu) 47 const char *description; 48 uint32_t maxChannels; // Const 49 uint32_t major,minor,patch; // Const 50 uint32_t wavTag; // const Avi fourcc 51 uint32_t priority; // const Higher means the codec is prefered and should appear first in the list 52 bool (*setOption)(CONFcouple **c,const char *paramName, uint32_t value); 53 void (*getDefaultConfiguration)(CONFcouple **c); 54 void *opaque; // Hide stuff in here 55 }ADM_audioEncoder; 56 57 // Macros to declare audio encoder 58 /**************************************************************************/ 59 #define ADM_DECLARE_AUDIO_ENCODER_PREAMBLE(Class) \ 60 \ 61 static ADM_AudioEncoder * create (AUDMAudioFilter * head,bool globalHeader, CONFcouple *setup) \ 62 { \ 63 return new Class (head,globalHeader,setup); \ 64 } \ 65 static void destroy (ADM_AudioEncoder * in) \ 66 {\ 67 Class *z = (Class *) in; \ 68 delete z; \ 69 } 70 //****************************************************** 71 #define ADM_DECLARE_AUDIO_ENCODER_CONFIG() \ 72 \ 73 extern "C" ADM_PLUGIN_EXPORT ADM_audioEncoder *getInfo (void) \ 74 { \ 75 return &encoderDesc; \ 76 } 77 78 extern ADM_COREAUDIOENCODER6_EXPORT BVector <ADM_audioEncoder *> ListOfAudioEncoder; 79 80 #endif 81 //EOF 82