X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fardour_ui.cc;h=f86defaaf40bf6cd174c686af90dbca26f5cc9c1;hb=a0b9c52a5e781f4b1514ffe8c21d2250b5c0ebaf;hp=24e566eecb93705a7fb870162737711cf5f756b4;hpb=f0bf3a0c190ced488d1520435df8234ef50971d6;p=ardour.git diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 24e566eecb..f86defaaf4 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -172,7 +172,12 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[]) #ifdef TOP_MENUBAR - _auto_display_errors = false; + // _auto_display_errors = false; + /* + * This was commented out as it wasn't defined + * in A3 IIRC. If this is not needed it should + * be completely removed. + */ #endif about = 0; @@ -440,7 +445,7 @@ ARDOUR_UI::configure_timeout () } gboolean -ARDOUR_UI::configure_handler (GdkEventConfigure* conf) +ARDOUR_UI::configure_handler (GdkEventConfigure* /*conf*/) { if (have_configure_timeout) { last_configure_time = get_microseconds(); @@ -733,7 +738,7 @@ ARDOUR_UI::finish() if (session->transport_rolling()) { session->request_stop (); - usleep (2500000); + usleep (250000); } if (session->dirty()) { @@ -995,7 +1000,7 @@ ARDOUR_UI::update_wall_clock () } gint -ARDOUR_UI::session_menu (GdkEventButton *ev) +ARDOUR_UI::session_menu (GdkEventButton */*ev*/) { session_popup_menu->popup (0, 0); return TRUE; @@ -1087,7 +1092,7 @@ ARDOUR_UI::redisplay_recent_sessions () void ARDOUR_UI::build_session_selector () { - session_selector_window = new ArdourDialog ("session selector"); + session_selector_window = new ArdourDialog (_("Recent Sessions")); Gtk::ScrolledWindow *scroller = manage (new Gtk::ScrolledWindow); @@ -1114,7 +1119,7 @@ ARDOUR_UI::build_session_selector () } void -ARDOUR_UI::recent_session_row_activated (const TreePath& path, TreeViewColumn* col) +ARDOUR_UI::recent_session_row_activated (const TreePath& /*path*/, TreeViewColumn* /*col*/) { session_selector_window->response (RESPONSE_ACCEPT); } @@ -1242,7 +1247,7 @@ ARDOUR_UI::open_session () void -ARDOUR_UI::session_add_midi_route (bool disk, RouteGroup* edit_group, uint32_t how_many) +ARDOUR_UI::session_add_midi_route (bool disk, RouteGroup* route_group, uint32_t how_many) { list > tracks; @@ -1254,7 +1259,7 @@ ARDOUR_UI::session_add_midi_route (bool disk, RouteGroup* edit_group, uint32_t h try { if (disk) { - tracks = session->new_midi_track (ARDOUR::Normal, edit_group, how_many); + tracks = session->new_midi_track (ARDOUR::Normal, route_group, how_many); if (tracks.size() != how_many) { if (how_many == 1) { @@ -1282,7 +1287,7 @@ restart JACK with more ports.")); void -ARDOUR_UI::session_add_audio_route (bool track, int32_t input_channels, int32_t output_channels, ARDOUR::TrackMode mode, RouteGroup* edit_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) { list > tracks; RouteList routes; @@ -1294,7 +1299,7 @@ ARDOUR_UI::session_add_audio_route (bool track, int32_t input_channels, int32_t try { if (track) { - tracks = session->new_audio_track (input_channels, output_channels, mode, edit_group, how_many); + tracks = session->new_audio_track (input_channels, output_channels, mode, route_group, how_many); if (tracks.size() != how_many) { if (how_many == 1) { @@ -1307,7 +1312,7 @@ ARDOUR_UI::session_add_audio_route (bool track, int32_t input_channels, int32_t } else { - routes = session->new_audio_route (input_channels, output_channels, edit_group, how_many); + routes = session->new_audio_route (input_channels, output_channels, route_group, how_many); if (routes.size() != how_many) { if (how_many == 1) { @@ -2203,6 +2208,41 @@ ARDOUR_UI::build_session_from_nsd (const Glib::ustring& session_path, const Glib return 0; } +void +ARDOUR_UI::idle_load (const Glib::ustring& path) +{ + if (session) { + if (Glib::file_test (path, Glib::FILE_TEST_IS_DIR)) { + /* /path/to/foo => /path/to/foo, foo */ + load_session (path, basename_nosuffix (path)); + } else { + /* /path/to/foo/foo.ardour => /path/to/foo, foo */ + load_session (Glib::path_get_dirname (path), basename_nosuffix (path)); + } + } else { + + ARDOUR_COMMAND_LINE::session_name = path; + + /* + * new_session_dialog doens't exist in A3 + * Try to remove all references to it to + * see if it will compile. NOTE: this will + * likely cause a runtime issue is my somewhat + * uneducated guess. + */ + + //if (new_session_dialog) { + + + /* make it break out of Dialog::run() and + start again. + */ + + //new_session_dialog->response (1); + //} + } +} + void ARDOUR_UI::end_loading_messages () { @@ -2210,7 +2250,7 @@ ARDOUR_UI::end_loading_messages () } void -ARDOUR_UI::loading_message (const std::string& msg) +ARDOUR_UI::loading_message (const std::string& /*msg*/) { // show_splash (); // splash->message (msg); @@ -2329,6 +2369,7 @@ ARDOUR_UI::close_session() unload_session (true); + ARDOUR_COMMAND_LINE::session_name = ""; get_session_parameters (false); } @@ -2527,7 +2568,7 @@ ARDOUR_UI::hide_about () } void -ARDOUR_UI::about_signal_response(int response) +ARDOUR_UI::about_signal_response (int /*response*/) { hide_about(); } @@ -2559,7 +2600,8 @@ ARDOUR_UI::hide_splash () } void -ARDOUR_UI::display_cleanup_results (Session::cleanup_report& rep, const gchar* list_title, const string & msg) +ARDOUR_UI::display_cleanup_results (Session::cleanup_report& rep, const gchar* list_title, + const string& plural_msg, const string& singular_msg) { size_t removed; @@ -2616,18 +2658,30 @@ require some unused files to continue to exist.")); const string dead_sound_directory = session->session_directory().dead_sound_path().to_string(); + + + + /* subst: + %1 - number of files removed + %2 - location of "dead_sounds" + %3 - size of files affected + %4 - prefix for "bytes" to produce sensible results (e.g. mega, kilo, giga) + */ + + const char* bprefix; + if (rep.space < 1048576.0f) { - if (removed > 1) { - 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"), dead_sound_directory, (float) rep.space / 1024.0f, "kilo")); - } + bprefix = X_("kilo"); + } else if (rep.space < 1048576.0f * 1000) { + bprefix = X_("mega"); } else { - if (removed > 1) { - 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"), dead_sound_directory, (float) rep.space / 1048576.0f, "mega")); - } + bprefix = X_("giga"); + } + + if (removed > 1) { + txt.set_text (string_compose (plural_msg, removed, dead_sound_directory, (float) rep.space / 1024.0f, bprefix)); + } else { + txt.set_text (string_compose (singular_msg, removed, dead_sound_directory, (float) rep.space / 1024.0f, bprefix)); } dhbox.pack_start (*dimage, true, false, 5); @@ -2723,12 +2777,19 @@ After cleanup, unused audio files will be moved to a \ display_cleanup_results (rep, _("cleaned files"), _("\ -The following %1 %2 not in use and \n\ +The following %1 files were not in use and \n\ have been moved to:\n\ -%3. \n\n\ +%2. \n\n\ +Flushing the wastebasket will \n\ +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\ -%4 %5bytes of disk space.\n" +%3 %4bytes of disk space.\n" )); } @@ -2749,9 +2810,12 @@ ARDOUR_UI::flush_trash () display_cleanup_results (rep, _("deleted file"), - _("The following %1 %2 deleted from\n\ -%3,\n\ -releasing %4 %5bytes of disk space")); + _("The following %1 files were deleted from\n\ +%2,\n\ +releasing %3 %4bytes of disk space"), + _("The following file was deleted from\n\ +%2,\n\ +releasing %3 %4bytes of disk space")); } void @@ -2802,7 +2866,7 @@ ARDOUR_UI::add_route (Gtk::Window* float_window) uint32_t output_chan; string name_template = add_route_dialog->name_template (); bool track = add_route_dialog->track (); - RouteGroup* edit_group = add_route_dialog->edit_group (); + RouteGroup* route_group = add_route_dialog->route_group (); AutoConnectOption oac = Config->get_output_auto_connect(); @@ -2816,7 +2880,7 @@ ARDOUR_UI::add_route (Gtk::Window* float_window) if (add_route_dialog->type() == ARDOUR::DataType::MIDI) { if (track) { - session_add_midi_track(edit_group, count); + session_add_midi_track (route_group, count); } else { MessageDialog msg (*editor, _("Sorry, MIDI Busses are not supported at this time.")); @@ -2825,9 +2889,9 @@ ARDOUR_UI::add_route (Gtk::Window* float_window) } } else { if (track) { - session_add_audio_track (input_chan, output_chan, add_route_dialog->mode(), edit_group, count); + session_add_audio_track (input_chan, output_chan, add_route_dialog->mode(), route_group, count); } else { - session_add_audio_bus (input_chan, output_chan, edit_group, count); + session_add_audio_bus (input_chan, output_chan, route_group, count); } } } @@ -3010,7 +3074,7 @@ quickly enough to keep up with playback.\n")); } void -ARDOUR_UI::disk_speed_dialog_gone (int ignored_response, MessageDialog* msg) +ARDOUR_UI::disk_speed_dialog_gone (int /*ignored_response*/, MessageDialog* msg) { have_disk_speed_dialog_displayed = false; delete msg;