MCPcopy Create free account
hub / github.com/TypesettingTools/Aegisub / OnSelectionChanged

Method OnSelectionChanged

src/audio_display.cpp:1293–1319  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1291}
1292
1293void AudioDisplay::OnSelectionChanged()
1294{
1295 TimeRange sel(controller->GetPrimaryPlaybackRange());
1296 scrollbar->SetSelection(AbsoluteXFromTime(sel.begin()), AbsoluteXFromTime(sel.length()));
1297
1298 if (audio_marker)
1299 {
1300 if (!scroll_timer.IsRunning())
1301 {
1302 // If the dragged object is outside the visible area, start the
1303 // scroll timer to shift it back into view
1304 int rel_x = RelativeXFromTime(audio_marker->GetPosition());
1305 if (rel_x < 0 || rel_x >= GetClientSize().GetWidth())
1306 {
1307 // 50ms is the default for this on Windows (hardcoded since
1308 // wxSystemSettings doesn't expose DragScrollDelay etc.)
1309 scroll_timer.Start(50, true);
1310 }
1311 }
1312 }
1313 else if (OPT_GET("Audio/Auto/Scroll")->GetBool() && sel.end() != 0)
1314 {
1315 ScrollTimeRangeInView(sel);
1316 }
1317
1318 RefreshRect(scrollbar->GetBounds(), false);
1319}
1320
1321void AudioDisplay::OnScrollTimer(wxTimerEvent &event)
1322{

Callers

nothing calls this directly

Calls 7

lengthMethod · 0.80
SetSelectionMethod · 0.45
beginMethod · 0.45
GetPositionMethod · 0.45
GetWidthMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected