| 88 | } |
| 89 | |
| 90 | void 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). |
nothing calls this directly
no test coverage detected