summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_mouse.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2007-01-17 20:04:46 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2007-01-17 20:04:46 +0000
commitc46b9078e3215abded4e67ae4f2a1a3d5190059b (patch)
tree0da925893f5c6d4d5cb0c2e6edac09d956b3ea8a /gtk2_ardour/editor_mouse.cc
parent729e6cc980ebfb17596e40c21a7550dd0f2c8420 (diff)
fix absolute fade in/out length during drag and odd select/deselect behaviour
git-svn-id: svn://localhost/ardour2/trunk@1340 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_mouse.cc')
-rw-r--r--gtk2_ardour/editor_mouse.cc74
1 files changed, 37 insertions, 37 deletions
diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc
index 04ef0e6d39..79581381e4 100644
--- a/gtk2_ardour/editor_mouse.cc
+++ b/gtk2_ardour/editor_mouse.cc
@@ -1784,6 +1784,13 @@ Editor::fade_in_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
snap_to (pos);
}
+ if (pos < (arv->region()->position() + 64)) {
+ fade_length = 64; // this should be a minimum defined somewhere
+ } else if (pos > arv->region()->last_frame()) {
+ fade_length = arv->region()->length();
+ } else {
+ fade_length = pos - arv->region()->position();
+ }
/* mapover the region selection */
for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
@@ -1794,14 +1801,6 @@ Editor::fade_in_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
continue;
}
- if (pos < (tmp->region()->position() + 64)) {
- fade_length = 64; // this should be a minimum defined somewhere
- } else if (pos > tmp->region()->last_frame()) {
- fade_length = tmp->region()->length();
- } else {
- fade_length = pos - tmp->region()->position();
- }
-
tmp->reset_fade_in_shape_width (fade_length);
}
@@ -1813,6 +1812,7 @@ Editor::fade_in_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
void
Editor::fade_in_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event)
{
+ AudioRegionView* arv = static_cast<AudioRegionView*>(drag_info.data);
nframes_t pos;
nframes_t fade_length;
@@ -1824,6 +1824,14 @@ Editor::fade_in_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* even
pos = 0;
}
+ if (pos < (arv->region()->position() + 64)) {
+ fade_length = 64; // this should be a minimum defined somewhere
+ } else if (pos > arv->region()->last_frame()) {
+ fade_length = arv->region()->length();
+ } else {
+ fade_length = pos - arv->region()->position();
+ }
+
begin_reversible_command (_("change fade in length"));
for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
@@ -1837,14 +1845,6 @@ Editor::fade_in_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* even
AutomationList& alist = tmp->audio_region()->fade_in();
XMLNode &before = alist.get_state();
- if (pos < (tmp->region()->position() + 64)) {
- fade_length = 64; // this should be a minimum defined somewhere
- } else if (pos > tmp->region()->last_frame()) {
- fade_length = tmp->region()->length();
- } else {
- fade_length = pos - tmp->region()->position();
- }
-
tmp->audio_region()->set_fade_in_length (fade_length);
XMLNode &after = alist.get_state();
@@ -1890,7 +1890,17 @@ Editor::fade_out_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event
if (!Keyboard::modifier_state_contains (event->button.state, Keyboard::snap_modifier())) {
snap_to (pos);
}
-
+
+ if (pos > (arv->region()->last_frame() - 64)) {
+ fade_length = 64; // this should really be a minimum fade defined somewhere
+ }
+ else if (pos < arv->region()->position()) {
+ fade_length = arv->region()->length();
+ }
+ else {
+ fade_length = arv->region()->last_frame() - pos;
+ }
+
/* mapover the region selection */
for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
@@ -1901,16 +1911,6 @@ Editor::fade_out_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event
continue;
}
- if (pos > (tmp->region()->last_frame() - 64)) {
- fade_length = 64; // this should really be a minimum fade defined somewhere
- }
- else if (pos < arv->region()->position()) {
- fade_length = tmp->region()->length();
- }
- else {
- fade_length = tmp->region()->last_frame() - pos;
- }
-
tmp->reset_fade_out_shape_width (fade_length);
}
@@ -1939,6 +1939,16 @@ Editor::fade_out_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* eve
snap_to (pos);
}
+ if (pos > (arv->region()->last_frame() - 64)) {
+ fade_length = 64; // this should really be a minimum fade defined somewhere
+ }
+ else if (pos < arv->region()->position()) {
+ fade_length = arv->region()->length();
+ }
+ else {
+ fade_length = arv->region()->last_frame() - pos;
+ }
+
begin_reversible_command (_("change fade out length"));
for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
@@ -1952,16 +1962,6 @@ Editor::fade_out_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* eve
AutomationList& alist = tmp->audio_region()->fade_out();
XMLNode &before = alist.get_state();
- if (pos > (tmp->region()->last_frame() - 64)) {
- fade_length = 64; // this should really be a minimum fade defined somewhere
- }
- else if (pos < tmp->region()->position()) {
- fade_length = tmp->region()->length();
- }
- else {
- fade_length = tmp->region()->last_frame() - pos;
- }
-
tmp->audio_region()->set_fade_out_length (fade_length);
XMLNode &after = alist.get_state();