Mercurial > hg > qm-vamp-plugins
comparison plugins/SegmenterPlugin.h @ 38:9a2edd83775f
* Fixes and tidying in segmenter &c
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Thu, 10 Jan 2008 15:15:12 +0000 |
parents | 9ce0db4770a2 |
children | 5d7ce1d87301 |
comparison
equal
deleted
inserted
replaced
37:9ce0db4770a2 | 38:9a2edd83775f |
---|---|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ | |
2 | |
1 /* | 3 /* |
2 * SegmeterPlugin.h | 4 * SegmenterPlugin.h |
3 * soundbite | |
4 * | 5 * |
5 * Created by Mark Levy on 24/03/2006. | 6 * Created by Mark Levy on 24/03/2006. |
6 * Copyright 2006 Centre for Digital Music, Queen Mary, University of London. All rights reserved. | 7 * Copyright 2006 Centre for Digital Music, Queen Mary, University of London. |
7 * | 8 * All rights reserved. |
8 */ | 9 */ |
9 | 10 |
10 #ifndef _SEGMENTER_PLUGIN_H_ | 11 #ifndef _SEGMENTER_PLUGIN_H_ |
11 #define _SEGMENTER_PLUGIN_H_ | 12 #define _SEGMENTER_PLUGIN_H_ |
12 | 13 |
13 #include <vamp-sdk/Plugin.h> | 14 #include <vamp-sdk/Plugin.h> |
14 #include <vamp-sdk/RealTime.h> | 15 #include <vamp-sdk/RealTime.h> |
15 #include "dsp/segmentation/Segmenter.h" | 16 #include "dsp/segmentation/Segmenter.h" |
16 #include "dsp/segmentation/segment.h" | 17 #include "dsp/segmentation/segment.h" |
17 | 18 |
19 class Decimator; | |
20 | |
18 class SegmenterPlugin : public Vamp::Plugin | 21 class SegmenterPlugin : public Vamp::Plugin |
19 { | 22 { |
20 public: | 23 public: |
21 SegmenterPlugin(float inputSampleRate); | 24 SegmenterPlugin(float inputSampleRate); |
22 virtual ~SegmenterPlugin(); | 25 virtual ~SegmenterPlugin(); |
23 | 26 |
24 bool initialise(size_t channels, size_t stepSize, size_t blockSize); | 27 bool initialise(size_t channels, size_t stepSize, size_t blockSize); |
25 void reset(); | 28 void reset(); |
26 | 29 |
27 std::string getIdentifier() const { return "qm-segmenter"; } | 30 std::string getIdentifier() const { return "qm-segmenter"; } |
28 std::string getName() const { return "Segmenter"; } | 31 std::string getName() const { return "Segmenter"; } |
29 std::string getDescription() const { return "Divide the track into a sequence of consistent segments"; } | 32 std::string getDescription() const { return "Divide the track into a sequence of consistent segments"; } |
30 std::string getMaker() const; | 33 std::string getMaker() const; |
31 int getPluginVersion() const; | 34 int getPluginVersion() const; |
32 std::string getCopyright() const; | 35 std::string getCopyright() const; |
33 | 36 |
34 size_t getPreferredStepSize() const; | 37 size_t getPreferredStepSize() const; |
35 size_t getPreferredBlockSize() const; | 38 size_t getPreferredBlockSize() const; |
36 InputDomain getInputDomain() const { return TimeDomain; } | 39 InputDomain getInputDomain() const { return TimeDomain; } |
37 | 40 |
38 SegmenterPlugin::ParameterList getParameterDescriptors() const; | 41 SegmenterPlugin::ParameterList getParameterDescriptors() const; |
39 float getParameter(std::string param) const; | 42 float getParameter(std::string param) const; |
40 void setParameter(std::string param, float value); | 43 void setParameter(std::string param, float value); |
41 | 44 |
42 OutputList getOutputDescriptors() const; | 45 OutputList getOutputDescriptors() const; |
43 | 46 |
44 FeatureSet process(const float *const *inputBuffers, Vamp::RealTime timestamp); | 47 FeatureSet process(const float *const *inputBuffers, Vamp::RealTime timestamp); |
45 | 48 |
46 FeatureSet getRemainingFeatures(); | 49 FeatureSet getRemainingFeatures(); |
47 | 50 |
48 protected: | 51 protected: |
49 mutable Segmenter* segmenter; | 52 mutable Segmenter* segmenter; |
50 mutable int hopsize; | 53 mutable int hopsize; |
51 mutable int windowsize; | 54 mutable int windowsize; |
52 int nSegmentTypes; | 55 int nSegmentTypes; |
53 feature_types featureType; // 1 = constant-Q, 2 = chroma | 56 feature_types featureType; // 1 = constant-Q, 2 = chroma |
54 | 57 |
55 void makeSegmenter() const; | 58 void makeSegmenter() const; |
56 }; | 59 }; |
57 | 60 |
58 #endif | 61 #endif |
59 | 62 |