Skip to content

Commit

Permalink
Fix restore after running scene (#447)
Browse files Browse the repository at this point in the history
* Fix restore after running scene

* Make sure scene list is updated

* Fix crash when clearing management when toggle widget is assigned

* Make sure scenes are updates when selecting new one
  • Loading branch information
aroffringa authored Mar 13, 2024
1 parent 0d1b923 commit 5779e0f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
5 changes: 4 additions & 1 deletion gui/faders/togglewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,10 @@ void ToggleWidget::OnAssigned(bool moveFader) {
name_label_.set_text("<..>");
icon_button_.SetColors({});
if (moveFader) {
UpdateActivated(GetSingleSourceValue(*source));
hold_updates_ = true;
icon_button_.SetActive(false);
fade_button_.set_image_from_icon_name("go-down");
hold_updates_ = false;
} else {
if (icon_button_.GetActive())
setTargetValue(0, theatre::ControlValue::MaxUInt());
Expand Down
7 changes: 3 additions & 4 deletions gui/windows/scenewindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ SceneWindow::SceneWindow(theatre::Management &management,
else {
NewScene();
}
fillControllablesList();
Update();
}

SceneWindow::~SceneWindow() {
Expand Down Expand Up @@ -568,8 +568,7 @@ bool SceneWindow::HandleKeyDown(char key) {
void SceneWindow::SetSelectedScene(theatre::Scene &scene) {
_selectedScene = &scene;
_sourceValue = _management.GetSourceValue(scene, 0);
updateAudio();
UpdateAudioWidgetKeys();
Update();
set_sensitive(true);
}

Expand All @@ -578,7 +577,7 @@ void SceneWindow::SetNoSelectedScene() {
_selectedScene = nullptr;
_sourceValue = nullptr;
_audioWidget.SetNoScene();
updateAudio();
Update();
}

void SceneWindow::onScalesChanged() {
Expand Down
4 changes: 3 additions & 1 deletion theatre/scenes/scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@ void Scene::RecalculateControllables() {
}

void Scene::BlackOut(double fade_speed) {
_storedSourceValues = _management.StoreSourceValues(true);
if (_storedSourceValues.Empty()) {
_storedSourceValues = _management.StoreSourceValues(true);
}
_management.BlackOut(true, fade_speed);
}

Expand Down

0 comments on commit 5779e0f

Please sign in to comment.