diff --git a/include/gui.h b/include/gui.h index dfe79e1..0ba06ba 100644 --- a/include/gui.h +++ b/include/gui.h @@ -94,7 +94,6 @@ enum PLAYER_RIGHT_MENU_STATES { PLAYER_RIGHT_MENU_TRACKS_AUDIO, PLAYER_RIGHT_MENU_TRACKS_SUB, PLAYER_RIGHT_MENU_CHAPTERS, - PLAYER_RIGHT_MENU_INTERPOLATION, PLAYER_RIGHT_MENU_ARATIO, PLAYER_RIGHT_MENU_CUSTOMARATIO, PLAYER_RIGHT_MENU_IMAGE, diff --git a/include/playerwindows.h b/include/playerwindows.h index 926409e..da5d297 100644 --- a/include/playerwindows.h +++ b/include/playerwindows.h @@ -78,7 +78,6 @@ namespace playerWindows{ void RightTrackVideoWindow(bool *focus, bool *first_item); void RightTrackAudioWindow(bool *focus, bool *first_item); void RightTrackSubWindow(bool *focus, bool *first_item); - void RightHomeInterpolation(bool *focus, bool *first_item); void RightHomeAnime4K(bool *focus, bool *first_item); void RightHomeARatio(bool *focus, bool *first_item); void RightHomeCustomARatio(bool *focus, bool *first_item); diff --git a/source/UI/playerWindows.cpp b/source/UI/playerWindows.cpp index ae317e7..78fbe18 100644 --- a/source/UI/playerWindows.cpp +++ b/source/UI/playerWindows.cpp @@ -51,7 +51,7 @@ namespace playerWindows{ rightmenuposX = item.rightmenu_startpos; if(item.rightmenu_startpos>1080)item.rightmenu_startpos-=10; playerWindows::SetupRightWindow(); - std::vector topmenu = {"Tracks","Chapters","Aspect Ratio","Interpolation","Image","Audio","Subtitle","ShaderMania","Anime4K v4.0.1"}; + std::vector topmenu = {"Tracks","Chapters","Aspect Ratio","Image","Audio","Subtitle","ShaderMania","Anime4K v4.0.1"}; if (ImGui::Begin("Right Menu Home", nullptr, ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoScrollbar)) { ImGui::SetNextWindowFocus(); if (ImGui::BeginListBox("Right Menu Home List",ImVec2(1280.0f, 720.0f))){ @@ -67,9 +67,6 @@ namespace playerWindows{ if(topmenu[n] == "Aspect Ratio"){ item.rightmenustate = PLAYER_RIGHT_MENU_ARATIO; } - if(topmenu[n] == "Interpolation"){ - item.rightmenustate = PLAYER_RIGHT_MENU_INTERPOLATION; - } if(topmenu[n] == "Image"){ item.rightmenustate = PLAYER_RIGHT_MENU_IMAGE; } @@ -327,64 +324,6 @@ namespace playerWindows{ playerWindows::ExitWindow(); } - void RightHomeInterpolation(bool *focus, bool *first_item){ - playerWindows::SetupRightWindow(); - if (ImGui::Begin("Right Menu Sub", nullptr, ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoScrollbar)) { - ImGui::PushItemWidth(200-10); - auto windowWidth = ImGui::GetWindowSize().x; - //New interpolation - ImGui::SetCursorPosX((windowWidth - ImGui::CalcTextSize("Interpolation", NULL, true).x) * 0.5f); - ImGui::PushItemWidth(200-10); - ImGui::Text("Interpolation"); - std::vector intermenu = {"Deactivated","Catmull_Rom","Mitchell","Bicubic","OverSample"}; - if (ImGui::BeginCombo("Interpolation", intermenu[interpolationidx].c_str(), 0)) - { - for (int n = 0; n < intermenu.size(); n++) - { - const bool is_selected = (interpolationidx == n); - if (ImGui::Selectable(intermenu[n].c_str(), is_selected)){ - if(n == 0){ - interpolationidx = 0; - mpv_command_string(libmpv->getHandle(),"set video-sync audio ; set interpolation no ; show-text \"Interpolation: ${interpolation}\nVideoSync: ${video-sync}\""); - } - if(n == 1){ - interpolationidx = 1; - mpv_command_string(libmpv->getHandle(),"set video-sync display-resample ; set interpolation yes ; set tscale catmull_rom ; show-text \"Interpolation: ${interpolation}\nMethod: ${tscale}\nVideoSync: ${video-sync}\""); - } - if(n == 2){ - interpolationidx = 2; - mpv_command_string(libmpv->getHandle(),"set video-sync display-resample ; set interpolation yes ; set tscale mitchell ; show-text \"Interpolation: ${interpolation}\nMethod: ${tscale}\nVideoSync: ${video-sync}\""); - } - if(n == 3){ - interpolationidx = 3; - mpv_command_string(libmpv->getHandle(),"set video-sync display-resample ; set interpolation yes ; set tscale bicubic ; show-text \"Interpolation: ${interpolation}\nMethod: ${tscale}\nVideoSync: ${video-sync}\""); - } - if(n == 4){ - interpolationidx = 4; - mpv_command_string(libmpv->getHandle(),"set video-sync display-resample ; set interpolation yes ; set tscale oversample ; show-text \"Interpolation: ${interpolation}\nMethod: ${tscale}\nVideoSync: ${video-sync}\""); - } - } - - - if (is_selected) - ImGui::SetItemDefaultFocus(); - } - ImGui::EndCombo(); - ImGui::PopItemWidth(); - } - ImGui::SetCursorPosY(ImGui::GetWindowSize().y -50); - if(ImGui::Button("Reset to Default")){ - interpolationidx = 0; - mpv_command_string(libmpv->getHandle(),"set video-sync audio ; set interpolation no ; show-text \"Interpolation: ${interpolation}\nVideoSync: ${video-sync}\""); - - } - //end new interpolation - - - } - playerWindows::ExitWindow(); - - } void RightHomeARatio(bool *focus, bool *first_item){ playerWindows::SetupRightWindow(); std::vector topmenu = {"Default","16:9","16:10","4:3","Custom Ratio"}; @@ -534,6 +473,47 @@ namespace playerWindows{ } ImGui::EndCombo(); } + //New interpolation + ImGui::SetCursorPosX((windowWidth - ImGui::CalcTextSize("Interpolation", NULL, true).x) * 0.5f); + ImGui::PushItemWidth(200-10); + ImGui::Text("Interpolation"); + std::vector intermenu = {"No","Catmull_Rom","Mitchell","Bicubic","OverSample"}; + if (ImGui::BeginCombo("Interpolation", intermenu[interpolationidx].c_str(), 0)) + { + for (int n = 0; n < intermenu.size(); n++) + { + const bool is_selected = (interpolationidx == n); + if (ImGui::Selectable(intermenu[n].c_str(), is_selected)){ + if(n == 0){ + interpolationidx = 0; + mpv_command_string(libmpv->getHandle(),"set video-sync audio ; set interpolation no ; show-text \"Interpolation: ${interpolation}\nVideoSync: ${video-sync}\""); + } + if(n == 1){ + interpolationidx = 1; + mpv_command_string(libmpv->getHandle(),"set video-sync display-resample ; set interpolation yes ; set tscale catmull_rom ; show-text \"Interpolation: ${interpolation}\nMethod: ${tscale}\nVideoSync: ${video-sync}\""); + } + if(n == 2){ + interpolationidx = 2; + mpv_command_string(libmpv->getHandle(),"set video-sync display-resample ; set interpolation yes ; set tscale mitchell ; show-text \"Interpolation: ${interpolation}\nMethod: ${tscale}\nVideoSync: ${video-sync}\""); + } + if(n == 3){ + interpolationidx = 3; + mpv_command_string(libmpv->getHandle(),"set video-sync display-resample ; set interpolation yes ; set tscale bicubic ; show-text \"Interpolation: ${interpolation}\nMethod: ${tscale}\nVideoSync: ${video-sync}\""); + } + if(n == 4){ + interpolationidx = 4; + mpv_command_string(libmpv->getHandle(),"set video-sync display-resample ; set interpolation yes ; set tscale oversample ; show-text \"Interpolation: ${interpolation}\nMethod: ${tscale}\nVideoSync: ${video-sync}\""); + } + } + + + if (is_selected) + ImGui::SetItemDefaultFocus(); + } + ImGui::EndCombo(); + ImGui::PopItemWidth(); + } + //end new interpolation ImGui::PopItemWidth(); @@ -546,6 +526,8 @@ namespace playerWindows{ drag_gamma = 0; drag_hue = 0; rotateidx = 0; + interpolationidx = 0; + mpv_command_string(libmpv->getHandle(),"set video-sync audio ; set interpolation no ; show-text \"Interpolation: ${interpolation}\nVideoSync: ${video-sync}\""); configini->setDeinterlace(configini->getDeinterlace(false)); libmpv->setDeinterlace(configini->getDeinterlace(false)); libmpv->setBrightness(drag_hue,false); diff --git a/source/gui.cpp b/source/gui.cpp index a4ef5d0..0c7b037 100644 --- a/source/gui.cpp +++ b/source/gui.cpp @@ -590,9 +590,6 @@ namespace GUI { else if(item.rightmenustate == PLAYER_RIGHT_MENU_CHAPTERS){ item.rightmenustate = PLAYER_RIGHT_MENU_HOME; } - else if(item.rightmenustate == PLAYER_RIGHT_MENU_INTERPOLATION){ - item.rightmenustate = PLAYER_RIGHT_MENU_HOME; - } else if(item.rightmenustate == PLAYER_RIGHT_MENU_ANIME4K){ item.rightmenustate = PLAYER_RIGHT_MENU_HOME; } @@ -902,9 +899,6 @@ namespace GUI { case PLAYER_RIGHT_MENU_CHAPTERS: playerWindows::RightChapterWindow(&item.rightmenu_focus,&item.rightmenu_first_item); break; - case PLAYER_RIGHT_MENU_INTERPOLATION: - playerWindows::RightHomeInterpolation(&item.rightmenu_focus,&item.rightmenu_first_item); - break; case PLAYER_RIGHT_MENU_ANIME4K: playerWindows::RightHomeAnime4K(&item.rightmenu_focus,&item.rightmenu_first_item); break;