1 // FlangerAddOn.cpp 2 // e.moon 16jun99 3 4 #include "FlangerNode.h" 5 #include "FlangerAddOn.h" 6 #include <Entry.h> 7 #include <Debug.h> 8 #include <cstring> 9 #include <cstdlib> 10 11 // instantiation function 12 extern "C" _EXPORT BMediaAddOn* make_media_addon(image_id image); 13 extern "C" _EXPORT BMediaAddOn* make_media_addon(image_id image) { 14 return new FlangerAddOn(image); 15 } 16 17 // -------------------------------------------------------- // 18 // ctor/dtor 19 // -------------------------------------------------------- // 20 21 FlangerAddOn::~FlangerAddOn() { 22 PRINT(("~FlangerAddOn()\n")); 23 } 24 FlangerAddOn::FlangerAddOn(image_id image) : 25 BMediaAddOn(image) {} 26 27 // -------------------------------------------------------- // 28 // BMediaAddOn impl 29 // -------------------------------------------------------- // 30 31 status_t FlangerAddOn::InitCheck( 32 const char** out_failure_text) { 33 return B_OK; 34 } 35 36 int32 FlangerAddOn::CountFlavors() { 37 return 1; 38 } 39 40 status_t FlangerAddOn::GetFlavorAt( 41 int32 n, 42 const flavor_info** out_info) { 43 if(n) 44 return B_ERROR; 45 46 flavor_info* pInfo = new flavor_info; 47 pInfo->internal_id = n; 48 pInfo->name = "Flanger"; 49 pInfo->info = 50 "An add-on version of FlangerNode.\n" 51 "by Eric Moon (16 June, 1999)"; 52 pInfo->kinds = B_BUFFER_CONSUMER | B_BUFFER_PRODUCER | B_CONTROLLABLE; 53 pInfo->flavor_flags = 0; 54 pInfo->possible_count = 0; 55 56 pInfo->in_format_count = 1; 57 media_format* pFormat = new media_format; 58 pFormat->type = B_MEDIA_RAW_AUDIO; 59 pFormat->u.raw_audio = media_raw_audio_format::wildcard; 60 pFormat->u.raw_audio.format = media_raw_audio_format::B_AUDIO_FLOAT; 61 pInfo->in_formats = pFormat; 62 63 pInfo->out_format_count = 1; 64 pFormat = new media_format; 65 pFormat->type = B_MEDIA_RAW_AUDIO; 66 pFormat->u.raw_audio = media_raw_audio_format::wildcard; 67 pFormat->u.raw_audio.format = media_raw_audio_format::B_AUDIO_FLOAT; 68 pInfo->out_formats = pFormat; 69 70 *out_info = pInfo; 71 return B_OK; 72 } 73 74 BMediaNode* FlangerAddOn::InstantiateNodeFor( 75 const flavor_info* info, 76 BMessage* config, 77 status_t* out_error) { 78 79 FlangerNode* pNode = new FlangerNode(this); 80 return pNode; 81 } 82 83 status_t FlangerAddOn::GetConfigurationFor( 84 BMediaNode* your_node, 85 BMessage* into_message) { 86 87 // no config yet 88 return B_OK; 89 } 90 91 // END -- FlangerAddOn.h -- 92