2 Copyright (C) 2001-2007 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #include <sigc++/bind.h>
23 #include <gtkmm/settings.h>
25 #include <pbd/error.h>
26 #include <pbd/textreceiver.h>
27 #include <pbd/failed_constructor.h>
28 #include <pbd/pthread_utils.h>
30 #include <jack/jack.h>
32 #include <ardour/version.h>
33 #include <ardour/ardour.h>
34 #include <ardour/audioengine.h>
36 #include <gtkmm/main.h>
37 #include <gtkmm2ext/popup.h>
38 #include <gtkmm2ext/utils.h>
40 #include "svn_revision.h"
42 #include "ardour_ui.h"
49 using namespace ARDOUR_COMMAND_LINE;
50 using namespace ARDOUR;
54 TextReceiver text_receiver ("ardour");
56 extern int curvetest (string);
58 static ARDOUR_UI *ui = 0;
61 show_ui_callback (void *arg)
63 ARDOUR_UI * ui = (ARDOUR_UI *) arg;
71 /* this is called from the entry point of a wine-compiled
72 executable that is linked against gtk2_ardour built
76 int ardour_main (int argc, char *argv[])
78 int main (int argc, char *argv[])
82 vector<Glib::ustring> null_file_list;
87 (void) bindtextdomain (PACKAGE, LOCALEDIR);
88 /* our i18n translations are all in UTF-8, so make sure
89 that even if the user locale doesn't specify UTF-8,
90 we use that when handling them.
92 (void) bind_textdomain_codeset (PACKAGE,"UTF-8");
93 (void) textdomain (PACKAGE);
95 pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, 0);
97 // catch error message system signals ();
99 text_receiver.listen_to (error);
100 text_receiver.listen_to (info);
101 text_receiver.listen_to (fatal);
102 text_receiver.listen_to (warning);
104 if (parse_opts (argc, argv)) {
108 if (curvetest_file) {
109 return curvetest (curvetest_file);
112 cout << _("Ardour/GTK ")
114 << _("\n (built using ")
115 << ardour_svn_revision
117 << _(" and GCC version ") << __VERSION__
127 cerr << _("Copyright (C) 1999-2007 Paul Davis") << endl
128 << _("Some portions Copyright (C) Steve Harris, Ari Johnson, Brett Viren, Joel Baker") << endl
130 << _("Ardour comes with ABSOLUTELY NO WARRANTY") << endl
131 << _("not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.") << endl
132 << _("This is free software, and you are welcome to redistribute it ") << endl
133 << _("under certain conditions; see the source for copying conditions.")
137 /* some GUI objects need this */
142 ui = new ARDOUR_UI (&argc, &argv);
143 } catch (failed_constructor& err) {
144 error << _("could not create ARDOUR GUI") << endmsg;
150 if (session_name.length()) {
151 g_timeout_add (4000, show_ui_callback, ui);
155 if (!keybindings_path.empty()) {
156 ui->set_keybindings_path (keybindings_path);
159 ui->run (text_receiver);
163 pthread_cancel_all ();
167 } // end of extern C block