mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-15 20:29:58 +01:00
Minor improvements
Display hourglass in left panel to inform source is loading and prevent buttons when loading + Varia.
This commit is contained in:
@@ -463,7 +463,15 @@ void ImGuiVisitor::visit (Source& s)
|
||||
if (s.ready()) {
|
||||
ImGui::SetCursorPos( ImVec2(pos.x + 0.5f * (preview_width-width), pos.y + 0.5f * (preview_height-height-space)) );
|
||||
ImGui::Image((void*)(uintptr_t) s.frame()->texture(), ImVec2(width, height));
|
||||
} else {
|
||||
ImGuiToolkit::PushFont(ImGuiToolkit::FONT_LARGE);
|
||||
ImGui::SetCursorPos(
|
||||
ImVec2(pos.x + (preview_width - ImGui::GetFrameHeight()) * 0.5f,
|
||||
pos.y + (preview_height - ImGui::GetFrameHeight()) * 0.5f));
|
||||
ImGui::Text(ICON_FA_HOURGLASS_HALF);
|
||||
ImGui::PopFont();
|
||||
}
|
||||
|
||||
// inform on visibility status
|
||||
ImGui::SetCursorPos( ImVec2(preview_width + 20, pos.y ) );
|
||||
if (s.active()) {
|
||||
@@ -637,9 +645,9 @@ void ImGuiVisitor::visit (Source& s)
|
||||
ImGui::Image((void*)(uintptr_t) s.frame()->texture(), ImVec2(width, height));
|
||||
|
||||
// centered icon of failed (skull)
|
||||
ImGui::SetCursorPos( ImVec2(pos.x + (width -ImGui::GetFrameHeightWithSpacing())* 0.5f ,
|
||||
pos.y + (height -ImGui::GetFrameHeightWithSpacing()) * 0.5f) );
|
||||
ImGuiToolkit::PushFont(ImGuiToolkit::FONT_LARGE);
|
||||
ImGui::SetCursorPos( ImVec2(pos.x + (preview_width -ImGui::GetFrameHeight())* 0.5f ,
|
||||
pos.y + (preview_height -ImGui::GetFrameHeight()) * 0.5f) );
|
||||
ImGui::Text(ICON_FA_SKULL);
|
||||
ImGui::PopFont();
|
||||
|
||||
@@ -753,10 +761,12 @@ void ImGuiVisitor::visit (MediaSource& s)
|
||||
ImGui::SetCursorPos(botom);
|
||||
|
||||
// because sometimes the error comes from gpu decoding
|
||||
if ( Settings::application.render.gpu_decoding && SystemToolkit::file_exists(s.path()) )
|
||||
if ( Settings::application.render.gpu_decoding &&
|
||||
SystemToolkit::file_exists(s.path()) &&
|
||||
!s.mediaplayer()->softwareDecodingForced() )
|
||||
{
|
||||
// offer to reload the source without hardware decoding
|
||||
if ( ImGui::Button( ICON_FA_REDO_ALT " Try again without\nhardware decoding", ImVec2(IMGUI_RIGHT_ALIGN, 0)) ) {
|
||||
if ( ImGui::Button( ICON_FA_REDO_ALT " Try again ", ImVec2(IMGUI_RIGHT_ALIGN, 0)) ) {
|
||||
// replace current source with one created with a flag forcing software decoding
|
||||
Mixer::manager().replaceSource(Mixer::manager().currentSource(),
|
||||
Mixer::manager().createSourceFile(s.path(), true));
|
||||
@@ -1420,8 +1430,10 @@ void ImGuiVisitor::visit (PatternSource& s)
|
||||
{
|
||||
for (uint p = 0; p < Pattern::count(); ++p){
|
||||
pattern_descriptor pattern = Pattern::get(p);
|
||||
std::string label = pattern.label + (pattern.animated ? " " ICON_FA_PLAY_CIRCLE : " ");
|
||||
if (pattern.available && ImGui::Selectable( label.c_str(), p == s.pattern()->type() )) {
|
||||
std::string label = pattern.label;
|
||||
if (pattern.available &&
|
||||
pattern.animated == s.playable() &&
|
||||
ImGui::Selectable( label.c_str(), p == s.pattern()->type() )) {
|
||||
s.setPattern(p, s.pattern()->resolution());
|
||||
info.reset();
|
||||
std::ostringstream oss;
|
||||
@@ -1448,7 +1460,7 @@ void ImGuiVisitor::visit (PatternSource& s)
|
||||
top.x += ImGui::GetFrameHeight();
|
||||
}
|
||||
ImGui::SetCursorPos(top);
|
||||
if (ImGuiToolkit::IconButton(ICON_FA_COPY, "Copy"))
|
||||
if (ImGuiToolkit::IconButton(ICON_FA_COPY, "Copy gstreamer code"))
|
||||
ImGui::SetClipboardText(Pattern::get( s.pattern()->type() ).pipeline.c_str());
|
||||
}
|
||||
else
|
||||
|
||||
@@ -657,7 +657,7 @@ const char* BlurFilter::method_label[BlurFilter::BLUR_INVALID] = {
|
||||
};
|
||||
|
||||
std::vector< FilteringProgram > BlurFilter::programs_ = {
|
||||
FilteringProgram("Gaussian", "shaders/filters/blur_1.glsl", "shaders/filters/blur_2.glsl", { { "Radius", 0.5} }),
|
||||
FilteringProgram("Gaussian", "shaders/filters/blur_1.glsl", "shaders/filters/blur_2.glsl", { { "Radius", 0.55} }),
|
||||
FilteringProgram("Scattered","shaders/filters/hashedblur.glsl", "", { { "Radius", 0.5}, { "Iterations", 0.25 } }),
|
||||
FilteringProgram("Opening", "shaders/filters/hashederosion.glsl", "shaders/filters/hasheddilation.glsl", { { "Radius", 0.5} }),
|
||||
FilteringProgram("Closing", "shaders/filters/hasheddilation.glsl","shaders/filters/hashederosion.glsl", { { "Radius", 0.5} }),
|
||||
@@ -800,7 +800,7 @@ const char* SharpenFilter::method_label[SharpenFilter::SHARPEN_INVALID] = {
|
||||
};
|
||||
|
||||
std::vector< FilteringProgram > SharpenFilter::programs_ = {
|
||||
FilteringProgram("UnsharpMask", "shaders/filters/sharpen_1.glsl", "shaders/filters/sharpen_2.glsl", { { "Amount", 0.5} }),
|
||||
FilteringProgram("UnsharpMask", "shaders/filters/sharpen_1.glsl", "shaders/filters/sharpen_2.glsl", { { "Amount", 0.25} }),
|
||||
FilteringProgram("Sharpen", "shaders/filters/sharpen.glsl", "", { { "Amount", 0.5} }),
|
||||
FilteringProgram("Sharp Edge", "shaders/filters/sharpenedge.glsl","", { { "Amount", 0.25} }),
|
||||
FilteringProgram("TopHat", "shaders/filters/erosion.glsl", "shaders/filters/tophat.glsl", { { "Radius", 0.5} }),
|
||||
|
||||
@@ -1446,7 +1446,7 @@ void MediaPlayer::execute_seek_command(GstClockTime target, bool force)
|
||||
if (seek_event && gst_element_send_event(pipeline_, seek_event) ) {
|
||||
seeking_ = true;
|
||||
#ifdef MEDIA_PLAYER_DEBUG
|
||||
g_printerr("MediaPlayer %s Seek %ld %.1f", std::to_string(id_).c_str(), seek_pos, rate_);
|
||||
g_printerr("MediaPlayer %s Seek %ld %.1f\n", std::to_string(id_).c_str(), seek_pos, rate_);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
|
||||
@@ -405,7 +405,7 @@ glm::ivec2 TextSource::icon() const
|
||||
std::string TextSource::info() const
|
||||
{
|
||||
if ( contents()->isSubtitle() )
|
||||
return "Subtitle text";
|
||||
return "Subtitle file";
|
||||
else
|
||||
return "Free text";
|
||||
return "Text";
|
||||
}
|
||||
|
||||
@@ -3558,8 +3558,13 @@ void Navigator::RenderSourcePannel(Source *s, const ImVec2 &iconsize)
|
||||
}
|
||||
}
|
||||
|
||||
// clone button
|
||||
///
|
||||
/// ACTION BUTTONS PANEL if not loading
|
||||
///
|
||||
ImGui::Text(" ");
|
||||
if (s->ready() || s->failed()) {
|
||||
|
||||
// clone button
|
||||
if ( s->failed() ) {
|
||||
ImGuiToolkit::ButtonDisabled( ICON_FA_SHARE_SQUARE " Clone & Filter", ImVec2(ImGui::GetContentRegionAvail().x, 0));
|
||||
}
|
||||
@@ -3603,7 +3608,7 @@ void Navigator::RenderSourcePannel(Source *s, const ImVec2 &iconsize)
|
||||
}
|
||||
ImGui::PopStyleColor(1);
|
||||
}
|
||||
|
||||
}
|
||||
ImGui::End();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user