BTRFS: Implement BTree::Path and change _Find.
[haiku.git] / src / apps / cortex / addons / Flanger / FlangerAddOn.cpp
blob884a07dcf4535a36885569f39b7035595d78522c
1 /*
2 * Copyright (c) 1999-2000, Eric Moon.
3 * All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions, and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions, and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * 3. The name of the author may not be used to endorse or promote products
17 * derived from this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
20 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 * OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
23 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
26 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
27 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 // FlangerAddOn.cpp
33 // e.moon 16jun99
35 #include "FlangerNode.h"
36 #include "FlangerAddOn.h"
37 #include <Entry.h>
38 #include <Debug.h>
39 #include <cstring>
40 #include <cstdlib>
42 // instantiation function
43 extern "C" _EXPORT BMediaAddOn* make_media_addon(image_id image);
44 extern "C" _EXPORT BMediaAddOn* make_media_addon(image_id image) {
45 return new FlangerAddOn(image);
48 // -------------------------------------------------------- //
49 // ctor/dtor
50 // -------------------------------------------------------- //
52 FlangerAddOn::~FlangerAddOn() {
53 PRINT(("~FlangerAddOn()\n"));
55 FlangerAddOn::FlangerAddOn(image_id image) :
56 BMediaAddOn(image) {}
58 // -------------------------------------------------------- //
59 // BMediaAddOn impl
60 // -------------------------------------------------------- //
62 status_t FlangerAddOn::InitCheck(
63 const char** out_failure_text) {
64 return B_OK;
67 int32 FlangerAddOn::CountFlavors() {
68 return 1;
71 status_t FlangerAddOn::GetFlavorAt(
72 int32 n,
73 const flavor_info** out_info) {
74 if(n)
75 return B_ERROR;
77 flavor_info* pInfo = new flavor_info;
78 pInfo->internal_id = n;
79 pInfo->name = (char *)"Flanger";
80 pInfo->info = (char *)
81 "An add-on version of FlangerNode.\n"
82 "by Eric Moon (16 June, 1999)";
83 pInfo->kinds = B_BUFFER_CONSUMER | B_BUFFER_PRODUCER | B_CONTROLLABLE;
84 pInfo->flavor_flags = 0;
85 pInfo->possible_count = 0;
87 pInfo->in_format_count = 1;
88 media_format* pFormat = new media_format;
89 pFormat->type = B_MEDIA_RAW_AUDIO;
90 pFormat->u.raw_audio = media_raw_audio_format::wildcard;
91 pFormat->u.raw_audio.format = media_raw_audio_format::B_AUDIO_FLOAT;
92 pInfo->in_formats = pFormat;
94 pInfo->out_format_count = 1;
95 pFormat = new media_format;
96 pFormat->type = B_MEDIA_RAW_AUDIO;
97 pFormat->u.raw_audio = media_raw_audio_format::wildcard;
98 pFormat->u.raw_audio.format = media_raw_audio_format::B_AUDIO_FLOAT;
99 pInfo->out_formats = pFormat;
101 *out_info = pInfo;
102 return B_OK;
105 BMediaNode* FlangerAddOn::InstantiateNodeFor(
106 const flavor_info* info,
107 BMessage* config,
108 status_t* out_error) {
110 FlangerNode* pNode = new FlangerNode(this);
111 return pNode;
114 status_t FlangerAddOn::GetConfigurationFor(
115 BMediaNode* your_node,
116 BMessage* into_message) {
118 // no config yet
119 return B_OK;
122 // END -- FlangerAddOn.h --