#include <pbd/error.h>
#include <pbd/compose.h>
-#include <pbd/pathscanner.h>
#include <pbd/failed_constructor.h>
#include <pbd/enumwriter.h>
#include <pbd/memento_command.h>
+#include <pbd/file_utils.h>
#include <gtkmm2ext/gtk_ui.h>
#include <gtkmm2ext/utils.h>
#include <ardour/ardour.h>
#include <ardour/profile.h>
+#include <ardour/session_directory.h>
#include <ardour/session_route.h>
#include <ardour/session_utils.h>
#include <ardour/port.h>
#include <ardour/port.h>
#include <ardour/audio_track.h>
#include <ardour/midi_track.h>
+#include <ardour/filesystem_paths.h>
#include "actions.h"
#include "ardour_ui.h"
#include "gui_thread.h"
#include "theme_manager.h"
+
#include "i18n.h"
using namespace ARDOUR;
using namespace sigc;
ARDOUR_UI *ARDOUR_UI::theArdourUI = 0;
+UIConfiguration *ARDOUR_UI::ui_config = 0;
sigc::signal<void,bool> ARDOUR_UI::Blink;
sigc::signal<void> ARDOUR_UI::RapidScreenUpdate;
sigc::signal<void> ARDOUR_UI::SuperRapidScreenUpdate;
sigc::signal<void,nframes_t, bool, nframes_t> ARDOUR_UI::Clock;
-sigc::signal<int,string> ThemeChanged;
ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
theArdourUI = this;
}
- /* load colors */
-
+ ui_config = new UIConfiguration();
theme_manager = new ThemeManager();
-
- std::string color_file = ARDOUR::find_config_file("ardour.colors");
-
- theme_manager->load (color_file);
-
+
editor = 0;
mixer = 0;
session = 0;
have_disk_speed_dialog_displayed = false;
session_loaded = false;
last_speed_displayed = -1.0f;
- keybindings_path = ARDOUR::find_config_file ("ardour.bindings");
ab_direction = true;
+ sys::path key_bindings_file;
+
+ find_file_in_search_path (ardour_search_path() + system_config_search_path(),
+ "ardour.bindings", key_bindings_file);
+
+ keybindings_path = key_bindings_file.to_string();
+
can_save_keybindings = false;
last_configure_time.tv_sec = 0;
gettimeofday (&last_peak_grab, 0);
gettimeofday (&last_shuttle_request, 0);
- ThemeChanged.connect (mem_fun(*this, &ARDOUR_UI::load_rcfile));
-
ARDOUR::Diskstream::DiskOverrun.connect (mem_fun(*this, &ARDOUR_UI::disk_overrun_handler));
ARDOUR::Diskstream::DiskUnderrun.connect (mem_fun(*this, &ARDOUR_UI::disk_underrun_handler));
XMLNode mnode(mixer->get_state());
if (session) {
- session->add_instant_xml (enode, session->path());
- session->add_instant_xml (mnode, session->path());
+ session->add_instant_xml (enode);
+ session->add_instant_xml (mnode);
} else {
- Config->add_instant_xml (enode, get_user_ardour_path());
- Config->add_instant_xml (mnode, get_user_ardour_path());
+ Config->add_instant_xml (enode);
+ Config->add_instant_xml (mnode);
}
save_keybindings ();
ARDOUR_UI::no_memory_warning ()
{
XMLNode node (X_("no-memory-warning"));
- Config->add_instant_xml (node, get_user_ardour_path());
+ Config->add_instant_xml (node);
}
void
return;
#else // !__APPLE__
- XMLNode* memory_warning_node = Config->instant_xml (X_("no-memory-warning"), get_user_ardour_path());
+ XMLNode* memory_warning_node = Config->instant_xml (X_("no-memory-warning"));
if (engine->is_realtime() && memory_warning_node == 0) {
}
engine->stop (true);
Config->save_state();
+ ARDOUR_UI::config()->save_state();
quit ();
}
break;
case Session::Recording:
case Session::Enabled:
- session->disable_record (true);
+ session->disable_record (false, true);
}
}
}
void
ARDOUR_UI::setup_theme ()
{
- string rcfile;
- char* env;
-
- if ((env = getenv ("ARDOUR2_UI_RC")) != 0 && strlen (env)) {
- rcfile = env;
- } else {
- rcfile = Config->get_ui_rc_file();
- }
-
- 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;
- }
-
- ThemeChanged (rcfile); //EMIT SIGNAL
- theme_manager->setup_theme_buttons();
+ theme_manager->setup_theme();
}
gint
dimage->set_alignment(ALIGN_LEFT, ALIGN_TOP);
+ const string dead_sound_directory = session->session_directory().dead_sound_path().to_string();
+
if (rep.space < 1048576.0f) {
if (removed > 1) {
- txt.set_text (string_compose (msg, removed, _("files were"), session->path() + "dead_sounds", (float) rep.space / 1024.0f, "kilo"));
+ txt.set_text (string_compose (msg, removed, _("files were"), dead_sound_directory, (float) rep.space / 1024.0f, "kilo"));
} else {
- txt.set_text (string_compose (msg, removed, _("file was"), session->path() + "dead_sounds", (float) rep.space / 1024.0f, "kilo"));
+ txt.set_text (string_compose (msg, removed, _("file was"), dead_sound_directory, (float) rep.space / 1024.0f, "kilo"));
}
} else {
if (removed > 1) {
- txt.set_text (string_compose (msg, removed, _("files were"), session->path() + "dead_sounds", (float) rep.space / 1048576.0f, "mega"));
+ txt.set_text (string_compose (msg, removed, _("files were"), dead_sound_directory, (float) rep.space / 1048576.0f, "mega"));
} else {
- txt.set_text (string_compose (msg, removed, _("file was"), session->path() + "dead_sounds", (float) rep.space / 1048576.0f, "mega"));
+ txt.set_text (string_compose (msg, removed, _("file was"), dead_sound_directory, (float) rep.space / 1048576.0f, "mega"));
}
}
XMLNode* node = 0;
if (session) {
- node = session->instant_xml(X_("Mixer"), session->path());
+ node = session->instant_xml(X_("Mixer"));
} else {
- node = Config->instant_xml(X_("Mixer"), get_user_ardour_path());
+ node = Config->instant_xml(X_("Mixer"));
}
if (!node) {
XMLNode* node = 0;
if (session) {
- node = session->instant_xml(X_("Editor"), session->path());
+ node = session->instant_xml(X_("Editor"));
} else {
- node = Config->instant_xml(X_("Editor"), get_user_ardour_path());
+ node = Config->instant_xml(X_("Editor"));
}
if (!node) {