1 // AudioAdapterAddOn.cpp 2 3 #include "AudioAdapterAddOn.h" 4 5 #include "AudioAdapterNode.h" 6 //#include "AudioFilterNode.h" 7 #include "AudioAdapterOp.h" 8 9 #include <Entry.h> 10 #include <Debug.h> 11 #include <cstring> 12 #include <cstdlib> 13 #include <cstdio> 14 15 // -------------------------------------------------------- // 16 // instantiation function 17 // -------------------------------------------------------- // 18 19 extern "C" _EXPORT BMediaAddOn* make_media_addon(image_id image) { 20 return new AudioAdapterAddOn(image); 21 } 22 23 // -------------------------------------------------------- // 24 // main() stub 25 // -------------------------------------------------------- // 26 27 int main() { 28 fputs("[AudioAdapter.media_addon]", stderr); 29 return 1; 30 } 31 32 // -------------------------------------------------------- // 33 // ctor/dtor 34 // -------------------------------------------------------- // 35 36 //AudioAdapterAddOn::~AudioAdapterAddOn() {} 37 AudioAdapterAddOn::AudioAdapterAddOn(image_id id) : 38 BMediaAddOn(id) {} 39 40 // -------------------------------------------------------- // 41 // BMediaAddOn impl 42 // -------------------------------------------------------- // 43 44 status_t AudioAdapterAddOn::InitCheck( 45 const char** out_failure_text) { 46 return B_OK; 47 } 48 49 int32 AudioAdapterAddOn::CountFlavors() { 50 return 1; 51 } 52 53 status_t AudioAdapterAddOn::GetFlavorAt( 54 int32 n, 55 const flavor_info** out_info) { 56 if(n) 57 return B_ERROR; 58 59 flavor_info* pInfo = new flavor_info; 60 pInfo->internal_id = n; 61 pInfo->name = "AudioAdapter"; 62 pInfo->info = 63 "AudioAdapter (generic raw-audio format conversion).\n" 64 "by Eric Moon (8 September 1999)"; 65 pInfo->kinds = B_BUFFER_CONSUMER | B_BUFFER_PRODUCER | B_CONTROLLABLE; 66 pInfo->flavor_flags = 0; 67 pInfo->possible_count = 0; 68 69 pInfo->in_format_count = 1; 70 media_format* pFormat = new media_format; 71 pFormat->type = B_MEDIA_RAW_AUDIO; 72 pFormat->u.raw_audio = media_raw_audio_format::wildcard; 73 pInfo->in_formats = pFormat; 74 75 pInfo->out_format_count = 1; 76 pFormat = new media_format; 77 pFormat->type = B_MEDIA_RAW_AUDIO; 78 pFormat->u.raw_audio = media_raw_audio_format::wildcard; 79 pInfo->out_formats = pFormat; 80 81 *out_info = pInfo; 82 return B_OK; 83 } 84 85 BMediaNode* AudioAdapterAddOn::InstantiateNodeFor( 86 const flavor_info* info, 87 BMessage* config, 88 status_t* out_error) { 89 90 return new _AudioAdapterNode( 91 "AudioAdapter", 92 new AudioAdapterOpFactory(), 93 this); 94 } 95 96 status_t AudioAdapterAddOn::GetConfigurationFor( 97 BMediaNode* your_node, 98 BMessage* into_message) { 99 100 // no config yet 101 return B_OK; 102 } 103 104 105 // END -- AudioAdapterAddOn.cpp -- 106