diff FChTransformF0gram.h @ 15:0a860992b4f4 spect

Break out the plugin into three different plugins (using the same class in different modes) in order to provide simplistic and more sophisticated spectrograms as well as the f0-gram. Remove the program support, since it doesn't work usefully anyway (it just overrides the user's preferred settings).
author Chris Cannam
date Wed, 03 Oct 2018 13:16:09 +0100
parents 44b86c346a5a
children ce62ed201de8
line wrap: on
line diff
--- a/FChTransformF0gram.h	Tue Oct 02 16:38:52 2018 +0100
+++ b/FChTransformF0gram.h	Wed Oct 03 13:16:09 2018 +0100
@@ -33,9 +33,16 @@
 
 using _VampPlugin::Vamp::FFTReal;
 
-class FChTransformF0gram : public Vamp::Plugin {
+class FChTransformF0gram : public Vamp::Plugin
+{
 public:
-    FChTransformF0gram(float inputSampleRate);
+    enum ProcessingMode {
+        ModeF0Gram,
+        ModeSpectrogram,
+        ModeRoughSpectrogram
+    };
+    
+    FChTransformF0gram(ProcessingMode mode, float inputSampleRate);
     virtual ~FChTransformF0gram();
 
     string getIdentifier() const;
@@ -56,8 +63,6 @@
     void setParameter(string identifier, float value);
 
     ProgramList getPrograms() const;
-    string getCurrentProgram() const;
-    void selectProgram(string name);
 
     OutputList getOutputDescriptors() const;
 
@@ -70,8 +75,7 @@
     FeatureSet getRemainingFeatures();
 
 protected:
-
-    string m_currentProgram;
+    ProcessingMode m_processingMode;
     int m_stepSize;
     int m_blockSize;
     float m_fs; // input sampling rate (inputSampleRate)
@@ -110,7 +114,12 @@
     } f0_parameters;
 
     f0_parameters m_f0_params;
-    bool m_f0gram_mode;
+
+    enum F0GramMode {
+        AllBinsOfBestDirection,
+        BestBinOfAllDirections
+    };
+    F0GramMode m_f0gram_mode;
 
     // ======== GATHERED LOG SPECTRUM PARAMETERS =======