projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use MTC instead of MIDI Timecode as the string for the external sync button. Fixes...
[ardour.git]
/
gtk2_ardour
/
crossfade_edit.cc
diff --git
a/gtk2_ardour/crossfade_edit.cc
b/gtk2_ardour/crossfade_edit.cc
index ecb7b8a1f864e2e8bb56dabc75f790109d1558fb..0c8daafb045995826673acdb50616d103a4c61db 100644
(file)
--- a/
gtk2_ardour/crossfade_edit.cc
+++ b/
gtk2_ardour/crossfade_edit.cc
@@
-419,15
+419,16
@@
CrossfadeEditor::point_event (GdkEvent* event, Point* point)
if (point_grabbed) {
double new_x, new_y;
if (point_grabbed) {
double new_x, new_y;
- /* can't drag first or last points horizontally */
+ /* can't drag first or last points horizontally
or vertically
*/
if (point == fade[current].points.front() || point == fade[current].points.back()) {
new_x = point->x;
if (point == fade[current].points.front() || point == fade[current].points.back()) {
new_x = point->x;
+ new_y = point->y;
} else {
new_x = (event->motion.x - canvas_border)/effective_width();
} else {
new_x = (event->motion.x - canvas_border)/effective_width();
+ new_y = 1.0 - ((event->motion.y - canvas_border)/effective_height());
}
}
- new_y = 1.0 - ((event->motion.y - canvas_border)/effective_height());
point->move_to (x_coordinate (new_x), y_coordinate (new_y),
new_x, new_y);
redraw ();
point->move_to (x_coordinate (new_x), y_coordinate (new_y),
new_x, new_y);
redraw ();
@@
-503,17
+504,17
@@
CrossfadeEditor::add_control_point (double x, double y)
void
CrossfadeEditor::Point::move_to (double nx, double ny, double xfract, double yfract)
{
void
CrossfadeEditor::Point::move_to (double nx, double ny, double xfract, double yfract)
{
-
if ( xfract < 0.0 ) {
-
xfract = 0.0;
-
} else if ( xfract > 1.0 ) {
-
xfract = 1.0;
-
}
+ if ( xfract < 0.0 ) {
+ xfract = 0.0;
+ } else if ( xfract > 1.0 ) {
+ xfract = 1.0;
+ }
-
if ( yfract < 0.0 ) {
-
yfract = 0.0;
-
} else if ( yfract > 1.0 ) {
-
yfract = 1.0;
-
}
+ if ( yfract < 0.0 ) {
+ yfract = 0.0;
+ } else if ( yfract > 1.0 ) {
+ yfract = 1.0;
+ }
const double half_size = rint(size/2.0);
double x1 = nx - half_size;
const double half_size = rint(size/2.0);
double x1 = nx - half_size;
@@
-655,7
+656,7
@@
CrossfadeEditor::redraw ()
return;
}
return;
}
-
nframes
_t len = xfade->length ();
+
framecnt
_t len = xfade->length ();
fade[current].normative_curve.clear ();
fade[current].gain_curve.clear ();
fade[current].normative_curve.clear ();
fade[current].gain_curve.clear ();
@@
-787,10
+788,10
@@
CrossfadeEditor::apply ()
_session->begin_reversible_command (_("Edit crossfade"));
XMLNode& before = xfade->get_state ();
_session->begin_reversible_command (_("Edit crossfade"));
XMLNode& before = xfade->get_state ();
-
+
_apply_to (xfade);
_apply_to (xfade);
- _session->add_command (new MementoCommand<Crossfade> (*xfade.get(), &before, &xfade->get_state()));
+ _session->add_command (new MementoCommand<Crossfade> (*xfade.get(), &before, &xfade->get_state
()));
_session->commit_reversible_command ();
}
_session->commit_reversible_command ();
}
@@
-872,7
+873,7
@@
CrossfadeEditor::reset ()
set (xfade->fade_in(), In);
set (xfade->fade_out(), Out);
set (xfade->fade_in(), In);
set (xfade->fade_out(), Out);
-
curve_select_clicked (current);
+ curve_select_clicked (current);
}
void
}
void
@@
-1214,11
+1215,11
@@
void
CrossfadeEditor::audition (Audition which)
{
AudioPlaylist& pl (_session->the_auditioner()->prepare_playlist());
CrossfadeEditor::audition (Audition which)
{
AudioPlaylist& pl (_session->the_auditioner()->prepare_playlist());
-
nframes
_t preroll;
-
nframes
_t postroll;
-
nframes
_t left_start_offset;
-
nframes
_t right_length;
-
nframes
_t left_length;
+
framecnt
_t preroll;
+
framecnt
_t postroll;
+
framecnt
_t left_start_offset;
+
framecnt
_t right_length;
+
framecnt
_t left_length;
if (which != Right && preroll_button.get_active()) {
preroll = _session->frame_rate() * 2; //2 second hardcoded preroll for now
if (which != Right && preroll_button.get_active()) {
preroll = _session->frame_rate() * 2; //2 second hardcoded preroll for now