#include "pbd/file_utils.h"
#include "gtkmm2ext/application.h"
+#include "gtkmm2ext/bindings.h"
#include "gtkmm2ext/gtk_ui.h"
#include "gtkmm2ext/utils.h"
#include "gtkmm2ext/click_box.h"
typedef uint64_t microseconds_t;
+#include "about.h"
#include "actions.h"
+#include "add_route_dialog.h"
+#include "ambiguous_file_dialog.h"
#include "ardour_ui.h"
-#include "public_editor.h"
#include "audio_clock.h"
+#include "bundle_manager.h"
+#include "engine_dialog.h"
+#include "gain_meter.h"
+#include "global_port_matrix.h"
+#include "gui_thread.h"
#include "keyboard.h"
+#include "location_ui.h"
+#include "missing_file_dialog.h"
+#include "missing_plugin_dialog.h"
#include "mixer_ui.h"
-#include "prompter.h"
#include "opts.h"
-#include "add_route_dialog.h"
-#include "about.h"
-#include "splash.h"
-#include "utils.h"
-#include "gui_thread.h"
-#include "theme_manager.h"
-#include "bundle_manager.h"
-#include "session_metadata_dialog.h"
-#include "gain_meter.h"
+#include "processor_box.h"
+#include "prompter.h"
+#include "public_editor.h"
#include "route_time_axis.h"
+#include "session_metadata_dialog.h"
+#include "speaker_dialog.h"
+#include "splash.h"
#include "startup.h"
-#include "engine_dialog.h"
-#include "processor_box.h"
+#include "theme_manager.h"
#include "time_axis_view_item.h"
+#include "utils.h"
#include "window_proxy.h"
-#include "global_port_matrix.h"
-#include "location_ui.h"
-#include "missing_file_dialog.h"
-#include "missing_plugin_dialog.h"
-#include "ambiguous_file_dialog.h"
#include "i18n.h"
keyboard = new ArdourKeyboard(*this);
+
XMLNode* node = ARDOUR_UI::instance()->keyboard_settings();
if (node) {
keyboard->set_state (*node, Stateful::loading_state_version);
}
+ /* we don't like certain modifiers */
+ Bindings::set_ignored_state (GDK_LOCK_MASK|GDK_MOD2_MASK|GDK_MOD3_MASK);
+
reset_dpi();
TimeAxisViewItem::set_constant_heights ();
location_ui = new ActionWindowProxy<LocationUIWindow> (X_("locations"), Config->extra_xml (X_("UI")), X_("ToggleLocations"));
big_clock_window = new ActionWindowProxy<Gtk::Window> (X_("bigclock"), Config->extra_xml (X_("UI")), X_("ToggleBigClock"));
+ speaker_config_window = new ActionWindowProxy<SpeakerDialog> (X_("speakerconf"), Config->extra_xml (X_("UI")), X_("toggle-speaker-config"));
for (ARDOUR::DataType::iterator i = ARDOUR::DataType::begin(); i != ARDOUR::DataType::end(); ++i) {
_global_port_matrix[*i] = new ActionWindowProxy<GlobalPortMatrixWindow> (
}
setup_clock ();
+ speaker_config_window->set (new SpeakerDialog);
starting.connect (sigc::mem_fun(*this, &ARDOUR_UI::startup));
stopping.connect (sigc::mem_fun(*this, &ARDOUR_UI::shutdown));
if (ARDOUR_COMMAND_LINE::show_key_actions) {
vector<string> names;
vector<string> paths;
+ vector<string> tooltips;
vector<string> keys;
vector<AccelKey> bindings;
- ActionManager::get_all_actions (names, paths, keys, bindings);
+ ActionManager::get_all_actions (names, paths, tooltips, keys, bindings);
vector<string>::iterator n;
vector<string>::iterator k;
void
-ARDOUR_UI::session_add_midi_route (bool disk, RouteGroup* route_group, uint32_t how_many)
+ARDOUR_UI::session_add_midi_route (bool disk, RouteGroup* route_group, uint32_t how_many, string const & name_template)
{
list<boost::shared_ptr<MidiTrack> > tracks;
try {
if (disk) {
- tracks = _session->new_midi_track (ARDOUR::Normal, route_group, how_many);
+ tracks = _session->new_midi_track (ARDOUR::Normal, route_group, how_many, name_template);
if (tracks.size() != how_many) {
if (how_many == 1) {
void
-ARDOUR_UI::session_add_audio_route (bool track, bool aux, int32_t input_channels, int32_t output_channels, ARDOUR::TrackMode mode, RouteGroup* route_group, uint32_t how_many)
+ARDOUR_UI::session_add_audio_route (
+ bool track,
+ int32_t input_channels,
+ int32_t output_channels,
+ ARDOUR::TrackMode mode,
+ RouteGroup* route_group,
+ uint32_t how_many,
+ string const & name_template
+ )
{
list<boost::shared_ptr<AudioTrack> > tracks;
RouteList routes;
try {
if (track) {
- tracks = _session->new_audio_track (input_channels, output_channels, mode, route_group, how_many);
+ tracks = _session->new_audio_track (input_channels, output_channels, mode, route_group, how_many, name_template);
if (tracks.size() != how_many) {
if (how_many == 1) {
} else {
- routes = _session->new_audio_route (aux, input_channels, output_channels, route_group, how_many);
+ routes = _session->new_audio_route (input_channels, output_channels, route_group, how_many, name_template);
if (routes.size() != how_many) {
if (how_many == 1) {
void
ARDOUR_UI::toggle_session_auto_loop ()
{
- if (_session) {
- if (_session->get_play_loop()) {
- if (_session->transport_rolling()) {
- Location * looploc = _session->locations()->auto_loop_location();
- if (looploc) {
- _session->request_locate (looploc->start(), true);
- }
- } else {
- _session->request_play_loop (false);
- }
- } else {
+ if (!_session) {
+ return;
+ }
+
+ if (_session->get_play_loop()) {
+
+ if (_session->transport_rolling()) {
+
Location * looploc = _session->locations()->auto_loop_location();
+
if (looploc) {
- _session->request_play_loop (true);
+ _session->request_locate (looploc->start(), true);
+ _session->request_play_loop (false);
}
+
+ } else {
+ _session->request_play_loop (false);
+ }
+ } else {
+
+ Location * looploc = _session->locations()->auto_loop_location();
+
+ if (looploc) {
+ _session->request_play_loop (true);
}
}
}
}
prompter.set_name (X_("Prompter"));
- prompter.set_title (_("Save Mix Template"));
- prompter.set_prompt (_("Name for mix template:"));
+ prompter.set_title (_("Save Template"));
+ prompter.set_prompt (_("Name for template:"));
prompter.set_initial_text(_session->name() + _("-template"));
prompter.add_button (Gtk::Stock::SAVE, Gtk::RESPONSE_ACCEPT);
} else {
ret = load_session (session_path, session_name, template_name);
+
+ if (ret == -2) {
+ /* not connected to the AudioEngine, so quit to avoid an infinite loop */
+ exit (1);
+ }
+
if (!ARDOUR_COMMAND_LINE::immediate_save.empty()) {
_session->save_state (ARDOUR_COMMAND_LINE::immediate_save, false);
exit (1);
goto_editor_window ();
}
+/** @return -2 if the load failed because we are not connected to the AudioEngine */
int
ARDOUR_UI::load_session (const std::string& path, const std::string& snap_name, std::string mix_template)
{
session_loaded = false;
if (!check_audioengine()) {
- return -1;
+ return -2;
}
unload_status = unload_session ();
goto out;
}
- loading_message (string_compose (_("Please wait while %1loads your session"), PROGRAM_NAME));
+ loading_message (string_compose (_("Please wait while %1 loads your session"), PROGRAM_NAME));
try {
new_session = new Session (*engine, path, snap_name, 0, mix_template);
new_session->add_instant_xml (*n, false);
}
+ /* Put the playhead at 0 and scroll fully left */
+ n = new_session->instant_xml (X_("Editor"));
+ if (n) {
+ n->add_property (X_("playhead"), X_("0"));
+ n->add_property (X_("left-frame"), X_("0"));
+ }
+
set_session (new_session);
session_loaded = true;
if (removed == 0) {
MessageDialog msgd (*editor,
- _("No audio files were ready for cleanup"),
+ _("No files were ready for cleanup"),
true,
Gtk::MESSAGE_INFO,
(Gtk::ButtonsType)(Gtk::BUTTONS_OK) );
dimage->set_alignment(ALIGN_LEFT, ALIGN_TOP);
- const string dead_sound_directory = _session->session_directory().dead_sound_path().to_string();
+ const string dead_directory = _session->session_directory().dead_path().to_string();
/* subst:
%1 - number of files removed
- %2 - location of "dead_sounds"
+ %2 - location of "dead"
%3 - size of files affected
%4 - prefix for "bytes" to produce sensible results (e.g. mega, kilo, giga)
*/
const char* bprefix;
double space_adjusted = 0;
- if (rep.space < 100000.0f) {
- bprefix = X_("kilo");
- } else if (rep.space < 1000000.0f * 1000) {
- bprefix = X_("mega");
+ if (rep.space < 1000) {
+ bprefix = X_("");
+ space_adjusted = rep.space;
+ } else if (rep.space < 1000000) {
+ bprefix = X_("kilo");
space_adjusted = truncf((float)rep.space / 1000.0);
+ } else if (rep.space < 1000000 * 1000) {
+ bprefix = X_("mega");
+ space_adjusted = truncf((float)rep.space / (1000.0 * 1000.0));
} else {
bprefix = X_("giga");
- space_adjusted = truncf((float)rep.space / (1000000.0 * 1000));
+ space_adjusted = truncf((float)rep.space / (1000.0 * 1000 * 1000.0));
}
if (removed > 1) {
- txt.set_text (string_compose (plural_msg, removed, _session->path() + "dead_sounds", space_adjusted, bprefix));
+ txt.set_text (string_compose (plural_msg, removed, dead_directory, space_adjusted, bprefix));
} else {
- txt.set_text (string_compose (singular_msg, removed, _session->path() + "dead_sounds", space_adjusted, bprefix));
+ txt.set_text (string_compose (singular_msg, removed, dead_directory, space_adjusted, bprefix));
}
dhbox.pack_start (*dimage, true, false, 5);
results.run ();
-}
+}
void
ARDOUR_UI::cleanup ()
checker.set_secondary_text(_("Cleanup is a destructive operation.\n\
ALL undo/redo information will be lost if you cleanup.\n\
-After cleanup, unused audio files will be moved to a \
-\"dead sounds\" location."));
+Cleanup will move all unused files to a \"dead\" location."));
checker.add_button (Stock::CANCEL, RESPONSE_CANCEL);
checker.add_button (_("Clean Up"), RESPONSE_ACCEPT);
_("cleaned files"),
_("\
The following %1 files were not in use and \n\
-have been moved to:\n\
-%2. \n\n\
-Flushing the wastebasket will \n\
-release an additional\n\
+have been moved to:\n\n\
+%2\n\n\
+After a restart of Ardour,\n\n\
+Session -> Cleanup -> Flush Wastebasket\n\n\
+will release an additional\n\
%3 %4bytes of disk space.\n"),
_("\
The following file was not in use and \n \
has been moved to:\n \
-%2. \n\n\
-Flushing the wastebasket will \n\
-release an additional\n\
+%2\n\n\
+After a restart of Ardour,\n\n\
+Session -> Cleanup -> Flush Wastebasket\n\n\
+will release an additional\n\
%3 %4bytes of disk space.\n"
));
uint32_t output_chan;
string name_template = add_route_dialog->name_template ();
bool track = add_route_dialog->track ();
- bool aux = !track && add_route_dialog->aux();
RouteGroup* route_group = add_route_dialog->route_group ();
AutoConnectOption oac = Config->get_output_auto_connect();
if (add_route_dialog->type() == ARDOUR::DataType::MIDI) {
if (track) {
- session_add_midi_track (route_group, count);
+ session_add_midi_track (route_group, count, name_template);
} else {
MessageDialog msg (*editor,
_("Sorry, MIDI Busses are not supported at this time."));
}
} else {
if (track) {
- session_add_audio_track (input_chan, output_chan, add_route_dialog->mode(), route_group, count);
+ session_add_audio_track (input_chan, output_chan, add_route_dialog->mode(), route_group, count, name_template);
} else {
- session_add_audio_bus (aux, input_chan, output_chan, route_group, count);
+ session_add_audio_bus (input_chan, output_chan, route_group, count, name_template);
}
}
}
if (!node) {
node = new XMLNode (X_("Keyboard"));
}
+
return node;
}