1 /* Written by Eric Moon, from the Cortex Source code archive.
2 * Distributed under the terms of the Be Sample Code License
5 // ToneProducerAddOn.cpp
8 #include "ToneProducer.h"
9 #include "ToneProducerAddOn.h"
13 // instantiation function
14 extern "C" _EXPORT BMediaAddOn
* make_media_addon(image_id image
) {
15 return new ToneProducerAddOn(image
);
18 // -------------------------------------------------------- //
20 // -------------------------------------------------------- //
22 ToneProducerAddOn::~ToneProducerAddOn() {}
23 ToneProducerAddOn::ToneProducerAddOn(image_id image
) :
26 // -------------------------------------------------------- //
28 // -------------------------------------------------------- //
30 status_t
ToneProducerAddOn::InitCheck(
31 const char** out_failure_text
) {
35 int32
ToneProducerAddOn::CountFlavors() {
39 status_t
ToneProducerAddOn::GetFlavorAt(
41 const flavor_info
** out_info
) {
45 flavor_info
* pInfo
= new flavor_info
;
46 pInfo
->internal_id
= n
;
47 pInfo
->name
= (char *)"Demo Audio Producer";
48 pInfo
->info
= (char *)
49 "An add-on version of the ToneProducer node.\n"
50 "See the Be Developer Newsletter: 2 June, 1999\n"
51 "adapted by Eric Moon (4 June, 1999)";
52 pInfo
->kinds
= B_BUFFER_PRODUCER
| B_CONTROLLABLE
;
53 pInfo
->flavor_flags
= 0;
54 pInfo
->possible_count
= 0;
56 pInfo
->in_format_count
= 0;
57 pInfo
->in_formats
= 0;
59 pInfo
->out_format_count
= 1;
60 media_format
* pFormat
= new media_format
;
61 pFormat
->type
= B_MEDIA_RAW_AUDIO
;
62 pFormat
->u
.raw_audio
= media_raw_audio_format::wildcard
;
63 pInfo
->out_formats
= pFormat
;
69 BMediaNode
* ToneProducerAddOn::InstantiateNodeFor(
70 const flavor_info
* info
,
72 status_t
* out_error
) {
74 return new ToneProducer(this);
77 status_t
ToneProducerAddOn::GetConfigurationFor(
78 BMediaNode
* your_node
,
79 BMessage
* into_message
) {
85 // END -- ToneProducerAddOn.cpp