mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-14 03:39:57 +01:00
Minor UI improvements
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
**/
|
**/
|
||||||
|
|
||||||
|
|
||||||
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
|
||||||
@@ -28,6 +29,7 @@
|
|||||||
|
|
||||||
#include <tinyxml2.h>
|
#include <tinyxml2.h>
|
||||||
|
|
||||||
|
#include "IconsFontAwesome5.h"
|
||||||
#include "imgui.h"
|
#include "imgui.h"
|
||||||
#include "imgui_internal.h"
|
#include "imgui_internal.h"
|
||||||
|
|
||||||
@@ -60,6 +62,7 @@
|
|||||||
#include "MixingGroup.h"
|
#include "MixingGroup.h"
|
||||||
#include "ActionManager.h"
|
#include "ActionManager.h"
|
||||||
#include "Mixer.h"
|
#include "Mixer.h"
|
||||||
|
#include "ControlManager.h"
|
||||||
|
|
||||||
#include "imgui.h"
|
#include "imgui.h"
|
||||||
#include "ImGuiToolkit.h"
|
#include "ImGuiToolkit.h"
|
||||||
@@ -452,9 +455,13 @@ void ImGuiVisitor::visit (Source& s)
|
|||||||
// inform on visibility status
|
// inform on visibility status
|
||||||
ImGui::SetCursorPos( ImVec2(preview_width + 20, pos.y ) );
|
ImGui::SetCursorPos( ImVec2(preview_width + 20, pos.y ) );
|
||||||
if (s.active()) {
|
if (s.active()) {
|
||||||
if (s.blendingShader()->color.a > 0.f)
|
if (s.blendingShader()->color.a > 0.f) {
|
||||||
ImGuiToolkit::Indication("Visible", ICON_FA_SUN);
|
std::string indication = "Visible\nAlpha ";
|
||||||
else
|
indication += std::to_string((int)(s.blendingShader()->color.a * 100.f)) + "%";
|
||||||
|
if (ImGuiToolkit::IconButton( ICON_FA_SUN, indication.c_str()) ) {
|
||||||
|
UserInterface::manager().setView(View::MIXING);
|
||||||
|
}
|
||||||
|
} else
|
||||||
ImGuiToolkit::Indication("not Visible", ICON_FA_MOON);
|
ImGuiToolkit::Indication("not Visible", ICON_FA_MOON);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -472,23 +479,26 @@ void ImGuiVisitor::visit (Source& s)
|
|||||||
else
|
else
|
||||||
ImGuiToolkit::Indication("not Linked", ICON_FA_UNLINK);
|
ImGuiToolkit::Indication("not Linked", ICON_FA_UNLINK);
|
||||||
|
|
||||||
// Inform on workspace
|
// inform of input mapping
|
||||||
ImGui::SetCursorPos( ImVec2(preview_width + 20, pos.y + 2.1f * ImGui::GetFrameHeightWithSpacing()) );
|
ImGui::SetCursorPos( ImVec2(preview_width + 20, pos.y + 2.1f * ImGui::GetFrameHeightWithSpacing()) );
|
||||||
static std::map< int, std::pair<int, std::string> > workspaces_ {
|
std::list<uint> inputs = Mixer::manager().session()->inputsForSource( s.id() );
|
||||||
{ Source::WORKSPACE_BACKGROUND, {10, "in Background"}},
|
if (!inputs.empty()) {
|
||||||
{ Source::WORKSPACE_CENTRAL, {11, "in Workspace"}},
|
if (ImGuiToolkit::IconButton( ICON_FA_HAND_PAPER ) ) {
|
||||||
{ Source::WORKSPACE_FOREGROUND, {12, "in Foreground"}}
|
// open input mapping window
|
||||||
};
|
Settings::application.widget.inputs = true;
|
||||||
// in Geometry view, offer to switch current workspace to the source workspace
|
}
|
||||||
if (Settings::application.current_view == View::GEOMETRY) {
|
if (ImGui::IsItemHovered()) {
|
||||||
if (ImGuiToolkit::IconButton( workspaces_[s.workspace()].first, 16, workspaces_[s.workspace()].second.c_str())) {
|
std::string tooltip = "Mapped to input";
|
||||||
Settings::application.current_workspace=s.workspace();
|
tooltip += inputs.size() > 1 ? "s:" : ":" ;
|
||||||
Mixer::manager().setCurrentSource(s.id());
|
for(const auto& input : inputs) {
|
||||||
|
tooltip += "\n - ";
|
||||||
|
tooltip += Control::inputLabel(input);
|
||||||
|
}
|
||||||
|
ImGuiToolkit::ToolTip(tooltip.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// otherwise in other views, just draw in indicator
|
|
||||||
else
|
else
|
||||||
ImGuiToolkit::Indication(workspaces_[s.workspace()].second.c_str(), workspaces_[s.workspace()].first, 16);
|
ImGuiToolkit::Indication("not Mapped to an input", ICON_FA_HAND_PAPER);
|
||||||
|
|
||||||
// locking
|
// locking
|
||||||
ImGui::SetCursorPos( ImVec2(preview_width + 20, pos.y + preview_height - ImGui::GetFrameHeightWithSpacing()) );
|
ImGui::SetCursorPos( ImVec2(preview_width + 20, pos.y + preview_height - ImGui::GetFrameHeightWithSpacing()) );
|
||||||
@@ -517,7 +527,7 @@ void ImGuiVisitor::visit (Source& s)
|
|||||||
pos = ImGui::GetCursorPos();
|
pos = ImGui::GetCursorPos();
|
||||||
|
|
||||||
// menu icon for image processing
|
// menu icon for image processing
|
||||||
ImGui::SameLine(preview_width, 2 * IMGUI_SAME_LINE);
|
ImGui::SameLine(preview_width + 5, 2 * IMGUI_SAME_LINE);
|
||||||
static uint counter_menu_timeout = 0;
|
static uint counter_menu_timeout = 0;
|
||||||
if (ImGuiToolkit::IconButton(5, 8) || ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup)) {
|
if (ImGuiToolkit::IconButton(5, 8) || ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup)) {
|
||||||
counter_menu_timeout=0;
|
counter_menu_timeout=0;
|
||||||
|
|||||||
@@ -80,8 +80,8 @@ std::list< FilteringProgram > FilteringProgram::example_filters = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
std::list< FilteringProgram > FilteringProgram::example_patterns = {
|
std::list< FilteringProgram > FilteringProgram::example_patterns = {
|
||||||
FilteringProgram("Source", "shaders/filters/source.glsl", "", { }),
|
|
||||||
FilteringProgram("Color", "shaders/filters/color.glsl", "", { }),
|
FilteringProgram("Color", "shaders/filters/color.glsl", "", { }),
|
||||||
|
FilteringProgram("Source", "shaders/filters/source.glsl", "", { }),
|
||||||
FilteringProgram("Color noise", "shaders/filters/RGBnoise.glsl", "", { }),
|
FilteringProgram("Color noise", "shaders/filters/RGBnoise.glsl", "", { }),
|
||||||
FilteringProgram("Simplex Noise", "shaders/filters/3DSimplexNoise.glsl", "", { }),
|
FilteringProgram("Simplex Noise", "shaders/filters/3DSimplexNoise.glsl", "", { }),
|
||||||
FilteringProgram("Perlin Noise", "shaders/filters/3DPerlinNoise.glsl", "", { }),
|
FilteringProgram("Perlin Noise", "shaders/filters/3DPerlinNoise.glsl", "", { }),
|
||||||
|
|||||||
@@ -947,6 +947,34 @@ std::list<uint> Session::assignedInputs()
|
|||||||
return inputs;
|
return inputs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::list<uint> Session::inputsForSource( uint64_t sid )
|
||||||
|
{
|
||||||
|
std::list<uint> inputs;
|
||||||
|
|
||||||
|
if (sid > 0 && !input_callbacks_.empty()) {
|
||||||
|
// test all targets of the list of input callbacks
|
||||||
|
for(const auto& [key, value] : input_callbacks_) {
|
||||||
|
if (Source * const* v = std::get_if<Source *>(&value.target_)) {
|
||||||
|
// v is a source
|
||||||
|
if (sid == (*v)->id())
|
||||||
|
// v is the source we are looking for
|
||||||
|
inputs.push_back(key);
|
||||||
|
}
|
||||||
|
else if ( const size_t* v = std::get_if<size_t>(&value.target_)) {
|
||||||
|
// v is a batch
|
||||||
|
SourceIdList::iterator it = std::find(batch_[*v].begin(),
|
||||||
|
batch_[*v].end(),sid);
|
||||||
|
if ( it != batch_[*v].end())
|
||||||
|
// v contains the source we are looking for
|
||||||
|
inputs.push_back(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// remove duplicates
|
||||||
|
inputs.unique();
|
||||||
|
}
|
||||||
|
return inputs;
|
||||||
|
}
|
||||||
|
|
||||||
bool Session::inputAssigned(uint input)
|
bool Session::inputAssigned(uint input)
|
||||||
{
|
{
|
||||||
return input_callbacks_.find(input) != input_callbacks_.end();
|
return input_callbacks_.find(input) != input_callbacks_.end();
|
||||||
|
|||||||
@@ -181,6 +181,7 @@ public:
|
|||||||
bool inputAssigned(uint input);
|
bool inputAssigned(uint input);
|
||||||
void swapInputCallback(uint from, uint to);
|
void swapInputCallback(uint from, uint to);
|
||||||
void copyInputCallback(uint from, uint to);
|
void copyInputCallback(uint from, uint to);
|
||||||
|
std::list<uint> inputsForSource( uint64_t id );
|
||||||
|
|
||||||
void setInputSynchrony(uint input, Metronome::Synchronicity sync);
|
void setInputSynchrony(uint input, Metronome::Synchronicity sync);
|
||||||
std::vector<Metronome::Synchronicity> getInputSynchrony();
|
std::vector<Metronome::Synchronicity> getInputSynchrony();
|
||||||
|
|||||||
@@ -248,7 +248,8 @@ uint64_t UserInterface::Runtime() const
|
|||||||
void UserInterface::setView(View::Mode mode)
|
void UserInterface::setView(View::Mode mode)
|
||||||
{
|
{
|
||||||
Mixer::manager().setView(mode);
|
Mixer::manager().setView(mode);
|
||||||
navigator.discardPannel();
|
if ( !Settings::application.pannel_always_visible )
|
||||||
|
navigator.discardPannel();
|
||||||
}
|
}
|
||||||
|
|
||||||
void UserInterface::handleKeyboard()
|
void UserInterface::handleKeyboard()
|
||||||
@@ -5099,11 +5100,12 @@ void Navigator::RenderMainPannelSession()
|
|||||||
|
|
||||||
ImGui::SetCursorPos( ImVec2( pannel_width_ IMGUI_RIGHT_ALIGN, pos_bot.y - 2.f * ImGui::GetFrameHeightWithSpacing()));
|
ImGui::SetCursorPos( ImVec2( pannel_width_ IMGUI_RIGHT_ALIGN, pos_bot.y - 2.f * ImGui::GetFrameHeightWithSpacing()));
|
||||||
ImGuiToolkit::HelpToolTip("Previous versions of the session (latest on top). "
|
ImGuiToolkit::HelpToolTip("Previous versions of the session (latest on top). "
|
||||||
"Double-clic on a version to restore it.");
|
"Double-clic on a version to restore it.\n\n"
|
||||||
|
ICON_FA_CODE_BRANCH " With Iterative saving enabled, a new version "
|
||||||
|
"is kept automatically each time the session is saved.");
|
||||||
// toggle button for versioning
|
// toggle button for versioning
|
||||||
ImGui::SetCursorPos( ImVec2( pannel_width_ IMGUI_RIGHT_ALIGN, pos_bot.y - ImGui::GetFrameHeightWithSpacing()) );
|
ImGui::SetCursorPos( ImVec2( pannel_width_ IMGUI_RIGHT_ALIGN, pos_bot.y - ImGui::GetFrameHeightWithSpacing()) );
|
||||||
ImGuiToolkit::ButtonToggle(" " ICON_FA_CODE_BRANCH " ", &Settings::application.save_version_snapshot, "With iterative saving enabled, a new version "
|
ImGuiToolkit::ButtonToggle(" " ICON_FA_CODE_BRANCH " ", &Settings::application.save_version_snapshot, "Iterative saving");
|
||||||
"is kept each time the session is saved.");
|
|
||||||
|
|
||||||
ImGui::SetCursorPos( pos_bot );
|
ImGui::SetCursorPos( pos_bot );
|
||||||
}
|
}
|
||||||
@@ -5198,11 +5200,12 @@ void Navigator::RenderMainPannelSession()
|
|||||||
|
|
||||||
ImGui::SetCursorPos( ImVec2( pannel_width_ IMGUI_RIGHT_ALIGN, pos_bot.y - 2.f * ImGui::GetFrameHeightWithSpacing()));
|
ImGui::SetCursorPos( ImVec2( pannel_width_ IMGUI_RIGHT_ALIGN, pos_bot.y - 2.f * ImGui::GetFrameHeightWithSpacing()));
|
||||||
ImGuiToolkit::HelpToolTip("History of actions (latest on top). "
|
ImGuiToolkit::HelpToolTip("History of actions (latest on top). "
|
||||||
"Double-clic on an action to restore its status.");
|
"Double-clic on an action to restore its status.\n\n"
|
||||||
|
ICON_FA_MAP_MARKED_ALT " With Show action View enabled, navigate "
|
||||||
|
"automatically to the view showing the action on undo/redo.");
|
||||||
// toggle button for shhow in view
|
// toggle button for shhow in view
|
||||||
ImGui::SetCursorPos( ImVec2( pannel_width_ IMGUI_RIGHT_ALIGN, pos_bot.y - ImGui::GetFrameHeightWithSpacing()) );
|
ImGui::SetCursorPos( ImVec2( pannel_width_ IMGUI_RIGHT_ALIGN, pos_bot.y - ImGui::GetFrameHeightWithSpacing()) );
|
||||||
ImGuiToolkit::ButtonToggle(ICON_FA_MAP_MARKED_ALT, &Settings::application.action_history_follow_view, "Enable Show in view to automatically "
|
ImGuiToolkit::ButtonToggle(ICON_FA_MAP_MARKED_ALT, &Settings::application.action_history_follow_view, "Show action View");
|
||||||
"navigate to the view where the action was done.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::PopStyleColor(1);
|
ImGui::PopStyleColor(1);
|
||||||
|
|||||||
Reference in New Issue
Block a user