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@135
|
8
|
c@135
|
9 This program is free software; you can redistribute it and/or
|
c@135
|
10 modify it under the terms of the GNU General Public License as
|
c@135
|
11 published by the Free Software Foundation; either version 2 of the
|
c@135
|
12 License, or (at your option) any later version. See the file
|
c@135
|
13 COPYING included with this distribution for more information.
|
c@36
|
14 */
|
c@36
|
15
|
c@36
|
16 #ifndef _SEGMENTER_PLUGIN_H_
|
c@36
|
17 #define _SEGMENTER_PLUGIN_H_
|
c@36
|
18
|
c@36
|
19 #include <vamp-sdk/Plugin.h>
|
c@36
|
20 #include <vamp-sdk/RealTime.h>
|
c@37
|
21 #include "dsp/segmentation/Segmenter.h"
|
c@37
|
22 #include "dsp/segmentation/segment.h"
|
c@36
|
23
|
c@38
|
24 class Decimator;
|
c@38
|
25
|
c@36
|
26 class SegmenterPlugin : public Vamp::Plugin
|
c@36
|
27 {
|
c@36
|
28 public:
|
c@36
|
29 SegmenterPlugin(float inputSampleRate);
|
c@36
|
30 virtual ~SegmenterPlugin();
|
c@36
|
31
|
c@36
|
32 bool initialise(size_t channels, size_t stepSize, size_t blockSize);
|
c@36
|
33 void reset();
|
c@36
|
34
|
c@45
|
35 std::string getIdentifier() const;
|
c@45
|
36 std::string getName() const;
|
c@45
|
37 std::string getDescription() const;
|
c@36
|
38 std::string getMaker() const;
|
c@36
|
39 int getPluginVersion() const;
|
c@36
|
40 std::string getCopyright() const;
|
c@36
|
41
|
c@36
|
42 size_t getPreferredStepSize() const;
|
c@36
|
43 size_t getPreferredBlockSize() const;
|
c@38
|
44 InputDomain getInputDomain() const { return TimeDomain; }
|
c@38
|
45
|
c@38
|
46 SegmenterPlugin::ParameterList getParameterDescriptors() const;
|
c@38
|
47 float getParameter(std::string param) const;
|
c@38
|
48 void setParameter(std::string param, float value);
|
c@38
|
49
|
c@36
|
50 OutputList getOutputDescriptors() const;
|
c@38
|
51
|
c@36
|
52 FeatureSet process(const float *const *inputBuffers, Vamp::RealTime timestamp);
|
c@38
|
53
|
c@36
|
54 FeatureSet getRemainingFeatures();
|
c@36
|
55
|
c@36
|
56 protected:
|
c@38
|
57 mutable Segmenter* segmenter;
|
c@38
|
58 mutable int hopsize;
|
c@38
|
59 mutable int windowsize;
|
c@96
|
60 mutable float neighbourhoodLimit; // in sec
|
c@38
|
61 int nSegmentTypes;
|
c@38
|
62 feature_types featureType; // 1 = constant-Q, 2 = chroma
|
c@150
|
63 Vamp::RealTime m_endTime;
|
c@38
|
64
|
c@38
|
65 void makeSegmenter() const;
|
c@36
|
66 };
|
c@36
|
67
|
c@36
|
68 #endif
|
c@36
|
69
|