MCPcopy Create free account
hub / github.com/audacity/audacity / OnUpdate

Method OnUpdate

src/tracks/ui/ChannelView.cpp:266–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

264 TrackPositioner &operator=( const TrackPositioner & ) = delete;
265
266 void OnUpdate(const TrackListEvent & e)
267 {
268 switch (e.mType) {
269 case TrackListEvent::ADDITION:
270 case TrackListEvent::DELETION:
271 case TrackListEvent::PERMUTED:
272 case TrackListEvent::RESIZING:
273 break;
274 default:
275 return;
276 }
277 auto iter =
278 TrackList::Get(mProject).Find(e.mpTrack.lock().get());
279 if (!*iter)
280 iter = TrackList::Get(mProject).begin();
281 if (!*iter)
282 return;
283
284 auto prev = iter;
285 auto yy = ChannelView::GetCumulativeHeight(*--prev);
286
287 while (auto pTrack = *iter) {
288 for (auto pChannel : (*iter)->Channels()) {
289 auto &view = ChannelView::Get(*pChannel);
290 view.SetCumulativeHeightBefore(yy);
291 yy += view.GetHeight();
292 }
293 ++iter;
294 }
295 }
296
297 Observer::Subscription mSubscription;
298};

Callers

nothing calls this directly

Calls 7

GetFunction · 0.85
ChannelsMethod · 0.80
GetHeightMethod · 0.80
FindMethod · 0.45
getMethod · 0.45
lockMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected