~ubuntu-branches/ubuntu/gutsy/audacity/gutsy-backports

« back to all changes in this revision

Viewing changes to src/effects/vamp/VampEffect.h

  • Committer: Bazaar Package Importer
  • Author(s): John Dong
  • Date: 2008-02-18 21:58:19 UTC
  • mfrom: (13.1.2 hardy)
  • Revision ID: james.westby@ubuntu.com-20080218215819-tmbcf1rx238r8gdv
Tags: 1.3.4-1.1ubuntu1~gutsy1
Automated backport upload; no source changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**********************************************************************
 
2
 
 
3
  Audacity: A Digital Audio Editor
 
4
 
 
5
  VampEffect.h
 
6
 
 
7
  Chris Cannam
 
8
 
 
9
  Vamp is an audio analysis and feature extraction plugin API.
 
10
  http://www.vamp-plugins.org/
 
11
 
 
12
**********************************************************************/
 
13
 
 
14
#include "../Effect.h"
 
15
#include "../../LabelTrack.h"
 
16
 
 
17
class wxSlider;
 
18
class wxStaticText;
 
19
class wxTextCtrl;
 
20
class wxCheckBox;
 
21
class wxComboBox;
 
22
 
 
23
#include <wx/dialog.h>
 
24
 
 
25
#ifdef _WIN32
 
26
#include "../../../lib-src/libvamp/vamp-sdk/hostext/PluginLoader.h"
 
27
#else
 
28
#include <vamp-sdk/hostext/PluginLoader.h>
 
29
#endif
 
30
 
 
31
void LoadVampPlugins();
 
32
 
 
33
class VampEffect : public Effect {
 
34
   
 
35
 public:
 
36
 
 
37
   VampEffect(Vamp::HostExt::PluginLoader::PluginKey key,
 
38
              int output,
 
39
              bool hasParameters,
 
40
              wxString name);
 
41
   virtual ~VampEffect();
 
42
 
 
43
   virtual wxString GetEffectName();
 
44
   
 
45
   virtual wxString GetEffectIdentifier();
 
46
 
 
47
   virtual wxString GetEffectAction();
 
48
 
 
49
   virtual int GetEffectFlags();
 
50
 
 
51
   virtual bool Init();
 
52
 
 
53
   virtual bool PromptUser();
 
54
 
 
55
   virtual bool Process();
 
56
 
 
57
   virtual void End();
 
58
 
 
59
 private:
 
60
 
 
61
   VampEffect(const VampEffect &);
 
62
   VampEffect &operator=(const VampEffect &);
 
63
 
 
64
   Vamp::HostExt::PluginLoader::PluginKey mKey;
 
65
   int mOutput;
 
66
   bool mHasParameters;
 
67
   wxString mName;
 
68
   double mRate;
 
69
 
 
70
   Vamp::Plugin *mPlugin;
 
71
 
 
72
   void GetSamples(WaveTrack *track,
 
73
                   longSampleCount *start,
 
74
                   sampleCount *len);
 
75
 
 
76
   void AddFeatures(LabelTrack *track,
 
77
                    Vamp::Plugin::FeatureSet &features);
 
78
};
 
79
 
 
80
 
 
81
class VampEffectDialog : public wxDialog {
 
82
 
 
83
   DECLARE_DYNAMIC_CLASS(VampEffectDialog)
 
84
 
 
85
 public:
 
86
   VampEffectDialog(VampEffect *effect,
 
87
                    wxWindow *parent,
 
88
                    Vamp::Plugin *plugin);
 
89
   ~VampEffectDialog();
 
90
 
 
91
   void OnCheckBox(wxCommandEvent & event);
 
92
   void OnComboBox(wxCommandEvent & event);
 
93
   void OnSlider(wxCommandEvent & event);
 
94
   void OnTextCtrl(wxCommandEvent & event);
 
95
   void OnOK(wxCommandEvent & event);
 
96
   void OnCancel(wxCommandEvent & event);
 
97
   void OnPreview(wxCommandEvent & event);
 
98
   void ControlSetFocus(wxFocusEvent & event);
 
99
 
 
100
   DECLARE_EVENT_TABLE()
 
101
 
 
102
 private:
 
103
   void HandleText();
 
104
   void UpdateFromPlugin();
 
105
   void ConnectFocus(wxControl *c);
 
106
   void DisconnectFocus(wxControl *c);
 
107
   bool inSlider;
 
108
   bool inText;
 
109
 
 
110
   VampEffect *mEffect;
 
111
   Vamp::Plugin *mPlugin;
 
112
   Vamp::Plugin::ParameterList mParameters;
 
113
 
 
114
   wxSlider **sliders;
 
115
   wxTextCtrl **fields;
 
116
   wxStaticText **labels;
 
117
   wxCheckBox **toggles;
 
118
   wxComboBox **combos;
 
119
   wxComboBox *programCombo;
 
120
};
 
121
 
 
122
// Indentation settings for Vim and Emacs and unique identifier for Arch, a
 
123
// version control system. Please do not modify past this point.
 
124
//
 
125
// Local Variables:
 
126
// c-basic-offset: 3
 
127
// indent-tabs-mode: nil
 
128
// End:
 
129
//
 
130
// vim: et sts=3 sw=3
 
131
// arch-tag: d8622b59-5c08-4e7f-a170-2502ff8af8e5