コード例 #1
0
ファイル: launcher.cpp プロジェクト: AlessandroOneto/M2
 const Matrix* Launcher::GetBIBasisMatrix(const Matrix* matrix, int toGroebner) const
 {
     if (!CheckMatrix(matrix))
     {
         return NULL;
     }
     
     switch(GetSettingsManager().GetMonomialOrder())
     {
         case Monom::Lex:
             {
                 BooleanInvolutiveBasis<MonomLex> basis(matrix, toGroebner);
                 return basis.ToMatrix();
             }
         case Monom::DegLex:
             {
                 BooleanInvolutiveBasis<MonomDL> basis(matrix, toGroebner);
                 return basis.ToMatrix();
             }
         case Monom::DegRevLex:
             {
                 BooleanInvolutiveBasis<MonomDRL> basis(matrix, toGroebner);
                 return basis.ToMatrix();
             }
         default:
             return 0;
     };
 }
コード例 #2
0
bool CGUIDialogAddonSettings::OnMessage(CGUIMessage &message)
{
  switch (message.GetMessage())
  {
    case GUI_MSG_CLICKED:
    {
      if (message.GetSenderId() == CONTROL_SETTINGS_CUSTOM_BUTTON)
      {
        OnResetSettings();
        return true;
      }
      break;
    }

    case GUI_MSG_SETTING_UPDATED:
    {
      std::string settingId = message.GetStringParam(0);
      std::string settingValue = message.GetStringParam(1);

      std::shared_ptr<CSetting> setting = GetSettingsManager()->GetSetting(settingId);
      if (setting != nullptr)
      {
        setting->FromString(settingValue);
        return true;
      }
      break;
    }

    default:
      break;
  }

  return CGUIDialogSettingsManagerBase::OnMessage(message);
}
コード例 #3
0
std::shared_ptr<CSettingSection> CGUIDialogAddonSettings::GetSection()
{
  const auto settingsManager = GetSettingsManager();
  if (settingsManager == nullptr)
    return nullptr;

  const auto sections = settingsManager->GetSections();
  if (!sections.empty())
    return sections.front();

  return nullptr;
}
コード例 #4
0
ファイル: CMakePlugin.cpp プロジェクト: AndrianDTR/codelite
void
CMakePlugin::ProcessBuildEvent(clBuildEvent& event, wxString param)
{
    wxString project = event.GetProjectName();
    const wxString config  = event.GetConfigurationName();

    // Get settings
    const CMakeProjectSettings* settings = GetSettingsManager()->GetProjectSettings(project, config);

    // Doesn't exists or not enabled
    if (!settings || !settings->enabled) {
        // Unable to export makefile
        event.Skip();
        return;
    }

    // Project has parent project
    if (!settings->parentProject.IsEmpty()) {
        // Add project name as target
        param = project + " " + param;
        // Build parent project
        project = settings->parentProject;
    }

    // Workspace directory
    const wxFileName workspaceDir = GetWorkspaceDirectory();

    // Use relative path
    wxFileName projectDir = GetProjectDirectory(project);
    projectDir.MakeRelativeTo(workspaceDir.GetFullPath());

    const wxString projectDirEsc = projectDir.GetPath(wxPATH_NO_SEPARATOR, wxPATH_UNIX);

    // Build command
    wxString cmd = "$(MAKE)";

    if (!projectDirEsc.IsEmpty())
        cmd += " -C \"" + projectDirEsc + "\"";

    // Add makefile
    cmd += " -f \"" + project + ".mk\"";

    // Add optional parameters
    if (!param.IsEmpty())
        cmd += " " + param;

    // The build command is simple make call with different makefile
    event.SetCommand(cmd);
}
コード例 #5
0
void CGUIDialogSubtitleSettings::FrameMove()
{
  if (g_application.GetAppPlayer().HasPlayer())
  {
    const CVideoSettings videoSettings = g_application.GetAppPlayer().GetVideoSettings();

    // these settings can change on the fly
    //! @todo m_settingsManager->SetBool(SETTING_SUBTITLE_ENABLE, g_application.GetAppPlayer().GetSubtitleVisible());
    //   \-> Unless subtitle visibility can change on the fly, while Dialog is up, this code should be removed.
    GetSettingsManager()->SetNumber(SETTING_SUBTITLE_DELAY, videoSettings.m_SubtitleDelay);
    //! @todo (needs special handling): m_settingsManager->SetInt(SETTING_SUBTITLE_STREAM, g_application.GetAppPlayer().GetSubtitle());
  }

  CGUIDialogSettingsManualBase::FrameMove();
}
コード例 #6
0
ファイル: CMakePlugin.cpp プロジェクト: kaustubhcs/codelite
void CMakePlugin::OnGetIsPluginMakefile(clBuildEvent& event)
{
    wxString project = event.GetProjectName();
    const wxString config = event.GetConfigurationName();

    // Get settings
    const CMakeProjectSettings* settings = GetSettingsManager()->GetProjectSettings(project, config);

    // Doesn't exists or not enabled
    if(!settings || !settings->enabled) {
        // Cannot provide custom makefile
        event.Skip();
        return;
    }

    // Custom makefile is provided
}
コード例 #7
0
void CGUIDialogCMSSettings::InitializeSettings()
{
  CGUIDialogSettingsManualBase::InitializeSettings();

  const std::shared_ptr<CSettingCategory> category = AddCategory("cms", -1);
  if (category == NULL)
  {
    CLog::Log(LOGERROR, "CGUIDialogCMSSettings: unable to setup settings");
    return;
  }

  // get all necessary setting groups
  const std::shared_ptr<CSettingGroup> groupColorManagement = AddGroup(category);
  if (groupColorManagement == NULL)
  {
    CLog::Log(LOGERROR, "CGUIDialogCMSSettings: unable to setup settings");
    return;
  }

  bool usePopup = g_SkinInfo->HasSkinFile("DialogSlider.xml");

  TranslatableIntegerSettingOptions entries;

  // create "depsCmsEnabled" for settings depending on CMS being enabled
  CSettingDependency dependencyCmsEnabled(SettingDependencyType::Enable, GetSettingsManager());
  dependencyCmsEnabled.Or()
    ->Add(CSettingDependencyConditionPtr(new CSettingDependencyCondition(SETTING_VIDEO_CMSENABLE, "true", SettingDependencyOperator::Equals, false, GetSettingsManager())));
  SettingDependencies depsCmsEnabled;
  depsCmsEnabled.push_back(dependencyCmsEnabled);

  // create "depsCms3dlut" for 3dlut settings
  CSettingDependency dependencyCms3dlut(SettingDependencyType::Visible, GetSettingsManager());
  dependencyCms3dlut.And()
    ->Add(CSettingDependencyConditionPtr(new CSettingDependencyCondition(SETTING_VIDEO_CMSMODE, std::to_string(CMS_MODE_3DLUT), SettingDependencyOperator::Equals, false, GetSettingsManager())));
  SettingDependencies depsCms3dlut;
  depsCms3dlut.push_back(dependencyCmsEnabled);
  depsCms3dlut.push_back(dependencyCms3dlut);

  // create "depsCmsIcc" for display settings with icc profile
  CSettingDependency dependencyCmsIcc(SettingDependencyType::Visible, GetSettingsManager());
  dependencyCmsIcc.And()
    ->Add(CSettingDependencyConditionPtr(new CSettingDependencyCondition(SETTING_VIDEO_CMSMODE, std::to_string(CMS_MODE_PROFILE), SettingDependencyOperator::Equals, false, GetSettingsManager())));
  SettingDependencies depsCmsIcc;
  depsCmsIcc.push_back(dependencyCmsEnabled);
  depsCmsIcc.push_back(dependencyCmsIcc);

  // create "depsCmsGamma" for effective gamma adjustment (not available with bt.1886)
  CSettingDependency dependencyCmsGamma(SettingDependencyType::Visible, GetSettingsManager());
  dependencyCmsGamma.And()
    ->Add(CSettingDependencyConditionPtr(new CSettingDependencyCondition(SETTING_VIDEO_CMSGAMMAMODE, std::to_string(CMS_TRC_BT1886), SettingDependencyOperator::Equals, true, GetSettingsManager())));
  SettingDependencies depsCmsGamma;
  depsCmsGamma.push_back(dependencyCmsEnabled);
  depsCmsGamma.push_back(dependencyCmsIcc);
  depsCmsGamma.push_back(dependencyCmsGamma);

  // color management settings
  AddToggle(groupColorManagement, SETTING_VIDEO_CMSENABLE, 36560, SettingLevel::Basic, CServiceBroker::GetSettings().GetBool(SETTING_VIDEO_CMSENABLE));

  int currentMode = CServiceBroker::GetSettings().GetInt(SETTING_VIDEO_CMSMODE);
  entries.clear();
  // entries.push_back(std::make_pair(16039, CMS_MODE_OFF)); // FIXME: get from CMS class
  entries.push_back(std::make_pair(36580, CMS_MODE_3DLUT));
#ifdef HAVE_LCMS2
  entries.push_back(std::make_pair(36581, CMS_MODE_PROFILE));
#endif
  std::shared_ptr<CSettingInt> settingCmsMode = AddSpinner(groupColorManagement, SETTING_VIDEO_CMSMODE, 36562, SettingLevel::Basic, currentMode, entries);
  settingCmsMode->SetDependencies(depsCmsEnabled);

  std::string current3dLUT = CServiceBroker::GetSettings().GetString(SETTING_VIDEO_CMS3DLUT);
  std::shared_ptr<CSettingString> settingCms3dlut = AddList(groupColorManagement, SETTING_VIDEO_CMS3DLUT, 36564, SettingLevel::Basic, current3dLUT, Cms3dLutsFiller, 36564);
  settingCms3dlut->SetDependencies(depsCms3dlut);

  // display settings
  int currentWhitepoint = CServiceBroker::GetSettings().GetInt(SETTING_VIDEO_CMSWHITEPOINT);
  entries.clear();
  entries.push_back(std::make_pair(36586, CMS_WHITEPOINT_D65));
  entries.push_back(std::make_pair(36587, CMS_WHITEPOINT_D93));
  std::shared_ptr<CSettingInt> settingCmsWhitepoint = AddSpinner(groupColorManagement, SETTING_VIDEO_CMSWHITEPOINT, 36568, SettingLevel::Basic, currentWhitepoint, entries);
  settingCmsWhitepoint->SetDependencies(depsCmsIcc);

  int currentPrimaries = CServiceBroker::GetSettings().GetInt(SETTING_VIDEO_CMSPRIMARIES);
  entries.clear();
  entries.push_back(std::make_pair(36588, CMS_PRIMARIES_AUTO));
  entries.push_back(std::make_pair(36589, CMS_PRIMARIES_BT709));
  entries.push_back(std::make_pair(36590, CMS_PRIMARIES_170M));
  entries.push_back(std::make_pair(36591, CMS_PRIMARIES_BT470M));
  entries.push_back(std::make_pair(36592, CMS_PRIMARIES_BT470BG));
  entries.push_back(std::make_pair(36593, CMS_PRIMARIES_240M));
  std::shared_ptr<CSettingInt> settingCmsPrimaries = AddSpinner(groupColorManagement, SETTING_VIDEO_CMSPRIMARIES, 36570, SettingLevel::Basic, currentPrimaries, entries);
  settingCmsPrimaries->SetDependencies(depsCmsIcc);

  int currentGammaMode = CServiceBroker::GetSettings().GetInt(SETTING_VIDEO_CMSGAMMAMODE);
  entries.clear();
  entries.push_back(std::make_pair(36582, CMS_TRC_BT1886));
  entries.push_back(std::make_pair(36583, CMS_TRC_INPUT_OFFSET));
  entries.push_back(std::make_pair(36584, CMS_TRC_OUTPUT_OFFSET));
  entries.push_back(std::make_pair(36585, CMS_TRC_ABSOLUTE));
  std::shared_ptr<CSettingInt> settingCmsGammaMode = AddSpinner(groupColorManagement, SETTING_VIDEO_CMSGAMMAMODE, 36572, SettingLevel::Basic, currentGammaMode, entries);
  settingCmsGammaMode->SetDependencies(depsCmsIcc);

  float currentGamma = CServiceBroker::GetSettings().GetInt(SETTING_VIDEO_CMSGAMMA)/100.0f;
  if (currentGamma == 0.0) currentGamma = 2.20;
  std::shared_ptr<CSettingNumber> settingCmsGamma = AddSlider(groupColorManagement, SETTING_VIDEO_CMSGAMMA, 36574, SettingLevel::Basic, currentGamma, 36597, 1.6, 0.05, 2.8, 36574, usePopup);
  settingCmsGamma->SetDependencies(depsCmsGamma);

  int currentLutSize = CServiceBroker::GetSettings().GetInt(SETTING_VIDEO_CMSLUTSIZE);
  entries.clear();
  entries.push_back(std::make_pair(36594, 4));
  entries.push_back(std::make_pair(36595, 6));
  entries.push_back(std::make_pair(36596, 8));
  std::shared_ptr<CSettingInt> settingCmsLutSize = AddSpinner(groupColorManagement, SETTING_VIDEO_CMSLUTSIZE, 36576, SettingLevel::Basic, currentLutSize, entries);
  settingCmsLutSize->SetDependencies(depsCmsIcc);
}
コード例 #8
0
ファイル: CMakePlugin.cpp プロジェクト: AndrianDTR/codelite
void
CMakePlugin::OnExportMakefile(clBuildEvent& event)
{
    const wxString project = event.GetProjectName();
    const wxString config  = event.GetConfigurationName();

    // Get settings
    const CMakeProjectSettings* settings = GetSettingsManager()->GetProjectSettings(project, config);

    // Doesn't exists or not enabled
    if (!settings || !settings->enabled) {
        // Unable to export makefile
        event.Skip();
        return;
    }

    // Get project directory - this is directory where the makefile is stored
    const wxFileName projectDir = GetProjectDirectory(project);

    // Targets forward inspired by
    // https://gist.github.com/doitian/4978329

    // Content of the generated makefile
    wxString content = wxString() <<
        "# Generated by CMakePlugin\n"
        ".PHONY: all clean $(MAKECMDGOALS)\n"
        "\n"
    ;

    // Parent project is set
    if (!settings->parentProject.IsEmpty()) {
        // Configure parent project instead
        const wxString& parentProject = settings->parentProject;
        settings = GetSettingsManager()->GetProjectSettings(parentProject, config);

        // Parent project not found
        if (!settings || !settings->enabled) {
            CL_ERROR("Unable to find or not enabled parent project "
                "'" + parentProject + "' for project '" + project + "'");
            return;
        }

        // Get parent project directory
        wxFileName parentProjectDir = GetProjectDirectory(parentProject);
        parentProjectDir.MakeRelativeTo(projectDir.GetFullPath());

        // Path is relative so UNIX path system can be used
        const wxString parentProjectDirEsc = parentProjectDir.GetPath(wxPATH_NO_SEPARATOR, wxPATH_UNIX);

        // Redirect make to the parent project
        content <<
            "# Parent project\n"
            "PARENT          := " << parentProjectDirEsc << "\n"
            "PARENT_MAKEFILE := " << parentProject << ".mk\n"
            "\n"
            "all:\n"
            "\t$(MAKE) -C \"$(PARENT)\" -f \"$(PARENT_MAKEFILE)\" " << project << "\n"
            "\n"
            "clean:\n"
            "\t$(MAKE) -C \"$(PARENT)\" -f \"$(PARENT_MAKEFILE)\" " << project << " clean\n"
            "\n"
        ;

    } else {

        // Macro expander
        // FIXME use IMacroManager (unable to find it yet)
        MacroManager* macro = MacroManager::Instance();
        wxASSERT(macro);

        // Get variables
        // Expand variables for final project
        const wxString cmake = GetConfiguration()->GetProgramPath();
        wxFileName sourceDir = wxFileName::DirName(macro->Expand(settings->sourceDirectory, GetManager(), project, config));
        wxFileName buildDir = wxFileName::DirName(macro->Expand(settings->buildDirectory, GetManager(), project, config));

        // Source dir must be relative to build directory (here is cmake called)
        sourceDir.MakeRelativeTo(buildDir.GetFullPath());
        // Build dir must be relative to project directory
        buildDir.MakeRelativeTo(projectDir.GetFullPath());

        // Relative paths
        const wxString sourceDirEsc = sourceDir.GetPath(wxPATH_NO_SEPARATOR, wxPATH_UNIX);
        const wxString buildDirEsc = buildDir.GetPath(wxPATH_NO_SEPARATOR, wxPATH_UNIX);

        // Generated makefile
        content <<
            "CMAKE      := \"" << cmake << "\"\n"
            "BUILD_DIR  := " << buildDirEsc << "\n"
            "SOURCE_DIR := " << sourceDirEsc << "\n"
            "CMAKE_ARGS := " << CreateArguments(*settings, *m_configuration.get()) << "\n"
            "\n"
            "# Building project(s)\n"
            "$(or $(lastword $(MAKECMDGOALS)), all): $(BUILD_DIR)/Makefile\n"
            "\t$(MAKE) -C \"$(BUILD_DIR)\" $(MAKECMDGOALS)\n"
            "\n"
            "# Building directory\n"
            "$(BUILD_DIR):\n"
            "\t$(CMAKE) -E make_directory \"$(BUILD_DIR)\"\n"
            "\n"
            "# Rule that detects if cmake is called\n"
            "$(BUILD_DIR)/Makefile: .cmake_dirty | $(BUILD_DIR)\n"
            "\tcd \"$(BUILD_DIR)\" && $(CMAKE) $(CMAKE_ARGS) \"$(SOURCE_DIR)\"\n"
            "\n"
            "# This rule / file allows force cmake run\n"
            ".cmake_dirty:\n"
            "\t@echo '' > .cmake_dirty\n"
            "\n"
        ;

    }

    // Path to makefile - called project directory required
    wxFileName makefile = projectDir;
    makefile.SetName(project);
    makefile.SetExt("mk");

    // Read old content from disk
    wxString oldContent;
    bool ok = ReadFileWithConversion(makefile.GetFullPath(), oldContent);

    // Write only if there are some changes
    if (!ok || content != oldContent) {
        // Write make file content
        wxFile file(makefile.GetFullPath(), wxFile::write);

        if (!file.Write(content)) {
            CL_ERROR("Unable to write custom makefile (CMakePlugin): " + makefile.GetFullPath());
        }
    }
}
コード例 #9
0
ファイル: launcher.cpp プロジェクト: AlessandroOneto/M2
    bool Launcher::CheckMatrix(const Matrix* matrix) const
    {
        if (!matrix)
        {
            ERROR("BIBasis::CheckMatrix(): no input matrix.");
            return false;
        }

        const Ring* matrixRing = matrix->get_ring();
        if (!matrixRing)
        {
            ERROR("BIBasis::CheckMatrix(): failed to get input matrix ring.");
            return false;
        }
  
        if (matrixRing->characteristic() != 2)
        {
            ERROR("BIBasis::CheckMatrix(): input matrix ring is not ZZ/2.");
            return false;
        }
  
        const PolynomialRing* polynomialRing = matrixRing->cast_to_PolynomialRing();
        if (!polynomialRing)
        {
            ERROR("BIBasis::CheckMatrix(): failed to cast matrix ring to polynomial ring.");
            return false;
        }
  
        const Ring* coefficientRing = polynomialRing->getCoefficientRing();
        if (!coefficientRing)
        {
            ERROR("BIBasis::CheckMatrix(): failed to get coefficient ring.");
            return false;
        }
  
        if (!coefficientRing->isFinitePrimeField())
        {
            ERROR("BIBasis::CheckMatrix(): coefficient ring is not ZZ/2.");
            return false;
        }
  
        const Monoid* monoid = polynomialRing->getMonoid();
        if (!monoid)
        {
            ERROR("BIBasis::CheckMatrix(): failed to get monoid.");
            return false;
        }
  
        const MonomialOrdering* monomialOrdering = monoid->getMonomialOrdering();
        if (!monomialOrdering)
        {
            ERROR("BIBasis::CheckMatrix(): failed to get monomial ordering.");
            return false;
        }
  
        if (!monomialOrdering->array[0])
        {
            ERROR("BIBasis::CheckMatrix(): monomial ordering is unknown.");
            return false;
        }
  
        switch(monomialOrdering->array[0]->type)
        {
            case MO_LEX:
                GetSettingsManager().SetMonomialOrder(Monom::Lex);
                break;
            case MO_GREVLEX:
                GetSettingsManager().SetMonomialOrder(Monom::DegRevLex);
                break;
            case MO_WEIGHTS:
                GetSettingsManager().SetMonomialOrder(Monom::DegLex);
                break;
            default:
                ERROR("BIBasis::CheckMatrix(): monomial ordering is unsupported: %d.", monomialOrdering->array[0]->type);
                return false;
        }
        
        GetSettingsManager().SetNumberOfVariables(static_cast<BIBasis::Monom::Integer>(polynomialRing->n_vars()));
        
        return true;
    }
コード例 #10
0
void CGUIDialogVideoSettings::OnSettingChanged(std::shared_ptr<const CSetting> setting)
{
  if (setting == NULL)
    return;

  CGUIDialogSettingsManualBase::OnSettingChanged(setting);

  const std::string &settingId = setting->GetId();
  if (settingId == SETTING_VIDEO_INTERLACEMETHOD)
  {
    CVideoSettings vs = g_application.GetAppPlayer().GetVideoSettings();
    vs.m_InterlaceMethod = static_cast<EINTERLACEMETHOD>(std::static_pointer_cast<const CSettingInt>(setting)->GetValue());
    g_application.GetAppPlayer().SetVideoSettings(vs);
  }
  else if (settingId == SETTING_VIDEO_SCALINGMETHOD)
  {
    CVideoSettings vs = g_application.GetAppPlayer().GetVideoSettings();
    vs.m_ScalingMethod = static_cast<ESCALINGMETHOD>(std::static_pointer_cast<const CSettingInt>(setting)->GetValue());
    g_application.GetAppPlayer().SetVideoSettings(vs);
  }
  else if (settingId == SETTING_VIDEO_STREAM)
  {
    m_videoStream = std::static_pointer_cast<const CSettingInt>(setting)->GetValue();
    // only change the video stream if a different one has been asked for
    if (g_application.GetAppPlayer().GetVideoStream() != m_videoStream)
    {
      g_application.GetAppPlayer().SetVideoStream(m_videoStream);    // Set the video stream to the one selected
    }
  }
  else if (settingId == SETTING_VIDEO_VIEW_MODE)
  {
    int value = std::static_pointer_cast<const CSettingInt>(setting)->GetValue();
    const CVideoSettings vs = g_application.GetAppPlayer().GetVideoSettings();

    g_application.GetAppPlayer().SetRenderViewMode(value, vs.m_CustomZoomAmount,
                                               vs.m_CustomPixelRatio, vs.m_CustomVerticalShift,
                                               vs.m_CustomNonLinStretch);

    m_viewModeChanged = true;
    GetSettingsManager()->SetNumber(SETTING_VIDEO_ZOOM, vs.m_CustomZoomAmount);
    GetSettingsManager()->SetNumber(SETTING_VIDEO_PIXEL_RATIO, vs.m_CustomPixelRatio);
    GetSettingsManager()->SetNumber(SETTING_VIDEO_VERTICAL_SHIFT, vs.m_CustomVerticalShift);
    GetSettingsManager()->SetBool(SETTING_VIDEO_NONLIN_STRETCH, vs.m_CustomNonLinStretch);
    m_viewModeChanged = false;
  }
  else if (settingId == SETTING_VIDEO_ZOOM ||
           settingId == SETTING_VIDEO_VERTICAL_SHIFT ||
           settingId == SETTING_VIDEO_PIXEL_RATIO ||
           settingId == SETTING_VIDEO_NONLIN_STRETCH)
  {
    CVideoSettings vs = g_application.GetAppPlayer().GetVideoSettings();
    if (settingId == SETTING_VIDEO_ZOOM)
      vs.m_CustomZoomAmount = static_cast<float>(std::static_pointer_cast<const CSettingNumber>(setting)->GetValue());
    else if (settingId == SETTING_VIDEO_VERTICAL_SHIFT)
      vs.m_CustomVerticalShift = static_cast<float>(std::static_pointer_cast<const CSettingNumber>(setting)->GetValue());
    else if (settingId == SETTING_VIDEO_PIXEL_RATIO)
      vs.m_CustomPixelRatio = static_cast<float>(std::static_pointer_cast<const CSettingNumber>(setting)->GetValue());
    else if (settingId == SETTING_VIDEO_NONLIN_STRETCH)
      vs.m_CustomNonLinStretch = std::static_pointer_cast<const CSettingBool>(setting)->GetValue();

    // try changing the view mode to custom. If it already is set to custom
    // manually call the render manager
    if (GetSettingsManager()->GetInt(SETTING_VIDEO_VIEW_MODE) != ViewModeCustom)
      GetSettingsManager()->SetInt(SETTING_VIDEO_VIEW_MODE, ViewModeCustom);
    else
      g_application.GetAppPlayer().SetRenderViewMode(vs.m_ViewMode, vs.m_CustomZoomAmount,
                                                 vs.m_CustomPixelRatio, vs.m_CustomVerticalShift,
                                                 vs.m_CustomNonLinStretch);
  }
  else if (settingId == SETTING_VIDEO_POSTPROCESS)
  {
    CVideoSettings vs = g_application.GetAppPlayer().GetVideoSettings();
    vs.m_PostProcess = std::static_pointer_cast<const CSettingBool>(setting)->GetValue();
    g_application.GetAppPlayer().SetVideoSettings(vs);
  }
  else if (settingId == SETTING_VIDEO_BRIGHTNESS)
  {
    CVideoSettings vs = g_application.GetAppPlayer().GetVideoSettings();
    vs.m_Brightness = static_cast<float>(std::static_pointer_cast<const CSettingInt>(setting)->GetValue());
    g_application.GetAppPlayer().SetVideoSettings(vs);
  }
  else if (settingId == SETTING_VIDEO_CONTRAST)
  {
    CVideoSettings vs = g_application.GetAppPlayer().GetVideoSettings();
    vs.m_Contrast = static_cast<float>(std::static_pointer_cast<const CSettingInt>(setting)->GetValue());
    g_application.GetAppPlayer().SetVideoSettings(vs);
  }
  else if (settingId == SETTING_VIDEO_GAMMA)
  {
    CVideoSettings vs = g_application.GetAppPlayer().GetVideoSettings();
    vs.m_Gamma = static_cast<float>(std::static_pointer_cast<const CSettingInt>(setting)->GetValue());
    g_application.GetAppPlayer().SetVideoSettings(vs);
  }
  else if (settingId == SETTING_VIDEO_VDPAU_NOISE)
  {
    CVideoSettings vs = g_application.GetAppPlayer().GetVideoSettings();
    vs.m_NoiseReduction = static_cast<float>(std::static_pointer_cast<const CSettingNumber>(setting)->GetValue());
    g_application.GetAppPlayer().SetVideoSettings(vs);
  }
  else if (settingId == SETTING_VIDEO_VDPAU_SHARPNESS)
  {
    CVideoSettings vs = g_application.GetAppPlayer().GetVideoSettings();
    vs.m_Sharpness = static_cast<float>(std::static_pointer_cast<const CSettingNumber>(setting)->GetValue());
    g_application.GetAppPlayer().SetVideoSettings(vs);
  }
  else if (settingId == SETTING_VIDEO_STEREOSCOPICMODE)
  {
    CVideoSettings vs = g_application.GetAppPlayer().GetVideoSettings();
    vs.m_StereoMode = std::static_pointer_cast<const CSettingInt>(setting)->GetValue();
    g_application.GetAppPlayer().SetVideoSettings(vs);
  }
  else if (settingId == SETTING_VIDEO_STEREOSCOPICINVERT)
  {
    CVideoSettings vs = g_application.GetAppPlayer().GetVideoSettings();
    vs.m_StereoInvert = std::static_pointer_cast<const CSettingBool>(setting)->GetValue();
    g_application.GetAppPlayer().SetVideoSettings(vs);
  }
}