make click on empty canvas area clear selection; change zoom-ot-region to be a toggle; fixup naming of audition-selection/play-selected-region

git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2789 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2007-12-17 14:44:27 +00:00
parent c0bb0deb29
commit 5119d48267
9 changed files with 25 additions and 23 deletions

View file

@ -66,7 +66,7 @@
(gtk_accel_path "<Actions>/Editor/jump-backward-to-mark" "<%PRIMARY%>KP_Left")
; (gtk_accel_path "<Actions>/Main/AudioFileFormatData" "")
; (gtk_accel_path "<Actions>/options/MeterFalloffFastest" "")
(gtk_accel_path "<Actions>/Editor/audition-region" "w")
(gtk_accel_path "<Actions>/Editor/play-selected-regions" "w")
(gtk_accel_path "<Actions>/Transport/Forward" "<%PRIMARY%>rightarrow")
; (gtk_accel_path "<Actions>/Snap/snap-to-smpte-seconds" "")
; (gtk_accel_path "<Actions>/Snap/snap-to-smpte-frame" "")

View file

@ -106,7 +106,7 @@
<menuitem action='edit-to-playhead'/>
</menu>
<menu name='KeyMouse Actions' action='KeyMouse Actions'>
<menuitem action='audition-region'/>
<menuitem action='play-selected-regions'/>
<menuitem action='brush-at-mouse'/>
<menuitem action='mute-unmute-region'/>
<separator/>

View file

@ -312,6 +312,7 @@ Editor::Editor ()
_dragging_edit_point = false;
_dragging_hscrollbar = false;
select_new_marker = false;
zoomed_to_region = false;
scrubbing_direction = 0;
@ -1719,7 +1720,7 @@ Editor::add_region_context_items (AudioStreamView* sv, boost::shared_ptr<Region>
items.push_back (MenuElem (_("Remove sync point"), mem_fun(*this, &Editor::remove_region_sync)));
items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Audition"), mem_fun(*this, &Editor::audition_selected_region)));
items.push_back (MenuElem (_("Audition"), mem_fun(*this, &Editor::play_selected_region)));
items.push_back (MenuElem (_("Export"), mem_fun(*this, &Editor::export_region)));
items.push_back (MenuElem (_("Bounce"), mem_fun(*this, &Editor::bounce_region_selection)));

View file

@ -1000,13 +1000,14 @@ class Editor : public PublicEditor
void play_from_start ();
void play_from_edit_point ();
void play_selected_region ();
void audition_selected_region ();
void loop_selected_region ();
void play_location (ARDOUR::Location&);
void loop_location (ARDOUR::Location&);
void temporal_zoom_selection ();
void temporal_zoom_region ();
void toggle_zoom_region ();
bool zoomed_to_region;
void temporal_zoom_session ();
void temporal_zoom (gdouble scale);
void temporal_zoom_by_frame (nframes_t start, nframes_t end, const string & op);

View file

@ -209,7 +209,7 @@ Editor::register_actions ()
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "zoom-to-session", _("Zoom to Session"), mem_fun(*this, &Editor::temporal_zoom_session));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "zoom-to-region", _("Zoom to Region"), mem_fun(*this, &Editor::temporal_zoom_region));
act = ActionManager::register_action (editor_actions, "zoom-to-region", _("Zoom to Region"), mem_fun(*this, &Editor::toggle_zoom_region));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "toggle-zoom", _("Toggle Zoom State"), mem_fun(*this, &Editor::swap_visual_state));
ActionManager::session_sensitive_actions.push_back (act);
@ -294,7 +294,7 @@ Editor::register_actions ()
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);
act = ActionManager::register_action (editor_actions, "audition-region", _("Audition Region"), mem_fun(*this, &Editor::audition_selected_region));
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);
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);

View file

@ -168,6 +168,7 @@ Editor::track_canvas_scroll_event (GdkEventScroll *event)
bool
Editor::track_canvas_button_press_event (GdkEventButton *event)
{
selection->clear ();
track_canvas.grab_focus();
return false;
}

View file

@ -1070,7 +1070,7 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
/* no drag, just a click */
switch (item_type) {
case RegionItem:
audition_selected_region ();
play_selected_region ();
break;
default:
break;

View file

@ -1588,6 +1588,17 @@ Editor::temporal_zoom_region ()
}
temporal_zoom_by_frame (start, end, "zoom to region");
zoomed_to_region = true;
}
void
Editor::toggle_zoom_region ()
{
if (zoomed_to_region) {
swap_visual_state ();
} else {
temporal_zoom_region ();
}
}
void
@ -2117,16 +2128,6 @@ Editor::play_selection ()
session->request_play_range (true);
}
void
Editor::play_selected_region ()
{
if (!selection->regions.empty()) {
RegionView *rv = *(selection->regions.begin());
session->request_bounded_roll (rv->region()->position(), rv->region()->last_frame());
}
}
void
Editor::loop_selected_region ()
{
@ -2280,7 +2281,7 @@ Editor::audition_playlist_region_via_route (boost::shared_ptr<Region> region, Ro
}
void
Editor::audition_selected_region ()
Editor::play_selected_region ()
{
nframes64_t start = max_frames;
nframes64_t end = 0;
@ -2300,11 +2301,7 @@ Editor::audition_selected_region ()
}
}
list<AudioRange> lr;
lr.push_back (AudioRange (start, end, 0));
session->set_audio_range (lr);
session->request_play_range (true);
session->request_bounded_roll (start, end);
}
void

View file

@ -611,6 +611,8 @@ Editor::region_list_display_drag_data_received (const RefPtr<Gdk::DragContext>&
{
vector<ustring> paths;
cerr << "ERLD:dddr target = " << data.get_target() << endl;
if (convert_drop_to_paths (paths, context, x, y, data, info, time) == 0) {
nframes64_t pos = 0;
do_embed (paths, Editing::ImportDistinctFiles, ImportAsRegion, pos);