mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
slight adjustment stippling and layers view
This commit is contained in:
@@ -219,7 +219,7 @@ Source * Mixer::createSourceFile(std::string path)
|
||||
|
||||
// test type of file by extension
|
||||
std::string ext = SystemToolkit::extension_filename(path);
|
||||
if ( ext == "vmx" )
|
||||
if ( ext == "mix" )
|
||||
{
|
||||
// create a session source
|
||||
SessionSource *ss = new SessionSource();
|
||||
|
||||
@@ -118,6 +118,7 @@ public:
|
||||
|
||||
// get hold on the main window
|
||||
inline RenderingWindow& mainWindow() { return main_; }
|
||||
inline RenderingWindow& outputWindow() { return output_; }
|
||||
|
||||
// request screenshot
|
||||
void requestScreenshot();
|
||||
|
||||
@@ -92,6 +92,10 @@ Source::Source() : initialized_(false), need_update_(true)
|
||||
overlays_[View::LAYER] = new Group;
|
||||
overlays_[View::LAYER]->translation_.z = 0.15;
|
||||
overlays_[View::LAYER]->visible_ = false;
|
||||
frame = new Frame(Frame::ROUND_LARGE);
|
||||
frame->translation_.z = 0.1;
|
||||
frame->color = glm::vec4( COLOR_HIGHLIGHT_SOURCE, 1.f);
|
||||
overlays_[View::LAYER]->attach(frame);
|
||||
groups_[View::LAYER]->attach(overlays_[View::LAYER]);
|
||||
|
||||
// will be associated to nodes later
|
||||
@@ -159,7 +163,7 @@ void Source::attach(FrameBuffer *renderbuffer)
|
||||
groups_[View::RENDERING]->attach(rendersurface_);
|
||||
groups_[View::GEOMETRY]->attach(rendersurface_);
|
||||
groups_[View::MIXING]->attach(rendersurface_);
|
||||
groups_[View::LAYER]->attach(rendersurface_);
|
||||
// groups_[View::LAYER]->attach(rendersurface_);
|
||||
|
||||
// for mixing view, add another surface to overlay (for stippled view in transparency)
|
||||
Surface *surfacemix = new FrameBufferSurface(renderbuffer_);
|
||||
|
||||
@@ -70,7 +70,7 @@ static void SessionFileDialogOpen(std::string path)
|
||||
sessionFileDialogLoadFinished_ = false;
|
||||
|
||||
char const * open_file_name;
|
||||
char const * open_pattern[1] = { "*.vmx" };
|
||||
char const * open_pattern[1] = { "*.mix" };
|
||||
|
||||
open_file_name = tinyfd_openFileDialog( "Open a session file", path.c_str(), 1, open_pattern, "vimix session", 0);
|
||||
|
||||
@@ -88,7 +88,7 @@ static void SessionFileDialogSave(std::string path)
|
||||
sessionFileDialogSaveFinished_ = false;
|
||||
|
||||
char const * save_file_name;
|
||||
char const * save_pattern[1] = { "*.vmx" };
|
||||
char const * save_pattern[1] = { "*.mix" };
|
||||
|
||||
save_file_name = tinyfd_saveFileDialog( "Save a session file", path.c_str(), 1, save_pattern, "vimix session");
|
||||
|
||||
@@ -99,8 +99,8 @@ static void SessionFileDialogSave(std::string path)
|
||||
sessionFileDialogFilename_ = std::string( save_file_name );
|
||||
// check extension
|
||||
std::string extension = sessionFileDialogFilename_.substr(sessionFileDialogFilename_.find_last_of(".") + 1);
|
||||
if (extension != "vmx")
|
||||
sessionFileDialogFilename_ += ".vmx";
|
||||
if (extension != "mix")
|
||||
sessionFileDialogFilename_ += ".mix";
|
||||
}
|
||||
|
||||
sessionFileDialogSaveFinished_ = true;
|
||||
@@ -112,7 +112,7 @@ static void ImportFileDialogOpen(char *filename, std::atomic<bool> *success, con
|
||||
return;
|
||||
fileDialogPending_ = true;
|
||||
|
||||
char const * open_pattern[18] = { "*.vmx", "*.mp4", "*.mpg", "*.avi", "*.mov", "*.mkv", "*.webm", "*.mod", "*.wmv", "*.mxf", "*.ogg", "*.flv", "*.asf", "*.jpg", "*.png", "*.gif", "*.tif", "*.svg" };
|
||||
char const * open_pattern[18] = { "*.mix", "*.mp4", "*.mpg", "*.avi", "*.mov", "*.mkv", "*.webm", "*.mod", "*.wmv", "*.mxf", "*.ogg", "*.flv", "*.asf", "*.jpg", "*.png", "*.gif", "*.tif", "*.svg" };
|
||||
char const * open_file_name;
|
||||
|
||||
open_file_name = tinyfd_openFileDialog( "Import a file", path.c_str(), 18, open_pattern, "All supported formats", 0);
|
||||
@@ -665,6 +665,13 @@ void UserInterface::RenderPreview()
|
||||
float width = ImGui::GetContentRegionAvail().x;
|
||||
|
||||
ImVec2 imagesize ( width, width / ar);
|
||||
// virtual button to show the output window when clic on the preview
|
||||
ImVec2 draw_pos = ImGui::GetCursorScreenPos();
|
||||
if (ImGui::Selectable("##preview", false, ImGuiSelectableFlags_PressedOnClick, imagesize))
|
||||
Rendering::manager().outputWindow().show();
|
||||
ImGui::SetCursorScreenPos(draw_pos);
|
||||
|
||||
// preview image
|
||||
ImGui::Image((void*)(intptr_t)output->texture(), imagesize);
|
||||
|
||||
ImGui::End();
|
||||
@@ -1193,7 +1200,7 @@ void Navigator::RenderNewPannel()
|
||||
|
||||
// helper
|
||||
ImGui::SetCursorPosX(pannel_width_ - 30 + IMGUI_RIGHT_ALIGN);
|
||||
ImGuiToolkit::HelpMarker("Create a source from a file:\n- Video (*.mpg, *mov, *.avi, etc.)\n- Image (*.jpg, *.png, etc.)\n- Vector graphics (*.svg)\n- vimix session (*.vmx)\n\nEquivalent to dropping the file in the workspace.");
|
||||
ImGuiToolkit::HelpMarker("Create a source from a file:\n- Video (*.mpg, *mov, *.avi, etc.)\n- Image (*.jpg, *.png, etc.)\n- Vector graphics (*.svg)\n- vimix session (*.mix)\n\nEquivalent to dropping the file in the workspace.");
|
||||
|
||||
// browse for a filename
|
||||
static std::atomic<bool> file_selected = false;
|
||||
|
||||
@@ -23,8 +23,8 @@ void main()
|
||||
float maskIntensity = (maskColor.r + maskColor.g + maskColor.b) / 3.0;
|
||||
|
||||
float A = textureColor.a * vertexColor.a * color.a * maskIntensity;
|
||||
A *= int(gl_FragCoord.x + gl_FragCoord.y) % 2 > (1 - int(stipple)) ? 0.0 : 0.8;
|
||||
A -= stipple * ( int(gl_FragCoord.x + gl_FragCoord.y) % 2 > 0 ? 0.0 : 9.0 );
|
||||
|
||||
// output RGBA
|
||||
FragColor = vec4(RGB, A);
|
||||
FragColor = vec4(RGB, clamp(A, 0.0, 1.0) );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user