Make import GUI report if you are importing a file of a name that
[ardour.git] / libs / ardour / vst_plugin.cc
index 800c5a98561f84d141f4f6f492b8ecd8789457c2..2211b028a7d81cce63e938f6c4e41a6a2016838b 100644 (file)
@@ -15,7 +15,6 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id$
 */
 
 #include <algorithm>
@@ -110,16 +109,6 @@ VSTPlugin::set_block_size (nframes_t nframes)
        activate ();
 }
 
-void
-VSTPlugin::store_state (PluginState& state)
-{
-}
-
-void
-VSTPlugin::restore_state (PluginState& state)
-{
-}
-
 float
 VSTPlugin::default_value (uint32_t port)
 {
@@ -152,7 +141,7 @@ VSTPlugin::get_state()
 {
        XMLNode *root = new XMLNode (state_node_name());
        LocaleGuard lg (X_("POSIX"));
-       
+
        if (_plugin->flags & effFlagsProgramChunks) {
 
                /* fetch the current chunk */
@@ -169,8 +158,8 @@ VSTPlugin::get_state()
                string path;
                struct stat sbuf;
 
-               path = getenv ("HOME");
-               path += "/.ardour/vst";
+               path = get_user_ardour_path ();
+               path += "vst";
 
                if (stat (path.c_str(), &sbuf)) {
                        if (errno == ENOENT) {
@@ -183,9 +172,8 @@ VSTPlugin::get_state()
 
                        } else {
 
-                               error << string_compose (_("cannot check VST chunk directory: %1"),
-                                                 strerror (errno))
-                                     << endmsg;
+                               warning << string_compose (_("cannot check VST chunk directory: %1"), strerror (errno))
+                                       << endmsg;
                                return *root;
                        }
 
@@ -420,10 +408,12 @@ VSTPlugin::activate ()
        _plugin->dispatcher (_plugin, effMainsChanged, 0, 1, NULL, 0.0f);
 }
 
-uint32_t 
+string
 VSTPlugin::unique_id() const
 {
-       return _plugin->uniqueID;
+       char buf[32];
+       snprintf (buf, sizeof (buf), "%d", _plugin->uniqueID);
+       return string (buf);
 }