Skip to content

Commit

Permalink
Merge pull request #58 from darkxex/master
Browse files Browse the repository at this point in the history
Deprecated Embedded Styles
  • Loading branch information
darkxex authored Mar 1, 2022
2 parents fcca9ee + 24b54dd commit 6bb9980
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions source/UI/playerWindows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ namespace playerWindows{
ignorestyleidx = 0;
initScale = configini->getSubFontScale(false);

mpv_command_string(libmpv->getHandle(),"no-osd set sub-ass yes ; no-osd seek 0");
mpv_command_string(libmpv->getHandle(),"no-osd set sub-ass-override no ; no-osd seek 0");
libmpv->setSubScaleSize(initScale,false);
libmpv->setShadowOffset(drag_shadowposition,false);
libmpv->setShadowIntensity(drag_shadowintensity,false);
Expand All @@ -631,23 +631,35 @@ namespace playerWindows{
ImGui::Separator();
ImGui::Dummy(ImVec2(0.0f,1.0f));
//ignore styles
ImGui::SetCursorPosX((windowWidth - ImGui::CalcTextSize("Embedded Styles", NULL, true).x) * 0.5f);
ImGui::SetCursorPosX((windowWidth - ImGui::CalcTextSize("Styles Override", NULL, true).x) * 0.5f);
ImGui::PushItemWidth(200-10);
ImGui::Text("Embedded Styles");
std::vector<std::string> stylemenu = {"Activated","Deactivated"};
if (ImGui::BeginCombo("Embedded Styles", stylemenu[ignorestyleidx].c_str(), 0))
ImGui::Text("Styles Override");
std::vector<std::string> stylemenu = {"No","Yes","Force","Scale","Strip"};
if (ImGui::BeginCombo("Styles Override", stylemenu[ignorestyleidx].c_str(), 0))
{
for (int n = 0; n < stylemenu.size(); n++)
{
const bool is_selected = (ignorestyleidx == n);
if (ImGui::Selectable(stylemenu[n].c_str(), is_selected)){
if(n == 0){
ignorestyleidx = 0;
mpv_command_string(libmpv->getHandle(),"no-osd set sub-ass yes ; no-osd seek 0");
mpv_command_string(libmpv->getHandle(),"no-osd set sub-ass-override no ; no-osd seek 0");
}
if(n == 1){
ignorestyleidx = 1;
mpv_command_string(libmpv->getHandle(),"no-osd set sub-ass no ; no-osd seek 0");
mpv_command_string(libmpv->getHandle(),"no-osd set sub-ass-override yes ; no-osd seek 0");
}
if(n == 2){
ignorestyleidx = 2;
mpv_command_string(libmpv->getHandle(),"no-osd set sub-ass-override force ; no-osd seek 0");
}
if(n == 3){
ignorestyleidx = 3;
mpv_command_string(libmpv->getHandle(),"no-osd set sub-ass-override scale ; no-osd seek 0");
}
if(n == 4){
ignorestyleidx = 4;
mpv_command_string(libmpv->getHandle(),"no-osd set sub-ass-override strip ; no-osd seek 0");
}
}

Expand Down

0 comments on commit 6bb9980

Please sign in to comment.