mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-20 06:39:59 +01:00
Add icon to show hardware decoding info in source panel
This commit is contained in:
@@ -666,8 +666,9 @@ void ImGuiVisitor::visit (Source& s)
|
|||||||
|
|
||||||
void ImGuiVisitor::visit (MediaSource& s)
|
void ImGuiVisitor::visit (MediaSource& s)
|
||||||
{
|
{
|
||||||
ImVec2 top = ImGui::GetCursorPos();
|
ImVec2 _top = ImGui::GetCursorPos();
|
||||||
top.x = 0.5f * ImGui::GetFrameHeight() + ImGui::GetContentRegionAvail().x IMGUI_RIGHT_ALIGN;
|
_top.x = 0.5f * ImGui::GetFrameHeight() + ImGui::GetContentRegionAvail().x IMGUI_RIGHT_ALIGN;
|
||||||
|
ImVec2 top = _top;
|
||||||
|
|
||||||
// Media info
|
// Media info
|
||||||
ImGui::PushTextWrapPos(ImGui::GetCursorPos().x + ImGui::GetContentRegionAvail().x IMGUI_RIGHT_ALIGN);
|
ImGui::PushTextWrapPos(ImGui::GetCursorPos().x + ImGui::GetContentRegionAvail().x IMGUI_RIGHT_ALIGN);
|
||||||
@@ -694,6 +695,16 @@ void ImGuiVisitor::visit (MediaSource& s)
|
|||||||
if (ImGuiToolkit::IconButton(ICON_FA_FOLDER_OPEN, "Show in finder"))
|
if (ImGuiToolkit::IconButton(ICON_FA_FOLDER_OPEN, "Show in finder"))
|
||||||
SystemToolkit::open(SystemToolkit::path_filename(s.path()));
|
SystemToolkit::open(SystemToolkit::path_filename(s.path()));
|
||||||
|
|
||||||
|
// Icon to inform hardware decoding
|
||||||
|
std::string decoder = s.mediaplayer()->decoderName();
|
||||||
|
if ( decoder.compare("software") != 0) {
|
||||||
|
top = _top;
|
||||||
|
top.y += ImGui::GetFrameHeight();
|
||||||
|
ImGui::SetCursorPos(top);
|
||||||
|
decoder = "Using hardware decoder\n" + decoder;
|
||||||
|
ImGuiToolkit::Indication(decoder.c_str(), ICON_FA_MICROCHIP);
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::SetCursorPos(botom);
|
ImGui::SetCursorPos(botom);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Reference in New Issue
Block a user