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

Method UpdateTimeBoxes

src/video_box.cpp:111–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111void VideoBox::UpdateTimeBoxes() {
112 if (!context->project->VideoProvider()) return;
113
114 int frame = context->videoController->GetFrameN();
115 int time = context->videoController->TimeAtFrame(frame, agi::vfr::EXACT);
116
117 // Set the text box for frame number and time
118 VideoPosition->SetValue(fmt_wx("%s - %d", agi::Time(time).GetAssFormatted(true), frame));
119 if (boost::binary_search(context->project->Keyframes(), frame)) {
120 // Set the background color to indicate this is a keyframe
121 VideoPosition->SetBackgroundColour(to_wx(OPT_GET("Colour/Subtitle Grid/Background/Selection")->GetColor()));
122 VideoPosition->SetForegroundColour(to_wx(OPT_GET("Colour/Subtitle Grid/Selection")->GetColor()));
123 }
124 else {
125 VideoPosition->SetBackgroundColour(wxNullColour);
126 VideoPosition->SetForegroundColour(wxNullColour);
127 }
128
129 AssDialogue *active_line = context->selectionController->GetActiveLine();
130 if (!active_line)
131 VideoSubsPos->SetValue("");
132 else {
133 VideoSubsPos->SetValue(fmt_wx(
134 "%+dms; %+dms",
135 time - active_line->Start,
136 time - active_line->End));
137 }
138}

Callers

nothing calls this directly

Calls 9

VideoProviderMethod · 0.80
GetFrameNMethod · 0.80
GetAssFormattedMethod · 0.80
GetColorMethod · 0.80
GetActiveLineMethod · 0.80
TimeClass · 0.70
to_wxFunction · 0.70
TimeAtFrameMethod · 0.45
SetValueMethod · 0.45

Tested by

no test coverage detected