From: David Robillard Date: Tue, 19 Feb 2008 22:10:27 +0000 (+0000) Subject: Merge with 2.0-ongoing R3082. X-Git-Tag: 3.0-alpha5~4327 X-Git-Url: https://main.carlh.net/gitweb/?a=commitdiff_plain;ds=sidebyside;h=a2a6cc0404757f445bd753d69f34d8bc2c0e87a9;p=ardour.git Merge with 2.0-ongoing R3082. Superficial generification of export stuff. git-svn-id: svn://localhost/ardour2/branches/3.0@3088 d708f5d6-7413-0410-9779-e7cbd77b26cf --- diff --git a/gtk2_ardour/SAE-de.bindings.in b/gtk2_ardour/SAE-de.bindings.in index e0758e5c04..a1dedef2f9 100644 --- a/gtk2_ardour/SAE-de.bindings.in +++ b/gtk2_ardour/SAE-de.bindings.in @@ -7,7 +7,7 @@ (gtk_accel_path "/Transport/ToggleRoll" "space") (gtk_accel_path "/Transport/ToggleRollForgetCapture" "<%PRIMARY%>space") -(gtk_accel_path "/Transport/record-roll" "<%TERTIARY%>space") +(gtk_accel_path "/Transport/record-roll" "<%PRIMARY%>space") (gtk_accel_path "/Editor/align-regions-end" "<%PRIMARY%><%SECONDARY%>less") (gtk_accel_path "/Editor/align-regions-end-relative" "<%PRIMARY%>less") @@ -43,17 +43,18 @@ ;; note that ctrl-w is special and consumed by the keyboard snooper -(gtk_accel_path "/Editor/audition-at-mouse" "w") +(gtk_accel_path "/Editor/play-from-edit-point-and-return" "<%LEVEL4%>space") +(gtk_accel_path "/Editor/play-edit-range" "<%SECONDARY%>space") +(gtk_accel_path "/Editor/play-selected-regions" "s") (gtk_accel_path "/Main/Close" "<%PRIMARY%>w") (gtk_accel_path "/Editor/set-fade-out-length" "e") (gtk_accel_path "/Main/ExportSession" "<%PRIMARY%>e") (gtk_accel_path "/Editor/select-all-before-edit-cursor" "<%PRIMARY%>e") (gtk_accel_path "/Editor/toggle-fade-out-active" "<%SECONDARY%>e") (gtk_accel_path "/Editor/show-editor-mixer" "<%TERTIARY%>e") -(gtk_accel_path "/Common/goto-editor" "<%WINDOW%>e") +; (gtk_accel_path "/Common/goto-editor" "<%SECONDARY%>e") (gtk_accel_path "/Editor/select-all-after-edit-cursor" "<%TERTIARY%><%PRIMARY%>e") -(gtk_accel_path "/MouseMode/set-mouse-mode-range" "r") -(gtk_accel_path "/Editor/redo" "<%PRIMARY%>r") +(gtk_accel_path "/Editor/redo" "<%PRIMARY%><%TERTIARY%>z") (gtk_accel_path "/Transport/Record" "<%TERTIARY%>r") (gtk_accel_path "/Editor/temporal-zoom-out" "r") (gtk_accel_path "/Editor/temporal-zoom-in" "t") @@ -62,28 +63,28 @@ (gtk_accel_path "/Editor/insert-region" "i") (gtk_accel_path "/Editor/addExistingAudioFiles" "<%PRIMARY%>i") (gtk_accel_path "/Editor/invert-selection" "<%TERTIARY%>i") -(gtk_accel_path "/Common/ToggleOptionsEditor" "<%WINDOW%>o") +(gtk_accel_path "/Common/ToggleOptionsEditor" "<%SECONDARY%>o") (gtk_accel_path "/Main/Open" "<%PRIMARY%>o") (gtk_accel_path "/Main/Recent" "<%PRIMARY%><%TERTIARY%>o") -(gtk_accel_path "/Editor/set-playhead" "p") +(gtk_accel_path "/Editor/set-playhead" "w") (gtk_accel_path "/Editor/select-all-in-punch-range" "<%TERTIARY%>p") ;; MITTELZEILE (gtk_accel_path "/Editor/trim-front" "a") (gtk_accel_path "/Editor/select-all" "<%PRIMARY%>a") -(gtk_accel_path "/Editor/trim-back" "s") +(gtk_accel_path "/Editor/trim-back" "d") (gtk_accel_path "/Common/Save" "<%PRIMARY%>s") (gtk_accel_path "/Main/Snapshot" "<%PRIMARY%><%TERTIARY%>s") -(gtk_accel_path "/Editor/duplicate-region" "d") -(gtk_accel_path "/Editor/multi-duplicate-region" "<%SECONDARY%>d") +(gtk_accel_path "/Editor/duplicate-region" "<%PRIMARY%>d") +(gtk_accel_path "/Editor/multi-duplicate-region" "<%PRIMARY%><%TERTIARY%>d") (gtk_accel_path "/Editor/toggle-follow-playhead" "f") -(gtk_accel_path "/Editor/set-edit-point" "g") -(gtk_accel_path "/MouseMode/set-mouse-mode-gain" "g") +; (gtk_accel_path "/Editor/set-edit-point" "g") +; (gtk_accel_path "/MouseMode/set-mouse-mode-gain" "g") (gtk_accel_path "/Editor/nudge-backward" "g") (gtk_accel_path "/Editor/nudge-forward" "h") -(gtk_accel_path "/Common/ToggleKeyEditor" "<%WINDOW%>k") -(gtk_accel_path "/Common/ToggleLocations" "<%WINDOW%>l") +(gtk_accel_path "/Common/ToggleKeyEditor" "<%SECONDARY%>k") +(gtk_accel_path "/Common/ToggleLocations" "<%SECONDARY%>l") (gtk_accel_path "/Transport/Loop" "l") (gtk_accel_path "/Editor/select-all-in-loop-range" "<%TERTIARY%>l") @@ -97,14 +98,14 @@ (gtk_accel_path "/Editor/editor-cut" "<%PRIMARY%>x") (gtk_accel_path "/Editor/crop" "c") (gtk_accel_path "/Editor/editor-copy" "<%PRIMARY%>c") -(gtk_accel_path "/Common/ToggleColorManager" "<%WINDOW%>c") +(gtk_accel_path "/Common/ToggleColorManager" "<%SECONDARY%>c") (gtk_accel_path "/Editor/editor-paste" "<%PRIMARY%>v") -(gtk_accel_path "/Common/ToggleBigClock" "<%WINDOW%>b") +(gtk_accel_path "/Common/ToggleBigClock" "<%SECONDARY%>b") (gtk_accel_path "/Editor/normalize-region" "n") (gtk_accel_path "/Main/New" "<%PRIMARY%>n") (gtk_accel_path "/Main/AddTrackBus" "<%PRIMARY%><%TERTIARY%>n") -(gtk_accel_path "/Common/goto-mixer" "<%WINDOW%>m") -(gtk_accel_path "/Editor/add-location-from-playhead" "m") +(gtk_accel_path "/Common/goto-mixer" "<%SECONDARY%>m") +(gtk_accel_path "/Editor/add-location-from-playhead" "KP_Enter") (gtk_accel_path "/Editor/mute-unmute-region" "<%SECONDARY%>m") ;; arrow keys, navigation etc. diff --git a/gtk2_ardour/actions.cc b/gtk2_ardour/actions.cc index 1484c01454..a383371c98 100644 --- a/gtk2_ardour/actions.cc +++ b/gtk2_ardour/actions.cc @@ -80,7 +80,8 @@ ActionManager::init () ui_manager->add_ui_from_file (ui_file.to_string()); loaded = true; } catch (Glib::MarkupError& err) { - error << _("badly formatted UI definition file") << endmsg; + error << string_compose (_("badly formatted UI definition file: %1"), err.what()) << endmsg; + cerr << string_compose (_("badly formatted UI definition file: %1"), err.what()) << endl; } catch (...) { error << _("Ardour menu definition file not found") << endmsg; } diff --git a/gtk2_ardour/ardour-sae.menus b/gtk2_ardour/ardour-sae.menus index 16f00955f3..e8b8a20b5e 100644 --- a/gtk2_ardour/ardour-sae.menus +++ b/gtk2_ardour/ardour-sae.menus @@ -1,12 +1,11 @@ - + - @@ -18,6 +17,7 @@ + @@ -28,43 +28,78 @@ + - - + + + + + + + - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -74,182 +109,191 @@ - - - - - - - - - - - - - - + + - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + diff --git a/gtk2_ardour/ardour.menus b/gtk2_ardour/ardour.menus index 73f65ef157..c333b03b61 100644 --- a/gtk2_ardour/ardour.menus +++ b/gtk2_ardour/ardour.menus @@ -123,7 +123,7 @@ - + diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index c94fb1ba9d..d12165bbb7 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -92,7 +92,7 @@ ARDOUR_UI::install_actions () ActionManager::register_action (main_actions, X_("Options"), _("Options")); ActionManager::register_action (main_actions, X_("TransportOptions"), _("Options")); ActionManager::register_action (main_actions, X_("Help"), _("Help")); - ActionManager::register_action (main_actions, X_("KeyMouse Actions"), _("KeyMouse Actions")); + ActionManager::register_action (main_actions, X_("KeyMouseActions"), _("Misc. Shortcuts")); ActionManager::register_action (main_actions, X_("AudioFileFormat"), _("Audio File Format")); ActionManager::register_action (main_actions, X_("AudioFileFormatHeader"), _("Header")); ActionManager::register_action (main_actions, X_("AudioFileFormatData"), _("Data")); @@ -310,6 +310,24 @@ ARDOUR_UI::install_actions () ActionManager::session_sensitive_actions.push_back (act); ActionManager::transport_sensitive_actions.push_back (act); + act = ActionManager::register_action (transport_actions, X_("primary-clock-bbt"), _("Bars & Beats"), bind (mem_fun(primary_clock, &AudioClock::set_mode), AudioClock::BBT)); + ActionManager::session_sensitive_actions.push_back (act); + act = ActionManager::register_action (transport_actions, X_("primary-clock-minsec"), _("Minutes & Seconds"), bind (mem_fun(primary_clock, &AudioClock::set_mode), AudioClock::MinSec)); + ActionManager::session_sensitive_actions.push_back (act); + act = ActionManager::register_action (transport_actions, X_("primary-clock-samples"), _("Samples"), bind (mem_fun(primary_clock, &AudioClock::set_mode), AudioClock::Frames)); + ActionManager::session_sensitive_actions.push_back (act); + act = ActionManager::register_action (transport_actions, X_("primary-clock-off"), _("Off"), bind (mem_fun(primary_clock, &AudioClock::set_mode), AudioClock::Off)); + ActionManager::session_sensitive_actions.push_back (act); + + act = ActionManager::register_action (transport_actions, X_("secondary-clock-bbt"), _("Bars & Beats"), bind (mem_fun(secondary_clock, &AudioClock::set_mode), AudioClock::BBT)); + ActionManager::session_sensitive_actions.push_back (act); + act = ActionManager::register_action (transport_actions, X_("secondary-clock-minsec"), _("Minutes & Seconds"), bind (mem_fun(secondary_clock, &AudioClock::set_mode), AudioClock::MinSec)); + ActionManager::session_sensitive_actions.push_back (act); + act = ActionManager::register_action (transport_actions, X_("secondary-clock-samples"), _("Samples"), bind (mem_fun(secondary_clock, &AudioClock::set_mode), AudioClock::Frames)); + ActionManager::session_sensitive_actions.push_back (act); + act = ActionManager::register_action (transport_actions, X_("secondary-clock-off"), _("Off"), bind (mem_fun(secondary_clock, &AudioClock::set_mode), AudioClock::Off)); + ActionManager::session_sensitive_actions.push_back (act); + act = ActionManager::register_toggle_action (transport_actions, X_("TogglePunchIn"), _("Punch In"), mem_fun(*this, &ARDOUR_UI::toggle_punch_in)); ActionManager::session_sensitive_actions.push_back (act); ActionManager::transport_sensitive_actions.push_back (act); diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc index c3e3b9a036..a98958f8a8 100644 --- a/gtk2_ardour/audio_region_view.cc +++ b/gtk2_ardour/audio_region_view.cc @@ -809,8 +809,8 @@ AudioRegionView::create_waves () ChanCount nchans = atv.get_diskstream()->n_channels(); - cerr << "creating waves for " << _region->name() << " with wfd = " << wait_for_data - << " and channels = " << nchans.n_audio() << endl; + // cerr << "creating waves for " << _region->name() << " with wfd = " << wait_for_data + // << " and channels = " << nchans.n_audio() << endl; /* in tmp_waves, set up null pointers for each channel so the vector is allocated */ for (uint32_t n = 0; n < nchans.n_audio(); ++n) { @@ -825,21 +825,21 @@ AudioRegionView::create_waves () wave_caches.push_back (WaveView::create_cache ()); - cerr << "\tchannel " << n << endl; + // cerr << "\tchannel " << n << endl; if (wait_for_data) { if (audio_region()->audio_source(n)->peaks_ready (bind (mem_fun(*this, &AudioRegionView::peaks_ready_handler), n), data_ready_connection)) { - cerr << "\tData is ready\n"; + // cerr << "\tData is ready\n"; cerr << "\tData is ready\n"; create_one_wave (n, true); } else { - cerr << "\tdata is not ready\n"; + // cerr << "\tdata is not ready\n"; // we'll get a PeaksReady signal from the source in the future // and will call create_one_wave(n) then. } } else { - cerr << "\tdon't delay, display today!\n"; + // cerr << "\tdon't delay, display today!\n"; create_one_wave (n, true); } diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 4d05d5dac6..6330265dc6 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -153,7 +153,7 @@ static const gchar *_zoom_focus_strings[] = { N_("Center"), N_("Playhead"), N_("Mouse"), - N_("Edit Point"), + N_("Active Mark"), 0 }; @@ -1288,12 +1288,23 @@ Editor::connect_to_session (Session *t) no_route_list_redisplay = false; redisplay_route_list (); } + + switch (snap_type) { + case SnapToRegionStart: + case SnapToRegionEnd: + case SnapToRegionSync: + case SnapToRegionBoundary: + build_region_boundary_cache (); + break; - /* register for undo history */ + default: + break; + } + /* register for undo history */ session->register_with_memento_command_factory(_id, this); - start_updating (); + start_updating (); } void @@ -2163,19 +2174,17 @@ Editor::add_bus_context_items (Menu_Helpers::MenuList& edit_items) edit_items.push_back (MenuElem (_("Nudge"), *nudge_menu)); } -/* CURSOR SETTING AND MARKS AND STUFF */ - void Editor::set_snap_to (SnapType st) { - unsigned int snap_ind = (unsigned int)st; + unsigned int snap_ind = (unsigned int)st; snap_type = st; - - if ( snap_ind > snap_type_strings.size() - 1 ) { - snap_ind = 0; - snap_type = (SnapType)snap_ind; - } - + + if (snap_ind > snap_type_strings.size() - 1) { + snap_ind = 0; + snap_type = (SnapType)snap_ind; + } + string str = snap_type_strings[snap_ind]; if (str != snap_type_selector.get_active_text()) { @@ -2190,9 +2199,17 @@ Editor::set_snap_to (SnapType st) case SnapToAEighthBeat: case SnapToAQuarterBeat: case SnapToAThirdBeat: - compute_bbt_ruler_scale (leftmost_frame, leftmost_frame + (nframes_t)(canvas_width * frames_per_unit)); - update_tempo_based_rulers (); + compute_bbt_ruler_scale (leftmost_frame, leftmost_frame + (nframes_t)(canvas_width * frames_per_unit)); + update_tempo_based_rulers (); + break; + + case SnapToRegionStart: + case SnapToRegionEnd: + case SnapToRegionSync: + case SnapToRegionBoundary: + build_region_boundary_cache (); break; + default: /* relax */ break; @@ -2229,28 +2246,25 @@ Editor::set_edit_point_preference (EditPoint ep) return; } - if (Profile->get_sae()) { - - switch (zoom_focus) { - case ZoomFocusMouse: - case ZoomFocusPlayhead: - case ZoomFocusEdit: - switch (_edit_point) { - case EditAtMouse: - set_zoom_focus (ZoomFocusMouse); - break; - case EditAtPlayhead: - set_zoom_focus (ZoomFocusPlayhead); - break; - case EditAtSelectedMarker: - set_zoom_focus (ZoomFocusEdit); - break; - } + switch (zoom_focus) { + case ZoomFocusMouse: + case ZoomFocusPlayhead: + case ZoomFocusEdit: + switch (_edit_point) { + case EditAtMouse: + set_zoom_focus (ZoomFocusMouse); break; - default: + case EditAtPlayhead: + set_zoom_focus (ZoomFocusPlayhead); + break; + case EditAtSelectedMarker: + set_zoom_focus (ZoomFocusEdit); break; } - } + break; + default: + break; + } instant_save (); } @@ -2527,13 +2541,19 @@ Editor::trackview_by_y_position (double y) void Editor::snap_to (nframes64_t& start, int32_t direction, bool for_mark) { - Location* before = 0; - Location* after = 0; - if (!session || snap_mode == SnapOff) { return; } + snap_to_internal (start, direction, for_mark); +} + +void +Editor::snap_to_internal (nframes64_t& start, int32_t direction, bool for_mark) +{ + Location* before = 0; + Location* after = 0; + const nframes64_t one_second = session->frame_rate(); const nframes64_t one_minute = session->frame_rate() * 60; const nframes64_t one_smpte_second = (nframes64_t)(rint(session->smpte_frames_per_second()) * session->frames_per_smpte_frame()); @@ -2542,7 +2562,7 @@ Editor::snap_to (nframes64_t& start, int32_t direction, bool for_mark) switch (snap_type) { case SnapToCDFrame: - if (direction) { + if (((direction == 0) && (start % (one_second/75) > (one_second/75) / 2)) || (direction > 0)) { start = (nframes_t) ceil ((double) start / (one_second / 75)) * (one_second / 75); } else { start = (nframes_t) floor ((double) start / (one_second / 75)) * (one_second / 75); @@ -2550,7 +2570,7 @@ Editor::snap_to (nframes64_t& start, int32_t direction, bool for_mark) break; case SnapToSMPTEFrame: - if (fmod((double)start, (double)session->frames_per_smpte_frame()) > (session->frames_per_smpte_frame() / 2)) { + if (((direction == 0) && (fmod((double)start, (double)session->frames_per_smpte_frame()) > (session->frames_per_smpte_frame() / 2))) || (direction > 0)) { start = (nframes_t) (ceil ((double) start / session->frames_per_smpte_frame()) * session->frames_per_smpte_frame()); } else { start = (nframes_t) (floor ((double) start / session->frames_per_smpte_frame()) * session->frames_per_smpte_frame()); @@ -2564,7 +2584,7 @@ Editor::snap_to (nframes64_t& start, int32_t direction, bool for_mark) } else { start -= session->smpte_offset (); } - if (start % one_smpte_second > one_smpte_second / 2) { + if (((direction == 0) && (start % one_smpte_second > one_smpte_second / 2)) || direction > 0) { start = (nframes_t) ceil ((double) start / one_smpte_second) * one_smpte_second; } else { start = (nframes_t) floor ((double) start / one_smpte_second) * one_smpte_second; @@ -2585,7 +2605,7 @@ Editor::snap_to (nframes64_t& start, int32_t direction, bool for_mark) } else { start -= session->smpte_offset (); } - if (start % one_smpte_minute > one_smpte_minute / 2) { + if (((direction == 0) && (start % one_smpte_minute > one_smpte_minute / 2)) || direction > 0) { start = (nframes_t) ceil ((double) start / one_smpte_minute) * one_smpte_minute; } else { start = (nframes_t) floor ((double) start / one_smpte_minute) * one_smpte_minute; @@ -2599,7 +2619,7 @@ Editor::snap_to (nframes64_t& start, int32_t direction, bool for_mark) break; case SnapToSeconds: - if (start % one_second > one_second / 2) { + if (((direction == 0) && (start % one_second > one_second / 2)) || (direction > 0)) { start = (nframes_t) ceil ((double) start / one_second) * one_second; } else { start = (nframes_t) floor ((double) start / one_second) * one_second; @@ -2607,7 +2627,7 @@ Editor::snap_to (nframes64_t& start, int32_t direction, bool for_mark) break; case SnapToMinutes: - if (start % one_minute > one_minute / 2) { + if (((direction == 0) && (start % one_minute > one_minute / 2)) || (direction > 0)) { start = (nframes_t) ceil ((double) start / one_minute) * one_minute; } else { start = (nframes_t) floor ((double) start / one_minute) * one_minute; @@ -2696,11 +2716,19 @@ Editor::snap_to (nframes64_t& start, int32_t direction, bool for_mark) } if (i != region_boundary_cache.end()) { + + /* lower bound doesn't quite to the right thing for our purposes */ + + if (direction < 0 && i != region_boundary_cache.begin()) { + --i; + } + start = *i; + } else { start = region_boundary_cache.back(); } - } + } break; } @@ -3596,7 +3624,7 @@ Editor::zoom_focus_selection_done () focus_type = ZoomFocusPlayhead; } else if (choice == _("Edit")) { focus_type = ZoomFocusEdit; - } else if (choice == _("Edit Point")) { + } else if (choice == _("Active Mark")) { focus_type = ZoomFocusEdit; } else { focus_type = ZoomFocusMouse; @@ -4375,9 +4403,9 @@ Editor::idle_visual_changer () if (p & VisualChange::ZoomLevel) { set_frames_per_unit (pending_visual_change.frames_per_unit); - compute_fixed_ruler_scale (); - compute_current_bbt_points(pending_visual_change.time_origin, pending_visual_change.time_origin + (nframes_t)(canvas_width * pending_visual_change.frames_per_unit)); - compute_bbt_ruler_scale (pending_visual_change.time_origin, pending_visual_change.time_origin + (nframes_t)(canvas_width * pending_visual_change.frames_per_unit)); + compute_fixed_ruler_scale (); + compute_current_bbt_points(pending_visual_change.time_origin, pending_visual_change.time_origin + (nframes_t)(canvas_width * pending_visual_change.frames_per_unit)); + compute_bbt_ruler_scale (pending_visual_change.time_origin, pending_visual_change.time_origin + (nframes_t)(canvas_width * pending_visual_change.frames_per_unit)); update_tempo_based_rulers (); } if (p & VisualChange::TimeOrigin) { diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 1e0f47edfc..62d62a330f 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -189,6 +189,8 @@ class Editor : public PublicEditor void new_region_from_selection (); void separate_regions_between (const TimeSelection&); void separate_region_from_selection (); + void separate_region_from_punch (); + void separate_region_from_loop (); void separate_regions_using_location (ARDOUR::Location&); void toggle_playback (bool with_abort); void transition_to_rolling (bool forward); @@ -1188,6 +1190,8 @@ class Editor : public PublicEditor void center_edit_point (); void edit_cursor_backward (); void edit_cursor_forward (); + void playhead_forward_to_grid (); + void playhead_backward_to_grid (); void playhead_backward (); void playhead_forward (); void scroll_playhead (bool forward); @@ -2196,6 +2200,8 @@ public: void select_next_route (); void select_prev_route (); + void snap_to_internal (nframes64_t& first, int32_t direction = 0, bool for_mark = false); + RhythmFerret* rhythm_ferret; }; diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc index 4d4ab99046..d6e4a5a214 100644 --- a/gtk2_ardour/editor_actions.cc +++ b/gtk2_ardour/editor_actions.cc @@ -44,26 +44,49 @@ Editor::register_actions () /* non-operative menu items for menu bar */ + ActionManager::register_action (editor_actions, X_("AlignMenu"), _("Align")); + ActionManager::register_action (editor_actions, X_("Autoconnect"), _("Autoconnect")); + ActionManager::register_action (editor_actions, X_("Crossfades"), _("Crossfades")); ActionManager::register_action (editor_actions, X_("Edit"), _("Edit")); - ActionManager::register_action (editor_actions, X_("Select"), _("Select")); - ActionManager::register_action (editor_actions, X_("EditSelectRegionOptions"), _("Select Regions")); - ActionManager::register_action (editor_actions, X_("EditSelectRangeOptions"), _("Select Range Operations")); ActionManager::register_action (editor_actions, X_("EditCursorMovementOptions"), _("Move Selected Marker")); - ActionManager::register_action (editor_actions, X_("RegionEditOps"), _("Region operations")); - ActionManager::register_action (editor_actions, X_("Tools"), _("Tools")); - ActionManager::register_action (editor_actions, X_("View"), _("View")); - ActionManager::register_action (editor_actions, X_("ZoomFocus"), _("Zoom Focus")); - ActionManager::register_action (editor_actions, X_("MeterHold"), _("Meter hold")); + ActionManager::register_action (editor_actions, X_("EditSelectRangeOptions"), _("Select Range Operations")); + ActionManager::register_action (editor_actions, X_("EditSelectRegionOptions"), _("Select Regions")); + ActionManager::register_action (editor_actions, X_("EditPointMenu"), _("Edit Point")); + ActionManager::register_action (editor_actions, X_("FadeMenu"), _("Fade")); + ActionManager::register_action (editor_actions, X_("LatchMenu"), _("Latch")); + ActionManager::register_action (editor_actions, X_("Layering"), _("Layering")); + ActionManager::register_action (editor_actions, X_("Link"), _("Link")); + ActionManager::register_action (editor_actions, X_("LocateToMarker"), _("Locate To Markers")); + ActionManager::register_action (editor_actions, X_("MarkerMenu"), _("Markers")); ActionManager::register_action (editor_actions, X_("MeterFalloff"), _("Meter falloff")); - ActionManager::register_action (editor_actions, X_("Solo"), _("Solo")); - ActionManager::register_action (editor_actions, X_("Crossfades"), _("Crossfades")); + ActionManager::register_action (editor_actions, X_("MeterHold"), _("Meter hold")); ActionManager::register_action (editor_actions, X_("Monitoring"), _("Monitoring")); - ActionManager::register_action (editor_actions, X_("Autoconnect"), _("Autoconnect")); - ActionManager::register_action (editor_actions, X_("Layering"), _("Layering")); - ActionManager::register_action (editor_actions, X_("Timecode"), _("Timecode fps")); + ActionManager::register_action (editor_actions, X_("MoveActiveMarkMenu"), _("Active Mark")); + ActionManager::register_action (editor_actions, X_("MovePlayHeadMenu"), _("Playhead")); + ActionManager::register_action (editor_actions, X_("NudgeRegionMenu"), _("Nudge")); + ActionManager::register_action (editor_actions, X_("PlayMenu"), _("Play")); + ActionManager::register_action (editor_actions, X_("PrimaryClockMenu"), _("Primary Clock")); ActionManager::register_action (editor_actions, X_("Pullup"), _("Pullup / Pulldown")); + ActionManager::register_action (editor_actions, X_("RegionEditOps"), _("Region operations")); + ActionManager::register_action (editor_actions, X_("RegionGainMenu"), _("Gain")); + ActionManager::register_action (editor_actions, X_("RulerMenu"), _("Rulers")); + ActionManager::register_action (editor_actions, X_("ScrollMenu"), _("Scroll")); + ActionManager::register_action (editor_actions, X_("SecondaryClockMenu"), _("Secondary Clock")); + ActionManager::register_action (editor_actions, X_("Select"), _("Select")); + ActionManager::register_action (editor_actions, X_("SelectMenu"), _("Select")); + ActionManager::register_action (editor_actions, X_("SeparateMenu"), _("Separate")); + ActionManager::register_action (editor_actions, X_("SetLoopMenu"), _("Loop")); + ActionManager::register_action (editor_actions, X_("SetPunchMenu"), _("Punch")); + ActionManager::register_action (editor_actions, X_("Solo"), _("Solo")); ActionManager::register_action (editor_actions, X_("Subframes"), _("Subframes")); - ActionManager::register_action (editor_actions, X_("LocateToMarker"), _("Locate To Markers")); + ActionManager::register_action (editor_actions, X_("TempoMenu"), _("Tempo")); + ActionManager::register_action (editor_actions, X_("Timecode"), _("Timecode fps")); + ActionManager::register_action (editor_actions, X_("Tools"), _("Tools")); + ActionManager::register_action (editor_actions, X_("TrimMenu"), _("Trim")); + ActionManager::register_action (editor_actions, X_("View"), _("View")); + ActionManager::register_action (editor_actions, X_("ZoomFocus"), _("Zoom")); + ActionManager::register_action (editor_actions, X_("ZoomMenu"), _("Zoom")); + ActionManager::register_action (editor_actions, X_("ZoomFocusMenu"), _("Zoom Focus")); /* add named actions for the editor */ @@ -210,6 +233,10 @@ Editor::register_actions () ActionManager::session_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "nudge-playhead-backward", _("Nudge Playhead Backward"), bind (mem_fun(*this, &Editor::nudge_backward), false, true)); ActionManager::session_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "playhead-forward-to-grid", _("Forward To Grid"), mem_fun(*this, &Editor::playhead_forward_to_grid)); + ActionManager::session_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "playhead-backward-to-grid", _("Backward To Grid"), mem_fun(*this, &Editor::playhead_backward_to_grid)); + ActionManager::session_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "temporal-zoom-out", _("Zoom Out"), bind (mem_fun(*this, &Editor::temporal_zoom_step), true)); @@ -255,31 +282,39 @@ Editor::register_actions () act = ActionManager::register_action (editor_actions, "trim-front", _("Trim start at edit point"), mem_fun(*this, &Editor::trim_region_front)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "trim-back", _("Trim end at edit point"), mem_fun(*this, &Editor::trim_region_back)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "trim-from-start", _("Start to edit point"), mem_fun(*this, &Editor::trim_region_from_edit_point)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "trim-to-end", _("Edit point to end"), mem_fun(*this, &Editor::trim_region_to_edit_point)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "trim-region-to-loop", _("Trim To Loop"), mem_fun(*this, &Editor::trim_region_to_loop)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "trim-region-to-punch", _("Trim To Punch"), mem_fun(*this, &Editor::trim_region_to_punch)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "set-loop-from-edit-range", _("Set Loop From Edit Range"), bind (mem_fun(*this, &Editor::set_loop_from_edit_range), false)); ActionManager::session_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "set-loop-from-region", _("Set Loop From Region"), bind (mem_fun(*this, &Editor::set_loop_from_region), false)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "loop-region", _("Loop Region"), bind (mem_fun(*this, &Editor::set_loop_from_region), true)); ActionManager::session_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "set-punch-from-edit-range", _("Set Punch From Edit Range"), mem_fun(*this, &Editor::set_punch_from_edit_range)); ActionManager::session_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "set-punch-from-region", _("Set Punch From Region"), mem_fun(*this, &Editor::set_punch_from_region)); ActionManager::session_sensitive_actions.push_back (act); - + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "pitch-shift-region", _("Transpose"), mem_fun(*this, &Editor::pitch_shift_regions)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "set-fade-in-length", _("Set Fade In Length"), bind (mem_fun(*this, &Editor::set_fade_length), true)); ActionManager::session_sensitive_actions.push_back (act); @@ -292,17 +327,23 @@ Editor::register_actions () act = ActionManager::register_action (editor_actions, "align-regions-start", _("Align Regions Start"), bind (mem_fun(*this, &Editor::align), ARDOUR::Start)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "align-regions-start-relative", _("Align Regions Start Relative"), bind (mem_fun(*this, &Editor::align_relative), ARDOUR::Start)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "align-regions-end", _("Align Regions End"), bind (mem_fun(*this, &Editor::align), ARDOUR::End)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "align-regions-end-relative", _("Align Regions End Relative"), bind (mem_fun(*this, &Editor::align_relative), ARDOUR::End)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "align-regions-sync", _("Align Regions Sync"), bind (mem_fun(*this, &Editor::align), ARDOUR::SyncPoint)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "align-regions-sync-relative", _("Align Regions Sync Relative"), bind (mem_fun(*this, &Editor::align_relative), ARDOUR::SyncPoint)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "play-from-edit-point", _("Play From Edit Point"), mem_fun(*this, &Editor::play_from_edit_point)); ActionManager::session_sensitive_actions.push_back (act); @@ -312,19 +353,81 @@ Editor::register_actions () act = ActionManager::register_action (editor_actions, "play-edit-range", _("Play Edit Range"), mem_fun(*this, &Editor::play_edit_range)); act = ActionManager::register_action (editor_actions, "play-selected-regions", _("Play Selected Region(s)"), mem_fun(*this, &Editor::play_selected_region)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "brush-at-mouse", _("Brush at Mouse"), mem_fun(*this, &Editor::kbd_brush)); ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "mute-unmute-region", _("Mute/Unmute Region"), mem_fun(*this, &Editor::kbd_mute_unmute_region)); - ActionManager::session_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "set-playhead", _("Set Playhead"), mem_fun(*this, &Editor::set_playhead_cursor)); ActionManager::session_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "set-edit-point", _("Set Edit Point"), mem_fun(*this, &Editor::set_edit_point)); ActionManager::session_sensitive_actions.push_back (act); + + act = ActionManager::register_action (editor_actions, "duplicate-region", _("Duplicate Region"), bind (mem_fun(*this, &Editor::duplicate_dialog), false)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "multi-duplicate-region", _("Multi-Duplicate Region"), bind (mem_fun(*this, &Editor::duplicate_dialog), true)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "duplicate-range", _("Duplicate Range"), bind (mem_fun(*this, &Editor::duplicate_dialog), false)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_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); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "normalize-region", _("Normalize Region"), mem_fun(*this, &Editor::normalize_region)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "rename-region", _("Rename"), mem_fun(*this, &Editor::rename_region)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "auto-rename-region", _("Auto-Rename"), mem_fun(*this, &Editor::rename_region)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "boost-region-gain", _("Boost Region Gain"), bind (mem_fun(*this, &Editor::adjust_region_scale_amplitude), true)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "cut-region-gain", _("Cut Region Gain"), bind (mem_fun(*this, &Editor::adjust_region_scale_amplitude), false)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "split-region", _("Split Region"), mem_fun(*this, &Editor::split)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "set-region-sync-position", _("Set Region Sync Position"), mem_fun(*this, &Editor::set_region_sync_from_edit_point)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "remove-region-sync", _("Remove Region Sync"), mem_fun(*this, &Editor::remove_region_sync)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "raise-region", _("Raise Region"), mem_fun(*this, &Editor::raise_region)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "lower-region", _("Lower Region"), mem_fun(*this, &Editor::lower_region)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "export-region", _("Export Region"), mem_fun(*this, &Editor::export_region)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_toggle_action (editor_actions, "lock-region", _("Lock Region"), mem_fun(*this, &Editor::toggle_region_lock)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_toggle_action (editor_actions, "glue-region", _("Glue Region To Bars&Beats"), bind (mem_fun (*this, &Editor::set_region_lock_style), Region::MusicTime)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "naturalize-region", _("Move To Original Position"), mem_fun (*this, &Editor::naturalize)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "reverse-region", _("Reverse"), mem_fun (*this, &Editor::reverse_region)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "monoize-region", _("Make mono regions"), (mem_fun(*this, &Editor::split_multichannel_region))); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "region-fill-track", _("Fill Track"), (mem_fun(*this, &Editor::region_fill_track))); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "mute-unmute-region", _("Mute/Unmute Region"), mem_fun(*this, &Editor::kbd_mute_unmute_region)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); undo_action = act = ActionManager::register_action (editor_actions, "undo", _("Undo"), bind (mem_fun(*this, &Editor::undo), 1U)); ActionManager::session_sensitive_actions.push_back (act); @@ -338,8 +441,16 @@ Editor::register_actions () act = ActionManager::register_action (editor_actions, "editor-separate", _("Separate"), mem_fun(*this, &Editor::separate_region_from_selection)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "separate-from-punch", _("Separate Using Punch Range"), mem_fun(*this, &Editor::separate_region_from_punch)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "separate-from-loop", _("Separate Using Loop Range"), mem_fun(*this, &Editor::separate_region_from_loop)); + ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "editor-crop", _("Crop"), mem_fun(*this, &Editor::crop_region_to_selection)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "editor-cut", _("Cut"), mem_fun(*this, &Editor::cut)); ActionManager::session_sensitive_actions.push_back (act); /* Note: for now, editor-delete does the exact same thing as editor-cut */ @@ -349,24 +460,7 @@ Editor::register_actions () ActionManager::session_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "editor-paste", _("Paste"), mem_fun(*this, &Editor::keyboard_paste)); ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "duplicate-region", _("Duplicate Region"), bind (mem_fun(*this, &Editor::duplicate_dialog), false)); - ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "multi-duplicate-region", _("Multi-Duplicate Region"), bind (mem_fun(*this, &Editor::duplicate_dialog), true)); - ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "duplicate-range", _("Duplicate Range"), bind (mem_fun(*this, &Editor::duplicate_dialog), false)); - 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 Region"), mem_fun(*this, &Editor::reverse_region)); - ActionManager::session_sensitive_actions.push_back (act); - 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, "boost-region-gain", _("Boost Region Gain"), bind (mem_fun(*this, &Editor::adjust_region_scale_amplitude), true)); - ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "cut-region-gain", _("Cut Region Gain"), bind (mem_fun(*this, &Editor::adjust_region_scale_amplitude), false)); - ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "quantize-region", _("Quantize Region"), mem_fun(*this, &Editor::quantize_region)); ActionManager::session_sensitive_actions.push_back (act); @@ -377,6 +471,7 @@ Editor::register_actions () act = ActionManager::register_action (editor_actions, "split-region-at-transients", _("Split Regions At Percussion Onsets"), mem_fun(*this, &Editor::split_region_at_transients)); ActionManager::session_sensitive_actions.push_back (act); + ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "toggle-rhythm-ferret", _("Rhythm Ferret"), mem_fun(*this, &Editor::show_rhythm_ferret)); ActionManager::session_sensitive_actions.push_back (act); @@ -441,6 +536,10 @@ Editor::register_actions () ActionManager::register_radio_action (editor_actions, edit_point_group, X_("edit-at-mouse"), _("Mouse"), (bind (mem_fun(*this, &Editor::edit_point_chosen), Editing::EditAtPlayhead))); ActionManager::register_radio_action (editor_actions, edit_point_group, X_("edit-at-selected-marker"), _("Marker"), (bind (mem_fun(*this, &Editor::edit_point_chosen), Editing::EditAtPlayhead))); + ActionManager::register_action (editor_actions, "edit-point-marker", _("Marker"), bind (mem_fun (*this, &Editor::set_edit_point_preference), EditAtSelectedMarker)); + ActionManager::register_action (editor_actions, "edit-point-playhead", _("Playhead"), bind (mem_fun (*this, &Editor::set_edit_point_preference), EditAtPlayhead)); + ActionManager::register_action (editor_actions, "edit-point-mouse", _("Mouse"), bind (mem_fun (*this, &Editor::set_edit_point_preference), EditAtMouse)); + ActionManager::register_action (editor_actions, "cycle-edit-point", _("Change edit point"), bind (mem_fun (*this, &Editor::cycle_edit_point), false)); ActionManager::register_action (editor_actions, "cycle-edit-point-with-marker", _("Change edit point (w/Marker)"), bind (mem_fun (*this, &Editor::cycle_edit_point), true)); @@ -482,6 +581,20 @@ Editor::register_actions () ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-region-sync"), _("Snap to region sync"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToRegionSync))); ActionManager::register_radio_action (snap_actions, snap_choice_group, X_("snap-to-region-boundary"), _("Snap to region boundary"), (bind (mem_fun(*this, &Editor::snap_type_chosen), Editing::SnapToRegionBoundary))); + /* RULERS */ + + Glib::RefPtr ruler_actions = ActionGroup::create (X_("Rulers")); + ActionManager::register_toggle_action (ruler_actions, X_("toggle-tempo-ruler"), _("Tempo"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_time_tempo)); + ActionManager::register_toggle_action (ruler_actions, X_("toggle-meter-ruler"), _("Meter"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_time_meter)); + ActionManager::register_toggle_action (ruler_actions, X_("toggle-range-ruler"), _("Ranges"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_time_range_marker)); + ActionManager::register_toggle_action (ruler_actions, X_("toggle-marker-ruler"), _("Markers"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_time_marker)); + ActionManager::register_toggle_action (ruler_actions, X_("toggle-cd-marker-ruler"), _("CD Markers"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_time_cd_marker)); + ActionManager::register_toggle_action (ruler_actions, X_("toggle-loop-punch-ruler"), _("Loop/Punch"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_time_transport_marker)); + ActionManager::register_toggle_action (ruler_actions, X_("toggle-bbt-ruler"), _("Bars & Beats"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_metric_frames)); + ActionManager::register_toggle_action (ruler_actions, X_("toggle-samples-ruler"), _("Samples"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_metric_bbt)); + ActionManager::register_toggle_action (ruler_actions, X_("toggle-timecode-ruler"), _("Timecode"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_metric_smpte)); + ActionManager::register_toggle_action (ruler_actions, X_("toggle-minsec-ruler"), _("Timecode"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_metric_minsec)); + /* REGION LIST */ Glib::RefPtr rl_actions = ActionGroup::create (X_("RegionList")); @@ -583,6 +696,7 @@ Editor::register_actions () &Editor::subframes_per_frame_chosen), 100)); ActionManager::add_action_group (rl_actions); + ActionManager::add_action_group (ruler_actions); ActionManager::add_action_group (zoom_actions); ActionManager::add_action_group (mouse_mode_actions); ActionManager::add_action_group (snap_actions); diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index bcf1af444f..0be6221be5 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -2820,6 +2820,24 @@ Editor::separate_region_from_selection () } } +void +Editor::separate_region_from_punch () +{ + Location* loc = session->locations()->auto_punch_location(); + if (loc) { + separate_regions_using_location (*loc); + } +} + +void +Editor::separate_region_from_loop () +{ + Location* loc = session->locations()->auto_loop_location(); + if (loc) { + separate_regions_using_location (*loc); + } +} + void Editor::separate_regions_using_location (Location& loc) { @@ -5487,3 +5505,29 @@ Editor::tab_to_transient (bool forward) } } } + +void +Editor::playhead_forward_to_grid () +{ + if (!session) return; + nframes64_t pos = playhead_cursor->current_frame; + if (pos < max_frames) { + pos++; + snap_to_internal (pos, 1, false); + session->request_locate (pos); + } +} + + +void +Editor::playhead_backward_to_grid () +{ + if (!session) return; + nframes64_t pos = playhead_cursor->current_frame; + if (pos > 1) { + pos--; + snap_to_internal (pos, -1, false); + session->request_locate (pos); + } +} + diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index 6cd022cce1..1408351d47 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -795,6 +795,27 @@ Editor::region_selection_changed () (*i)->set_selected_regionviews (selection->regions); } + bool have_selected_regions = !selection->regions.empty(); + + for (vector >::iterator x = ActionManager::region_selection_sensitive_actions.begin(); + x != ActionManager::region_selection_sensitive_actions.end(); ++x) { + + string accel_path = (*x)->get_accel_path (); + AccelKey key; + + /* if there is an accelerator, it should always be sensitive + to allow for keyboard ops on entered regions. + */ + + bool known = ActionManager::lookup_entry (accel_path, key); + + if (known && ((key.get_key() != GDK_VoidSymbol) && (key.get_key() != 0))) { + (*x)->set_sensitive (true); + } else { + (*x)->set_sensitive (have_selected_regions); + } + } + zoomed_to_region = false; } diff --git a/gtk2_ardour/export_dialog.cc b/gtk2_ardour/export_dialog.cc index 67de31ca82..62f43f37fd 100644 --- a/gtk2_ardour/export_dialog.cc +++ b/gtk2_ardour/export_dialog.cc @@ -975,7 +975,7 @@ ExportDialog::do_export () progress_connection = Glib::signal_timeout().connect (mem_fun(*this, &ExportDialog::progress_timeout), 100); cancel_label.set_text (_("Stop Export")); - export_audio_data(); + export_data(); progress_connection.disconnect (); end_dialog (); diff --git a/gtk2_ardour/export_dialog.h b/gtk2_ardour/export_dialog.h index 596467d3e1..a35322b854 100644 --- a/gtk2_ardour/export_dialog.h +++ b/gtk2_ardour/export_dialog.h @@ -48,7 +48,7 @@ class ExportDialog : public ArdourDialog virtual Gtk::FileChooserAction browse_action() const { return Gtk::FILE_CHOOSER_ACTION_SAVE; } protected: - ARDOUR::AudioExportSpecification spec; + ARDOUR::ExportSpecification spec; Gtk::Frame file_frame; struct ExportModelColumns : public Gtk::TreeModel::ColumnRecord @@ -77,7 +77,7 @@ class ExportDialog : public ArdourDialog // Gets called from within do_export. Is responsible for exporting the // audio data. spec has already been filled with user input before calling // this method. The dialog will be closed after this function exited. - virtual void export_audio_data() = 0; + virtual void export_data() = 0; virtual bool wants_dir() { return false; } diff --git a/gtk2_ardour/export_range_markers_dialog.cc b/gtk2_ardour/export_range_markers_dialog.cc index 1184294a67..8bb93eb4aa 100644 --- a/gtk2_ardour/export_range_markers_dialog.cc +++ b/gtk2_ardour/export_range_markers_dialog.cc @@ -54,7 +54,7 @@ ExportRangeMarkersDialog::browse_action () const } void -ExportRangeMarkersDialog::export_audio_data () +ExportRangeMarkersDialog::export_data () { getSession().locations()->apply(*this, &ExportRangeMarkersDialog::process_range_markers_export); } @@ -83,7 +83,7 @@ ExportRangeMarkersDialog::process_range_markers_export(Locations::LocationList& getSession().request_locate(spec.start_frame, false); - if (getSession().start_audio_export(spec)){ + if (getSession().start_export(spec)){ // if export fails return; } diff --git a/gtk2_ardour/export_range_markers_dialog.h b/gtk2_ardour/export_range_markers_dialog.h index 7d231c62d5..9083b87b26 100644 --- a/gtk2_ardour/export_range_markers_dialog.h +++ b/gtk2_ardour/export_range_markers_dialog.h @@ -35,7 +35,7 @@ class ExportRangeMarkersDialog : public ExportDialog protected: virtual bool is_filepath_valid(string &filepath); - void export_audio_data(); + void export_data(); bool wants_dir() { return true; } diff --git a/gtk2_ardour/export_region_dialog.cc b/gtk2_ardour/export_region_dialog.cc index cb3804c11b..f73b990880 100644 --- a/gtk2_ardour/export_region_dialog.cc +++ b/gtk2_ardour/export_region_dialog.cc @@ -28,14 +28,14 @@ #include "i18n.h" -ExportRegionDialog::ExportRegionDialog (PublicEditor& editor, boost::shared_ptr region) +ExportRegionDialog::ExportRegionDialog (PublicEditor& editor, boost::shared_ptr reg) : ExportDialog(editor) + , region(reg) { - set_title (_("ardour: export region")); - file_frame.set_label (_("Export to File")), + assert(region); - audio_region = boost::dynamic_pointer_cast(region); - assert(audio_region); + set_title (_("Ardour: Export Region")); + file_frame.set_label (_("Export to File")), do_not_allow_track_and_master_selection(); do_not_allow_channel_count_selection(); @@ -43,7 +43,7 @@ ExportRegionDialog::ExportRegionDialog (PublicEditor& editor, boost::shared_ptr< void -ExportRegionDialog::export_audio_data() +ExportRegionDialog::export_data() { pthread_t thr; pthread_create_and_store ("region export", &thr, 0, ExportRegionDialog::_export_region_thread, this); @@ -71,5 +71,6 @@ ExportRegionDialog::_export_region_thread (void *arg) void ExportRegionDialog::export_region () { - audio_region->exportme (getSession(), spec); + region->exportme (getSession(), spec); } + diff --git a/gtk2_ardour/export_region_dialog.h b/gtk2_ardour/export_region_dialog.h index a0457b7331..95c721bed0 100644 --- a/gtk2_ardour/export_region_dialog.h +++ b/gtk2_ardour/export_region_dialog.h @@ -33,10 +33,10 @@ class ExportRegionDialog : public ExportDialog void export_region (); protected: - void export_audio_data(); + void export_data(); private: - boost::shared_ptr audio_region; + boost::shared_ptr region; }; diff --git a/gtk2_ardour/export_session_dialog.cc b/gtk2_ardour/export_session_dialog.cc index 006f9675b3..4226a7e7ee 100644 --- a/gtk2_ardour/export_session_dialog.cc +++ b/gtk2_ardour/export_session_dialog.cc @@ -30,9 +30,9 @@ ExportSessionDialog::ExportSessionDialog (PublicEditor& editor) } void -ExportSessionDialog::export_audio_data () +ExportSessionDialog::export_data () { - if (getSession().start_audio_export (spec)) { + if (getSession().start_export (spec)) { return; } diff --git a/gtk2_ardour/export_session_dialog.h b/gtk2_ardour/export_session_dialog.h index 5aeec4ad10..a6e118fc85 100644 --- a/gtk2_ardour/export_session_dialog.h +++ b/gtk2_ardour/export_session_dialog.h @@ -30,7 +30,7 @@ class ExportSessionDialog : public ExportDialog void set_range (nframes_t start, nframes_t end); protected: - void export_audio_data(); + void export_data(); }; diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index 0a4a3acc95..6adaf07186 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -38,7 +38,7 @@ namespace ARDOUR { class Session; - class AudioExportSpecification; + class ExportSpecification; class Region; class Playlist; class RouteGroup; diff --git a/libs/ardour/ardour/audioregion.h b/libs/ardour/ardour/audioregion.h index 3fddfc55b4..e88e10d521 100644 --- a/libs/ardour/ardour/audioregion.h +++ b/libs/ardour/ardour/audioregion.h @@ -125,7 +125,7 @@ class AudioRegion : public Region /* export */ - int exportme (ARDOUR::Session&, ARDOUR::AudioExportSpecification&); + int exportme (ARDOUR::Session&, ARDOUR::ExportSpecification&); /* xfade/fade interactions */ diff --git a/libs/ardour/ardour/export.h b/libs/ardour/ardour/export.h index bf1297d3cb..141786873d 100644 --- a/libs/ardour/ardour/export.h +++ b/libs/ardour/ardour/export.h @@ -42,12 +42,12 @@ namespace ARDOUR class Port; typedef pair PortChannelPair; - typedef map > AudioExportPortMap; + typedef map > ExportPortMap; - struct AudioExportSpecification : public SF_INFO, public sigc::trackable { + struct ExportSpecification : public SF_INFO, public sigc::trackable { - AudioExportSpecification(); - ~AudioExportSpecification (); + ExportSpecification(); + ~ExportSpecification (); void init (); void clear (); @@ -62,36 +62,36 @@ namespace ARDOUR string path; nframes_t sample_rate; - int src_quality; - SNDFILE* out; + int src_quality; + SNDFILE* out; uint32_t channels; - AudioExportPortMap port_map; + ExportPortMap port_map; nframes_t start_frame; nframes_t end_frame; - GDitherType dither_type; - bool do_freewheel; + GDitherType dither_type; + bool do_freewheel; /* used exclusively during export */ nframes_t frame_rate; - GDither dither; - float* dataF; - float* dataF2; - float* leftoverF; + GDither dither; + float* dataF; + float* dataF2; + float* leftoverF; nframes_t leftover_frames; nframes_t max_leftover_frames; - void* output_data; + void* output_data; nframes_t out_samples_max; - uint32_t sample_bytes; - uint32_t data_width; + uint32_t sample_bytes; + uint32_t data_width; nframes_t total_frames; - SF_INFO sfinfo; - SRC_DATA src_data; - SRC_STATE* src_state; + SF_INFO sfinfo; + SRC_DATA src_data; + SRC_STATE* src_state; nframes_t pos; - sigc::connection freewheel_connection; + sigc::connection freewheel_connection; /* shared between UI thread and audio thread */ @@ -99,9 +99,9 @@ namespace ARDOUR volatile bool stop; /* UI sets this */ volatile bool running; /* audio thread sets to false when export is done */ - int status; - + int status; }; + } // namespace ARDOUR #endif /* __ardour_export_h__ */ diff --git a/libs/ardour/ardour/midi_region.h b/libs/ardour/ardour/midi_region.h index 50c6b8bce7..cd2b0d6132 100644 --- a/libs/ardour/ardour/midi_region.h +++ b/libs/ardour/ardour/midi_region.h @@ -84,6 +84,8 @@ class MidiRegion : public Region boost::shared_ptr control(Parameter id) const { return midi_source()->model()->control(id); } + + int exportme (ARDOUR::Session&, ARDOUR::ExportSpecification&); private: friend class RegionFactory; diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h index d793e8ca23..4196aac886 100644 --- a/libs/ardour/ardour/region.h +++ b/libs/ardour/ardour/region.h @@ -37,6 +37,7 @@ namespace ARDOUR { class Playlist; class Filter; +class ExportSpecification; enum RegionEditState { EditChangesNothing = 0, @@ -222,6 +223,8 @@ class Region : public Automatable, public boost::enable_shared_from_this virtual bool is_dependent() const { return false; } virtual bool depends_on (boost::shared_ptr other) const { return false; } + virtual int exportme (ARDOUR::Session&, ARDOUR::ExportSpecification&) = 0; + virtual int get_transients (AnalysisFeatureList&, bool force_new = false) { // no transients, but its OK return 0; diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 10167ae5b3..bc77157e9f 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -109,7 +109,7 @@ class SMFSource; class SessionDirectory; -struct AudioExportSpecification; +struct ExportSpecification; struct RouteGroup; using std::vector; @@ -606,8 +606,8 @@ class Session : public PBD::StatefulDestructible SlaveSource post_export_slave; nframes_t post_export_position; - int start_audio_export (ARDOUR::AudioExportSpecification&); - int stop_audio_export (ARDOUR::AudioExportSpecification&); + int start_export (ARDOUR::ExportSpecification&); + int stop_export (ARDOUR::ExportSpecification&); void finalize_audio_export (); void add_source (boost::shared_ptr); @@ -1037,7 +1037,7 @@ class Session : public PBD::StatefulDestructible void process_without_events (nframes_t); void process_with_events (nframes_t); void process_audition (nframes_t); - int process_export (nframes_t, ARDOUR::AudioExportSpecification*); + int process_export (nframes_t, ARDOUR::ExportSpecification*); /* slave tracking */ @@ -1062,7 +1062,7 @@ class Session : public PBD::StatefulDestructible void set_slave_source (SlaveSource); bool _exporting; - int prepare_to_export (ARDOUR::AudioExportSpecification&); + int prepare_to_export (ARDOUR::ExportSpecification&); void prepare_diskstreams (); void commit_diskstreams (nframes_t, bool& session_requires_butler); diff --git a/libs/ardour/audioanalyser.cc b/libs/ardour/audioanalyser.cc index 9da404e5bf..eccc38434d 100644 --- a/libs/ardour/audioanalyser.cc +++ b/libs/ardour/audioanalyser.cc @@ -119,7 +119,7 @@ AudioAnalyser::analyse (const string& path, Readable* src, uint32_t channel) /* zero fill buffer if necessary */ if (to_read != bufsize) { - memset (data + to_read, 0, (bufsize - to_read)); + memset (data + to_read, 0, (bufsize - to_read) * sizeof (Sample)); } features = plugin->process (bufs, RealTime::fromSeconds ((double) pos / sample_rate)); @@ -128,7 +128,7 @@ AudioAnalyser::analyse (const string& path, Readable* src, uint32_t channel) goto out; } - pos += stepsize; + pos += min (stepsize, to_read); if (pos >= len) { done = true; diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc index 7e2b709abd..5e0cd136ff 100644 --- a/libs/ardour/audioregion.cc +++ b/libs/ardour/audioregion.cc @@ -1022,7 +1022,7 @@ AudioRegion::read_raw_internal (Sample* buf, nframes_t pos, nframes_t cnt) const int -AudioRegion::exportme (Session& session, AudioExportSpecification& spec) +AudioRegion::exportme (Session& session, ARDOUR::ExportSpecification& spec) { const nframes_t blocksize = 4096; nframes_t to_read; diff --git a/libs/ardour/midi_region.cc b/libs/ardour/midi_region.cc index b0b7e4575f..ababd41a8d 100644 --- a/libs/ardour/midi_region.cc +++ b/libs/ardour/midi_region.cc @@ -310,6 +310,12 @@ MidiRegion::separate_by_channel (Session& session, vector& v) const return -1; } +int +MidiRegion::exportme (ARDOUR::Session&, ARDOUR::ExportSpecification&) +{ + return -1; +} + boost::shared_ptr MidiRegion::midi_source (uint32_t n) const { diff --git a/libs/ardour/session_export.cc b/libs/ardour/session_export.cc index b1058f2e7e..49b6d9b150 100644 --- a/libs/ardour/session_export.cc +++ b/libs/ardour/session_export.cc @@ -57,7 +57,7 @@ using namespace ARDOUR; using namespace PBD; static int -convert_spec_to_info (AudioExportSpecification& spec, SF_INFO& sfinfo) +convert_spec_to_info (ExportSpecification& spec, SF_INFO& sfinfo) { if (spec.path.length() == 0) { error << _("Export: no output file specified") << endmsg; @@ -76,18 +76,18 @@ convert_spec_to_info (AudioExportSpecification& spec, SF_INFO& sfinfo) return 0; } -AudioExportSpecification::AudioExportSpecification () +ExportSpecification::ExportSpecification () { init (); } -AudioExportSpecification::~AudioExportSpecification () +ExportSpecification::~ExportSpecification () { clear (); } void -AudioExportSpecification::init () +ExportSpecification::init () { src_state = 0; pos = 0; @@ -113,7 +113,7 @@ AudioExportSpecification::init () } void -AudioExportSpecification::clear () +ExportSpecification::clear () { if (out) { sf_close (out); @@ -153,7 +153,7 @@ AudioExportSpecification::clear () } int -AudioExportSpecification::prepare (nframes_t blocksize, nframes_t frate) +ExportSpecification::prepare (nframes_t blocksize, nframes_t frate) { char errbuf[256]; GDitherSize dither_size; @@ -161,7 +161,7 @@ AudioExportSpecification::prepare (nframes_t blocksize, nframes_t frate) frame_rate = frate; if (channels == 0) { - error << _("illegal frame range in export specification") << endmsg; + error << _("illegal channel count in export specification") << endmsg; return -1; } @@ -258,7 +258,7 @@ AudioExportSpecification::prepare (nframes_t blocksize, nframes_t frate) } int -AudioExportSpecification::process (nframes_t nframes) +ExportSpecification::process (nframes_t nframes) { float* float_buffer = 0; uint32_t chn; @@ -426,7 +426,7 @@ AudioExportSpecification::process (nframes_t nframes) } int -Session::start_audio_export (AudioExportSpecification& spec) +Session::start_export (ExportSpecification& spec) { if (!_engine.connected()) { return -1; @@ -448,7 +448,7 @@ Session::start_audio_export (AudioExportSpecification& spec) } int -Session::stop_audio_export (AudioExportSpecification& spec) +Session::stop_export (ExportSpecification& spec) { /* don't stop freewheeling but do stop paying attention to it for now */ @@ -459,7 +459,7 @@ Session::stop_audio_export (AudioExportSpecification& spec) } int -Session::prepare_to_export (AudioExportSpecification& spec) +Session::prepare_to_export (ExportSpecification& spec) { int ret = -1; @@ -521,7 +521,7 @@ Session::prepare_to_export (AudioExportSpecification& spec) } int -Session::process_export (nframes_t nframes, AudioExportSpecification* spec) +Session::process_export (nframes_t nframes, ExportSpecification* spec) { uint32_t chn; uint32_t x; @@ -551,7 +551,7 @@ Session::process_export (nframes_t nframes, AudioExportSpecification* spec) if (!spec->running || spec->stop || (this_nframes = min ((spec->end_frame - spec->pos), nframes)) == 0) { process_without_events (nframes); - return stop_audio_export (*spec); + return stop_export (*spec); } /* make sure we've caught up with disk i/o, since @@ -574,7 +574,7 @@ Session::process_export (nframes_t nframes, AudioExportSpecification* spec) for (chn = 0; chn < spec->channels; ++chn) { - AudioExportPortMap::iterator mi = spec->port_map.find (chn); + ExportPortMap::iterator mi = spec->port_map.find (chn); if (mi == spec->port_map.end()) { /* no ports exported to this channel */ @@ -588,17 +588,18 @@ Session::process_export (nframes_t nframes, AudioExportSpecification* spec) /* OK, this port's output is supposed to appear on this channel */ - AudioPort* const port = dynamic_cast((*t).first); - if (port == 0) { - cerr << "FIXME: Non-audio export" << endl; - continue; - } - Sample* port_buffer = port->get_audio_buffer().data(); + AudioPort* const aport = dynamic_cast((*t).first); + MidiPort* const mport = dynamic_cast((*t).first); + if (aport != 0) { + Sample* port_buffer = aport->get_audio_buffer().data(); - /* now interleave the data from the channel into the float buffer */ - - for (x = 0; x < nframes; ++x) { - spec->dataF[chn+(x*spec->channels)] += (float) port_buffer[x]; + /* now interleave the data from the channel into the float buffer */ + + for (x = 0; x < nframes; ++x) { + spec->dataF[chn+(x*spec->channels)] += (float) port_buffer[x]; + } + } else if (mport != 0) { + cerr << "EXPORT MIDI PORT" << endl; } } } diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc index 3170d588a1..bcbb01d9c9 100644 --- a/libs/ardour/tempo.cc +++ b/libs/ardour/tempo.cc @@ -1141,16 +1141,16 @@ TempoMap::round_to_type (nframes_t frame, int dir, BBTPointType type) case Bar: if (dir < 0) { /* relax */ - } else if (dir > 0) { if (bbt.beats > 0) { bbt.bars++; + } else if (metric.frame() < frame) { + bbt.bars++; } } else { if (bbt.beats > metric.meter().beats_per_bar()/2) { bbt.bars++; } - } bbt.beats = 1; bbt.ticks = 0; @@ -1162,6 +1162,8 @@ TempoMap::round_to_type (nframes_t frame, int dir, BBTPointType type) } else if (dir > 0) { if (bbt.ticks > 0) { bbt.beats++; + } else if (metric.frame() < frame) { + bbt.beats++; } } else { if (bbt.ticks >= (Meter::ticks_per_beat/2)) { @@ -1177,11 +1179,9 @@ TempoMap::round_to_type (nframes_t frame, int dir, BBTPointType type) } - /* - cerr << "for " << frame << " round to " << bbt << " using " - << metric.start() - << endl; - */ + cerr << "for " << frame << " round to " << bbt << " using " + << metric.start() + << endl; return metric.frame() + count_frames_between (metric.start(), bbt); } diff --git a/libs/ardour/transient_detector.cc b/libs/ardour/transient_detector.cc index d24c4c9442..d3200d72e4 100644 --- a/libs/ardour/transient_detector.cc +++ b/libs/ardour/transient_detector.cc @@ -54,7 +54,7 @@ TransientDetector::use_features (Plugin::FeatureSet& features, ostream* out) if (out) { (*out) << (*f).timestamp.toString() << endl; } - + current_results->push_back (RealTime::realTime2Frame ((*f).timestamp, (nframes_t) floor(sample_rate))); } }