Implement Audio/Auto/Scroll option

Originally committed to SVN as r5656.
This commit is contained in:
Thomas Goyne 2011-09-28 19:51:09 +00:00
parent 976061747d
commit d863d4379b
1 changed files with 2 additions and 1 deletions

View File

@ -1214,7 +1214,8 @@ void AudioDisplay::OnSelectionChanged()
/// @todo Handle rendering style ranges from timing controller instead
SampleRange sel(controller->GetPrimaryPlaybackRange());
scrollbar->SetSelection(AbsoluteXFromSamples(sel.begin()), AbsoluteXFromSamples(sel.length()));
if (OPT_GET("Audio/Auto/Scroll")->GetBool())
ScrollSampleRangeInView(sel);
int s1 = RelativeXFromSamples(sel.begin());
int e1 = RelativeXFromSamples(sel.end());