~mr-unwell2006/mixxx/features_key_preferences

« back to all changes in this revision

Viewing changes to mixxx/src/vamp/vampanalyser.h

  • Committer: Keith Salisbury
  • Date: 2012-06-24 07:28:29 UTC
  • mfrom: (3002.1.281 trunk)
  • Revision ID: keithsalisbury@gmail.com-20120624072829-y14q80b9dnac35c2
merged with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * vampanalyser.h
 
3
 *  Created on: 14/mar/2011
 
4
 *      Author: Vittorio Colao
 
5
 *      Original ideas taken from Audacity VampEffect class from Chris Cannam.
 
6
 */
 
7
 
 
8
#ifndef VAMPANALYSER_H_
 
9
#define VAMPANALYSER_H_
 
10
 
 
11
#include <QString>
 
12
#include <QList>
 
13
#include <QVector>
 
14
#include <vamp-hostsdk/vamp-hostsdk.h>
 
15
 
 
16
#include "vamp/vamppluginloader.h"
 
17
#include "sampleutil.h"
 
18
#include "configobject.h"
 
19
 
 
20
class VampAnalyser {
 
21
  public:
 
22
    VampAnalyser(ConfigObject<ConfigValue> *pconfig);
 
23
    virtual ~VampAnalyser();
 
24
 
 
25
    bool Init(const QString pluginlibrary, const QString pluginid,
 
26
              const int samplerate, const int TotalSamples, bool bFastAnalysis);
 
27
    bool Process(const CSAMPLE *pIn, const int iLen);
 
28
    bool End();
 
29
    bool SetParameter(const QString parameter, const double value);
 
30
 
 
31
    QVector<double> GetInitFramesVector();
 
32
    QVector<double> GetEndFramesVector();
 
33
    QVector<QString> GetLabelsVector();
 
34
    QVector<double> GetFirstValuesVector();
 
35
    QVector<double> GetLastValuesVector();
 
36
 
 
37
    // Initialize the VAMP_PATH environment variable to point to the default
 
38
    // places that Mixxx VAMP plugins are deployed on installation. If a
 
39
    // VAMP_PATH environment variable is already set by the user, then this
 
40
    // method appends to that.
 
41
    static void initializePluginPaths();
 
42
 
 
43
  private:
 
44
    void SelectOutput(const int outputnumber);
 
45
 
 
46
    Vamp::HostExt::PluginLoader::PluginKey m_key;
 
47
    int m_iSampleCount, m_iOUT, m_iRemainingSamples,
 
48
        m_iBlockSize, m_iStepSize, m_rate, m_iOutput;
 
49
    CSAMPLE ** m_pluginbuf;
 
50
    Vamp::Plugin *m_plugin;
 
51
    Vamp::Plugin::ParameterList mParameters;
 
52
    Vamp::Plugin::FeatureList m_Results;
 
53
 
 
54
    bool m_bDoNotAnalyseMoreSamples;
 
55
    bool m_FastAnalysisEnabled;
 
56
    int m_iMaxSamplesToAnalyse;
 
57
    /** Pointer to config object */
 
58
    ConfigObject<ConfigValue>* m_pConfig;
 
59
};
 
60
 
 
61
#endif /* VAMPANALYSER_H_ */