Clear view mode for transition view.

This commit is contained in:
brunoherbelin
2020-07-20 01:08:11 +02:00
parent 91dd7e5cc8
commit e3f75aa0ef
5 changed files with 39 additions and 28 deletions

View File

@@ -81,7 +81,8 @@ void Settings::Save()
// Transition
XMLElement *TransitionNode = xmlDoc.NewElement( "Transition" );
TransitionNode->SetAttribute("auto_end", application.transition.auto_open);
TransitionNode->SetAttribute("auto_open", application.transition.auto_open);
TransitionNode->SetAttribute("hide_windows", application.transition.hide_windows);
TransitionNode->SetAttribute("cross_fade", application.transition.cross_fade);
TransitionNode->SetAttribute("duration", application.transition.duration);
TransitionNode->SetAttribute("profile", application.transition.profile);
@@ -221,7 +222,8 @@ void Settings::Load()
// Transition
XMLElement * transitionnode = pRoot->FirstChildElement("Transition");
if (transitionnode != nullptr) {
transitionnode->QueryBoolAttribute("auto_end", &application.transition.auto_open);
transitionnode->QueryBoolAttribute("hide_windows", &application.transition.hide_windows);
transitionnode->QueryBoolAttribute("auto_open", &application.transition.auto_open);
transitionnode->QueryBoolAttribute("cross_fade", &application.transition.cross_fade);
transitionnode->QueryFloatAttribute("duration", &application.transition.duration);
transitionnode->QueryIntAttribute("profile", &application.transition.profile);

View File

@@ -89,12 +89,14 @@ struct TransitionConfig
{
bool cross_fade;
bool auto_open;
bool hide_windows;
float duration;
int profile;
TransitionConfig() {
cross_fade = true;
auto_open = true;
hide_windows = true;
duration = 1.f;
profile = 0;
}

View File

@@ -79,7 +79,7 @@ void InfiniteGlowCallback::update(Node *n, float dt)
initialized_ = true;
}
time_ += dt / 1000.f;
time_ += dt / 600.f;
n->scale_.x = initial_scale_.x + amplitude_ * sin(M_PI * time_);
n->scale_.y = initial_scale_.y + amplitude_ * sin(M_PI * time_);

View File

@@ -583,29 +583,35 @@ void UserInterface::Render()
// warning modal dialog
Log::Render();
// windows
if (Settings::application.widget.toolbox)
toolbox.Render();
if (Settings::application.widget.preview)
RenderPreview();
if (Settings::application.widget.media_player)
mediacontrol.Render();
if (Settings::application.widget.shader_editor)
RenderShaderEditor();
// clear view mode in Transition view
if ( !Settings::application.transition.hide_windows || Settings::application.current_view != 4) {
// windows
if (Settings::application.widget.toolbox)
toolbox.Render();
if (Settings::application.widget.preview)
RenderPreview();
if (Settings::application.widget.media_player)
mediacontrol.Render();
if (Settings::application.widget.shader_editor)
RenderShaderEditor();
if (Settings::application.widget.logs)
Log::ShowLogWindow(&Settings::application.widget.logs);
// about dialogs
if (show_about)
ShowAbout(&show_about);
if (show_imgui_about)
ImGui::ShowAboutWindow(&show_imgui_about);
if (show_gst_about)
ShowAboutGStreamer(&show_gst_about);
if (show_opengl_about)
ShowAboutOpengl(&show_opengl_about);
}
// stats in the corner
if (Settings::application.widget.stats)
ImGuiToolkit::ShowStats(&Settings::application.widget.stats, &Settings::application.widget.stats_corner);
if (Settings::application.widget.logs)
Log::ShowLogWindow(&Settings::application.widget.logs);
// about
if (show_about)
ShowAbout(&show_about);
if (show_imgui_about)
ImGui::ShowAboutWindow(&show_imgui_about);
if (show_gst_about)
ShowAboutGStreamer(&show_gst_about);
if (show_opengl_about)
ShowAboutOpengl(&show_opengl_about);
// all IMGUI Rendering
ImGui::Render();
@@ -1685,7 +1691,8 @@ void Navigator::RenderTransitionPannel()
ImGui::SetCursorPosY(width_);
ImGui::Text("Behavior");
ImGuiToolkit::ButtonSwitch( ICON_FA_RANDOM " Cross fading", &Settings::application.transition.cross_fade);
ImGuiToolkit::ButtonSwitch( ICON_FA_SIGN_IN_ALT " Automatic open", &Settings::application.transition.auto_open);
ImGuiToolkit::ButtonSwitch( ICON_FA_CROSSHAIRS " Open on target", &Settings::application.transition.auto_open);
ImGuiToolkit::ButtonSwitch( ICON_FA_CLOUD_SUN " Clear view", &Settings::application.transition.hide_windows);
// Transition options
ImGui::Text(" ");
@@ -1700,7 +1707,7 @@ void Navigator::RenderTransitionPannel()
ImGui::Combo("Curve", &Settings::application.transition.profile, "Linear\0Quadratic\0");
ImGui::Text(" ");
if ( ImGui::Button( ICON_FA_PLAY " Play ", ImVec2(IMGUI_RIGHT_ALIGN, 0)) ){
if ( ImGui::Button( ICON_FA_SIGN_IN_ALT " Play ", ImVec2(IMGUI_RIGHT_ALIGN, 0)) ){
TransitionView *tv = static_cast<TransitionView *>(Mixer::manager().view(View::TRANSITION));
if (tv) tv->play(true);
}

View File

@@ -970,7 +970,7 @@ void TransitionView::draw()
scene.accept(dv2);
// display interface duration
glm::vec2 P = Rendering::manager().project(glm::vec3(-0.03f, -0.14f, 0.f), scene.root()->transform_, false);
glm::vec2 P = Rendering::manager().project(glm::vec3(-0.11f, -0.14f, 0.f), scene.root()->transform_, false);
ImGui::SetNextWindowPos(ImVec2(P.x, P.y), ImGuiCond_Always);
if (ImGui::Begin("##Transition", NULL, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoBackground
| ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings
@@ -981,7 +981,7 @@ void TransitionView::draw()
ImGui::DragFloat("##nolabel", &Settings::application.transition.duration,
0.1f, TRANSITION_MIN_DURATION, TRANSITION_MAX_DURATION, "%.1f s");
ImGui::SameLine();
if ( ImGui::Button(ICON_FA_PLAY) )
if ( ImGui::Button(ICON_FA_STEP_FORWARD) )
play(false);
ImGui::PopFont();
ImGui::End();