Source replacement and create source with software decoder

This commit is contained in:
Bruno Herbelin
2023-05-31 19:27:08 +02:00
parent c2c7c37ef6
commit ced318637f
3 changed files with 33 additions and 11 deletions

View File

@@ -694,15 +694,29 @@ void ImGuiVisitor::visit (MediaSource& s)
if (ImGuiToolkit::IconButton(ICON_FA_FOLDER_OPEN, "Show in finder"))
SystemToolkit::open(SystemToolkit::path_filename(s.path()));
ImGui::SetCursorPos(botom);
}
else {
// failed
ImGui::SetCursorPos(top);
if (ImGuiToolkit::IconButton(ICON_FA_COPY, "Copy message"))
ImGui::SetClipboardText(info.str().c_str());
info.reset();
ImGui::SetCursorPos(botom);
// because sometimes the error comes from gpu decoding
if ( Settings::application.render.gpu_decoding )
{
// 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)) ) {
// replace current source with one created with a flag forcing software decoding
Mixer::manager().replaceSource(Mixer::manager().currentSource(),
Mixer::manager().createSourceFile(s.path(), true));
}
}
}
ImGui::SetCursorPos(botom);
}
void ImGuiVisitor::visit (SessionFileSource& s)