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