mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 10:19:59 +01:00
Integrated view selection in navigator side bar.
This commit is contained in:
@@ -5,11 +5,10 @@ using namespace std;
|
||||
#include "tinyxml2Toolkit.h"
|
||||
using namespace tinyxml2;
|
||||
|
||||
#include "defines.h"
|
||||
#include "Settings.h"
|
||||
#include "SystemToolkit.h"
|
||||
|
||||
#define SETTINGS_BASEFILENAME "vmix.xml"
|
||||
|
||||
|
||||
Settings::Application Settings::application;
|
||||
static string settingsFilename = "";
|
||||
@@ -24,6 +23,7 @@ void Settings::Save()
|
||||
xmlDoc.InsertEndChild(pRoot);
|
||||
|
||||
string comment = "Settings for " + application.name;
|
||||
comment += "Version " + std::to_string(APP_VERSION_MAJOR) + "." + std::to_string(APP_VERSION_MINOR);
|
||||
XMLComment *pComment = xmlDoc.NewComment(comment.c_str());
|
||||
pRoot->InsertEndChild(pComment);
|
||||
|
||||
@@ -88,7 +88,7 @@ void Settings::Save()
|
||||
}
|
||||
|
||||
if (settingsFilename.empty())
|
||||
settingsFilename = SystemToolkit::settings_prepend_path(SETTINGS_BASEFILENAME);
|
||||
settingsFilename = SystemToolkit::settings_prepend_path(APP_SETTINGS);
|
||||
|
||||
XMLError eResult = xmlDoc.SaveFile(settingsFilename.c_str());
|
||||
XMLResultError(eResult);
|
||||
@@ -98,7 +98,7 @@ void Settings::Load()
|
||||
{
|
||||
XMLDocument xmlDoc;
|
||||
if (settingsFilename.empty())
|
||||
settingsFilename = SystemToolkit::settings_prepend_path(SETTINGS_BASEFILENAME);
|
||||
settingsFilename = SystemToolkit::settings_prepend_path(APP_SETTINGS);
|
||||
XMLError eResult = xmlDoc.LoadFile(settingsFilename.c_str());
|
||||
|
||||
// do not warn if non existing file
|
||||
|
||||
@@ -29,6 +29,7 @@ using namespace std;
|
||||
#define PATH_SETTINGS "/.config/"
|
||||
#endif
|
||||
|
||||
#include "defines.h"
|
||||
#include "SystemToolkit.h"
|
||||
|
||||
|
||||
@@ -86,7 +87,7 @@ string SystemToolkit::settings_path()
|
||||
if (SystemToolkit::file_exists(settingspath)) {
|
||||
// good, we have a place to put the settings file
|
||||
// settings should be in 'vmix' subfolder
|
||||
settingspath += "vmix";
|
||||
settingspath += APP_NAME;
|
||||
|
||||
// 3. create the vmix subfolder in settings folder if not existing already
|
||||
if ( !SystemToolkit::file_exists(settingspath)) {
|
||||
|
||||
@@ -333,7 +333,7 @@ void UserInterface::Terminate()
|
||||
ImGui::DestroyContext();
|
||||
}
|
||||
|
||||
MainWindow::MainWindow()
|
||||
ToolBox::ToolBox()
|
||||
{
|
||||
show_app_about = false;
|
||||
show_gst_about = false;
|
||||
@@ -344,12 +344,12 @@ MainWindow::MainWindow()
|
||||
screenshot_step = 0;
|
||||
}
|
||||
|
||||
void MainWindow::ToggleLogs()
|
||||
void ToolBox::ToggleLogs()
|
||||
{
|
||||
Settings::application.logs = !Settings::application.logs;
|
||||
}
|
||||
|
||||
void MainWindow::StartScreenshot()
|
||||
void ToolBox::StartScreenshot()
|
||||
{
|
||||
screenshot_step = 1;
|
||||
}
|
||||
@@ -506,7 +506,7 @@ static void ShowAboutGStreamer(bool* p_open)
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::Render()
|
||||
void ToolBox::Render()
|
||||
{
|
||||
// first run
|
||||
ImGui::SetNextWindowPos(ImVec2(40, 40), ImGuiCond_FirstUseEver);
|
||||
@@ -569,35 +569,6 @@ void MainWindow::Render()
|
||||
ImGui::EndMenuBar();
|
||||
}
|
||||
|
||||
// Select view
|
||||
|
||||
bool selected_view[4] = { false, false, false, false };
|
||||
selected_view[ Settings::application.current_view ] = true;
|
||||
|
||||
// if ( ImGuiToolkit::ButtonToggle())
|
||||
float width = ImGui::GetContentRegionAvail().x / 3;
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_SelectableTextAlign, ImVec2(0.50f, 0.50f));
|
||||
if (ImGui::Selectable( ICON_FA_BULLSEYE " Mixing", &selected_view[1], 0, ImVec2(width,50)))
|
||||
{
|
||||
Mixer::manager().setCurrentView(View::MIXING);
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Selectable( ICON_FA_SIGN " Geometry", &selected_view[2], 0, ImVec2(width,50)))
|
||||
{
|
||||
Mixer::manager().setCurrentView(View::GEOMETRY);
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Selectable( ICON_FA_BARS " Layers", &selected_view[3], 0, ImVec2(width,50)))
|
||||
{
|
||||
|
||||
}
|
||||
ImGui::PopStyleVar();
|
||||
|
||||
// ImGuiToolkit::PushFont(ImGuiToolkit::FONT_LARGE);
|
||||
// ImGui::Text("Some text");
|
||||
// ImGui::PopFont();
|
||||
|
||||
|
||||
// TEMPLATE CODE FOR FILE BROWSER
|
||||
// if( ImGui::Button( ICON_FA_FOLDER_OPEN " Open File" ) && !loadThread.joinable())
|
||||
// {
|
||||
@@ -666,8 +637,8 @@ void UserInterface::RenderPreview()
|
||||
FrameBuffer *output = Mixer::manager().session()->frame();
|
||||
if (output)
|
||||
{
|
||||
ImGui::SetNextWindowPos(ImVec2(100, 300), ImGuiCond_FirstUseEver);
|
||||
ImGui::SetNextWindowSize(ImVec2(640, 480), ImGuiCond_FirstUseEver);
|
||||
ImGui::SetNextWindowPos(ImVec2(850, 450), ImGuiCond_FirstUseEver);
|
||||
ImGui::SetNextWindowSize(ImVec2(380, 260), ImGuiCond_FirstUseEver);
|
||||
ImGui::Begin(ICON_FA_LAPTOP " Preview", &Settings::application.preview, ImGuiWindowFlags_NoScrollbar);
|
||||
float width = ImGui::GetContentRegionAvail().x;
|
||||
|
||||
@@ -693,7 +664,7 @@ void UserInterface::RenderMediaPlayer()
|
||||
}
|
||||
|
||||
ImGui::SetNextWindowPos(ImVec2(200, 200), ImGuiCond_FirstUseEver);
|
||||
ImGui::SetNextWindowSize(ImVec2(300, 300), ImGuiCond_FirstUseEver);
|
||||
ImGui::SetNextWindowSize(ImVec2(400, 300), ImGuiCond_FirstUseEver);
|
||||
|
||||
if ( !ImGui::Begin(IMGUI_TITLE_MEDIAPLAYER, &Settings::application.media_player, ImGuiWindowFlags_NoScrollbar) || !show)
|
||||
{
|
||||
@@ -900,13 +871,16 @@ void UserInterface::RenderShaderEditor()
|
||||
}
|
||||
|
||||
|
||||
SourceNavigator::SourceNavigator()
|
||||
Navigator::Navigator()
|
||||
{
|
||||
clearSelection();
|
||||
selected_source_index = -1;
|
||||
width = 100;
|
||||
height = 100;
|
||||
padding_width = 100;
|
||||
}
|
||||
|
||||
void SourceNavigator::toggle(int index)
|
||||
void Navigator::toggle(int index)
|
||||
{
|
||||
bool s = selected_button[index];
|
||||
clearSelection();
|
||||
@@ -917,13 +891,13 @@ void SourceNavigator::toggle(int index)
|
||||
selected_source_index = -1;
|
||||
}
|
||||
|
||||
void SourceNavigator::clearSelection()
|
||||
void Navigator::clearSelection()
|
||||
{
|
||||
for(int i=0; i<NAV_COUNT; ++i)
|
||||
selected_button[i] = false;
|
||||
}
|
||||
|
||||
void SourceNavigator::Render()
|
||||
void Navigator::Render()
|
||||
{
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
ImGuiStyle& style = ImGui::GetStyle();
|
||||
@@ -933,25 +907,28 @@ void SourceNavigator::Render()
|
||||
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(COLOR_NAVIGATOR, 1.f));
|
||||
|
||||
ImGuiToolkit::PushFont(ImGuiToolkit::FONT_LARGE);
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_SelectableTextAlign, ImVec2(0.50f, 0.50f));
|
||||
|
||||
float window_width = 2.f * ImGui::GetTextLineHeightWithSpacing();
|
||||
ImGui::SetNextWindowPos( ImVec2(0, 0), ImGuiCond_Always );
|
||||
ImGui::SetNextWindowSize(ImVec2( window_width, io.DisplaySize.y), ImGuiCond_Always );
|
||||
ImGui::SetNextWindowBgAlpha(0.95f); // Transparent background
|
||||
|
||||
float icon_width = window_width - 2.f * style.WindowPadding.x;
|
||||
// calculate size of items based on text size and display dimensions
|
||||
width = 2.f * ImGui::GetTextLineHeightWithSpacing();
|
||||
padding_width = 2.f * style.WindowPadding.x;
|
||||
height = io.DisplaySize.y;
|
||||
sourcelist_height = height - 6 * ImGui::GetTextLineHeight();
|
||||
float icon_width = width - 2.f * style.WindowPadding.x;
|
||||
ImVec2 iconsize(icon_width, icon_width);
|
||||
|
||||
// Left bar top
|
||||
ImGui::SetNextWindowPos( ImVec2(0, 0), ImGuiCond_Always );
|
||||
ImGui::SetNextWindowSize( ImVec2(width, sourcelist_height), ImGuiCond_Always );
|
||||
ImGui::SetNextWindowBgAlpha(0.95f); // Transparent background
|
||||
if (ImGui::Begin("##navigator", NULL, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav))
|
||||
{
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_SelectableTextAlign, ImVec2(0.50f, 0.50f));
|
||||
|
||||
// the "=" icon for menu
|
||||
if (ImGui::Selectable( ICON_FA_BARS, &selected_button[NAV_MENU], 0, iconsize))
|
||||
{
|
||||
toggle(NAV_MENU);
|
||||
}
|
||||
|
||||
// the list of INITIALS for sources
|
||||
int index = 0;
|
||||
SourceList::iterator iter;
|
||||
for (iter = Mixer::manager().session()->begin(); iter != Mixer::manager().session()->end(); iter++, index++)
|
||||
@@ -979,92 +956,45 @@ void SourceNavigator::Render()
|
||||
Mixer::manager().unsetCurrentSource();
|
||||
toggle(NAV_NEW);
|
||||
}
|
||||
ImGui::PopStyleVar();
|
||||
|
||||
}
|
||||
ImGui::End();
|
||||
|
||||
// Left bar bottom
|
||||
ImGui::SetNextWindowPos( ImVec2(0, sourcelist_height), ImGuiCond_Always );
|
||||
ImGui::SetNextWindowSize( ImVec2(width, height - sourcelist_height), ImGuiCond_Always );
|
||||
ImGui::SetNextWindowBgAlpha(0.95f); // Transparent background
|
||||
if (ImGui::Begin("##navigatorViews", NULL, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav))
|
||||
{
|
||||
bool selected_view[4] = { false, false, false, false };
|
||||
selected_view[ Settings::application.current_view ] = true;
|
||||
if (ImGui::Selectable( ICON_FA_BULLSEYE, &selected_view[1], 0, iconsize))
|
||||
{
|
||||
Mixer::manager().setCurrentView(View::MIXING);
|
||||
}
|
||||
if (ImGui::Selectable( ICON_FA_SIGN , &selected_view[2], 0, iconsize))
|
||||
{
|
||||
Mixer::manager().setCurrentView(View::GEOMETRY);
|
||||
}
|
||||
if (ImGui::Selectable( ICON_FA_CUBE, &selected_view[3], 0, iconsize))
|
||||
{
|
||||
// TODO : Layers view
|
||||
}
|
||||
}
|
||||
ImGui::End();
|
||||
|
||||
ImGui::PopStyleVar();
|
||||
ImGui::PopFont();
|
||||
|
||||
// window menu
|
||||
if (selected_button[NAV_MENU])
|
||||
{
|
||||
// Next window is a side pannel
|
||||
ImGui::SetNextWindowPos( ImVec2(window_width, 0), ImGuiCond_Always );
|
||||
ImGui::SetNextWindowSize(ImVec2( 5.f * window_width, io.DisplaySize.y), ImGuiCond_Always );
|
||||
ImGui::SetNextWindowBgAlpha(0.85f); // Transparent background
|
||||
if (ImGui::Begin("##navigatorNewSource", NULL, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav))
|
||||
{
|
||||
// TITLE
|
||||
ImGuiToolkit::PushFont(ImGuiToolkit::FONT_LARGE);
|
||||
ImGui::Text("vimix");
|
||||
ImGui::PopFont();
|
||||
|
||||
ImGui::Text("Windows");
|
||||
ImGuiToolkit::ButtonSwitch( IMGUI_TITLE_PREVIEW, &Settings::application.preview);
|
||||
ImGuiToolkit::ButtonSwitch( IMGUI_TITLE_MEDIAPLAYER, &Settings::application.media_player);
|
||||
ImGuiToolkit::ButtonSwitch( IMGUI_TITLE_SHADEREDITOR, &Settings::application.shader_editor);
|
||||
ImGuiToolkit::ButtonSwitch( ICON_FA_TACHOMETER_ALT " Metrics", &Settings::application.stats);
|
||||
ImGuiToolkit::ButtonSwitch( ICON_FA_LIST " Logs", &Settings::application.logs, "Ctrl + L");
|
||||
|
||||
ImGui::Text("Appearance");
|
||||
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
||||
if ( ImGui::SliderFloat("Scale", &Settings::application.scale, 0.8f, 1.2f, "%.1f"))
|
||||
ImGui::GetIO().FontGlobalScale = Settings::application.scale;
|
||||
|
||||
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
||||
if ( ImGui::Combo("Color", &Settings::application.accent_color, "Blue\0Orange\0Grey\0\0"))
|
||||
ImGuiToolkit::SetAccentColor(static_cast<ImGuiToolkit::accent_color>(Settings::application.accent_color));
|
||||
|
||||
}
|
||||
ImGui::End();
|
||||
RenderMainPannel();
|
||||
}
|
||||
// window to create a source
|
||||
else if (selected_button[NAV_NEW])
|
||||
{
|
||||
// Next window is a side pannel
|
||||
ImGui::SetNextWindowPos( ImVec2(window_width, 0), ImGuiCond_Always );
|
||||
ImGui::SetNextWindowSize(ImVec2( 5.f * window_width, io.DisplaySize.y), ImGuiCond_Always );
|
||||
ImGui::SetNextWindowBgAlpha(0.85f); // Transparent background
|
||||
if (ImGui::Begin("##navigatorNewSource", NULL, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav))
|
||||
{
|
||||
// TITLE
|
||||
ImGuiToolkit::PushFont(ImGuiToolkit::FONT_LARGE);
|
||||
ImGui::Text("New Source");
|
||||
ImGui::PopFont();
|
||||
|
||||
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
||||
static int new_source_type = 0;
|
||||
ImGui::Combo("Type", &new_source_type, "Media\0Render\0Clone\0");
|
||||
if (new_source_type == 0) {
|
||||
|
||||
static char filename[128];
|
||||
if (ImGuiToolkit::ButtonIcon(2, 5)) {
|
||||
|
||||
}
|
||||
ImGui::SameLine(0, 10);
|
||||
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
||||
ImGui::InputText("Filename", filename, 64, ImGuiInputTextFlags_CharsNoBlank);
|
||||
|
||||
// Description
|
||||
ImGuiToolkit::HelpMarker("A Media source displays an image or a video file.");
|
||||
|
||||
}
|
||||
else if (new_source_type == 1){
|
||||
|
||||
ImGuiToolkit::HelpMarker("A Render source replicates the rendering of the output.");
|
||||
}
|
||||
else {
|
||||
|
||||
ImGuiToolkit::HelpMarker("A Clone source duplicates the content of another source.");
|
||||
}
|
||||
|
||||
if ( ImGui::Button("Create !", ImVec2(5.f * window_width - 2.f * style.WindowPadding.x, 0)) ) {
|
||||
|
||||
selected_button[NAV_NEW] = false;
|
||||
}
|
||||
|
||||
}
|
||||
ImGui::End();
|
||||
RenderNewPannel();
|
||||
}
|
||||
// window to configure a selected source
|
||||
else if (selected_source_index > -1)
|
||||
@@ -1073,45 +1003,130 @@ void SourceNavigator::Render()
|
||||
Source *s = Mixer::manager().currentSource();
|
||||
clearSelection();
|
||||
selected_button[Mixer::manager().indexCurrentSource()] = true;
|
||||
|
||||
if (s)
|
||||
{
|
||||
// Next window is a side pannel
|
||||
ImGui::SetNextWindowPos( ImVec2(window_width, 0), ImGuiCond_Always );
|
||||
ImGui::SetNextWindowSize(ImVec2( 5.f * window_width, io.DisplaySize.y), ImGuiCond_Always );
|
||||
ImGui::SetNextWindowBgAlpha(0.85f); // Transparent background
|
||||
if (ImGui::Begin("##navigatorNewSource", NULL, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav))
|
||||
{
|
||||
// TITLE
|
||||
ImGuiToolkit::PushFont(ImGuiToolkit::FONT_LARGE);
|
||||
ImGui::Text("Source");
|
||||
ImGui::PopFont();
|
||||
|
||||
static char buf5[128];
|
||||
sprintf ( buf5, "%s", s->name().c_str() );
|
||||
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
||||
if (ImGui::InputText("Name", buf5, 64, ImGuiInputTextFlags_CharsNoBlank)){
|
||||
Mixer::manager().renameSource(s, buf5);
|
||||
}
|
||||
// blending pannel
|
||||
static ImGuiVisitor v;
|
||||
s->blendingShader()->accept(v);
|
||||
// preview
|
||||
float width = ImGui::GetContentRegionAvail().x IMGUI_RIGHT_ALIGN;
|
||||
ImVec2 imagesize ( width, width / s->frame()->aspectRatio());
|
||||
ImGui::Image((void*)(uintptr_t) s->frame()->texture(), imagesize);
|
||||
// image processing pannel
|
||||
s->processingShader()->accept(v);
|
||||
|
||||
}
|
||||
ImGui::End();
|
||||
|
||||
}
|
||||
|
||||
RenderSourcePannel(s);
|
||||
}
|
||||
|
||||
ImGui::PopStyleColor(2);
|
||||
ImGui::PopStyleVar(1);
|
||||
ImGui::PopStyleVar();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
void Navigator::RenderSourcePannel(Source *s)
|
||||
{
|
||||
if (s)
|
||||
{
|
||||
// Next window is a side pannel
|
||||
ImGui::SetNextWindowPos( ImVec2(width, 0), ImGuiCond_Always );
|
||||
ImGui::SetNextWindowSize( ImVec2( 5.f * width, height), ImGuiCond_Always );
|
||||
ImGui::SetNextWindowBgAlpha(0.85f); // Transparent background
|
||||
if (ImGui::Begin("##navigatorNewSource", NULL, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav))
|
||||
{
|
||||
// TITLE
|
||||
ImGuiToolkit::PushFont(ImGuiToolkit::FONT_LARGE);
|
||||
ImGui::Text("Source");
|
||||
ImGui::PopFont();
|
||||
|
||||
static char buf5[128];
|
||||
sprintf ( buf5, "%s", s->name().c_str() );
|
||||
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
||||
if (ImGui::InputText("Name", buf5, 64, ImGuiInputTextFlags_CharsNoBlank)){
|
||||
Mixer::manager().renameSource(s, buf5);
|
||||
}
|
||||
// blending pannel
|
||||
static ImGuiVisitor v;
|
||||
s->blendingShader()->accept(v);
|
||||
// preview
|
||||
float width = ImGui::GetContentRegionAvail().x IMGUI_RIGHT_ALIGN;
|
||||
ImVec2 imagesize ( width, width / s->frame()->aspectRatio());
|
||||
ImGui::Image((void*)(uintptr_t) s->frame()->texture(), imagesize);
|
||||
// image processing pannel
|
||||
s->processingShader()->accept(v);
|
||||
|
||||
}
|
||||
ImGui::End();
|
||||
}
|
||||
}
|
||||
|
||||
void Navigator::RenderNewPannel()
|
||||
{
|
||||
// Next window is a side pannel
|
||||
ImGui::SetNextWindowPos( ImVec2(width, 0), ImGuiCond_Always );
|
||||
ImGui::SetNextWindowSize( ImVec2( 5.f * width, height), ImGuiCond_Always );
|
||||
ImGui::SetNextWindowBgAlpha(0.85f); // Transparent background
|
||||
if (ImGui::Begin("##navigatorNewSource", NULL, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav))
|
||||
{
|
||||
// TITLE
|
||||
ImGuiToolkit::PushFont(ImGuiToolkit::FONT_LARGE);
|
||||
ImGui::Text("New Source");
|
||||
ImGui::PopFont();
|
||||
|
||||
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
||||
static int new_source_type = 0;
|
||||
ImGui::Combo("Type", &new_source_type, "Media\0Render\0Clone\0");
|
||||
if (new_source_type == 0) {
|
||||
|
||||
static char filename[128];
|
||||
if (ImGuiToolkit::ButtonIcon(2, 5)) {
|
||||
|
||||
}
|
||||
ImGui::SameLine(0, 10);
|
||||
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
||||
ImGui::InputText("Filename", filename, 64, ImGuiInputTextFlags_CharsNoBlank);
|
||||
|
||||
// Description
|
||||
ImGuiToolkit::HelpMarker("A Media source displays an image or a video file.");
|
||||
|
||||
}
|
||||
else if (new_source_type == 1){
|
||||
|
||||
ImGuiToolkit::HelpMarker("A Render source replicates the rendering of the output.");
|
||||
}
|
||||
else {
|
||||
|
||||
ImGuiToolkit::HelpMarker("A Clone source duplicates the content of another source.");
|
||||
}
|
||||
|
||||
if ( ImGui::Button("Create !", ImVec2(5.f * width - padding_width, 0)) ) {
|
||||
|
||||
selected_button[NAV_NEW] = false;
|
||||
}
|
||||
|
||||
}
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
void Navigator::RenderMainPannel()
|
||||
{
|
||||
// Next window is a side pannel
|
||||
ImGui::SetNextWindowPos( ImVec2(width, 0), ImGuiCond_Always );
|
||||
ImGui::SetNextWindowSize( ImVec2( 5.f * width, height), ImGuiCond_Always );
|
||||
ImGui::SetNextWindowBgAlpha(0.85f); // Transparent background
|
||||
if (ImGui::Begin("##navigatorNewSource", NULL, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav))
|
||||
{
|
||||
// TITLE
|
||||
ImGuiToolkit::PushFont(ImGuiToolkit::FONT_LARGE);
|
||||
ImGui::Text("vimix");
|
||||
ImGui::PopFont();
|
||||
|
||||
ImGui::Text("Windows");
|
||||
ImGuiToolkit::ButtonSwitch( IMGUI_TITLE_PREVIEW, &Settings::application.preview);
|
||||
ImGuiToolkit::ButtonSwitch( IMGUI_TITLE_MEDIAPLAYER, &Settings::application.media_player);
|
||||
ImGuiToolkit::ButtonSwitch( IMGUI_TITLE_SHADEREDITOR, &Settings::application.shader_editor);
|
||||
ImGuiToolkit::ButtonSwitch( ICON_FA_TACHOMETER_ALT " Metrics", &Settings::application.stats);
|
||||
ImGuiToolkit::ButtonSwitch( ICON_FA_LIST " Logs", &Settings::application.logs, "Ctrl + L");
|
||||
|
||||
ImGui::Text("Appearance");
|
||||
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
||||
if ( ImGui::SliderFloat("Scale", &Settings::application.scale, 0.8f, 1.2f, "%.1f"))
|
||||
ImGui::GetIO().FontGlobalScale = Settings::application.scale;
|
||||
|
||||
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
||||
if ( ImGui::Combo("Color", &Settings::application.accent_color, "Blue\0Orange\0Grey\0\0"))
|
||||
ImGuiToolkit::SetAccentColor(static_cast<ImGuiToolkit::accent_color>(Settings::application.accent_color));
|
||||
|
||||
}
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,20 +10,35 @@ using namespace std;
|
||||
#define NAV_NEW 65
|
||||
#define NAV_MENU 66
|
||||
|
||||
class SourceNavigator
|
||||
struct ImVec2;
|
||||
class Source;
|
||||
|
||||
class Navigator
|
||||
{
|
||||
// top items : group of buttons openning a pannel
|
||||
int selected_source_index;
|
||||
bool selected_button[NAV_COUNT];
|
||||
void clearSelection();
|
||||
void toggle(int index);
|
||||
|
||||
// bottom items : individual buttons
|
||||
|
||||
float width;
|
||||
float height;
|
||||
float sourcelist_height;
|
||||
float padding_width;
|
||||
|
||||
void RenderSourcePannel(Source *s);
|
||||
void RenderNewPannel();
|
||||
void RenderMainPannel();
|
||||
|
||||
public:
|
||||
SourceNavigator();
|
||||
Navigator();
|
||||
|
||||
void Render();
|
||||
};
|
||||
|
||||
class MainWindow
|
||||
class ToolBox
|
||||
{
|
||||
bool show_app_about;
|
||||
bool show_gst_about;
|
||||
@@ -34,7 +49,7 @@ class MainWindow
|
||||
unsigned int screenshot_step;
|
||||
|
||||
public:
|
||||
MainWindow();
|
||||
ToolBox();
|
||||
|
||||
void ToggleLogs();
|
||||
void StartScreenshot();
|
||||
@@ -43,9 +58,10 @@ public:
|
||||
|
||||
class UserInterface
|
||||
{
|
||||
friend class MainWindow;
|
||||
MainWindow mainwindow;
|
||||
SourceNavigator navigator;
|
||||
friend class ToolBox;
|
||||
Navigator navigator;
|
||||
ToolBox mainwindow;
|
||||
|
||||
std::string currentTextEdit;
|
||||
|
||||
void handleKeyboard();
|
||||
|
||||
2
View.cpp
2
View.cpp
@@ -48,7 +48,7 @@ MixingView::MixingView() : View(MIXING)
|
||||
if ( Settings::application.views[View::MIXING].name.empty() ) {
|
||||
// no settings found: store application default
|
||||
Settings::application.views[View::MIXING].name = "Mixing";
|
||||
scene.root()->scale_ = glm::vec3(1.6f, 1.6f, 1.0f);
|
||||
scene.root()->scale_ = glm::vec3(2.0f, 2.0f, 1.0f);
|
||||
saveSettings();
|
||||
}
|
||||
else
|
||||
|
||||
10
defines.h
10
defines.h
@@ -1,9 +1,11 @@
|
||||
#ifndef VMIX_DEFINES_H
|
||||
#define VMIX_DEFINES_H
|
||||
|
||||
#define APP_NAME "vmix"
|
||||
#define APP_TITLE "v-mix -- Video Live Mixer"
|
||||
#define APP_VERSION "0.0.1"
|
||||
#define APP_NAME "vimix"
|
||||
#define APP_TITLE "vimix -- Video Live Mixer"
|
||||
#define APP_SETTINGS "vimix.xml"
|
||||
#define APP_VERSION_MAJOR 0
|
||||
#define APP_VERSION_MINOR 1
|
||||
#define XML_VERSION_MAJOR 0
|
||||
#define XML_VERSION_MINOR 1
|
||||
|
||||
@@ -23,7 +25,7 @@
|
||||
#define SCENE_DEPTH -10.f
|
||||
#define CIRCLE_SQUARE_DIST(x,y) ( (x*x + y*y) / (SCENE_UNIT * SCENE_UNIT * SCENE_UNIT * SCENE_UNIT) )
|
||||
|
||||
#define IMGUI_TITLE_MAINWINDOW ICON_FA_CIRCLE_NOTCH " v-mix"
|
||||
#define IMGUI_TITLE_MAINWINDOW ICON_FA_CIRCLE_NOTCH " vimix"
|
||||
#define IMGUI_TITLE_MEDIAPLAYER ICON_FA_FILM " Media Player"
|
||||
#define IMGUI_TITLE_SHADEREDITOR ICON_FA_CODE " Shader Editor"
|
||||
#define IMGUI_TITLE_PREVIEW ICON_FA_LAPTOP " Preview"
|
||||
|
||||
Reference in New Issue
Block a user