break out ARDOUR::PluginType
authorRobin Gareus <robin@gareus.org>
Fri, 28 Feb 2014 16:32:22 +0000 (17:32 +0100)
committerRobin Gareus <robin@gareus.org>
Fri, 28 Feb 2014 16:48:21 +0000 (17:48 +0100)
libs/ardour/ardour/plugin_types.h [new file with mode: 0644]
libs/ardour/ardour/types.h
libs/ardour/vst_info_file.cc

diff --git a/libs/ardour/ardour/plugin_types.h b/libs/ardour/ardour/plugin_types.h
new file mode 100644 (file)
index 0000000..e0dd660
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+    Copyright (C) 2002 Paul Davis
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#ifndef __ardour_plugin_types_h__
+#define __ardour_plugin_types_h__
+
+namespace ARDOUR {
+
+       enum PluginType {
+               AudioUnit,
+               LADSPA,
+               LV2,
+               Windows_VST,
+               LXVST,
+       };
+
+}
+#endif
index 50a96030b19ac05ec955fd2c47c4f006adde0c37..ab76208c0b7b55d85ad75b6db862973532e3e9a8 100644 (file)
@@ -38,6 +38,7 @@
 #include "evoral/Range.hpp"
 
 #include "ardour/chan_count.h"
+#include "ardour/plugin_types.h"
 
 #include <map>
 
@@ -469,14 +470,6 @@ namespace ARDOUR {
                PeakDatum max;
        };
 
-       enum PluginType {
-               AudioUnit,
-               LADSPA,
-               LV2,
-               Windows_VST,
-               LXVST,
-       };
-
        enum RunContext {
                ButlerContext = 0,
                TransportContext,
index cc0ac8431c18a7c93b753beeceb62966c75c8363..e6ab197fd026fee64a24f705d4318273666947c7 100644 (file)
@@ -49,6 +49,7 @@
 
 #include "ardour/filesystem_paths.h"
 #include "ardour/linux_vst_support.h"
+#include "ardour/plugin_types.h"
 #include "ardour/vst_info_file.h"
 
 #define MAX_STRING_LEN 256
@@ -532,7 +533,7 @@ vstfx_parse_vst_state (VSTState* vstfx)
 }
 
 static void
-vstfx_info_from_plugin (const char *dllpath, VSTState* vstfx, vector<VSTInfo *> *infos, int type)
+vstfx_info_from_plugin (const char *dllpath, VSTState* vstfx, vector<VSTInfo *> *infos, enum ARDOUR::PluginType type)
 {
        assert(vstfx);
        VSTInfo *info;
@@ -574,10 +575,10 @@ vstfx_info_from_plugin (const char *dllpath, VSTState* vstfx, vector<VSTInfo *>
                                bool ok;
                                switch (type) { // TODO use lib ardour's type
 #ifdef WINDOWS_VST_SUPPORT
-                                       case 1:  ok = vstfx_instantiate_and_get_info_fst(dllpath, infos, id); break;
+                                       case ARDOUR::Windows_VST:  ok = vstfx_instantiate_and_get_info_fst(dllpath, infos, id); break;
 #endif
 #ifdef LXVST_SUPPORT
-                                       case 2:  ok = vstfx_instantiate_and_get_info_lx(dllpath, infos, id); break;
+                                       case ARDOUR::LXVST:  ok = vstfx_instantiate_and_get_info_lx(dllpath, infos, id); break;
 #endif
                                        default: ok = false;
                                }
@@ -670,7 +671,7 @@ vstfx_instantiate_and_get_info_lx (
 
        vstfx_current_loading_id = 0;
 
-       vstfx_info_from_plugin(dllpath, vstfx, infos, 2);
+       vstfx_info_from_plugin(dllpath, vstfx, infos, ARDOUR::LXVST);
 
        vstfx_close (vstfx);
        vstfx_unload (h);
@@ -700,7 +701,7 @@ vstfx_instantiate_and_get_info_fst (
        }
        vstfx_current_loading_id = 0;
 
-       vstfx_info_from_plugin(dllpath, vstfx, infos, 1);
+       vstfx_info_from_plugin(dllpath, vstfx, infos, ARDOUR::Windows_VST);
 
        fst_close(vstfx);
        //fst_unload(&h); // XXX -> fst_close()
@@ -717,7 +718,7 @@ static void parse_scanner_output (std::string msg, size_t /*len*/)
 #endif
 
 static vector<VSTInfo *> *
-vstfx_get_info (const char* dllpath, int type, enum VSTScanMode mode)
+vstfx_get_info (const char* dllpath, enum ARDOUR::PluginType type, enum VSTScanMode mode)
 {
        FILE* infofile;
        vector<VSTInfo*> *infos = new vector<VSTInfo*>;
@@ -784,12 +785,12 @@ vstfx_get_info (const char* dllpath, int type, enum VSTScanMode mode)
        /* blacklist in case instantiation fails */
        vstfx_blacklist(dllpath);
 
-       switch (type) { // TODO use lib ardour's type
+       switch (type) {
 #ifdef WINDOWS_VST_SUPPORT
-               case 1:  ok = vstfx_instantiate_and_get_info_fst(dllpath, infos, 0); break;
+               case ARDOUR::Windows_VST:  ok = vstfx_instantiate_and_get_info_fst(dllpath, infos, 0); break;
 #endif
 #ifdef LXVST_SUPPORT
-               case 2:  ok = vstfx_instantiate_and_get_info_lx(dllpath, infos, 0); break;
+               case ARDOUR::LXVST:  ok = vstfx_instantiate_and_get_info_lx(dllpath, infos, 0); break;
 #endif
                default: ok = false;
        }
@@ -854,7 +855,7 @@ get_personal_vst_info_cache_dir() {
 vector<VSTInfo *> *
 vstfx_get_info_lx (char* dllpath, enum VSTScanMode mode)
 {
-       return vstfx_get_info(dllpath, 2, mode);
+       return vstfx_get_info(dllpath, ARDOUR::LXVST, mode);
 }
 #endif
 
@@ -862,6 +863,6 @@ vstfx_get_info_lx (char* dllpath, enum VSTScanMode mode)
 vector<VSTInfo *> *
 vstfx_get_info_fst (char* dllpath, enum VSTScanMode mode)
 {
-       return vstfx_get_info(dllpath, 1, mode);
+       return vstfx_get_info(dllpath, ARDOUR::Windows_VST, mode);
 }
 #endif