c@36
|
1 /*
|
c@36
|
2 * SegmeterPlugin.h
|
c@36
|
3 * soundbite
|
c@36
|
4 *
|
c@36
|
5 * Created by Mark Levy on 24/03/2006.
|
c@36
|
6 * Copyright 2006 Centre for Digital Music, Queen Mary, University of London. All rights reserved.
|
c@36
|
7 *
|
c@36
|
8 */
|
c@36
|
9
|
c@36
|
10 #ifndef _SEGMENTER_PLUGIN_H_
|
c@36
|
11 #define _SEGMENTER_PLUGIN_H_
|
c@36
|
12
|
c@36
|
13 #include <vamp-sdk/Plugin.h>
|
c@36
|
14 #include <vamp-sdk/RealTime.h>
|
c@37
|
15 #include "dsp/segmentation/Segmenter.h"
|
c@37
|
16 #include "dsp/segmentation/segment.h"
|
c@36
|
17
|
c@36
|
18 class SegmenterPlugin : public Vamp::Plugin
|
c@36
|
19 {
|
c@36
|
20 public:
|
c@36
|
21 SegmenterPlugin(float inputSampleRate);
|
c@36
|
22 virtual ~SegmenterPlugin();
|
c@36
|
23
|
c@36
|
24 bool initialise(size_t channels, size_t stepSize, size_t blockSize);
|
c@36
|
25 void reset();
|
c@36
|
26
|
c@37
|
27 std::string getIdentifier() const { return "qm-segmenter"; }
|
c@36
|
28 std::string getName() const { return "Segmenter"; }
|
c@36
|
29 std::string getDescription() const { return "Divide the track into a sequence of consistent segments"; }
|
c@36
|
30 std::string getMaker() const;
|
c@36
|
31 int getPluginVersion() const;
|
c@36
|
32 std::string getCopyright() const;
|
c@36
|
33
|
c@36
|
34 size_t getPreferredStepSize() const;
|
c@36
|
35 size_t getPreferredBlockSize() const;
|
c@36
|
36 InputDomain getInputDomain() const { return TimeDomain; }
|
c@36
|
37
|
c@36
|
38 SegmenterPlugin::ParameterList getParameterDescriptors() const;
|
c@36
|
39 float getParameter(std::string param) const;
|
c@36
|
40 void setParameter(std::string param, float value);
|
c@36
|
41
|
c@36
|
42 OutputList getOutputDescriptors() const;
|
c@36
|
43
|
c@36
|
44 FeatureSet process(const float *const *inputBuffers, Vamp::RealTime timestamp);
|
c@36
|
45
|
c@36
|
46 FeatureSet getRemainingFeatures();
|
c@36
|
47
|
c@36
|
48 protected:
|
c@36
|
49 mutable Segmenter* segmenter;
|
c@36
|
50 mutable int hopsize;
|
c@36
|
51 mutable int windowsize;
|
c@36
|
52 int nSegmentTypes;
|
c@36
|
53 feature_types featureType; // 1 = constant-Q, 2 = chroma
|
c@36
|
54
|
c@36
|
55 void makeSegmenter() const;
|
c@36
|
56 };
|
c@36
|
57
|
c@36
|
58 #endif
|
c@36
|
59
|