diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2007-12-18 20:54:46 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2007-12-18 20:54:46 +0000 |
commit | 6bcec5f82091c860e1625bdc68b0ee4075e84046 (patch) | |
tree | a524880bd2324e79c4858126a503977f3ff406ba /gtk2_ardour/editor_ops.cc | |
parent | 5119d48267be90aa4af3daa91f8bb72e6ab57c2c (diff) |
new LocateRollLocate event, used to implement play-at-edit-point-and-return; other fixes from the OS X world
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2792 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_ops.cc')
-rw-r--r-- | gtk2_ardour/editor_ops.cc | 49 |
1 files changed, 41 insertions, 8 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index f3a493e195..dc170e938f 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -2119,6 +2119,32 @@ Editor::play_from_edit_point () } void +Editor::play_from_edit_point_and_return () +{ + nframes64_t start_frame; + nframes64_t return_frame; + + if (session->transport_rolling()) { + session->request_stop (); + return; + } + + switch (_edit_point) { + case EditAtPlayhead: + session->request_transport_speed (1.0f); + break; + + default: + return_frame = session->transport_frame(); + start_frame = get_preferred_edit_position (); + if (start_frame >= 0) { + session->request_roll_at_and_return (start_frame, return_frame); + } + break; + } +} + +void Editor::play_selection () { if (selection->time.empty()) { @@ -4193,31 +4219,38 @@ Editor::toggle_fade_active (bool in) } const char* cmd = (in ? _("toggle fade in active") : _("toggle fade out active")); + bool have_switch = false; + bool yn; + bool in_command = false; begin_reversible_command (cmd); for (RegionSelection::iterator x = selection->regions.begin(); x != selection->regions.end(); ++x) { AudioRegionView* tmp = dynamic_cast<AudioRegionView*> (*x); - + if (!tmp) { return; } boost::shared_ptr<AudioRegion> region (tmp->audio_region()); - XMLNode &before = region->get_state(); - - if (in) { - region->set_fade_in_active (!region->fade_in_active()); - } else { - region->set_fade_out_active (!region->fade_out_active()); + /* make the behaviour consistent across all regions */ + + if (!have_switch) { + yn = region->fade_in_active(); + have_switch = true; } + XMLNode &before = region->get_state(); + region->set_fade_in_active (!yn); XMLNode &after = region->get_state(); session->add_command(new MementoCommand<AudioRegion>(*region.get(), &before, &after)); + in_command = true; } - commit_reversible_command (); + if (in_command) { + commit_reversible_command (); + } } void |