diff options
author | David Robillard <d@drobilla.net> | 2008-01-12 23:45:50 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-01-12 23:45:50 +0000 |
commit | e92c1669c1cdf857b8a3900abb9f891e6ca9fdad (patch) | |
tree | f02725efdfd3473527cb7fa94471a7cff2528880 /gtk2_ardour | |
parent | bf256c168170de1b9e1411bb563c571d67470c05 (diff) |
Merge with 2.0-ongoing R2885.
Fix loading of 2.0 sessions.
git-svn-id: svn://localhost/ardour2/trunk@2904 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/ardour_ui.cc | 3 | ||||
-rw-r--r-- | gtk2_ardour/editor.cc | 570 | ||||
-rw-r--r-- | gtk2_ardour/editor.h | 47 | ||||
-rw-r--r-- | gtk2_ardour/editor_actions.cc | 6 | ||||
-rw-r--r-- | gtk2_ardour/editor_canvas.cc | 82 | ||||
-rw-r--r-- | gtk2_ardour/editor_markers.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/editor_mouse.cc | 48 | ||||
-rw-r--r-- | gtk2_ardour/editor_ops.cc | 97 | ||||
-rw-r--r-- | gtk2_ardour/editor_selection.cc | 53 | ||||
-rw-r--r-- | gtk2_ardour/engine_dialog.cc | 46 | ||||
-rw-r--r-- | gtk2_ardour/marker.cc | 39 | ||||
-rw-r--r-- | gtk2_ardour/marker.h | 6 | ||||
-rw-r--r-- | gtk2_ardour/mixer_ui.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/new_session_dialog.cc | 108 | ||||
-rw-r--r-- | gtk2_ardour/new_session_dialog.h | 4 | ||||
-rw-r--r-- | gtk2_ardour/po/sv_SE.po | 38 |
16 files changed, 686 insertions, 465 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 70dac73a59..ca77ccb903 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -1341,7 +1341,6 @@ ARDOUR_UI::session_add_audio_route (bool track, int32_t input_channels, int32_t } catch (...) { - cerr << "About to complain about JACK\n"; MessageDialog msg (*editor, _("There are insufficient JACK ports available\n\ to create a new track or bus.\n\ @@ -2270,7 +2269,7 @@ ARDOUR_UI::get_session_parameters (Glib::ustring predetermined_path, bool have_e if (session_name[0] == '/' || (session_name.length() > 2 && session_name[0] == '.' && session_name[1] == '/') || (session_name.length() > 3 && session_name[0] == '.' && session_name[1] == '.' && session_name[2] == '/')) { - cerr << "here\n"; + if (load_session (Glib::path_get_dirname (session_name), session_name)) { response = Gtk::RESPONSE_NONE; goto try_again; diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 325584f7ed..41261b7079 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -901,19 +901,6 @@ Editor::show_window () } void -Editor::tie_vertical_scrolling () -{ - double y1 = vertical_adjustment.get_value(); - - playhead_cursor->set_y_axis (y1); - if (logo_item) { - logo_item->property_y() = y1; - } - - controls_layout.get_vadjustment()->set_value (y1); -} - -void Editor::instant_save () { if (!constructed || !ARDOUR_UI::instance()->session_loaded) { @@ -1431,28 +1418,179 @@ Editor::popup_fade_context_menu (int button, int32_t time, ArdourCanvas::Item* i fade_context_menu.popup (button, time); } -/* Pop up the general track context menu for when the user clicks pretty much anywhere in a track or bus */ void -Editor::popup_track_context_menu (int button, int32_t time, nframes_t frame) +Editor::popup_track_context_menu (int button, int32_t time, ItemType item_type, bool with_selection, nframes_t frame) +{ + using namespace Menu_Helpers; + Menu* (Editor::*build_menu_function)(nframes_t); + Menu *menu; + + switch (item_type) { + case RegionItem: + case RegionViewName: + case RegionViewNameHighlight: + if (with_selection) { + build_menu_function = &Editor::build_track_selection_context_menu; + } else { + build_menu_function = &Editor::build_track_region_context_menu; + } + break; + + case SelectionItem: + if (with_selection) { + build_menu_function = &Editor::build_track_selection_context_menu; + } else { + build_menu_function = &Editor::build_track_context_menu; + } + break; + + case CrossfadeViewItem: + build_menu_function = &Editor::build_track_crossfade_context_menu; + break; + + case StreamItem: + if (clicked_routeview->get_diskstream()) { + build_menu_function = &Editor::build_track_context_menu; + } else { + build_menu_function = &Editor::build_track_bus_context_menu; + } + break; + + default: + /* probably shouldn't happen but if it does, we don't care */ + return; + } + + menu = (this->*build_menu_function)(frame); + menu->set_name ("ArdourContextMenu"); + + /* now handle specific situations */ + + switch (item_type) { + case RegionItem: + case RegionViewName: + case RegionViewNameHighlight: + if (!with_selection) { + if (region_edit_menu_split_item) { + if (clicked_regionview && clicked_regionview->region()->covers (get_preferred_edit_position())) { + ActionManager::set_sensitive (ActionManager::edit_point_in_region_sensitive_actions, true); + } else { + ActionManager::set_sensitive (ActionManager::edit_point_in_region_sensitive_actions, false); + } + } + /* + if (region_edit_menu_split_multichannel_item) { + if (clicked_regionview && clicked_regionview->region().n_channels() > 1) { + // GTK2FIX find the action, change its sensitivity + // region_edit_menu_split_multichannel_item->set_sensitive (true); + } else { + // GTK2FIX see above + // region_edit_menu_split_multichannel_item->set_sensitive (false); + } + }*/ + } + break; + + case SelectionItem: + break; + + case CrossfadeViewItem: + break; + + case StreamItem: + break; + + default: + /* probably shouldn't happen but if it does, we don't care */ + return; + } + + if (item_type != SelectionItem && clicked_routeview && clicked_routeview->audio_track()) { + + /* Bounce to disk */ + + using namespace Menu_Helpers; + MenuList& edit_items = menu->items(); + + edit_items.push_back (SeparatorElem()); + + switch (clicked_routeview->audio_track()->freeze_state()) { + case AudioTrack::NoFreeze: + edit_items.push_back (MenuElem (_("Freeze"), mem_fun(*this, &Editor::freeze_route))); + break; + + case AudioTrack::Frozen: + edit_items.push_back (MenuElem (_("Unfreeze"), mem_fun(*this, &Editor::unfreeze_route))); + break; + + case AudioTrack::UnFrozen: + edit_items.push_back (MenuElem (_("Freeze"), mem_fun(*this, &Editor::freeze_route))); + break; + } + + } + + menu->popup (button, time); +} + +Menu* +Editor::build_track_context_menu (nframes_t ignored) { - build_track_context_menu (frame)->popup (button, time); + using namespace Menu_Helpers; + + MenuList& edit_items = track_context_menu.items(); + edit_items.clear(); + + add_dstream_context_items (edit_items); + return &track_context_menu; } Menu* -Editor::build_track_context_menu (nframes_t frame) +Editor::build_track_bus_context_menu (nframes_t ignored) { using namespace Menu_Helpers; - Menu* menu = manage (new Menu); - MenuList& edit_items = menu->items(); + MenuList& edit_items = track_context_menu.items(); edit_items.clear(); - /* Build the general `track' context menu, adding what is appropriate given - the current selection */ + add_bus_context_items (edit_items); + return &track_context_menu; +} + +Menu* +Editor::build_track_region_context_menu (nframes_t frame) +{ + using namespace Menu_Helpers; + MenuList& edit_items = track_region_context_menu.items(); + edit_items.clear(); + + RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (clicked_axisview); + + if (rtv) { + boost::shared_ptr<Diskstream> ds; + boost::shared_ptr<Playlist> pl; + + if ((ds = rtv->get_diskstream()) && ((pl = ds->playlist()))) { + Playlist::RegionList* regions = pl->regions_at ((nframes_t) floor ( (double)frame * ds->speed())); + for (Playlist::RegionList::iterator i = regions->begin(); i != regions->end(); ++i) { + add_region_context_items (rtv->view(), (*i), edit_items); + } + delete regions; + } + } + + add_dstream_context_items (edit_items); + + return &track_region_context_menu; +} + +Menu* +Editor::build_track_crossfade_context_menu (nframes_t frame) +{ + using namespace Menu_Helpers; + MenuList& edit_items = track_crossfade_context_menu.items(); + edit_items.clear (); - /* XXX: currently crossfades can't be selected, so we can't use the selection - to decide which crossfades to mention in the menu. I believe this will - change at some point. For now we have to use clicked_trackview to decide. */ AudioTimeAxisView* atv = dynamic_cast<AudioTimeAxisView*> (clicked_axisview); if (atv) { @@ -1462,7 +1600,9 @@ Editor::build_track_context_menu (nframes_t frame) if ((ds = atv->get_diskstream()) && ((pl = ds->playlist()) != 0) && ((apl = boost::dynamic_pointer_cast<AudioPlaylist> (pl)) != 0)) { + Playlist::RegionList* regions = pl->regions_at (frame); AudioPlaylist::Crossfades xfades; + apl->crossfades_at (frame, xfades); bool many = xfades.size() > 1; @@ -1470,24 +1610,18 @@ Editor::build_track_context_menu (nframes_t frame) for (AudioPlaylist::Crossfades::iterator i = xfades.begin(); i != xfades.end(); ++i) { add_crossfade_context_items (atv->audio_view(), (*i), edit_items, many); } - } - } - if (!selection->time.empty()) { - add_selection_context_items (edit_items); - } + for (Playlist::RegionList::iterator i = regions->begin(); i != regions->end(); ++i) { + add_region_context_items (atv->audio_view(), (*i), edit_items); + } - if (!selection->regions.empty()) { - add_region_context_items (edit_items); + delete regions; + } } - if (!selection->tracks.empty()) { - add_bus_or_audio_track_context_items (edit_items); - } - - menu->set_name ("ArdourContextMenu"); + add_dstream_context_items (edit_items); - return menu; + return &track_crossfade_context_menu; } #ifdef FFT_ANALYSIS @@ -1528,6 +1662,19 @@ Editor::analyze_range_selection() } #endif /* FFT_ANALYSIS */ +Menu* +Editor::build_track_selection_context_menu (nframes_t ignored) +{ + using namespace Menu_Helpers; + MenuList& edit_items = track_selection_context_menu.items(); + edit_items.clear (); + + add_selection_context_items (edit_items); + // edit_items.push_back (SeparatorElem()); + // add_dstream_context_items (edit_items); + + return &track_selection_context_menu; +} /** Add context menu items relevant to crossfades. * @param edit_items List to add the items to. @@ -1603,34 +1750,27 @@ Editor::add_item_with_sensitivity (Menu_Helpers::MenuList& m, Menu_Helpers::Menu } } -/** Add context menu items relevant to regions. - * @param edit_items List to add the items to. - */ void -Editor::add_region_context_items (Menu_Helpers::MenuList& edit_items) +Editor::add_region_context_items (StreamView* sv, boost::shared_ptr<Region> region, Menu_Helpers::MenuList& edit_items) { using namespace Menu_Helpers; - sigc::connection fooc; - Menu *region_menu = manage (new Menu); - MenuList& items = region_menu->items(); + Menu *region_menu = manage (new Menu); + MenuList& items = region_menu->items(); region_menu->set_name ("ArdourContextMenu"); - items.push_back (MenuElem (_("Edit..."), mem_fun(*this, &Editor::edit_region))); - items.push_back (MenuElem (_("Raise to top layer"), mem_fun(*this, &Editor::raise_region_to_top))); - items.push_back (MenuElem (_("Lower to bottom layer"), mem_fun (*this, &Editor::lower_region_to_bottom))); + boost::shared_ptr<AudioRegion> ar; + boost::shared_ptr<MidiRegion> mr; - Menu* sync_point_menu = manage (new Menu); - MenuList& sync_point_items = sync_point_menu->items(); - sync_point_menu->set_name("ArdourContextMenu"); - - sync_point_items.push_back (MenuElem (_("Define"), mem_fun(*this, &Editor::set_region_sync_from_edit_point))); - sync_point_items.push_back (MenuElem (_("Remove"), mem_fun(*this, &Editor::remove_region_sync))); + if (region) { + ar = boost::dynamic_pointer_cast<AudioRegion> (region); + mr = boost::dynamic_pointer_cast<MidiRegion> (region); + } - items.push_back (MenuElem (_("Sync points"), *sync_point_menu)); + /* when this particular menu pops up, make the relevant region + become selected. + */ - //add_item_with_sensitivity (items, MenuElem (_("Audition"), mem_fun(*this, &Editor::audition_selected_region)), selection->regions.size() == 1); - - add_item_with_sensitivity (items, MenuElem (_("Export"), mem_fun(*this, &Editor::export_region)), selection->regions.size() == 1); + region_menu->signal_map_event().connect (bind (mem_fun(*this, &Editor::set_selected_regionview_from_map_event), sv, boost::weak_ptr<Region>(region))); items.push_back (MenuElem (_("Rename"), mem_fun(*this, &Editor::rename_region))); items.push_back (MenuElem (_("Popup region editor"), mem_fun(*this, &Editor::edit_region))); @@ -1646,97 +1786,59 @@ Editor::add_region_context_items (Menu_Helpers::MenuList& edit_items) items.push_back (MenuElem (_("Bounce"), mem_fun(*this, &Editor::bounce_region_selection))); #ifdef FFT_ANALYSIS - items.push_back (MenuElem (_("Analyze region"), mem_fun(*this, &Editor::analyze_region_selection))); + if (ar) + items.push_back (MenuElem (_("Analyze region"), mem_fun(*this, &Editor::analyze_region_selection))); #endif items.push_back (SeparatorElem()); + sigc::connection fooc; + items.push_back (CheckMenuElem (_("Lock"))); - region_lock_item = static_cast<CheckMenuItem*>(&items.back()); + CheckMenuItem* region_lock_item = static_cast<CheckMenuItem*>(&items.back()); fooc = region_lock_item->signal_activate().connect (mem_fun(*this, &Editor::toggle_region_lock)); - -#if FIXUP_REGION_MENU if (region->locked()) { fooc.block (true); region_lock_item->set_active(); fooc.block (false); } -#endif - - items.push_back (CheckMenuElem (_("Lock Position"))); - region_lock_position_item = static_cast<CheckMenuItem*>(&items.back()); - fooc = region_lock_item->signal_activate().connect (mem_fun(*this, &Editor::toggle_region_position_lock)); -#if FIXUP_REGION_MENU - if (region->locked()) { - fooc.block (true); - region_lock_position_item->set_active(); - fooc.block (false); - } -#endif - items.push_back (CheckMenuElem (_("Mute"))); - region_mute_item = static_cast<CheckMenuItem*>(&items.back()); + CheckMenuItem* region_mute_item = static_cast<CheckMenuItem*>(&items.back()); fooc = region_mute_item->signal_activate().connect (mem_fun(*this, &Editor::toggle_region_mute)); -#if FIXUP_REGION_MENU if (region->muted()) { fooc.block (true); region_mute_item->set_active(); fooc.block (false); } -#endif if (!Profile->get_sae()) { items.push_back (CheckMenuElem (_("Opaque"))); - region_opaque_item = static_cast<CheckMenuItem*>(&items.back()); + CheckMenuItem* region_opaque_item = static_cast<CheckMenuItem*>(&items.back()); fooc = region_opaque_item->signal_activate().connect (mem_fun(*this, &Editor::toggle_region_opaque)); -#if FIXUP_REGION_MENU if (region->opaque()) { fooc.block (true); region_opaque_item->set_active(); fooc.block (false); } -#endif } - /* We allow "Original position" if at least one region is not at its - natural position - */ - RegionSelection::iterator i = selection->regions.begin(); - while (i != selection->regions.end() && (*i)->region()->at_natural_position() == true) { - ++i; + items.push_back (CheckMenuElem (_("Original position"), mem_fun(*this, &Editor::naturalize))); + if (region->at_natural_position()) { + items.back().set_sensitive (false); } - - add_item_with_sensitivity (items, MenuElem (_("Original position"), mem_fun(*this, &Editor::naturalize)), i != selection->regions.end()); items.push_back (SeparatorElem()); - - /* Find out if we have a selected audio region */ - i = selection->regions.begin(); - while (i != selection->regions.end() && boost::dynamic_pointer_cast<AudioRegion>((*i)->region()) == 0) { - ++i; - } - const bool have_selected_audio_region = (i != selection->regions.end()); - - if (have_selected_audio_region) { - - Menu* envelopes_menu = manage (new Menu); - - envelopes_menu->set_name ("ArdourContextMenu"); - -#if FIXUP_REGION_MENU - - XXX NEED TO RESOLVE ONE v. MANY REGION ISSUE + + if (ar) { - MenuList& envelopes_items = envelopes_menu->items(); - RegionView* rv = sv->find_view (ar); AudioRegionView* arv = dynamic_cast<AudioRegionView*>(rv); - + if (!Profile->get_sae()) { - envelopes_items.push_back (MenuElem (_("Reset Envelope"), mem_fun(*this, &Editor::reset_region_gain_envelopes))); + items.push_back (MenuElem (_("Reset Envelope"), mem_fun(*this, &Editor::reset_region_gain_envelopes))); - envelopes_items.push_back (CheckMenuElem (_("Envelope Visible"))); - region_envelope_visible_item = static_cast<CheckMenuItem*> (&items.back()); + items.push_back (CheckMenuElem (_("Envelope Visible"))); + CheckMenuItem* region_envelope_visible_item = static_cast<CheckMenuItem*> (&items.back()); fooc = region_envelope_visible_item->signal_activate().connect (mem_fun(*this, &Editor::toggle_gain_envelope_visibility)); if (arv->envelope_visible()) { fooc.block (true); @@ -1744,8 +1846,8 @@ Editor::add_region_context_items (Menu_Helpers::MenuList& edit_items) fooc.block (false); } - envelopes_items.push_back (CheckMenuElem (_("Envelope Active"))); - region_envelope_active_item = static_cast<CheckMenuItem*> (&items.back()); + items.push_back (CheckMenuElem (_("Envelope Active"))); + CheckMenuItem* region_envelope_active_item = static_cast<CheckMenuItem*> (&items.back()); fooc = region_envelope_active_item->signal_activate().connect (mem_fun(*this, &Editor::toggle_gain_envelope_active)); if (ar->envelope_active()) { @@ -1756,39 +1858,25 @@ Editor::add_region_context_items (Menu_Helpers::MenuList& edit_items) items.push_back (SeparatorElem()); } -#endif - items.push_back (MenuElem (_("Envelopes"), *envelopes_menu)); - -#if FIXUP_REGION_MENU if (ar->scale_amplitude() != 1.0f) { - items.push_back (MenuElem (_("DeNormalize"), mem_fun(*this, &Editor::denormalize_regions))); + items.push_back (MenuElem (_("DeNormalize"), mem_fun(*this, &Editor::denormalize_region))); } else { - items.push_back (MenuElem (_("Normalize"), mem_fun(*this, &Editor::normalize_regions))); + items.push_back (MenuElem (_("Normalize"), mem_fun(*this, &Editor::normalize_region))); } -#endif - } - - /* Find out if we have a selected MIDI region */ - i = selection->regions.begin(); - while (i != selection->regions.end() && boost::dynamic_pointer_cast<MidiRegion>((*i)->region()) == 0) { - ++i; - } - const bool have_selected_midi_region = (i != selection->regions.end()); - - if (have_selected_midi_region) { - items.push_back (MenuElem (_("Quantize"), mem_fun(*this, &Editor::quantize_regions))); + } else if (mr) { + items.push_back (MenuElem (_("Quantize"), mem_fun(*this, &Editor::quantize_region))); items.push_back (SeparatorElem()); - } + items.push_back (MenuElem (_("Reverse"), mem_fun(*this, &Editor::reverse_region))); + items.push_back (SeparatorElem()); + /* range related stuff */ - - add_item_with_sensitivity (items, MenuElem (_("Add range markers"), mem_fun (*this, &Editor::add_location_from_audio_region)), selection->regions.size() == 1); - - add_item_with_sensitivity (items, MenuElem (_("Set range selection"), mem_fun (*this, &Editor::set_selection_from_audio_region)), selection->regions.size() == 1); - + + items.push_back (MenuElem (_("Add Range Markers"), mem_fun (*this, &Editor::add_location_from_audio_region))); + items.push_back (MenuElem (_("Set Range Selection"), mem_fun (*this, &Editor::set_selection_from_region))); items.push_back (SeparatorElem()); /* Nudge region */ @@ -1797,12 +1885,13 @@ Editor::add_region_context_items (Menu_Helpers::MenuList& edit_items) MenuList& nudge_items = nudge_menu->items(); nudge_menu->set_name ("ArdourContextMenu"); - nudge_items.push_back (MenuElem (_("Nudge forward"), (bind (mem_fun(*this, &Editor::nudge_forward), false)))); - nudge_items.push_back (MenuElem (_("Nudge backward"), (bind (mem_fun(*this, &Editor::nudge_backward), false)))); - nudge_items.push_back (MenuElem (_("Nudge forward by capture offset"), (mem_fun(*this, &Editor::nudge_forward_capture_offset)))); - nudge_items.push_back (MenuElem (_("Nudge backward by capture offset"), (mem_fun(*this, &Editor::nudge_backward_capture_offset)))); + nudge_items.push_back (MenuElem (_("Nudge fwd"), (bind (mem_fun(*this, &Editor::nudge_forward), false)))); + nudge_items.push_back (MenuElem (_("Nudge bwd"), (bind (mem_fun(*this, &Editor::nudge_backward), false)))); + nudge_items.push_back (MenuElem (_("Nudge fwd by capture offset"), (mem_fun(*this, &Editor::nudge_forward_capture_offset)))); + nudge_items.push_back (MenuElem (_("Nudge bwd by capture offset"), (mem_fun(*this, &Editor::nudge_backward_capture_offset)))); items.push_back (MenuElem (_("Nudge"), *nudge_menu)); + items.push_back (SeparatorElem()); Menu *trim_menu = manage (new Menu); MenuList& trim_items = trim_menu->items(); @@ -1814,20 +1903,38 @@ Editor::add_region_context_items (Menu_Helpers::MenuList& edit_items) trim_items.push_back (MenuElem (_("Trim To Punch"), mem_fun(*this, &Editor::trim_region_to_punch))); items.push_back (MenuElem (_("Trim"), *trim_menu)); + items.push_back (SeparatorElem()); + items.push_back (MenuElem (_("Split"), (mem_fun(*this, &Editor::split_region)))); + region_edit_menu_split_item = &items.back(); + items.push_back (MenuElem (_("Make mono regions"), (mem_fun(*this, &Editor::split_multichannel_region)))); + region_edit_menu_split_multichannel_item = &items.back(); + items.push_back (MenuElem (_("Duplicate"), (bind (mem_fun(*this, &Editor::duplicate_dialog), false)))); items.push_back (MenuElem (_("Multi-Duplicate"), (bind (mem_fun(*this, &Editor::duplicate_dialog), true)))); - items.push_back (MenuElem (_("Fill track"), (mem_fun(*this, &Editor::region_fill_track)))); + items.push_back (MenuElem (_("Fill Track"), (mem_fun(*this, &Editor::region_fill_track)))); items.push_back (SeparatorElem()); - items.push_back (MenuElem (_("Remove"), mem_fun(*this, &Editor::remove_selected_regions))); + items.push_back (MenuElem (_("Remove"), mem_fun(*this, &Editor::remove_clicked_region))); /* OK, stick the region submenu at the top of the list, and then add the standard items. */ - string const menu_item_name = selection->regions.size() > 1 ? _("Regions") : _("Region"); + /* we have to hack up the region name because "_" has a special + meaning for menu titles. + */ + + string::size_type pos = 0; + string menu_item_name = region->name(); + + while ((pos = menu_item_name.find ("_", pos)) != string::npos) { + menu_item_name.replace (pos, 1, "__"); + pos += 2; + } + edit_items.push_back (MenuElem (menu_item_name, *region_menu)); + edit_items.push_back (SeparatorElem()); } /** Add context menu items relevant to selection ranges. @@ -1876,33 +1983,12 @@ Editor::add_selection_context_items (Menu_Helpers::MenuList& edit_items) items.push_back (MenuElem (_("Export range"), mem_fun(*this, &Editor::export_selection))); } -/** Add context menu items relevant to busses or audio tracks. - * @param edit_items List to add the items to. - */ + void -Editor::add_bus_or_audio_track_context_items (Menu_Helpers::MenuList& edit_items) +Editor::add_dstream_context_items (Menu_Helpers::MenuList& edit_items) { using namespace Menu_Helpers; - /* We add every possible action here, and de-sensitize things - that aren't allowed. The sensitivity logic is a bit spread out; - on the one hand I'm using things like can_cut_copy (), which is - reasonably complicated and so perhaps better near the function that - it expresses sensitivity for, and on the other hand checks - in this function as well. You can't really have can_* for everything - or the number of methods would get silly. */ - - bool const one_selected_region = selection->regions.size() == 1; - - /* Count the number of selected audio tracks */ - int n_audio_tracks = 0; - for (TrackSelection::iterator i = selection->tracks.begin(); i != selection->tracks.end(); ++i) { - RouteTimeAxisView const * r = dynamic_cast<RouteTimeAxisView*>(*i); - if (r && r->is_audio_track()) { - n_audio_tracks++; - } - } - /* Playback */ Menu *play_menu = manage (new Menu); @@ -1911,9 +1997,9 @@ Editor::add_bus_or_audio_track_context_items (Menu_Helpers::MenuList& edit_items play_items.push_back (MenuElem (_("Play from edit point"), mem_fun(*this, &Editor::play_from_edit_point))); play_items.push_back (MenuElem (_("Play from start"), mem_fun(*this, &Editor::play_from_start))); - add_item_with_sensitivity (play_items, MenuElem (_("Play region"), mem_fun(*this, &Editor::play_selected_region)), one_selected_region); - - add_item_with_sensitivity (play_items, MenuElem (_("Loop region"), mem_fun(*this, &Editor::loop_selected_region)), one_selected_region); + play_items.push_back (MenuElem (_("Play region"), mem_fun(*this, &Editor::play_selected_region))); + play_items.push_back (SeparatorElem()); + play_items.push_back (MenuElem (_("Loop Region"), mem_fun(*this, &Editor::loop_selected_region))); edit_items.push_back (MenuElem (_("Play"), *play_menu)); @@ -1922,25 +2008,15 @@ Editor::add_bus_or_audio_track_context_items (Menu_Helpers::MenuList& edit_items Menu *select_menu = manage (new Menu); MenuList& select_items = select_menu->items(); select_menu->set_name ("ArdourContextMenu"); - - string str = selection->tracks.size() == 1 ? _("Select all in track") : _("Select all in tracks"); - - select_items.push_back (MenuElem (str, bind (mem_fun(*this, &Editor::select_all_in_selected_tracks), Selection::Set))); - - select_items.push_back (MenuElem (_("Select all"), bind (mem_fun(*this, &Editor::select_all), Selection::Set))); - - str = selection->tracks.size() == 1 ? _("Invert selection in track") : _("Invert selection in tracks"); - - select_items.push_back (MenuElem (str, mem_fun(*this, &Editor::invert_selection_in_selected_tracks))); + select_items.push_back (MenuElem (_("Select All in track"), bind (mem_fun(*this, &Editor::select_all_in_track), Selection::Set))); + select_items.push_back (MenuElem (_("Select All"), bind (mem_fun(*this, &Editor::select_all), Selection::Set))); + select_items.push_back (MenuElem (_("Invert selection in track"), mem_fun(*this, &Editor::invert_selection_in_track))); select_items.push_back (MenuElem (_("Invert selection"), mem_fun(*this, &Editor::invert_selection))); select_items.push_back (SeparatorElem()); - - if (n_audio_tracks) { - select_items.push_back (MenuElem (_("Set range to loop range"), mem_fun(*this, &Editor::set_selection_from_loop))); - select_items.push_back (MenuElem (_("Set range to punch range"), mem_fun(*this, &Editor::set_selection_from_punch))); - } - + select_items.push_back (MenuElem (_("Set range to loop range"), mem_fun(*this, &Editor::set_selection_from_loop))); + select_items.push_back (MenuElem (_("Set range to punch range"), mem_fun(*this, &Editor::set_selection_from_punch))); + select_items.push_back (SeparatorElem()); select_items.push_back (MenuElem (_("Select All After Edit Point"), bind (mem_fun(*this, &Editor::select_all_selectables_using_edit), true))); select_items.push_back (MenuElem (_("Select All Before Edit Point"), bind (mem_fun(*this, &Editor::select_all_selectables_using_edit), false))); select_items.push_back (MenuElem (_("Select All After Playhead"), bind (mem_fun(*this, &Editor::select_all_selectables_using_cursor), playhead_cursor, true))); @@ -1958,69 +2034,97 @@ Editor::add_bus_or_audio_track_context_items (Menu_Helpers::MenuList& edit_items Menu *cutnpaste_menu = manage (new Menu); MenuList& cutnpaste_items = cutnpaste_menu->items(); cutnpaste_menu->set_name ("ArdourContextMenu"); - + cutnpaste_items.push_back (MenuElem (_("Cut"), mem_fun(*this, &Editor::cut))); cutnpaste_items.push_back (MenuElem (_("Copy"), mem_fun(*this, &Editor::copy))); cutnpaste_items.push_back (MenuElem (_("Paste"), bind (mem_fun(*this, &Editor::paste), 1.0f))); - add_item_with_sensitivity (cutnpaste_items, MenuElem (_("Cut"), mem_fun(*this, &Editor::cut)), can_cut_copy ()); - - add_item_with_sensitivity (cutnpaste_items, MenuElem (_("Copy"), mem_fun(*this, &Editor::copy)), can_cut_copy ()); + cutnpaste_items.push_back (SeparatorElem()); + + cutnpaste_items.push_back (MenuElem (_("Align"), bind (mem_fun(*this, &Editor::align), ARDOUR::SyncPoint))); + cutnpaste_items.push_back (MenuElem (_("Align Relative"), bind (mem_fun(*this, &Editor::align_relative), ARDOUR::SyncPoint))); + + cutnpaste_items.push_back (SeparatorElem()); + + cutnpaste_items.push_back (MenuElem (_("Insert chunk"), bind (mem_fun(*this, &Editor::paste_named_selection), 1.0f))); + + edit_items.push_back (MenuElem (_("Edit"), *cutnpaste_menu)); + + /* Adding new material */ - if (n_audio_tracks) { - cutnpaste_items.push_back (MenuElem (_("Paste at edit cursor"), bind (mem_fun(*this, &Editor::paste), 1.0f))); - cutnpaste_items.push_back (MenuElem (_("Paste at mouse"), mem_fun(*this, &Editor::mouse_paste))); - - cutnpaste_items.push_back (SeparatorElem()); - - cutnpaste_items.push_back (MenuElem (_("Align"), bind (mem_fun(*this, &Editor::align), ARDOUR::SyncPoint))); - cutnpaste_items.push_back (MenuElem (_("Align relative"), bind (mem_fun(*this, &Editor::align_relative), ARDOUR::SyncPoint))); - cutnpaste_items.push_back (MenuElem (_("Insert chunk"), bind (mem_fun(*this, &Editor::paste_named_selection), 1.0f))); - } else { - cutnpaste_items.push_back (MenuElem (_("Paste"), bind (mem_fun(*this, &Editor::paste), 1.0f))); - } + edit_items.push_back (SeparatorElem()); + edit_items.push_back (MenuElem (_("Insert Selected Region"), bind (mem_fun(*this, &Editor::insert_region_list_selection), 1.0f))); + edit_items.push_back (MenuElem (_("Insert Existing Audio"), bind (mem_fun(*this, &Editor::add_external_audio_action), ImportToTrack))); + + /* Nudge track */ + Menu *nudge_menu = manage (new Menu()); + MenuList& nudge_items = nudge_menu->items(); + nudge_menu->set_name ("ArdourContextMenu"); + edit_items.push_back (SeparatorElem()); - edit_items.push_back (MenuElem (_("Edit"), *cutnpaste_menu)); + nudge_items.push_back (MenuElem (_("Nudge entire track fwd"), (bind (mem_fun(*this, &Editor::nudge_track), false, true)))); + nudge_items.push_back (MenuElem (_("Nudge track after edit point fwd"), (bind (mem_fun(*this, &Editor::nudge_track), true, true)))); + nudge_items.push_back (MenuElem (_("Nudge entire track bwd"), (bind (mem_fun(*this, &Editor::nudge_track), false, false)))); + nudge_items.push_back (MenuElem (_("Nudge track after edit point bwd"), (bind (mem_fun(*this, &Editor::nudge_track), true, false)))); - if (n_audio_tracks) { + edit_items.push_back (MenuElem (_("Nudge"), *nudge_menu)); +} - Menu *track_menu = manage (new Menu); - MenuList& track_items = track_menu->items(); - track_menu->set_name ("ArdourContextMenu"); - - /* Adding new material */ +void +Editor::add_bus_context_items (Menu_Helpers::MenuList& edit_items) +{ + using namespace Menu_Helpers; + + /* Playback */ + + Menu *play_menu = manage (new Menu); + MenuList& play_items = play_menu->items(); + play_menu->set_name ("ArdourContextMenu"); - add_item_with_sensitivity (track_items, MenuElem (_("Insert Selected Region"), bind (mem_fun(*this, &Editor::insert_region_list_selection), 1.0f)), n_audio_tracks == 1); - add_item_with_sensitivity (track_items, MenuElem (_("Insert Existing Audio"), bind (mem_fun(*this, &Editor::add_external_audio_action), ImportToTrack)), n_audio_tracks == 1); - - /* Nudge */ + play_items.push_back (MenuElem (_("Play from edit point"), mem_fun(*this, &Editor::play_from_edit_point))); + play_items.push_back (MenuElem (_("Play from start"), mem_fun(*this, &Editor::play_from_start))); + edit_items.push_back (MenuElem (_("Play"), *play_menu)); - Menu *nudge_menu = manage (new Menu()); - MenuList& nudge_items = nudge_menu->items(); - nudge_menu->set_name ("ArdourContextMenu"); + /* Selection */ - str = selection->tracks.size() == 1 ? _("Nudge track after edit cursor forward") : _("Nudge tracks after edit cursor forward"); - - nudge_items.push_back (MenuElem (str, (bind (mem_fun(*this, &Editor::nudge_selected_tracks), true, true)))); + Menu *select_menu = manage (new Menu); + MenuList& select_items = select_menu->items(); + select_menu->set_name ("ArdourContextMenu"); + + select_items.push_back (MenuElem (_("Select All in track"), bind (mem_fun(*this, &Editor::select_all_in_track), Selection::Set))); + select_items.push_back (MenuElem (_("Select All"), bind (mem_fun(*this, &Editor::select_all), Selection::Set))); + select_items.push_back (MenuElem (_("Invert selection in track"), mem_fun(*this, &Editor::invert_selection_in_track))); + select_items.push_back (MenuElem (_("Invert selection"), mem_fun(*this, &Editor::invert_selection))); + select_items.push_back (SeparatorElem()); + select_items.push_back (MenuElem (_("Select all after edit point"), bind (mem_fun(*this, &Editor::select_all_selectables_using_edit), true))); + select_items.push_back (MenuElem (_("Select all before edit point"), bind (mem_fun(*this, &Editor::select_all_selectables_using_edit), false))); + select_items.push_back (MenuElem (_("Select all after playhead"), bind (mem_fun(*this, &Editor::select_all_selectables_using_cursor), playhead_cursor, true))); + select_items.push_back (MenuElem (_("Select all before playhead"), bind (mem_fun(*this, &Editor::select_all_selectables_using_cursor), playhead_cursor, false))); - str = selection->tracks.size() == 1 ? _("Nudge track backward") : _("Nudge tracks backward"); - - nudge_items.push_back (MenuElem (str, (bind (mem_fun(*this, &Editor::nudge_selected_tracks), false, false)))); + edit_items.push_back (MenuElem (_("Select"), *select_menu)); - str = selection->tracks.size() == 1 ? _("Nudge track after edit cursor backward") : _("Nudge tracks after edit cursor backward"); - - nudge_items.push_back (MenuElem (str, (bind (mem_fun(*this, &Editor::nudge_selected_tracks), true, false)))); - - track_items.push_back (MenuElem (_("Nudge"), *nudge_menu)); + /* Cut-n-Paste */ - /* Freeze */ - track_items.push_back (MenuElem (_("Freeze"), mem_fun(*this, &Editor::freeze_routes))); - track_items.push_back (MenuElem (_("Unfreeze"), mem_fun(*this, &Editor::unfreeze_routes))); + Menu *cutnpaste_menu = manage (new Menu); + MenuList& cutnpaste_items = cutnpaste_menu->items(); + cutnpaste_menu->set_name ("ArdourContextMenu"); + + cutnpaste_items.push_back (MenuElem (_("Cut"), mem_fun(*this, &Editor::cut))); + cutnpaste_items.push_back (MenuElem (_("Copy"), mem_fun(*this, &Editor::copy))); + cutnpaste_items.push_back (MenuElem (_("Paste"), bind (mem_fun(*this, &Editor::paste), 1.0f))); - str = selection->tracks.size() == 1 ? _("Track") : _("Tracks"); - edit_items.push_back (MenuElem (str, *track_menu)); - } + Menu *nudge_menu = manage (new Menu()); + MenuList& nudge_items = nudge_menu->items(); + nudge_menu->set_name ("ArdourContextMenu"); + + edit_items.push_back (SeparatorElem()); + nudge_items.push_back (MenuElem (_("Nudge entire track fwd"), (bind (mem_fun(*this, &Editor::nudge_track), false, true)))); + nudge_items.push_back (MenuElem (_("Nudge track after edit point fwd"), (bind (mem_fun(*this, &Editor::nudge_track), true, true)))); + nudge_items.push_back (MenuElem (_("Nudge entire track bwd"), (bind (mem_fun(*this, &Editor::nudge_track), false, false)))); + nudge_items.push_back (MenuElem (_("Nudge track after edit point bwd"), (bind (mem_fun(*this, &Editor::nudge_track), true, false)))); + + edit_items.push_back (MenuElem (_("Nudge"), *nudge_menu)); } /* CURSOR SETTING AND MARKS AND STUFF */ diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 14ed3a46a8..bfdbcd4a6c 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -239,9 +239,9 @@ class Editor : public PublicEditor bool extend_selection_to_track (TimeAxisView&); void play_selection (); - void select_all_in_selected_tracks (Selection::Operation op); + void select_all_in_track (Selection::Operation op); void select_all (Selection::Operation op); - void invert_selection_in_selected_tracks (); + void invert_selection_in_track (); void invert_selection (); void deselect_all (); @@ -511,16 +511,30 @@ class Editor : public PublicEditor bool set_selected_regionview_from_click (bool press, Selection::Operation op = Selection::Set, bool no_track_remove=false); void set_selected_regionview_from_region_list (boost::shared_ptr<ARDOUR::Region> region, Selection::Operation op = Selection::Set); + bool set_selected_regionview_from_map_event (GdkEventAny*, StreamView*, boost::weak_ptr<ARDOUR::Region>); void collect_new_region_view (RegionView *); void collect_and_select_new_region_view (RegionView *); + + Gtk::Menu track_context_menu; + Gtk::Menu track_region_context_menu; + Gtk::Menu track_selection_context_menu; + Gtk::Menu track_crossfade_context_menu; Gtk::MenuItem* region_edit_menu_split_item; Gtk::MenuItem* region_edit_menu_split_multichannel_item; + Gtk::Menu * track_region_edit_playlist_menu; + Gtk::Menu * track_edit_playlist_submenu; + Gtk::Menu * track_selection_edit_playlist_submenu; - void popup_track_context_menu (int, int, nframes_t); + void popup_track_context_menu (int, int, ItemType, bool, nframes_t); Gtk::Menu* build_track_context_menu (nframes_t); - void add_bus_or_audio_track_context_items (Gtk::Menu_Helpers::MenuList&); - void add_region_context_items (Gtk::Menu_Helpers::MenuList&); + Gtk::Menu* build_track_bus_context_menu (nframes_t); + Gtk::Menu* build_track_region_context_menu (nframes_t frame); + Gtk::Menu* build_track_crossfade_context_menu (nframes_t); + Gtk::Menu* build_track_selection_context_menu (nframes_t); + void add_dstream_context_items (Gtk::Menu_Helpers::MenuList&); + void add_bus_context_items (Gtk::Menu_Helpers::MenuList&); + void add_region_context_items (StreamView*, boost::shared_ptr<ARDOUR::Region>, Gtk::Menu_Helpers::MenuList&); void add_crossfade_context_items (AudioStreamView*, boost::shared_ptr<ARDOUR::Crossfade>, Gtk::Menu_Helpers::MenuList&, bool many); void add_selection_context_items (Gtk::Menu_Helpers::MenuList&); @@ -1031,10 +1045,10 @@ class Editor : public PublicEditor void audition_playlist_region_standalone (boost::shared_ptr<ARDOUR::Region>); void audition_playlist_region_via_route (boost::shared_ptr<ARDOUR::Region>, ARDOUR::Route&); void split_multichannel_region(); - void reverse_regions (); - void normalize_regions (); - void denormalize_regions (); - void quantize_regions (); + void reverse_region (); + void normalize_region (); + void denormalize_region (); + void quantize_region (); void audition_region_from_region_list (); void hide_region_from_region_list (); @@ -1176,7 +1190,7 @@ class Editor : public PublicEditor void set_selection_from_range (ARDOUR::Location&); void set_selection_from_punch (); void set_selection_from_loop (); - void set_selection_from_audio_region (); + void set_selection_from_region (); void add_location_mark (nframes64_t where); void add_location_from_audio_region (); @@ -1901,8 +1915,8 @@ class Editor : public PublicEditor static void* _freeze_thread (void*); void* freeze_thread (); - void freeze_routes (); - void unfreeze_routes (); + void freeze_route (); + void unfreeze_route (); /* edit-group solo + mute */ @@ -1990,7 +2004,7 @@ class Editor : public PublicEditor /* nudging tracks */ - void nudge_selected_tracks (bool use_edit_cursor, bool forwards); + void nudge_track (bool use_edit_point, bool forwards); /* xfades */ @@ -2101,13 +2115,6 @@ class Editor : public PublicEditor void toggle_gain_envelope_active (); void reset_region_gain_envelopes (); - Gtk::CheckMenuItem* region_envelope_visible_item; - Gtk::CheckMenuItem* region_envelope_active_item; - Gtk::CheckMenuItem* region_mute_item; - Gtk::CheckMenuItem* region_lock_item; - Gtk::CheckMenuItem* region_lock_position_item; - Gtk::CheckMenuItem* region_opaque_item; - bool on_key_press_event (GdkEventKey*); bool on_key_release_event (GdkEventKey*); diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc index e881b02a4e..c8cde42754 100644 --- a/gtk2_ardour/editor_actions.cc +++ b/gtk2_ardour/editor_actions.cc @@ -352,11 +352,11 @@ Editor::register_actions () ActionManager::session_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "insert-region", _("Insert Region"), mem_fun(*this, &Editor::keyboard_insert_region_list_selection)); ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "reverse-region", _("Reverse Regions"), mem_fun(*this, &Editor::reverse_regions)); + act = ActionManager::register_action (editor_actions, "reverse-region", _("Reverse Region"), mem_fun(*this, &Editor::reverse_region)); ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "normalize-region", _("Normalize Regions"), mem_fun(*this, &Editor::normalize_regions)); + act = ActionManager::register_action (editor_actions, "normalize-region", _("Normalize Region"), mem_fun(*this, &Editor::normalize_region)); ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "quantize-region", _("Quantize Regions"), mem_fun(*this, &Editor::quantize_regions)); + act = ActionManager::register_action (editor_actions, "quantize-region", _("Quantize Region"), mem_fun(*this, &Editor::quantize_region)); ActionManager::session_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "crop", _("Crop"), mem_fun(*this, &Editor::crop_region_to_selection)); ActionManager::session_sensitive_actions.push_back (act); diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index 68e0f62be4..e526d2d0db 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -335,51 +335,27 @@ Editor::track_canvas_size_allocated () reset_scrolling_region (); if (playhead_cursor) playhead_cursor->set_length (canvas_height); + + double y1 = vertical_adjustment.get_value (); for (MarkerSelection::iterator x = selection->markers.begin(); x != selection->markers.end(); ++x) { - (*x)->set_line_length (full_canvas_height); - } - - if (range_marker_drag_rect) { - range_marker_drag_rect->property_y1() = 0.0; - range_marker_drag_rect->property_y2() = canvas_height; - } - - if (transport_loop_range_rect) { - transport_loop_range_rect->property_y1() = 0.0; - transport_loop_range_rect->property_y2() = canvas_height; - } - - if (transport_punch_range_rect) { - transport_punch_range_rect->property_y1() = 0.0; - transport_punch_range_rect->property_y2() = canvas_height; - } - - if (transport_punchin_line) { - transport_punchin_line->property_y1() = 0.0; - transport_punchin_line->property_y2() = canvas_height; + (*x)->set_line_vpos (y1, canvas_height); } - if (transport_punchout_line) { - transport_punchout_line->property_y1() = 0.0; - transport_punchout_line->property_y2() = canvas_height; - } - compute_fixed_ruler_scale (); - - range_marker_drag_rect->property_y2() = full_canvas_height; - transport_loop_range_rect->property_y2() = full_canvas_height; - transport_punch_range_rect->property_y2() = full_canvas_height; - transport_punchin_line->property_y2() = full_canvas_height; - transport_punchout_line->property_y2() = full_canvas_height; + range_marker_drag_rect->property_y1() = 0.0; + range_marker_drag_rect->property_y2() = canvas_height; + transport_loop_range_rect->property_y1() = 0.0; + transport_loop_range_rect->property_y2() = canvas_height; + transport_punch_range_rect->property_y1() = 0.0; + transport_punch_range_rect->property_y2() = canvas_height; + transport_punchin_line->property_y1() = 0.0; + transport_punchin_line->property_y2() = canvas_height; + transport_punchout_line->property_y1() = 0.0; + transport_punchout_line->property_y2() = canvas_height; update_fixed_rulers(); redisplay_tempo (true); - if (logo_item) { - // logo_item->property_height() = full_canvas_height; - // logo_item->property_width() = canvas_width; - } - Resized (); /* EMIT_SIGNAL */ return false; @@ -723,6 +699,38 @@ Editor::left_track_canvas (GdkEventCrossing *ev) return FALSE; } +void +Editor::tie_vertical_scrolling () +{ + double y1 = vertical_adjustment.get_value(); + + playhead_cursor->set_y_axis (y1); + + range_marker_drag_rect->property_y1() = y1; + range_marker_drag_rect->property_y2() = y1 + canvas_height; + transport_loop_range_rect->property_y1() = y1; + transport_loop_range_rect->property_y2() = y1 + canvas_height; + transport_punch_range_rect->property_y1() = y1; + transport_punch_range_rect->property_y2() = y1 + canvas_height; + transport_punchin_line->property_y1() = y1; + transport_punchin_line->property_y2() = y1 + canvas_height; + transport_punchout_line->property_y1() = y1; + transport_punchout_line->property_y2() = y1 + canvas_height; + + if (!selection->markers.empty()) { + for (MarkerSelection::iterator x = selection->markers.begin(); x != selection->markers.end(); ++x) { + (*x)->set_line_vpos (y1, canvas_height); + } + } + + if (logo_item) { + logo_item->property_y() = y1; + } + + /* this will do an immediate redraw */ + + controls_layout.get_vadjustment()->set_value (y1); +} void Editor::canvas_horizontally_scrolled () diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc index e6fb32feca..13e8f49d61 100644 --- a/gtk2_ardour/editor_markers.cc +++ b/gtk2_ardour/editor_markers.cc @@ -1172,7 +1172,7 @@ Editor::marker_selection_changed () } for (MarkerSelection::iterator x = selection->markers.begin(); x != selection->markers.end(); ++x) { - (*x)->add_line (cursor_group, full_canvas_height); + (*x)->add_line (cursor_group, vertical_adjustment.get_value(), canvas_height); (*x)->show_line (); } diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index 35f410eb25..048277fea7 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -967,24 +967,23 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT case FadeOutHandleItem: popup_fade_context_menu (1, event->button.time, item, item_type); break; - + case StreamItem: - popup_track_context_menu (1, event->button.time, where); + popup_track_context_menu (1, event->button.time, item_type, false, where); break; case RegionItem: case RegionViewNameHighlight: case RegionViewName: - popup_track_context_menu (1, event->button.time, where); + popup_track_context_menu (1, event->button.time, item_type, false, where); break; case SelectionItem: - popup_track_context_menu (1, event->button.time, where); + popup_track_context_menu (1, event->button.time, item_type, true, where); break; case AutomationTrackItem: - case CrossfadeViewItem: - popup_track_context_menu (1, event->button.time, where); + popup_track_context_menu (1, event->button.time, item_type, false, where); break; case MarkerBarItem: @@ -1007,6 +1006,10 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT case MeterMarkerItem: tm_marker_context_menu (&event->button, item); break; + + case CrossfadeViewItem: + popup_track_context_menu (1, event->button.time, item_type, false, where); + break; #ifdef WITH_CMT case ImageFrameItem: @@ -3680,7 +3683,7 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event if (regionview_y_movement) { - /* moved to a different audio track. */ + /* moved to a different track. */ vector<RegionView*> new_selection; @@ -3695,7 +3698,11 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event RouteTimeAxisView* rtv2 = dynamic_cast<RouteTimeAxisView*>(trackview_by_y_position (iy1)); + boost::shared_ptr<Playlist> from_playlist = rv->region()->playlist(); boost::shared_ptr<Playlist> to_playlist = rtv2->playlist(); + + where = (nframes_t) (unit_to_frame (ix1) * speed); + boost::shared_ptr<Region> new_region (RegionFactory::create (rv->region())); if (! to_playlist->frozen()) { /* @@ -3720,35 +3727,26 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event to_playlist->freeze(); } - where = (nframes_t) (unit_to_frame (ix1) * speed); - boost::shared_ptr<Region> new_region (RegionFactory::create (rv->region())); - - if (!drag_info.copy) { + /* undo the previous hide_dependent_views so that xfades don't + disappear on copying regions + */ + rv->get_time_axis_view().reveal_dependent_views (*rv); + if (!drag_info.copy) { + /* the region that used to be in the old playlist is not moved to the new one - we make a copy of it. as a result, any existing editor for the region should no longer be visible. */ - - RouteTimeAxisView* from_playlist_rtv = dynamic_cast<RouteTimeAxisView*>(&(*i)->get_trackview()); - boost::shared_ptr<Playlist> from_playlist = from_playlist_rtv->playlist(); - - if (! from_playlist->frozen()) { - from_playlist->freeze(); - used_playlists.push_back(from_playlist); - - sigc::connection c = rtv2->view()->RegionViewAdded.connect (mem_fun(*this, &Editor::collect_and_select_new_region_view)); - used_connections.push_back (c); - - session->add_command (new MementoCommand<Playlist>(*from_playlist, &from_playlist->get_state(), 0)); - } - + rv->hide_region_editor(); rv->fake_set_opaque (false); + session->add_command (new MementoCommand<Playlist>(*from_playlist, &from_playlist->get_state(), 0)); from_playlist->remove_region ((rv->region())); + session->add_command (new MementoCommand<Playlist>(*from_playlist, 0, &from_playlist->get_state())); } else { diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 4919091a62..7df3d1dfe9 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -2595,6 +2595,9 @@ Editor::separate_regions_between (const TimeSelection& ts) sort_track_selection (&tmptracks); + + + for (TrackSelection::iterator i = tmptracks.begin(); i != tmptracks.end(); ++i) { RouteTimeAxisView* rtv; @@ -3298,16 +3301,14 @@ Editor::trim_region_from_edit_point () commit_reversible_command (); } -/** Unfreeze selected routes */ void -Editor::unfreeze_routes () +Editor::unfreeze_route () { - for (TrackSelection::iterator i = selection->tracks.begin(); i != selection->tracks.end(); ++i) { - AudioTimeAxisView* atv = dynamic_cast<AudioTimeAxisView*>(*i); - if (atv && atv->is_audio_track()) { - atv->audio_track()->unfreeze (); - } + if (clicked_routeview == 0 || !clicked_routeview->is_audio_track()) { + return; } + + clicked_routeview->audio_track()->unfreeze (); } void* @@ -3320,15 +3321,7 @@ Editor::_freeze_thread (void* arg) void* Editor::freeze_thread () { - for (TrackSelection::iterator i = selection->tracks.begin(); i != selection->tracks.end(); ++i) { - AudioTimeAxisView* atv = dynamic_cast<AudioTimeAxisView*>(*i); - if (atv && atv->is_audio_track()) { - atv->audio_track()->freeze (*current_interthread_info); - } - } - - current_interthread_info->done = true; - + clicked_routeview->audio_track()->freeze (*current_interthread_info); return 0; } @@ -3339,10 +3332,13 @@ Editor::freeze_progress_timeout (void *arg) return !(current_interthread_info->done || current_interthread_info->cancel); } -/** Freeze selected routes */ void -Editor::freeze_routes () +Editor::freeze_route () { + if (clicked_routeview == 0 || !clicked_routeview->is_audio_track()) { + return; + } + InterThreadInfo itt; if (interthread_progress_window == 0) { @@ -3991,7 +3987,7 @@ Editor::clear_playlist (boost::shared_ptr<Playlist> playlist) } void -Editor::nudge_selected_tracks (bool use_edit, bool forwards) +Editor::nudge_track (bool use_edit, bool forwards) { boost::shared_ptr<Playlist> playlist; nframes_t distance; @@ -4058,7 +4054,7 @@ Editor::remove_last_capture () } void -Editor::normalize_regions () +Editor::normalize_region () { if (!session) { return; @@ -4088,7 +4084,7 @@ Editor::normalize_regions () void -Editor::denormalize_regions () +Editor::denormalize_region () { if (!session) { return; @@ -4114,7 +4110,7 @@ Editor::denormalize_regions () void -Editor::reverse_regions () +Editor::reverse_region () { if (!session) { return; @@ -4126,7 +4122,7 @@ Editor::reverse_regions () void -Editor::quantize_regions () +Editor::quantize_region () { if (!session) { return; @@ -4270,10 +4266,7 @@ Editor::toggle_gain_envelope_visibility () for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) { AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i); if (arv) { - bool x = region_envelope_visible_item->get_active(); - if (x != arv->envelope_visible()) { - arv->set_envelope_visible (x); - } + arv->set_envelope_visible (!arv->envelope_visible()); } } } @@ -4284,28 +4277,7 @@ Editor::toggle_gain_envelope_active () for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) { AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i); if (arv) { - bool x = region_envelope_active_item->get_active(); - if (x != arv->audio_region()->envelope_active()) { - arv->audio_region()->set_envelope_active (x); - } - } - } -} - -/** Set the position-locked state of all selected regions to a particular value. - * @param yn true to make locked, false to make unlocked. - */ -void -Editor::toggle_region_position_lock () -{ - bool x = region_lock_position_item->get_active(); - - for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) { - AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i); - if (arv) { - if (x != arv->audio_region()->locked()) { - arv->audio_region()->set_position_locked (x); - } + arv->audio_region()->set_envelope_active (!arv->audio_region()->envelope_active()); } } } @@ -4313,45 +4285,24 @@ Editor::toggle_region_position_lock () void Editor::toggle_region_lock () { - bool x = region_lock_item->get_active(); - for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) { - AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i); - if (arv) { - if (x != arv->audio_region()->locked()) { - arv->audio_region()->set_locked (x); - } - } + (*i)->region()->set_locked (!(*i)->region()->locked()); } } void Editor::toggle_region_mute () { - bool x = region_mute_item->get_active(); - for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) { - AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i); - if (arv) { - if (x != arv->audio_region()->muted()) { - arv->audio_region()->set_muted (x); - } - } + (*i)->region()->set_muted (!(*i)->region()->muted()); } } void Editor::toggle_region_opaque () { - bool x = region_opaque_item->get_active(); - for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) { - AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i); - if (arv) { - if (x != arv->audio_region()->opaque()) { - arv->audio_region()->set_opaque (x); - } - } + (*i)->region()->set_opaque (!(*i)->region()->opaque()); } } diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index 87b9eba6f7..7c75701270 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -713,6 +713,37 @@ Editor::set_selected_regionview_from_region_list (boost::shared_ptr<Region> regi commit_reversible_command () ; } +bool +Editor::set_selected_regionview_from_map_event (GdkEventAny* ev, StreamView* sv, boost::weak_ptr<Region> weak_r) +{ + RegionView* rv; + boost::shared_ptr<Region> r (weak_r.lock()); + + if (!r) { + return true; + } + + if ((rv = sv->find_view (r)) == 0) { + return true; + } + + /* don't reset the selection if its something other than + a single other region. + */ + + if (selection->regions.size() > 1) { + return true; + } + + begin_reversible_command (_("set selected regions")); + + selection->set (rv); + + commit_reversible_command () ; + + return true; +} + void Editor::track_selection_changed () { @@ -776,17 +807,16 @@ Editor::point_selection_changed () } } -/** Select everything in the selected tracks - * @param Selection operation to apply. - */ void -Editor::select_all_in_selected_tracks (Selection::Operation op) +Editor::select_all_in_track (Selection::Operation op) { list<Selectable *> touched; - for (TrackSelection::iterator i = selection->tracks.begin(); i != selection->tracks.end(); ++i) { - (*i)->get_selectables (0, max_frames, 0, DBL_MAX, touched); + if (!clicked_routeview) { + return; } + + clicked_routeview->get_selectables (0, max_frames, 0, DBL_MAX, touched); switch (op) { case Selection::Toggle: @@ -832,17 +862,16 @@ Editor::select_all (Selection::Operation op) } commit_reversible_command (); } - -/** Invert the selection in the selected tracks */ void -Editor::invert_selection_in_selected_tracks () +Editor::invert_selection_in_track () { list<Selectable *> touched; - for (TrackSelection::iterator i = selection->tracks.begin(); i != selection->tracks.end(); ++i) { - (*i)->get_inverted_selectables (*selection, touched); + if (!clicked_routeview) { + return; } + clicked_routeview->get_inverted_selectables (*selection, touched); selection->set (touched); } @@ -926,7 +955,7 @@ Editor::select_all_within (nframes_t start, nframes_t end, double top, double bo } void -Editor::set_selection_from_audio_region () +Editor::set_selection_from_region () { if (selection->regions.empty()) { return; diff --git a/gtk2_ardour/engine_dialog.cc b/gtk2_ardour/engine_dialog.cc index e511e59af2..c1ffcefb2b 100644 --- a/gtk2_ardour/engine_dialog.cc +++ b/gtk2_ardour/engine_dialog.cc @@ -4,6 +4,7 @@ #include <map> #include <glibmm.h> +#include <gtkmm/messagedialog.h> #include <pbd/xml++.h> #ifdef __APPLE__ @@ -427,11 +428,11 @@ EngineControl::build_command_line (vector<string>& cmd) cmd.push_back ("netjack"); } else if (driver == X_("FFADO")) { using_ffado = true; - cmd.push_back ("firewire"); + cmd.push_back ("ffado"); } else if ( driver == X_("Dummy")) { using_dummy = true; cmd.push_back ("dummy"); - } + } /* driver arguments */ @@ -621,10 +622,29 @@ EngineControl::enumerate_coreaudio_devices () // Look for the CoreAudio device name... char coreDeviceName[256]; size_t nameSize; + for (int i = 0; i < numCoreDevices; i++) { nameSize = sizeof (coreDeviceName); + /* enforce duplex devices only */ + + err = AudioDeviceGetPropertyInfo(coreDeviceIDs[i], + 0, true, kAudioDevicePropertyStreams, + &outSize, &isWritable); + + if (err != noErr || outSize == 0) { + continue; + } + + err = AudioDeviceGetPropertyInfo(coreDeviceIDs[i], + 0, false, kAudioDevicePropertyStreams, + &outSize, &isWritable); + + if (err != noErr || outSize == 0) { + continue; + } + err = AudioDeviceGetPropertyInfo(coreDeviceIDs[i], 0, true, kAudioDevicePropertyDeviceName, &outSize, &isWritable); @@ -649,6 +669,26 @@ EngineControl::enumerate_coreaudio_devices () delete [] coreDeviceIDs; } + if (devs.size() == 0) { + MessageDialog msg (_("\ +You do not have any audio devices capable of\n\ +simultaneous playback and recording.\n\n\ +Please use Applications -> Utilities -> Audio MIDI Setup\n\ +to create an \"aggregrate\" device, or install a suitable\n\ +audio interface.\n\n\ +Please send email to Apple and ask them why new Macs\n\ +have no duplex audio device.\n\n\ +Alternatively, if you really want just playback\n\ +or recording but not both, start JACK before running\n\ +Ardour and choose the relevant device then." + ), + true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK); + msg.set_title (_("No suitable audio devices")); + msg.set_position (Gtk::WIN_POS_MOUSE); + msg.run (); + exit (1); + } + return devs; } #else @@ -869,7 +909,7 @@ EngineControl::find_jack_servers (vector<string>& strings) std::map<string,int> un; path = getenv ("PATH"); - + jack_servers = scanner (path, jack_server_filter, 0, false, true); vector<string *>::iterator iter; diff --git a/gtk2_ardour/marker.cc b/gtk2_ardour/marker.cc index 6e37908d1b..771683d80e 100644 --- a/gtk2_ardour/marker.cc +++ b/gtk2_ardour/marker.cc @@ -25,6 +25,7 @@ #include "utils.h" #include "canvas_impl.h" #include "ardour_ui.h" +#include "simpleline.h" #include "i18n.h" @@ -269,7 +270,6 @@ Marker::Marker (PublicEditor& ed, ArdourCanvas::Group& parent, guint32 rgba, con } line = 0; - line_points = 0; } @@ -285,7 +285,6 @@ Marker::~Marker () if (line) { delete line; - delete line_points; } } @@ -295,35 +294,28 @@ void Marker::reparent(ArdourCanvas::Group & parent) _parent = &parent; } + void -Marker::set_line_length (double len) +Marker::set_line_vpos (double pos, double height) { if (line) { - line_points->back().set_y (len); - line->property_points() = *line_points; + line->property_y1() = pos; + line->property_y2() = pos + height; } } void -Marker::add_line (ArdourCanvas::Group* group, double initial_height) +Marker::add_line (ArdourCanvas::Group* group, double y_origin, double initial_height) { if (!line) { - line_points = new ArdourCanvas::Points (); - line_points->push_back (Gnome::Art::Point (unit_position + shift, 0.0)); - line_points->push_back (Gnome::Art::Point (unit_position + shift, initial_height)); - - line = new ArdourCanvas::Line (*group); - line->property_width_pixels() = 1; - line->property_points() = *line_points; - line->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_EditPoint.get(); -#if 0 - line->property_first_arrowhead() = TRUE; - line->property_last_arrowhead() = TRUE; - line->property_arrow_shape_a() = 11.0; - line->property_arrow_shape_b() = 0.0; - line->property_arrow_shape_c() = 9.0; -#endif + line = new ArdourCanvas::SimpleLine (*group); + line->property_color_rgba() = ARDOUR_UI::config()->canvasvar_EditPoint.get(); + line->property_x1() = unit_position + shift; + line->property_y1() = y_origin; + line->property_x2() = unit_position + shift; + line->property_y2() = y_origin + initial_height; + line->signal_event().connect (bind (mem_fun (editor, &PublicEditor::canvas_marker_event), mark, this)); } @@ -372,9 +364,8 @@ Marker::set_position (nframes_t frame) unit_position = new_unit_position; if (line) { - (*line_points)[0].set_x (unit_position + shift); - (*line_points)[1].set_x (unit_position + shift); - line->property_points() = *line_points; + line->property_x1() = unit_position + shift; + line->property_x2() = unit_position + shift; } } diff --git a/gtk2_ardour/marker.h b/gtk2_ardour/marker.h index fa252571fb..1a53726ede 100644 --- a/gtk2_ardour/marker.h +++ b/gtk2_ardour/marker.h @@ -57,10 +57,10 @@ class Marker : public PBD::Destructible ArdourCanvas::Item& the_item() const; - void add_line (ArdourCanvas::Group*, double initial_height); + void add_line (ArdourCanvas::Group*, double y_origin, double initial_height); void show_line (); void hide_line (); - void set_line_length (double); + void set_line_vpos (double y_origin, double height); void set_position (nframes_t); void set_name (const string&); @@ -84,7 +84,7 @@ class Marker : public PBD::Destructible ArdourCanvas::Polygon *mark; ArdourCanvas::Text *text; ArdourCanvas::Points *points; - ArdourCanvas::Line *line; + ArdourCanvas::SimpleLine *line; ArdourCanvas::Points *line_points; double unit_position; diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index 94c687f829..f7a1d48a50 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -311,6 +311,8 @@ Mixer_UI::add_strip (Session::RouteList& routes) Config->get_default_narrow_ms() ? _strip_width = Narrow : _strip_width = Wide; + Config->get_default_narrow_ms() ? _strip_width = Narrow : _strip_width = Wide; + if (strip->width_owner() != strip) { strip->set_width (_strip_width, this); } diff --git a/gtk2_ardour/new_session_dialog.cc b/gtk2_ardour/new_session_dialog.cc index 820a614ecc..db970b4d46 100644 --- a/gtk2_ardour/new_session_dialog.cc +++ b/gtk2_ardour/new_session_dialog.cc @@ -20,6 +20,8 @@ #include "i18n.h" #include "new_session_dialog.h" +#include <pbd/error.h> + #include <ardour/recent_sessions.h> #include <ardour/session_state_utils.h> #include <ardour/template_utils.h> @@ -38,8 +40,8 @@ #include <gtkmm2ext/window_title.h> using namespace Gtkmm2ext; -using namespace ARDOUR; using namespace PBD; +using namespace ARDOUR; #include "opts.h" #include "utils.h" @@ -526,7 +528,49 @@ NewSessionDialog::set_session_name (const Glib::ustring& name) void NewSessionDialog::set_session_folder(const Glib::ustring& dir) { - m_folder->set_current_folder (dir); + Glib::ustring realdir = dir; + char* res; + + /* this little tangled mess is a result of 4 things: + + 1) GtkFileChooser vomits when given a non-absolute directory + argument to set_current_folder() + 2) canonicalize_file_name() doesn't exist on OS X + 3) linux man page for realpath() says "do not use this function" + 4) canonicalize_file_name() & realpath() have entirely + different semantics on OS X and Linux when given + a non-existent path. + + as result of all this, we take two distinct pathways through the code. + */ + + +#ifdef __APPLE__ + + char buf[PATH_MAX]; + + if((res = realpath (dir.c_str(), buf)) != 0) { + if (!Glib::file_test (dir, Glib::FILE_TEST_IS_DIR)) { + realdir = Glib::path_get_dirname (realdir); + } + m_folder->set_current_folder (realdir); + } + + +#else + if (!Glib::file_test (dir, Glib::FILE_TEST_IS_DIR)) { + realdir = Glib::path_get_dirname (realdir); + cerr << "didn't exist, use " << realdir << endl; + } + + if ((res = canonicalize_file_name (realdir.c_str())) != 0) { + cerr << "canonical, use " << res << endl; + m_folder->set_current_folder (res); + free (res); + } + +#endif + } std::string @@ -547,40 +591,54 @@ NewSessionDialog::session_name() const } */ - int page = m_notebook->get_current_page(); - - if (page == 0 || page == 2) { + switch (which_page()) { + case NewPage: + case EnginePage: /* new or audio setup pages */ return Glib::filename_from_utf8(m_name->get_text()); - } else { - if (m_treeview->get_selection()->count_selected_rows() == 0) { - return Glib::filename_from_utf8(str); - } - Gtk::TreeModel::iterator i = m_treeview->get_selection()->get_selected(); - return (*i)[recent_columns.visible_name]; + default: + break; + } + + if (m_treeview->get_selection()->count_selected_rows() == 0) { + return Glib::filename_from_utf8(str); } + Gtk::TreeModel::iterator i = m_treeview->get_selection()->get_selected(); + return (*i)[recent_columns.visible_name]; } std::string NewSessionDialog::session_folder() const { - if (m_notebook->get_current_page() == 0) { + switch (which_page()) { + case NewPage: return Glib::filename_from_utf8(m_folder->get_filename()); - } else { - - if (m_treeview->get_selection()->count_selected_rows() == 0) { - const string filename(Glib::filename_from_utf8(m_open_filechooser->get_filename())); - return Glib::path_get_dirname(filename); + + case EnginePage: + if (page_set == EnginePage) { + /* just engine page, nothing else : use m_folder since it should be set */ + return Glib::filename_from_utf8(m_folder->get_filename()); } - Gtk::TreeModel::iterator i = m_treeview->get_selection()->get_selected(); - return (*i)[recent_columns.fullpath]; + break; + + default: + break; } + + if (m_treeview->get_selection()->count_selected_rows() == 0) { + const string filename(Glib::filename_from_utf8(m_open_filechooser->get_filename())); + return Glib::path_get_dirname(filename); + } + + Gtk::TreeModel::iterator i = m_treeview->get_selection()->get_selected(); + return (*i)[recent_columns.fullpath]; } bool NewSessionDialog::use_session_template() const { - if(m_template->get_filename().empty() && (m_notebook->get_current_page() == 0)) return false; + if (m_template->get_filename().empty() && (which_page() == NewPage)) + return false; return true; } @@ -663,13 +721,13 @@ NewSessionDialog::connect_outs_to_physical() const } int -NewSessionDialog::get_current_page() const +NewSessionDialog::get_current_page() { return m_notebook->get_current_page(); } NewSessionDialog::Pages -NewSessionDialog::which_page () +NewSessionDialog::which_page () const { int num = m_notebook->get_current_page(); @@ -755,7 +813,6 @@ NewSessionDialog::notebook_page_changed (GtkNotebookPage* np, uint pagenum) m_okbutton->set_label(_("Open")); m_okbutton->set_image (*(manage (new Gtk::Image (Gtk::Stock::OPEN, Gtk::ICON_SIZE_BUTTON)))); set_response_sensitive (Gtk::RESPONSE_NONE, false); - m_okbutton->set_image (*(new Gtk::Image (Gtk::Stock::OPEN, Gtk::ICON_SIZE_BUTTON))); if (m_treeview->get_selection()->count_selected_rows() == 0) { set_response_sensitive (Gtk::RESPONSE_OK, false); } else { @@ -772,8 +829,7 @@ NewSessionDialog::notebook_page_changed (GtkNotebookPage* np, uint pagenum) break; default: - m_okbutton->set_label(_("New")); - m_okbutton->set_image (*(new Gtk::Image (Gtk::Stock::NEW, Gtk::ICON_SIZE_BUTTON))); + on_new_session_page = true; m_okbutton->set_label(_("New")); m_okbutton->set_image (*(new Gtk::Image (Gtk::Stock::NEW, Gtk::ICON_SIZE_BUTTON))); if (m_name->get_text() == "") { @@ -893,7 +949,7 @@ NewSessionDialog::monitor_bus_button_clicked () void NewSessionDialog::reset_template() { - m_template->set_filename(""); + m_template->unselect_all (); } void diff --git a/gtk2_ardour/new_session_dialog.h b/gtk2_ardour/new_session_dialog.h index 6f0820168b..aa6911f360 100644 --- a/gtk2_ardour/new_session_dialog.h +++ b/gtk2_ardour/new_session_dialog.h @@ -92,9 +92,9 @@ public: bool connect_outs_to_master() const; bool connect_outs_to_physical() const ; - Pages which_page (); + Pages which_page () const; - int get_current_page() const; + int get_current_page(); void set_current_page (int); void reset_recent(); diff --git a/gtk2_ardour/po/sv_SE.po b/gtk2_ardour/po/sv_SE.po index 9804869d95..b6c4a01b1b 100644 --- a/gtk2_ardour/po/sv_SE.po +++ b/gtk2_ardour/po/sv_SE.po @@ -6854,7 +6854,7 @@ msgstr "som nya bandspår" #: gtk2_ardour/sfdb_ui.cc:109 msgid "Auto-play" -msgstr "Spela automatiskt" +msgstr "Spela autom." #: gtk2_ardour/sfdb_ui.cc:994 gtk2_ardour/sfdb_ui.cc:1129 msgid "use file timestamp" @@ -7062,3 +7062,39 @@ msgstr "Bra" #: gtk2_ardour/sfdb_ui.cc:1069 gtk2_ardour/sfdb_ui.cc:1149 msgid "Quick" msgstr "Snabb" + +#: gtk2_ardour/editor_timefx.cc:74 +msgid "Strict Linear" +msgstr "Strikt linjär" + +#: gtk2_ardour/editor_timefx.cc:84 +msgid "Time Stretch" +msgstr "Förläng/förkorta" + +#: gtk2_ardour/editor.cc:156 +msgid "Mushy" +msgstr "Mossig" + +#: gtk2_ardour/editor.cc:157 +msgid "Smooth" +msgstr "Mjuk" + +#: gtk2_ardour/editor.cc:158 +msgid "Balanced multitimbral mixture" +msgstr "Balanserad flerröstig mix" + +#: gtk2_ardour/editor.cc:159 +msgid "Unpitched percussion with stable notes" +msgstr "Ej tonhöjdsändrat slagverk med stabila noter" + +#: gtk2_ardour/editor.cc:160 +msgid "Crisp monophonic instrumental" +msgstr "Skarpt monofoniskt" + +#: gtk2_ardour/editor.cc:161 +msgid "Unpitched solo percussion" +msgstr "EJ tonhöjdsändrat soloslagverk" + +#: gtk2_ardour/editor_timefx.cc:73 +msgid "Contents:" +msgstr "Innehåll" |