summaryrefslogtreecommitdiff
path: root/libs/ardour/insert.cc
diff options
context:
space:
mode:
authorTaybin Rutkin <taybin@taybin.com>2006-08-10 04:01:15 +0000
committerTaybin Rutkin <taybin@taybin.com>2006-08-10 04:01:15 +0000
commit77a13df5bd70bf87ee856b81acec7eeed5b1f033 (patch)
treea3b6fcceecc0ab7f5607c986cfc4c4d88b2ad2d4 /libs/ardour/insert.cc
parentd4dd338beb813bcfe7470729cf6611aeea55cfa4 (diff)
Moved PluginInfo::Type to ARDOUR::PluginType in ardour/types.h.
Figured out (mostly) AUPluginUI hierarchy. Moved LadspaPluginUI to its own ladspa_pluginui.cc file. git-svn-id: svn://localhost/ardour2/trunk@782 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/insert.cc')
-rw-r--r--libs/ardour/insert.cc52
1 files changed, 48 insertions, 4 deletions
diff --git a/libs/ardour/insert.cc b/libs/ardour/insert.cc
index a057fef931..18727e8b5b 100644
--- a/libs/ardour/insert.cc
+++ b/libs/ardour/insert.cc
@@ -30,9 +30,18 @@
#include <ardour/port.h>
#include <ardour/route.h>
#include <ardour/ladspa_plugin.h>
+
+#ifdef VST_SUPPORT
#include <ardour/vst_plugin.h>
+#endif
+
+#ifdef HAVE_COREAUDIO
+#include <ardour/audio_unit.h>
+#endif
+
#include <ardour/audioengine.h>
#include <ardour/session.h>
+#include <ardour/types.h>
#include "i18n.h"
@@ -45,7 +54,6 @@ Insert::Insert(Session& s, Placement p)
{
}
-
Insert::Insert(Session& s, Placement p, int imin, int imax, int omin, int omax)
: Redirect (s, s.next_insert_name(), p, imin, imax, omin, omax)
{
@@ -505,6 +513,9 @@ PluginInsert::plugin_factory (boost::shared_ptr<Plugin> other)
#ifdef VST_SUPPORT
boost::shared_ptr<VSTPlugin> vp;
#endif
+#ifdef HAVE_COREAUDIO
+ boost::shared_ptr<AUPlugin> ap;
+#endif
if ((lp = boost::dynamic_pointer_cast<LadspaPlugin> (other)) != 0) {
return boost::shared_ptr<Plugin> (new LadspaPlugin (*lp));
@@ -512,6 +523,10 @@ PluginInsert::plugin_factory (boost::shared_ptr<Plugin> other)
} else if ((vp = boost::dynamic_pointer_cast<VSTPlugin> (other)) != 0) {
return boost::shared_ptr<Plugin> (new VSTPlugin (*vp));
#endif
+#ifdef HAVE_COREAUDIO
+ } else if ((ap = boost::dynamic_pointer_cast<AUPlugin> (other)) != 0) {
+ return boost::shared_ptr<Plugin> (new AUPlugin (*ap));
+#endif
}
fatal << string_compose (_("programming error: %1"),
@@ -630,7 +645,7 @@ PluginInsert::set_state(const XMLNode& node)
XMLPropertyList plist;
const XMLProperty *prop;
long unique = 0;
- PluginInfo::Type type;
+ ARDOUR::PluginType type;
if ((prop = node.property ("type")) == 0) {
error << _("XML node describing insert is missing the `type' field") << endmsg;
@@ -638,9 +653,9 @@ PluginInsert::set_state(const XMLNode& node)
}
if (prop->value() == X_("ladspa") || prop->value() == X_("Ladspa")) { /* handle old school sessions */
- type = PluginInfo::LADSPA;
+ type = ARDOUR::LADSPA;
} else if (prop->value() == X_("vst")) {
- type = PluginInfo::VST;
+ type = ARDOUR::VST;
} else {
error << string_compose (_("unknown plugin type %1 in plugin insert state"),
prop->value())
@@ -807,6 +822,35 @@ PluginInsert::state_factory (std::string why) const
return state;
}
+ARDOUR::PluginType
+PluginInsert::type ()
+{
+ boost::shared_ptr<LadspaPlugin> lp;
+#ifdef VST_SUPPORT
+ boost::shared_ptr<VSTPlugin> vp;
+#endif
+#ifdef HAVE_COREAUDIO
+ boost::shared_ptr<AUPlugin> ap;
+#endif
+
+ PluginPtr other = plugin ();
+
+ if ((lp = boost::dynamic_pointer_cast<LadspaPlugin> (other)) != 0) {
+ return ARDOUR::LADSPA;
+#ifdef VST_SUPPORT
+ } else if ((vp = boost::dynamic_pointer_cast<VSTPlugin> (other)) != 0) {
+ return ARDOUR::VST;
+#endif
+#ifdef HAVE_COREAUDIO
+ } else if ((ap = boost::dynamic_pointer_cast<AUPlugin> (other)) != 0) {
+ return ARDOUR::AudioUnit;
+#endif
+ } else {
+ /* NOT REACHED */
+ return (ARDOUR::PluginType) 0;
+ }
+}
+
/***************************************************************
Port inserts: send output to a port, pick up input at a port
***************************************************************/