Merging from trunk
[ardour.git] / gtk2_ardour / main.cc
index e9ac25a8f81b0f28e8f781dc6eff69473a43e67e..778355c858414b1793c509ef36df39cbbd84b7e0 100644 (file)
@@ -53,6 +53,7 @@
 using namespace Gtk;
 using namespace GTK_ARDOUR;
 using namespace ARDOUR;
+using namespace PBD;
 using namespace sigc;
 
 TextReceiver text_receiver ("ardour");
@@ -102,12 +103,6 @@ handler (int sig)
        shutdown (1);
 }
 
-static void 
-handler2 (int sig, siginfo_t* ctxt, void* ignored)
-{
-       handler (sig);
-}      
-
 static void *
 signal_thread (void *arg)
 {
@@ -361,8 +356,17 @@ To create it from the command line, start ardour as \"ardour --new %1"), path)
        return true;
 }
 
-int
-main (int argc, char *argv[])
+#ifdef VST_SUPPORT
+/* this is called from the entry point of a wine-compiled
+   executable that is linked against gtk2_ardour built
+   as a shared library.
+*/
+extern "C" {
+int ardour_main (int argc, char *argv[])
+#else
+int main (int argc, char *argv[])
+#endif
+
 {
        ARDOUR::AudioEngine *engine;
        vector<Glib::ustring> null_file_list;
@@ -442,7 +446,7 @@ main (int argc, char *argv[])
        
        try { 
                engine = new ARDOUR::AudioEngine (jack_client_name);
-               ARDOUR::init (*engine, use_vst, try_hw_optimization, handler2);
+               ARDOUR::init (*engine, use_vst, try_hw_optimization);
                ui->set_engine (*engine);
        } catch (AudioEngine::NoBackendAvailable& err) {
                gui_jack_error ();
@@ -458,11 +462,13 @@ main (int argc, char *argv[])
                ui = 0;
        }
 
-  out:
        delete engine;
        ARDOUR::cleanup ();
        shutdown (0);
 
-       /* just another commit forcing change */
+       return 0;
 }
+#ifdef VST_SUPPORT
+} // end of extern C block
+#endif