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

Method saveViewState

YUViewLib/src/ui/ViewStateHandler.cpp:90–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90void ViewStateHandler::saveViewState(int slot, bool saveOnSeparateView)
91{
92 if (slot < 0 || slot >= 8)
93 // Only eight slots
94 return;
95
96 // Get the selected items from the playlist
97 auto items = playlist->getSelectedItems();
98 selectionStates[slot][0] = items[0];
99 selectionStates[slot][1] = items[1];
100
101 // Get the current frame index from the playbackController
102 playbackStateFrameIdx(slot) = playback->getCurrentFrame();
103
104 // Get the state of the view from the splitView
105 if (saveOnSeparateView)
106 splitView[1]->getViewState(viewStates[slot].centerOffset,
107 viewStates[slot].zoomFactor,
108 viewStates[slot].splittingPoint,
109 viewStates[slot].viewMode);
110 else
111 splitView[0]->getViewState(viewStates[slot].centerOffset,
112 viewStates[slot].zoomFactor,
113 viewStates[slot].splittingPoint,
114 viewStates[slot].viewMode);
115}
116
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).

Callers

nothing calls this directly

Calls 3

getSelectedItemsMethod · 0.80
getCurrentFrameMethod · 0.80
getViewStateMethod · 0.80

Tested by

no test coverage detected