Mercurial > hg > svcore
comparison plugin/api/FEAPI.h @ 0:da6937383da8
initial import
| author | Chris Cannam |
|---|---|
| date | Tue, 10 Jan 2006 16:33:16 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:da6937383da8 |
|---|---|
| 1 //////////////////////////////////////////////////////////////////////////////////// | |
| 2 // /*! \file FEAPI.h | |
| 3 // \brief interface of the feature extraction plugin. | |
| 4 // <br><br> | |
| 5 // In the following, context function pointers typedefs are referred to as | |
| 6 // functions.<br> | |
| 7 // | |
| 8 // | |
| 9 // Create a new instance of the plugin with the function | |
| 10 // ::FEAPI_CreatePluginInstance. The call of this function is mandatory. | |
| 11 // <br><br> | |
| 12 // | |
| 13 // Initialize the plugin with the call of function | |
| 14 // ::FEAPI_InitializePlugin.<br><br> | |
| 15 // | |
| 16 // Information about the plugin can be requested via the following | |
| 17 // functions:<br> | |
| 18 // ::FEAPI_GetPluginAPIVersion, <br> | |
| 19 // ::FEAPI_GetPluginName, <br> | |
| 20 // ::FEAPI_GetPluginVendor, <br> | |
| 21 // ::FEAPI_GetPluginVendorVersion, <br> | |
| 22 // ::FEAPI_GetPluginCopyright, <br> | |
| 23 // ::FEAPI_GetPluginDescription. <br> | |
| 24 // The call of these functions is optional. Combined with a call to | |
| 25 // ::FEAPI_GetPluginId, the plugin can be uniquely identified. <br><br> | |
| 26 // | |
| 27 // The technical capabilities of the plugin can be requested via the call | |
| 28 // of the function | |
| 29 // ::FEAPI_GetPluginProperty.<br><br> | |
| 30 // | |
| 31 // To get the number of the features resp. results that are computed | |
| 32 // by the plugin, call the function <br> | |
| 33 // ::FEAPI_GetPluginNumOfResults; <br> | |
| 34 // the function <br> | |
| 35 // ::FEAPI_GetPluginResultDescription gives you detailed information about the | |
| 36 // meaning and usage of every result (see structure ::_ResultDescription | |
| 37 // for details). <br><br> | |
| 38 // | |
| 39 // To get the number of the options/ parameter settings that can be | |
| 40 // done before processing, call the function <br> | |
| 41 // ::FEAPI_GetPluginNumOfParameters; <br> | |
| 42 // the function <br> | |
| 43 // ::FEAPI_GetPluginParamDescription gives you detailed information about | |
| 44 // the meaning and usage of every single parameter (see structure | |
| 45 // ::FEAPI_ParameterDescription_t for details).<br><br> | |
| 46 // | |
| 47 // To get or set a specific parameter value, call the function <br> | |
| 48 // ::FEAPI_GetPluginParameter resp. <br> | |
| 49 // ::FEAPI_SetPluginParameter. <br><br> | |
| 50 // | |
| 51 // After the plugin is initialized, the actual processing can begin. | |
| 52 // The ::FEAPI_ProcessPlugin <br> | |
| 53 // function can be called to do the actual feature/result | |
| 54 // calculation. ::FEAPI_ProcessPlugin expects subsequently new blocks | |
| 55 // of audio data. Note that ::FEAPI_ProcessPlugin does not return | |
| 56 // computed feature values.<br> | |
| 57 // | |
| 58 // After finishing one ::FEAPI_ProcessPlugin call, zero, one or more | |
| 59 // results can be available, depending on the plug-ins implementation. | |
| 60 // To query the available number of values for every feature/result, | |
| 61 // call <br> | |
| 62 // ::FEAPI_GetPluginSizeOfResult, <br> | |
| 63 // which returns the number of values for this | |
| 64 // result. Afterwards, the result values for each result can | |
| 65 // be requested via <br> | |
| 66 // ::FEAPI_GetPluginResult. Note that the memory for the results has to be | |
| 67 // allocated by the host.<br><br> | |
| 68 // | |
| 69 // To signal that no more audio data is available at the end (e.g. of | |
| 70 // the audio file), call <br> | |
| 71 // ::FEAPI_ProcessPluginDone and get the last results with | |
| 72 // ::FEAPI_GetPluginResult if available.<br><br> | |
| 73 // | |
| 74 // To flush the internal buffers, the function <br> | |
| 75 // ::FEAPI_ResetPlugin <br> | |
| 76 // may be called. | |
| 77 // | |
| 78 // After all processing has been done, destroy the instance of the | |
| 79 // plugin with the function <br> | |
| 80 // ::FEAPI_DestroyPluginInstance. <br> | |
| 81 // The call of this function is mandatory. <br><br> | |
| 82 // | |
| 83 // <br><br><br> | |
| 84 // The Feature Extraction plugin API is released under a BSD style | |
| 85 // license. Please make all changes available to the authors.<br> | |
| 86 // Contact information: lerch <at> zplane.de. | |
| 87 // | |
| 88 // */ | |
| 89 // | |
| 90 // Copyright (c) 2004-2005, Alexander Lerch, zplane.development GbR | |
| 91 // All rights reserved. | |
| 92 // | |
| 93 // Redistribution and use in source and binary forms, with or without | |
| 94 // modification, are permitted provided that the following conditions | |
| 95 // are met: | |
| 96 // | |
| 97 // * Redistributions of source code must retain the above copyright | |
| 98 // notice, this list of conditions and the following disclaimer. | |
| 99 // * Redistributions in binary form must link to the FEAPI website | |
| 100 // http://www.sf.net/projects/feapi, | |
| 101 // reproduce this list of conditions and the following | |
| 102 // disclaimer in the documentation and/or other materials | |
| 103 // provided with the distribution. | |
| 104 // * The name of the contributors to this software must not be used | |
| 105 // to endorse or promote products derived from this software | |
| 106 // without specific prior written permission. | |
| 107 // | |
| 108 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
| 109 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
| 110 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | |
| 111 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | |
| 112 // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | |
| 113 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |
| 114 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | |
| 115 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |
| 116 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
| 117 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | |
| 118 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
| 119 // POSSIBILITY OF SUCH DAMAGE. | |
| 120 // | |
| 121 //////////////////////////////////////////////////////////////////////////////////// | |
| 122 // CVS INFORMATION | |
| 123 // | |
| 124 // $RCSfile: FEAPI.h,v $ | |
| 125 // $Author: alex_lerch $ | |
| 126 // $Date: 2005/05/20 17:08:36 $ | |
| 127 // | |
| 128 // $Log: FEAPI.h,v $ | |
| 129 // Revision 1.2 2005/05/20 17:08:36 alex_lerch | |
| 130 // - updated documentation | |
| 131 // - added "signal" typedef for inputs and results | |
| 132 // - changed function PluginCanDo to PluginGetProperty and changed the function itself to return values instead of bools | |
| 133 // - cosmetic changes | |
| 134 // | |
| 135 // Revision 1.1.1.1 2005/03/30 14:54:40 alex_lerch | |
| 136 // first draft version requiring several updates: | |
| 137 // - interface check | |
| 138 // - check of plugin base class | |
| 139 // - implementation of host base class | |
| 140 // - update of outdated documentation | |
| 141 // | |
| 142 // | |
| 143 //////////////////////////////////////////////////////////////////////////////////// | |
| 144 //////////////////////////////////////////////////////////////////////////////////// | |
| 145 // !!!Do never ever edit this file!!! | |
| 146 //////////////////////////////////////////////////////////////////////////////////// | |
| 147 //////////////////////////////////////////////////////////////////////////////////// | |
| 148 | |
| 149 /*! \brief avoid multiple header includes */ | |
| 150 #if !defined(FEAPI_HEADER_INCLUDED) | |
| 151 #define FEAPI_HEADER_INCLUDED | |
| 152 | |
| 153 | |
| 154 #ifdef __cplusplus | |
| 155 extern "C" { | |
| 156 #endif | |
| 157 | |
| 158 /* Maximum string lengths. */ | |
| 159 const unsigned int FEAPI_uiMaxNameLength = 1024; //!< maximum number of characters for a name string (including null terminator) | |
| 160 const unsigned int FEAPI_uiMaxUnitLength = 1024; //!< maximum number of characters for a unit string (including null terminator) | |
| 161 const unsigned int FEAPI_uiMaxDescriptionLength = 4096; //!< maximum number of characters for a description string (including null terminator) | |
| 162 | |
| 163 //////////////////////////////////////////////////////////////////////////////////// | |
| 164 // interface structures and types | |
| 165 /** @defgroup types Interface Structures and Types | |
| 166 * @{ | |
| 167 */ | |
| 168 | |
| 169 | |
| 170 /*! Structure describing properties and other information about one result/feature. */ | |
| 171 typedef struct FEAPI_SignalDescription_t_tag | |
| 172 { | |
| 173 char acName[FEAPI_uiMaxNameLength]; //!< name of the result/feature (e.g. "Spectral Centroid", "Loudness", etc.) | |
| 174 char acUnit[FEAPI_uiMaxUnitLength]; //!< unit of the result/feature (e.g. "dB", "sone", "Hz", etc.) | |
| 175 char acDescription[FEAPI_uiMaxDescriptionLength]; //!< description of the result/feature (clear text description) | |
| 176 float fRangeMin; //!< minimum value of the result/feature (if no minimum value: minimum floating point value) | |
| 177 float fRangeMax; //!< maximum value of the result/feature (if no maximum value: maximum floating point value) | |
| 178 float fQuantizedTo; //!< quantization step size of the result/feature (e.g. 1 for integer result, -1 for no quantization) | |
| 179 float fSampleRate; //!< sample rate of the result/feature output in Hz; -1 if sample rate equals input block length, -2 for non-equidistant samples | |
| 180 } FEAPI_SignalDescription_t; | |
| 181 | |
| 182 | |
| 183 /*! Structure describing properties and other information about one parameter. */ | |
| 184 typedef struct FEAPI_ParameterDescription_t_tag | |
| 185 { | |
| 186 char acName[FEAPI_uiMaxNameLength]; //!< name of the parameter (e.g. "Gain", "Sensitivity", etc.) | |
| 187 char acUnit[FEAPI_uiMaxUnitLength]; //!< unit of the parameter (e.g. "dB", "Hz", etc.) | |
| 188 char acDescription[FEAPI_uiMaxDescriptionLength]; //!< description of the parameter (clear text description) | |
| 189 float fRangeMin, //!< minimum value of the parameter (if no minimum value: minimum floating point value) | |
| 190 fRangeMax, //!< maximum value of the parameter (if no maximum value: maximum floating point value) | |
| 191 fDefaultValue; //!< default value for the parameter | |
| 192 float fQuantizedTo; //!< quantization step size of the parameter (e.g. 1 for integer quantization, -1 for no quantization) | |
| 193 int bIsChangeableInRealTime;//!< 0/false if the parameter has to be set before the processing starts and can not be changed during processing, 1 if the parameter can be changed during processing | |
| 194 } FEAPI_ParameterDescription_t; | |
| 195 | |
| 196 | |
| 197 /*! Structure for user/vendor defined commands. */ | |
| 198 typedef struct FEAPI_UserData_t_tag | |
| 199 { | |
| 200 char *pcUserString; //!< user defined string value (memory could be freed by host after function call) | |
| 201 void *pcUserData; //!< pointer to user defined data | |
| 202 } FEAPI_UserData_t; | |
| 203 | |
| 204 | |
| 205 /*! Typedef for the plugin instance handle. */ | |
| 206 typedef void* FEAPI_PluginInstance_t; | |
| 207 | |
| 208 | |
| 209 /*! This typedef is used for time stamps in seconds. | |
| 210 For a block of data, the time stamp is defined to be the time at the beginning of the block. */ | |
| 211 typedef double FEAPI_TimeStamp_t; | |
| 212 | |
| 213 | |
| 214 /*! This typedef is used for input and output data. | |
| 215 At least for this version of the API, this is exactly float. */ | |
| 216 typedef float FEAPI_Signal_t; | |
| 217 | |
| 218 | |
| 219 /*! Enumerator for possible error return values, if any other value than FEAPI_kNoError is returned, | |
| 220 the function was not able to execute the specified operation(s).<br> | |
| 221 All error defines are negative. */ | |
| 222 typedef enum FEAPI_Error_t_tag | |
| 223 { | |
| 224 FEAPI_kNoError = 0, //!< no error occurred | |
| 225 FEAPI_kUnspecifiedError = -1, //!< an error occurred, but the type is not yet specified | |
| 226 FEAPI_kUnknownError = -9999 //!< an error occurred, but its type is not specifyable | |
| 227 } FEAPI_Error_t; | |
| 228 | |
| 229 | |
| 230 /*! Enumerator for retrieval of version info which can be resolved as major.minor.sub. */ | |
| 231 typedef enum FEAPI_VersionInfo_t_tag | |
| 232 { | |
| 233 FEAPI_kMajorVersion = 0, //!< indicates the major version | |
| 234 FEAPI_kMinorVersion = 1, //!< indicates the minor version | |
| 235 FEAPI_kSubVersion = 2 //!< indicates the sub version or bug-fix version | |
| 236 } FEAPI_VersionInfo_t; | |
| 237 | |
| 238 | |
| 239 /*! Enumerator for retrieval of information about what the plug supports. */ | |
| 240 typedef enum FEAPI_PluginProperty_t_tag | |
| 241 { | |
| 242 FEAPI_kMinSampleRate = 0, //!< indicates the minimum sample rate | |
| 243 FEAPI_kMaxSampleRate = 1, //!< indicates the maximum sample rate | |
| 244 FEAPI_kMinChannels = 2, //!< indicates minimum number of channels | |
| 245 FEAPI_kMaxChannels = 3, //!< indicates maximum number of channels | |
| 246 FEAPI_kMinFrameSize = 4, //!< indicates minimum number of frames per process call | |
| 247 FEAPI_kMaxFrameSize = 5, //!< indicates maximum number of frames per process call | |
| 248 FEAPI_kOptFrameSize = 6 //!< indicates optimal number of frames per process call | |
| 249 } FEAPI_PluginProperty_t; | |
| 250 | |
| 251 /** @} */ | |
| 252 | |
| 253 //////////////////////////////////////////////////////////////////////////////////// | |
| 254 // API function declaration | |
| 255 /** @defgroup apifun API function pointers | |
| 256 * @{ | |
| 257 */ | |
| 258 | |
| 259 /*! | |
| 260 * Creates a new instance of the plugin | |
| 261 * | |
| 262 * @param phInstanceHandle : handle to the instance to be created | |
| 263 * @return FEAPI_Error_t : FEAPI_kNoError when no error | |
| 264 */ | |
| 265 typedef FEAPI_Error_t (*FEAPI_CreatePluginInstance_t) ( FEAPI_PluginInstance_t *phInstanceHandle ); | |
| 266 | |
| 267 /*! | |
| 268 * Destroys an instance of the plugin. | |
| 269 * | |
| 270 * @param phInstanceHandle : handle to the instance to be destroyed | |
| 271 * @return FEAPI_Error_t : FEAPI_kNoError when no error | |
| 272 */ | |
| 273 typedef FEAPI_Error_t (*FEAPI_DestroyPluginInstance_t) ( FEAPI_PluginInstance_t *phInstanceHandle ); | |
| 274 | |
| 275 /*! | |
| 276 * initializes a new instance of the plugin | |
| 277 * | |
| 278 * @param hInstanceHandle : handle to the instance | |
| 279 * @param fInputSampleRate : sample rate of input(s) in Hz | |
| 280 * @param iNumberOfAudioChannels : number of input audio channels | |
| 281 * @param iHostApiMajorVersion : major version number of host | |
| 282 * @param pstUserData : pointer to user or vendor defined data (may be NULL) | |
| 283 * | |
| 284 * @return FEAPI_Error_t : FEAPI_kNoError when no error | |
| 285 */ | |
| 286 typedef FEAPI_Error_t (*FEAPI_InitializePlugin_t) (FEAPI_PluginInstance_t hInstanceHandle, | |
| 287 float fInputSampleRate, | |
| 288 int iNumberOfAudioChannels, | |
| 289 int iHostApiMajorVersion, | |
| 290 FEAPI_UserData_t *pstUserData); | |
| 291 | |
| 292 | |
| 293 /*! | |
| 294 * Gets the version number (major, minor or subversion) of the API used by the plugin. | |
| 295 * This is *not* the plugin version, therefore the function may be called without a previously | |
| 296 * created instance. | |
| 297 * | |
| 298 * @param eAPIMajorMinorOrSubVersion : flag which version type is requested | |
| 299 * @return int : requested version number | |
| 300 */ | |
| 301 typedef int (*FEAPI_GetPluginAPIVersion_t) ( FEAPI_VersionInfo_t eAPIMajorMinorOrSubVersion ); //!< \todo change ints to (unsigned) ints where appropriate? | |
| 302 | |
| 303 | |
| 304 /*! | |
| 305 * Gets the name of the plugin. | |
| 306 * | |
| 307 * @param hInstanceHandle : handle to instance | |
| 308 * @param *pcPluginName : pointer to buffer of FEAPI_uiMaxNameLength chars, the name will be copied to this buffer | |
| 309 * @return FEAPI_Error_t : FEAPI_kNoError when no error | |
| 310 */ | |
| 311 typedef FEAPI_Error_t (*FEAPI_GetPluginName_t) ( FEAPI_PluginInstance_t hInstanceHandle, | |
| 312 char *pcPluginName); | |
| 313 | |
| 314 /*! | |
| 315 * Gets the vendor name of the plugin. | |
| 316 * | |
| 317 * @param hInstanceHandle : handle to instance | |
| 318 * @param *pcPluginVendor : pointer to buffer of FEAPI_uiMaxNameLength chars, the vendor name will be copied to this buffer | |
| 319 * @return FEAPI_Error_t : FEAPI_kNoError when no error | |
| 320 */ | |
| 321 typedef FEAPI_Error_t (*FEAPI_GetPluginVendor_t) (FEAPI_PluginInstance_t hInstanceHandle, | |
| 322 char *pcPluginVendor); | |
| 323 | |
| 324 /*! | |
| 325 * Gets an indication of the plugins capabilities. | |
| 326 * | |
| 327 * @param hInstanceHandle : handle to instance | |
| 328 * @param ePluginProperty : requested property | |
| 329 * @return float : corresponding value | |
| 330 */ | |
| 331 typedef float (*FEAPI_GetPluginProperty_t) (FEAPI_PluginInstance_t hInstanceHandle, | |
| 332 FEAPI_PluginProperty_t ePluginProperty); | |
| 333 | |
| 334 /*! | |
| 335 * Gets the (vendor unique) plugin identification string. | |
| 336 * | |
| 337 * @param hInstanceHandle : handle to instance | |
| 338 * @param *pcPluginId : pointer to buffer of FEAPI_uiMaxNameLength chars, the id will be copied to this buffer | |
| 339 * @return FEAPI_Error_t : FEAPI_kNoError when no error | |
| 340 */ | |
| 341 typedef FEAPI_Error_t (*FEAPI_GetPluginId_t) (FEAPI_PluginInstance_t hInstanceHandle, | |
| 342 char *pcPluginId); | |
| 343 | |
| 344 /*! | |
| 345 * Gets the vendor version of the plugin. | |
| 346 * | |
| 347 * @param hInstanceHandle : handle to instance | |
| 348 * @param ePluginMajorMinorOrSubVersion : flag which version type is requested | |
| 349 * @return int : requested version number | |
| 350 */ | |
| 351 typedef int (*FEAPI_GetPluginVendorVersion_t) ( FEAPI_PluginInstance_t hInstanceHandle, | |
| 352 FEAPI_VersionInfo_t ePluginMajorMinorOrSubVersion); | |
| 353 | |
| 354 /*! | |
| 355 * Gets the description of the plugin, containing information about what the plugin actually does. | |
| 356 * | |
| 357 * @param hInstanceHandle : handle to instance | |
| 358 * @param *pcPluginDescription : pointer to buffer of FEAPI_uiMaxDescriptionLength chars, the plugin description will be copied to this buffer | |
| 359 * @return FEAPI_Error_t : FEAPI_kNoError when no error | |
| 360 */ | |
| 361 typedef FEAPI_Error_t (*FEAPI_GetPluginDescription_t) (FEAPI_PluginInstance_t hInstanceHandle, | |
| 362 char *pcPluginDescription); | |
| 363 | |
| 364 /*! | |
| 365 * Gets the copyright information for the plugin. | |
| 366 * | |
| 367 * @param hInstanceHandle : handle to instance | |
| 368 * @param *pcPluginCopyright : pointer to buffer of FEAPI_uiMaxDescriptionLength chars, the plugin copyright information will be copied to this buffer | |
| 369 * @return FEAPI_Error_t : FEAPI_kNoError when no error | |
| 370 */ | |
| 371 typedef FEAPI_Error_t (*FEAPI_GetPluginCopyright_t) (FEAPI_PluginInstance_t hInstanceHandle, | |
| 372 char *pcPluginCopyright); | |
| 373 | |
| 374 /*! | |
| 375 * Gets the number of inputs for the plugin. This number will equal the | |
| 376 * number of audio channels in many cases, otherwise exceed the number of audio channels. | |
| 377 * The additional input channels are plugin developer specific and not recommended. If used, | |
| 378 * they have to be routed host internally. | |
| 379 * | |
| 380 * @param hInstanceHandle : handle to instance | |
| 381 * @return int : number of inputs | |
| 382 */ | |
| 383 typedef int (*FEAPI_GetPluginNumOfInputs_t) (FEAPI_PluginInstance_t hInstanceHandle); | |
| 384 | |
| 385 /*! | |
| 386 * Gets information about one of the possible inputs. | |
| 387 * | |
| 388 * @param hInstanceHandle : handle to instance | |
| 389 * @param iInputIndex : index of the input the description is requested for, index ranges from 0...NumOfInputs-1 | |
| 390 * @param *pstInputDescription : the requested description will be copied to this structure | |
| 391 * @return FEAPI_Error_t : FEAPI_kNoError when no error | |
| 392 */ | |
| 393 typedef FEAPI_Error_t (*FEAPI_GetPluginInputDescription_t) (FEAPI_PluginInstance_t hInstanceHandle, | |
| 394 int iInputIndex, | |
| 395 FEAPI_SignalDescription_t *pstInputDescription); | |
| 396 | |
| 397 /*! | |
| 398 * Gets the number of parameters. | |
| 399 * | |
| 400 * @param hInstanceHandle : handle to instance | |
| 401 * @return int : number of parameters | |
| 402 */ | |
| 403 typedef int (*FEAPI_GetPluginNumOfParameters_t) (FEAPI_PluginInstance_t hInstanceHandle); | |
| 404 | |
| 405 /*! | |
| 406 * Gets information about one of the possible parameters. | |
| 407 * | |
| 408 * @param hInstanceHandle : handle to instance | |
| 409 * @param iParameterIndex : index of the parameter (setting) the description is requested for, index ranges from 0...NumOfParameters-1 | |
| 410 * @param *pstParameterDescription : the requested description will be copied to this structure | |
| 411 * @return FEAPI_Error_t : FEAPI_kNoError when no error | |
| 412 */ | |
| 413 typedef FEAPI_Error_t (*FEAPI_GetPluginParameterDescription_t) (FEAPI_PluginInstance_t hInstanceHandle, | |
| 414 int iParameterIndex, | |
| 415 FEAPI_ParameterDescription_t *pstParameterDescription); | |
| 416 | |
| 417 /*! | |
| 418 * Sets a parameter to a specified value. | |
| 419 * | |
| 420 * @param hInstanceHandle : handle to instance | |
| 421 * @param iParameterIndex : index of the parameter (setting) to be changed, index ranges from 0...NumOfParameters-1 | |
| 422 * @param fValue : new value of the parameter | |
| 423 * @return FEAPI_Error_t : FEAPI_kNoError when no error | |
| 424 */ | |
| 425 typedef FEAPI_Error_t (*FEAPI_SetPluginParameter_t) ( FEAPI_PluginInstance_t hInstanceHandle, | |
| 426 int iParameterIndex, | |
| 427 float fValue); | |
| 428 | |
| 429 /*! | |
| 430 * Gets the current value of a parameter. | |
| 431 * | |
| 432 * @param hInstanceHandle : handle to instance | |
| 433 * @param iParameterIndex : index of the parameter (setting) requested, index ranges from 0...NumOfParameters-1 | |
| 434 * @return float : value of the parameter with index iParameterIndex | |
| 435 */ | |
| 436 typedef float (*FEAPI_GetPluginParameter_t) (FEAPI_PluginInstance_t hInstanceHandle, | |
| 437 int iParameterIndex); | |
| 438 | |
| 439 /*! | |
| 440 * Processes a block of audio data. | |
| 441 * | |
| 442 * @param hInstanceHandle : handle to instance | |
| 443 * @param **ppfInputBuffer : input audio data in the format [channels][samples]; audio samples have a range from -1.0...+1.0 | |
| 444 * @param *ptFEAPI_TimeStamp : time stamps in seconds for every input, may be NULL | |
| 445 * @param iNumberOfFrames : number of frames in ppfInputBuffer | |
| 446 * @return FEAPI_Error_t : FEAPI_kNoError when no error | |
| 447 */ | |
| 448 typedef FEAPI_Error_t (*FEAPI_ProcessPlugin_t) (FEAPI_PluginInstance_t hInstanceHandle, | |
| 449 const FEAPI_Signal_t **ppfInputBuffer, | |
| 450 const FEAPI_TimeStamp_t *ptFEAPI_TimeStamp, | |
| 451 int iNumberOfFrames); | |
| 452 | |
| 453 /*! | |
| 454 * Signals that no more input data is available (does the final processing). | |
| 455 * | |
| 456 * @param hInstanceHandle : handle to instance | |
| 457 * @return FEAPI_Error_t : FEAPI_kNoError when no error | |
| 458 */ | |
| 459 typedef FEAPI_Error_t (*FEAPI_ProcessPluginDone_t) (FEAPI_PluginInstance_t hInstanceHandle); | |
| 460 | |
| 461 /*! | |
| 462 * Gets the number of results/features to be calculated. | |
| 463 * | |
| 464 * @param hInstanceHandle : handle to instance | |
| 465 * @return int : number of results | |
| 466 */ | |
| 467 typedef int (*FEAPI_GetPluginNumOfResults_t) (FEAPI_PluginInstance_t hInstanceHandle); | |
| 468 | |
| 469 /*! | |
| 470 * Gets information about one of the possible results/features. | |
| 471 * | |
| 472 * @param hInstanceHandle : handle to instance | |
| 473 * @param iResultIndex : index of the result (feature) the description is requested for, index ranges from 0...NumOfResults-1 | |
| 474 * @param *pstResultDescription : the requested description will be copied to this structure | |
| 475 * @return FEAPI_Error_t : FEAPI_kNoError when no error | |
| 476 */ | |
| 477 typedef FEAPI_Error_t (*FEAPI_GetPluginResultDescription_t) ( FEAPI_PluginInstance_t hInstanceHandle, | |
| 478 int iResultIndex, | |
| 479 FEAPI_SignalDescription_t *pstResultDescription); | |
| 480 | |
| 481 /*! | |
| 482 * Gets the size of one result in FEAPI_Signal_t values (4 bytes per value). | |
| 483 * | |
| 484 * @param hInstanceHandle : handle to instance | |
| 485 * @param iResultIndex : index of the result/feature the size is requested for, index ranges from 0...NumOfResults-1 | |
| 486 * @return int : size of result in FEAPI_Signal_t values (4 bytes per value) | |
| 487 */ | |
| 488 typedef int (*FEAPI_GetPluginSizeOfResult_t) (FEAPI_PluginInstance_t hInstanceHandle, | |
| 489 int iResultIndex); | |
| 490 | |
| 491 /*! | |
| 492 * Gets one result. | |
| 493 * | |
| 494 * @param hInstanceHandle : handle to instance | |
| 495 * @param iResultIndex : index of the requested result/feature, index ranges from 0...NumOfResults-1 | |
| 496 * @param *pfResult : the result data is copied into this buffer | |
| 497 * @param *ptFEAPI_TimeStamp : the time stamp of the result | |
| 498 * @return FEAPI_Error_t : FEAPI_kNoError when no error | |
| 499 */ | |
| 500 typedef FEAPI_Error_t (*FEAPI_GetPluginResult_t) ( FEAPI_PluginInstance_t hInstanceHandle, | |
| 501 int iResultIndex, | |
| 502 FEAPI_Signal_t *pfResult, | |
| 503 FEAPI_TimeStamp_t *ptFEAPI_TimeStamp); | |
| 504 | |
| 505 /*! | |
| 506 * Gets the maximum latency of one result. Since the host buffer size may vary, this is only the | |
| 507 * *internal* latency. | |
| 508 * | |
| 509 * @param hInstanceHandle : handle to instance | |
| 510 * @param iResultIndex : index of the requested result (feature), index ranges from 0...NumOfResults-1 | |
| 511 * @return int : number of samples (at audio input sample rate) which is required to calculate this result the first time (negative values are not allowed, 0 means undefined) | |
| 512 */ | |
| 513 typedef int (*FEAPI_GetPluginResultLatency_t) (FEAPI_PluginInstance_t hInstanceHandle, int iResultIndex); | |
| 514 | |
| 515 /*! | |
| 516 * Resets/clears all internal buffers and states, so that the plugin is in a state where it can start processing a new audio stream. | |
| 517 * | |
| 518 * @param hInstanceHandle : handle to instance | |
| 519 * @return FEAPI_Error_t : FEAPI_kNoError when no error | |
| 520 */ | |
| 521 typedef FEAPI_Error_t (*FEAPI_ResetPlugin_t) (FEAPI_PluginInstance_t hInstanceHandle); | |
| 522 | |
| 523 /** @} */ | |
| 524 | |
| 525 | |
| 526 #ifdef __cplusplus | |
| 527 } | |
| 528 #endif | |
| 529 | |
| 530 | |
| 531 #endif // #if !defined(FEAPI_HEADER_INCLUDED) |
