MCPcopy Create free account
hub / github.com/IENT/YUView / loadViewState

Method loadViewState

YUViewLib/src/ui/ViewStateHandler.cpp:119–145  ·  view source on GitHub ↗

Load the view state for a specific slot. If the views are linked, the behavior is different if loading was toggled from the primary, or the separate view (loadOnSeparateView).

Source from the content-addressed store, hash-verified

117// Load the view state for a specific slot. If the views are linked, the behavior is different if
118// loading was toggled from the primary, or the separate view (loadOnSeparateView).
119void ViewStateHandler::loadViewState(int slot, bool loadOnSeparateView)
120{
121 if (slot < 0 || slot >= 8)
122 // Only eight slots
123 return;
124
125 if (playbackStateFrameIdx(slot) == -1)
126 // Slot not valid
127 return;
128
129 // First load the correct selection
130 playlist->setSelectedItems(selectionStates[slot][0], selectionStates[slot][1]);
131
132 // Then load the correct frame index
133 playback->setCurrentFrameAndUpdate(playbackStateFrameIdx(slot));
134
135 if (loadOnSeparateView)
136 splitView[1]->setViewState(viewStates[slot].centerOffset,
137 viewStates[slot].zoomFactor,
138 viewStates[slot].splittingPoint,
139 viewStates[slot].viewMode);
140 else
141 splitView[0]->setViewState(viewStates[slot].centerOffset,
142 viewStates[slot].zoomFactor,
143 viewStates[slot].splittingPoint,
144 viewStates[slot].viewMode);
145}
146
147void ViewStateHandler::savePlaylist(QDomElement &root)
148{

Callers

nothing calls this directly

Calls 3

setSelectedItemsMethod · 0.80
setViewStateMethod · 0.80

Tested by

no test coverage detected