#include <ardour/version.h>
#include <ardour/ardour.h>
#include <ardour/audioengine.h>
+#include <ardour/session_utils.h>
#include <gtkmm/main.h>
#include <gtkmm2ext/popup.h>
static ARDOUR_UI *ui = 0;
-string
-which_ui_rcfile ()
-{
- string rcfile;
- char* env;
-
- if ((env = getenv ("ARDOUR2_UI_RC")) != 0 && strlen (env)) {
- rcfile = env;
- } else {
- rcfile = "ardour2_ui.rc";
- }
-
- rcfile = find_config_file (rcfile);
-
- if (rcfile.empty()) {
- warning << _("Without a UI style file, ardour will look strange.\n Please set ARDOUR2_UI_RC to point to a valid UI style file") << endmsg;
- } else {
- cerr << "Loading ui configuration file " << rcfile << endl;
- }
-
- return rcfile;
-}
-
gint
show_ui_callback (void *arg)
{
if (!session_name.length()) {
ui->hide_splash ();
if (!Config->get_no_new_session_dialog()) {
- ui->new_session ();
+ if (!ui->new_session ()) {
+ return false;
+ }
}
return true;
bool isnew;
- if (Session::find_session (session_name, path, name, isnew)) {
+ if (find_session (session_name, path, name, isnew)) {
error << string_compose(_("could not load command line session \"%1\""), session_name) << endmsg;
return false;
}
/* Show the NSD */
ui->hide_splash ();
if (!Config->get_no_new_session_dialog()) {
- ui->new_session ();
+ if (!ui->new_session ()) {
+ return false;
+ }
}
}
#endif
{
- ARDOUR::AudioEngine *engine;
+ ARDOUR::AudioEngine *engine = NULL;
vector<Glib::ustring> null_file_list;
- Glib::thread_init();
+ Glib::thread_init();
gtk_set_locale ();
(void) bindtextdomain (PACKAGE, LOCALEDIR);
PBD::ID::init ();
- try {
- ui = new ARDOUR_UI (&argc, &argv, which_ui_rcfile());
+ try {
+ ui = new ARDOUR_UI (&argc, &argv);
} catch (failed_constructor& err) {
error << _("could not create ARDOUR GUI") << endmsg;
exit (1);
}
}
- try {
+ try {
ARDOUR::init (use_vst, try_hw_optimization);
setup_gtk_ardour_enums ();
Config->set_current_owner (ConfigVariableBase::Interface);
+ ui->setup_profile ();
try {
engine = new ARDOUR::AudioEngine (jack_client_name);
error << string_compose (_("Could not connect to JACK server as \"%1\""), jack_client_name) << endmsg;
return -1;
}
+
+ ARDOUR::setup_midi(*engine);
ui->set_engine (*engine);