pitch shift fix from colin f.; fix marker line heights (and a few other things that have height that should span the entire editor canvas

git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2880 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2008-01-10 20:06:11 +00:00
parent bd6dba5c6d
commit 45b3dcad4c
3 changed files with 19 additions and 22 deletions

View file

@ -319,20 +319,20 @@ Editor::track_canvas_size_allocated ()
if (playhead_cursor) playhead_cursor->set_length (canvas_height); if (playhead_cursor) playhead_cursor->set_length (canvas_height);
for (MarkerSelection::iterator x = selection->markers.begin(); x != selection->markers.end(); ++x) { for (MarkerSelection::iterator x = selection->markers.begin(); x != selection->markers.end(); ++x) {
(*x)->set_line_length (canvas_height); (*x)->set_line_length (full_canvas_height);
} }
range_marker_drag_rect->property_y2() = canvas_height; range_marker_drag_rect->property_y2() = full_canvas_height;
transport_loop_range_rect->property_y2() = canvas_height; transport_loop_range_rect->property_y2() = full_canvas_height;
transport_punch_range_rect->property_y2() = canvas_height; transport_punch_range_rect->property_y2() = full_canvas_height;
transport_punchin_line->property_y2() = canvas_height; transport_punchin_line->property_y2() = full_canvas_height;
transport_punchout_line->property_y2() = canvas_height; transport_punchout_line->property_y2() = full_canvas_height;
update_fixed_rulers(); update_fixed_rulers();
redisplay_tempo (true); redisplay_tempo (true);
if (logo_item) { if (logo_item) {
// logo_item->property_height() = canvas_height; // logo_item->property_height() = full_canvas_height;
// logo_item->property_width() = canvas_width; // logo_item->property_width() = canvas_width;
} }

View file

@ -1172,7 +1172,7 @@ Editor::marker_selection_changed ()
} }
for (MarkerSelection::iterator x = selection->markers.begin(); x != selection->markers.end(); ++x) { for (MarkerSelection::iterator x = selection->markers.begin(); x != selection->markers.end(); ++x) {
(*x)->add_line (cursor_group, canvas_height); (*x)->add_line (cursor_group, full_canvas_height);
(*x)->show_line (); (*x)->show_line ();
} }

View file

@ -62,9 +62,9 @@ Editor::TimeFXDialog::TimeFXDialog (Editor& e, bool pitch)
: ArdourDialog (X_("time fx dialog")), : ArdourDialog (X_("time fx dialog")),
editor (e), editor (e),
pitching (pitch), pitching (pitch),
pitch_octave_adjustment (0.0, 0.0, 4.0, 1, 2.0), pitch_octave_adjustment (0.0, -4.0, 4.0, 1, 2.0),
pitch_semitone_adjustment (0.0, 0.0, 12.0, 1.0, 4.0), pitch_semitone_adjustment (0.0, -12.0, 12.0, 1.0, 4.0),
pitch_cent_adjustment (0.0, 0.0, 150.0, 5.0, 15.0), pitch_cent_adjustment (0.0, -499.0, 500.0, 5.0, 15.0),
pitch_octave_spinner (pitch_octave_adjustment), pitch_octave_spinner (pitch_octave_adjustment),
pitch_semitone_spinner (pitch_semitone_adjustment), pitch_semitone_spinner (pitch_semitone_adjustment),
pitch_cent_spinner (pitch_cent_adjustment), pitch_cent_spinner (pitch_cent_adjustment),
@ -217,6 +217,7 @@ Editor::time_fx (RegionSelection& regions, float val, bool pitching)
if (pitching) { if (pitching) {
float cents = current_timefx->pitch_octave_adjustment.get_value() * 1200.0; float cents = current_timefx->pitch_octave_adjustment.get_value() * 1200.0;
float pitch_fraction;
cents += current_timefx->pitch_semitone_adjustment.get_value() * 100.0; cents += current_timefx->pitch_semitone_adjustment.get_value() * 100.0;
cents += current_timefx->pitch_cent_adjustment.get_value(); cents += current_timefx->pitch_cent_adjustment.get_value();
@ -226,18 +227,14 @@ Editor::time_fx (RegionSelection& regions, float val, bool pitching)
return 0; return 0;
} }
// we now have the pitch shift in cents. divide by 1200 to get octaves // one octave == 1200 cents
// then multiply by 2.0 because 1 octave == doubling the frequency // adding one octave doubles the frequency
// ratio is 2^^octaves
cents /= 1200.0; pitch_fraction = pow(2, cents/1200);
cents /= 2.0;
// add 1.0 to convert to RB scale
cents += 1.0;
current_timefx->request.time_fraction = 1.0; current_timefx->request.time_fraction = 1.0;
current_timefx->request.pitch_fraction = cents; current_timefx->request.pitch_fraction = pitch_fraction;
} else { } else {