annotate vampyhost.h @ 0:68f3f32565b4

Import the early draft version
author Chris Cannam
date Mon, 22 Oct 2012 16:10:46 +0100
parents
children cb0d3af1be4d
rev   line source
Chris@0 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@0 2
Chris@0 3 #ifndef _VAMPYHOST_H_
Chris@0 4 #define _VAMPYHOST_H_
Chris@0 5
Chris@0 6 #include "vamp-sdk/Plugin.h"
Chris@0 7 #include <string>
Chris@0 8
Chris@0 9 // structure of NumPy array intrface (just a hack, shouldn't be needed here...)
Chris@0 10 typedef struct {
Chris@0 11 int two; /* contains the integer 2 -- simple sanity check */
Chris@0 12 int nd; /* number of dimensions */
Chris@0 13 char typekind; /* kind in array --- character code of typestr */
Chris@0 14 int itemsize; /* size of each element */
Chris@0 15 int flags; /* flags indicating how the data should be interpreted */
Chris@0 16 /* must set ARR_HAS_DESCR bit to validate descr */
Chris@0 17 Py_intptr_t *shape; /* A length-nd array of shape information */
Chris@0 18 Py_intptr_t *strides; /* A length-nd array of stride information */
Chris@0 19 void *data; /* A pointer to the first element of the array */
Chris@0 20 PyObject *descr; /* NULL or data-description (same as descr key */
Chris@0 21 /* of __array_interface__) -- must set ARR_HAS_DESCR */
Chris@0 22 /* flag or this will be ignored. */
Chris@0 23 } PyArrayInterface;
Chris@0 24
Chris@0 25 //structure for holding plugin instance data
Chris@0 26 typedef struct {
Chris@0 27 std::string key;
Chris@0 28 std::string identifier;
Chris@0 29 bool isInitialised;
Chris@0 30 float inputSampleRate;
Chris@0 31 size_t channels;
Chris@0 32 size_t blockSize;
Chris@0 33 size_t stepSize;
Chris@0 34 size_t sampleSize;
Chris@0 35 bool mixChannels;
Chris@0 36 enum InputSampleType {
Chris@0 37 int16,
Chris@0 38 float32 };
Chris@0 39 InputSampleType inputSampleType;
Chris@0 40 Vamp::Plugin::FeatureSet output;
Chris@0 41 } PyPluginDescriptor;
Chris@0 42
Chris@0 43 #endif