mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-13 19:29:58 +01:00
Cleanup session properties panel
This commit is contained in:
@@ -1081,21 +1081,6 @@ void UserInterface::RenderPreview()
|
|||||||
Settings::application.widget.preview = false;
|
Settings::application.widget.preview = false;
|
||||||
if (ImGui::BeginMenu(IMGUI_TITLE_PREVIEW))
|
if (ImGui::BeginMenu(IMGUI_TITLE_PREVIEW))
|
||||||
{
|
{
|
||||||
// glm::ivec2 p = FrameBuffer::getParametersFromResolution(output->resolution());
|
|
||||||
// std::ostringstream info;
|
|
||||||
// info << "Resolution " << output->width() << "x" << output->height();
|
|
||||||
// if (p.x > -1)
|
|
||||||
// info << " " << FrameBuffer::aspect_ratio_name[p.x] ;
|
|
||||||
// ImGui::MenuItem(info.str().c_str(), nullptr, false, false);
|
|
||||||
// // cannot change resolution when recording
|
|
||||||
// if (video_recorder_ == nullptr && p.y > -1) {
|
|
||||||
// ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
|
||||||
// if (ImGui::Combo("Height", &p.y, FrameBuffer::resolution_name, IM_ARRAYSIZE(FrameBuffer::resolution_name) ) )
|
|
||||||
// {
|
|
||||||
// glm::vec3 res = FrameBuffer::getResolutionFromParameters(p.x, p.y);
|
|
||||||
// Mixer::manager().session()->setResolution(res);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
if ( ImGui::MenuItem( ICON_FA_PLUS " Insert Rendering Source") )
|
if ( ImGui::MenuItem( ICON_FA_PLUS " Insert Rendering Source") )
|
||||||
Mixer::manager().addSource( Mixer::manager().createSourceRender() );
|
Mixer::manager().addSource( Mixer::manager().createSourceRender() );
|
||||||
|
|
||||||
@@ -4184,40 +4169,67 @@ void Navigator::RenderMainPannelVimix()
|
|||||||
//
|
//
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
ImGui::Text("Current");
|
ImGui::Text("Current");
|
||||||
|
|
||||||
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
||||||
ImGui::Combo("##SelectHistory", &Settings::application.pannel_history_mode,
|
ImGui::Combo("##SelectHistory", &Settings::application.pannel_history_mode,
|
||||||
ICON_FA_STAR " Snapshots\0" ICON_FA_HISTORY " Undo history\0" ICON_FA_FILE_ALT " Properties\0");
|
ICON_FA_STAR " Snapshots\0" ICON_FA_HISTORY " Undo history\0" ICON_FA_FILE_ALT " Properties\0");
|
||||||
|
|
||||||
|
//
|
||||||
|
// Current 2. PROPERTIES
|
||||||
|
//
|
||||||
if (Settings::application.pannel_history_mode > 1) {
|
if (Settings::application.pannel_history_mode > 1) {
|
||||||
|
|
||||||
std::string sessionfilename = Mixer::manager().session()->filename();
|
std::string sessionfilename = Mixer::manager().session()->filename();
|
||||||
|
|
||||||
// Information and resolution
|
// Information and resolution
|
||||||
FrameBuffer *output = Mixer::manager().session()->frame();
|
const FrameBuffer *output = Mixer::manager().session()->frame();
|
||||||
if (output)
|
if (output)
|
||||||
{
|
{
|
||||||
// fill information buffer
|
// get parameters to edit resolution
|
||||||
ImGuiTextBuffer info;
|
|
||||||
if (!sessionfilename.empty())
|
|
||||||
info.appendf("%s\n", SystemToolkit::filename(sessionfilename).c_str());
|
|
||||||
else
|
|
||||||
info.append("<unsaved>\n");
|
|
||||||
info.appendf("Sources: %d\n", Mixer::manager().session()->numSource());
|
|
||||||
|
|
||||||
glm::ivec2 p = FrameBuffer::getParametersFromResolution(output->resolution());
|
glm::ivec2 p = FrameBuffer::getParametersFromResolution(output->resolution());
|
||||||
if (p.x > -1)
|
|
||||||
info.appendf("Ratio: %s\n", FrameBuffer::aspect_ratio_name[p.x]);
|
|
||||||
info.appendf("Resolution: %dx%d", output->width(), output->height());
|
|
||||||
|
|
||||||
// Show info text bloc (multi line, dark background)
|
// Basic information on session
|
||||||
ImGuiToolkit::PushFont( ImGuiToolkit::FONT_MONO );
|
ImGuiToolkit::PushFont( ImGuiToolkit::FONT_MONO );
|
||||||
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(0.14f, 0.14f, 0.14f, 0.9f));
|
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, 0.75);
|
||||||
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
if (sessionfilename.empty())
|
||||||
ImGui::InputTextMultiline("##Info", (char *)info.c_str(), info.size(), ImVec2(IMGUI_RIGHT_ALIGN, 4*ImGui::GetTextLineHeightWithSpacing()), ImGuiInputTextFlags_ReadOnly);
|
ImGui::Text(" <unsaved>");
|
||||||
ImGui::PopStyleColor(1);
|
else
|
||||||
|
ImGui::Text(" %s", SystemToolkit::filename(sessionfilename).c_str());
|
||||||
|
if (p.x > -1)
|
||||||
|
ImGui::Text(" %dx%dpx, %s", output->width(), output->height(), FrameBuffer::aspect_ratio_name[p.x]);
|
||||||
|
else
|
||||||
|
ImGui::Text(" %dx%dpx", output->width(), output->height());
|
||||||
|
ImGui::PopStyleVar();
|
||||||
ImGui::PopFont();
|
ImGui::PopFont();
|
||||||
|
|
||||||
|
// Kept for later? Larger info box with more details on the session file...
|
||||||
|
// ImGuiTextBuffer info;
|
||||||
|
// if (!sessionfilename.empty())
|
||||||
|
// info.appendf("%s\n", SystemToolkit::filename(sessionfilename).c_str());
|
||||||
|
// else
|
||||||
|
// info.append("<unsaved>\n");
|
||||||
|
// info.appendf("%dx%dpx", output->width(), output->height());
|
||||||
|
// if (p.x > -1)
|
||||||
|
// info.appendf(", %s", FrameBuffer::aspect_ratio_name[p.x]);
|
||||||
|
// // content info
|
||||||
|
// const uint N = Mixer::manager().session()->numSource();
|
||||||
|
// if (N > 1)
|
||||||
|
// info.appendf("\n%d sources", N);
|
||||||
|
// else if (N > 0)
|
||||||
|
// info.append("\n1 source");
|
||||||
|
// const size_t M = MediaPlayer::registered().size();
|
||||||
|
// if (M > 0) {
|
||||||
|
// info.appendf("\n%d media files:", M);
|
||||||
|
// for (auto mit = MediaPlayer::begin(); mit != MediaPlayer::end(); ++mit)
|
||||||
|
// info.appendf("\n- %s", SystemToolkit::filename((*mit)->filename()).c_str());
|
||||||
|
// }
|
||||||
|
// // Show info text bloc (multi line, dark background)
|
||||||
|
// ImGuiToolkit::PushFont( ImGuiToolkit::FONT_MONO );
|
||||||
|
// ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(0.14f, 0.14f, 0.14f, 0.9f));
|
||||||
|
// ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
||||||
|
// ImGui::InputTextMultiline("##Info", (char *)info.c_str(), info.size(), ImVec2(IMGUI_RIGHT_ALIGN, 2*ImGui::GetTextLineHeightWithSpacing()), ImGuiInputTextFlags_ReadOnly);
|
||||||
|
// ImGui::PopStyleColor(1);
|
||||||
|
// ImGui::PopFont();
|
||||||
|
|
||||||
// change resolution (height only)
|
// change resolution (height only)
|
||||||
if (p.y > -1) {
|
if (p.y > -1) {
|
||||||
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
||||||
@@ -4247,7 +4259,7 @@ void Navigator::RenderMainPannelVimix()
|
|||||||
// Thumbnail
|
// Thumbnail
|
||||||
static Thumbnail _file_thumbnail;
|
static Thumbnail _file_thumbnail;
|
||||||
static FrameBufferImage *thumbnail = nullptr;
|
static FrameBufferImage *thumbnail = nullptr;
|
||||||
if ( ImGui::Button( ICON_FA_TAGS " Capture thumbnail", ImVec2(IMGUI_RIGHT_ALIGN, 0)) ) {
|
if ( ImGui::Button( ICON_FA_TAG " Capture thumbnail", ImVec2(IMGUI_RIGHT_ALIGN, 0)) ) {
|
||||||
Mixer::manager().session()->setThumbnail();
|
Mixer::manager().session()->setThumbnail();
|
||||||
thumbnail = nullptr;
|
thumbnail = nullptr;
|
||||||
}
|
}
|
||||||
@@ -4263,6 +4275,7 @@ void Navigator::RenderMainPannelVimix()
|
|||||||
if (_file_thumbnail.filled()) {
|
if (_file_thumbnail.filled()) {
|
||||||
ImGui::BeginTooltip();
|
ImGui::BeginTooltip();
|
||||||
_file_thumbnail.Render(230);
|
_file_thumbnail.Render(230);
|
||||||
|
ImGui::Text("This thumbnail will be used\nin the sessions list above.");
|
||||||
ImGui::EndTooltip();
|
ImGui::EndTooltip();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4287,7 +4300,8 @@ void Navigator::RenderMainPannelVimix()
|
|||||||
|
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// UNDO History
|
// Current 1. UNDO History
|
||||||
|
//
|
||||||
else if (Settings::application.pannel_history_mode > 0) {
|
else if (Settings::application.pannel_history_mode > 0) {
|
||||||
|
|
||||||
static uint _over = 0;
|
static uint _over = 0;
|
||||||
@@ -4374,7 +4388,8 @@ void Navigator::RenderMainPannelVimix()
|
|||||||
ImGuiToolkit::ToolTip("Show in view");
|
ImGuiToolkit::ToolTip("Show in view");
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// SNAPSHOTS
|
// Current 0. SNAPSHOTS
|
||||||
|
//
|
||||||
else {
|
else {
|
||||||
static uint64_t _over = 0;
|
static uint64_t _over = 0;
|
||||||
static bool _tooltip = 0;
|
static bool _tooltip = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user