public override void LoadSettings()
        {
            int windowid = 0;

            using (Settings xmlreader = new MPSettings())
            {
                checkBoxEnableScreensaver.Checked = xmlreader.GetValueAsBool("general", "IdleTimer", true);
                numericUpDownDelay.Value          = xmlreader.GetValueAsInt("general", "IdleTimeValue", 300);
                radioBtnBlankScreen.Checked       = xmlreader.GetValueAsBool("general", "IdleBlanking", true);
                radioButtonLoadPlugin.Checked     = xmlreader.GetValueAsBool("general", "IdlePlugin", false);
                windowid = xmlreader.GetValueAsInt("general", "IdlePluginWindow", 0);
            }
            radioBtnFPSReduce.Checked     = !radioBtnBlankScreen.Checked && !radioButtonLoadPlugin.Checked;
            pluginsComboBox.DataSource    = loadedPlugins;
            pluginsComboBox.DisplayMember = "PluginName";
            pluginsComboBox.ValueMember   = "PluginName";
            if (windowid != 0)
            {
                for (int i = 0; i < loadedPlugins.Count; i++)
                {
                    ItemTag t = loadedPlugins[i];
                    if (t.WindowId == windowid)
                    {
                        pluginsComboBox.SelectedIndex = i;
                        break;
                    }
                }
            }
        }
Beispiel #2
0
        private SerialUIR(OnRemoteCommand remoteCommandCallback) : this()
        {
            try
            {
                using (Settings xmlreader = new MPSettings())
                {
                    recInternalCommands = xmlreader.GetValueAsString("SerialUIR", "internal", "false") == "true";
                    commport            = xmlreader.GetValueAsString("SerialUIR", "commport", "COM1:");
                    baudrate            = xmlreader.GetValueAsInt("SerialUIR", "baudrate", 9600);
                    handshake           = xmlreader.GetValueAsString("SerialUIR", "handshake", "None");
                    irbytes             = xmlreader.GetValueAsInt("SerialUIR", "irbytes", 6);
                    uirirmaninit        = xmlreader.GetValueAsString("SerialUIR", "uirirmaninit", "true") == "true";
                    LearningTimeOut     = 1000 * xmlreader.GetValueAsInt("SerialUIR", "timeout", 4);
                    CommandDelay        = xmlreader.GetValueAsInt("SerialUIR", "delay", 300);
                }
                this.remoteCommandCallback = remoteCommandCallback;
                commandsLearned            = new Hashtable();
                if (File.Exists(remotefile))
                {
                    LoadValues();
                }

                if (InternalCommandsActive)
                {
                    base.Open();
                }
            }
            catch (Exception ex)
            {
                //most users dont have serial device on their system so will get a exception here
                Log.Error("SerialUIR:SerialUIR {0}", ex.Message);
            }
        }
        public PluginSettings()
        {
            using (Settings settings = new MPSettings())
            {
                ServerName    = settings.GetValueAsString(SECTION_NAME, SERVER_NAME, System.Windows.Forms.SystemInformation.ComputerName);
                Password      = settings.GetValueAsString(SECTION_NAME, SERVER_PASS, null);
                CustomAddress = settings.GetValueAsString(SECTION_NAME, CUSTOM_ADDRESS, null).BytesFromHexString();
                RtspPort      = settings.GetValueAsInt(SECTION_NAME, RTSP_PORT, DEFAULT_RTSP_PORT);
                UdpPort       = settings.GetValueAsInt(SECTION_NAME, UDP_PORT, DEFAULT_UDP_PORT);
                AllowVolume   = settings.GetValueAsBool(SECTION_NAME, ALLOW_VOLUME, true);
                SendCommands  = settings.GetValueAsBool(SECTION_NAME, SEND_COMMANDS, true);

                decimal bufferSize;
                if (!decimal.TryParse(settings.GetValue(SECTION_NAME, BUFFER_SIZE), NumberStyles.Float, CultureInfo.InvariantCulture, out bufferSize))
                {
                    bufferSize = 2M;
                }
                AudioBuffer = bufferSize;

                AirplayPort    = settings.GetValueAsInt(SECTION_NAME, AIRPLAY_PORT, DEFAULT_HTTP_PORT);
                AllowHDStreams = settings.GetValueAsBool(SECTION_NAME, ALLOW_HD_STREAMS, true);
                VideoBuffer    = settings.GetValueAsInt(SECTION_NAME, VIDEO_BUFFER, 2);

                iOS8Workaround = settings.GetValueAsBool(SECTION_NAME, IOS8_WORKAROUND, false);
            }
        }
Beispiel #4
0
        /// <summary>
        ///   Register raw input device as defined and imported from our XML.
        /// </summary>
        /// <param name="aHWND"></param>
        public void Register(IntPtr aHWND)
        {
            SharpLib.Win32.RAWINPUTDEVICE[] rid = new SharpLib.Win32.RAWINPUTDEVICE[_usageActions.Count];

            var i = 0;

            foreach (var entry in _usageActions)
            {
                rid[i].usUsagePage = entry.Value.UsagePage;
                rid[i].usUsage     = entry.Value.UsageCollection;
                rid[i].dwFlags     = (entry.Value.HandleHidEventsWhileInBackground ? SharpLib.Win32.RawInputDeviceFlags.RIDEV_INPUTSINK : 0);
                //Funny enough that "no legacy" flag prevents our HID keyboard handler to work
                //rid[i].dwFlags |= SharpLib.Win32.RawInputDeviceFlags.RIDEV_NOLEGACY;
                rid[i].hwndTarget = aHWND;
                i++;
            }

            int repeatDelay = -1;
            int repeatSpeed = -1;

            using (Settings settings = new MPSettings())
            {
                repeatDelay = settings.GetValueAsInt("remote", "HidRepeatDelayInMs", repeatDelay);
                repeatSpeed = settings.GetValueAsInt("remote", "HidRepeatSpeedInMs", repeatSpeed);
            }

            _handler = new SharpLib.Hid.Handler(rid, true, repeatDelay, repeatSpeed);
            if (!_handler.IsRegistered)
            {
                Log.Info("Failed to register raw input devices: " + Marshal.GetLastWin32Error().ToString());
            }
            _handler.OnHidEvent += OnHidEvent;
        }
    public override void LoadSettings()
    {
      int windowid = 0;

      using (Settings xmlreader = new MPSettings())
      {
        checkBoxEnableScreensaver.Checked = xmlreader.GetValueAsBool("general", "IdleTimer", true);
        numericUpDownDelay.Value = xmlreader.GetValueAsInt("general", "IdleTimeValue", 300);
        radioBtnBlankScreen.Checked = xmlreader.GetValueAsBool("general", "IdleBlanking", true);
        radioButtonLoadPlugin.Checked = xmlreader.GetValueAsBool("general", "IdlePlugin", false);
        windowid = xmlreader.GetValueAsInt("general", "IdlePluginWindow", 0);
      }    
      pluginsComboBox.DataSource = loadedPlugins;
      pluginsComboBox.DisplayMember = "PluginName";
      pluginsComboBox.ValueMember = "PluginName";
      if (windowid != 0)
      {
        for (int i = 0; i < loadedPlugins.Count; i++)
        {
          ItemTag t = loadedPlugins[i];
          if (t.WindowId == windowid)
          {
            pluginsComboBox.SelectedIndex = i;
            break;
          }
        }
      }
    }
Beispiel #6
0
        public void LoadSettings()
        {
            using (Settings xmlreader = new MPSettings())
            {
                defStyle = new SubtitleStyle();
                defStyle.Load(xmlreader);
                delayInterval = xmlreader.GetValueAsInt("subtitles", "delayInterval", 250);

                bool save = xmlreader.GetValueAsBool("subtitles", "saveNever", true);
                if (save)
                {
                    autoSaveType = AutoSaveTypeEnum.NEVER;
                }
                else
                {
                    save         = xmlreader.GetValueAsBool("subtitles", "saveAsk", false);
                    autoSaveType = (save ? AutoSaveTypeEnum.ASK : AutoSaveTypeEnum.ALWAYS);
                }

                posRelativeToFrame = xmlreader.GetValueAsBool("subtitles", "subPosRelative", false);
                overrideASSStyle   = xmlreader.GetValueAsBool("subtitles", "subStyleOverride", false);
                subPaths           = xmlreader.GetValueAsString("subtitles", "paths", @".\");
                adjustPosY         = xmlreader.GetValueAsInt("subtitles", "adjustY", 0);
                autoShow           = xmlreader.GetValueAsBool("subtitles", "enabled", true);
                selectionOff       = xmlreader.GetValueAsBool("subtitles", "selectionoff", true);
                LoadAdvancedSettings(xmlreader);
            }
        }
Beispiel #7
0
    public VolumeHandler(int[] volumeTable)
    {
      bool isDigital = true;
      //string mixerControlledComponent = "Wave";

      using (Settings reader = new MPSettings())
      {
        int levelStyle = reader.GetValueAsInt("volume", "startupstyle", 0);

        if (levelStyle == 0)
        {
          _startupVolume = Math.Max(0, Math.Min(65535, reader.GetValueAsInt("volume", "lastknown", 52428)));
        }

        if (levelStyle == 1)
        {
          _startupVolume = _mixer.Volume;
        }

        if (levelStyle == 2)
        {
          _startupVolume = Math.Max(0, Math.Min(65535, reader.GetValueAsInt("volume", "startuplevel", 52428)));
        }

        //mixerControlledComponent = reader.GetValueAsString("volume", "controlledMixer", "Wave");
        isDigital = reader.GetValueAsBool("volume", "digital", false);

        _showVolumeOSD = reader.GetValueAsBool("volume", "defaultVolumeOSD", true);
      }

      _mixer = new Mixer.Mixer();
      _mixer.Open(0, isDigital);
      _volumeTable = volumeTable;
      _mixer.ControlChanged += new Mixer.MixerEventHandler(mixer_ControlChanged);
    }
Beispiel #8
0
        public VolumeHandler(int[] volumeTable)
        {
            bool isDigital;

            using (Settings reader = new MPSettings())
            {
                int levelStyle = reader.GetValueAsInt("volume", "startupstyle", 0);

                if (levelStyle == 0)
                {
                    _startupVolume = Math.Max(0, Math.Min(65535, reader.GetValueAsInt("volume", "lastknown", 52428)));
                }

                if (levelStyle == 1)
                {
                }

                if (levelStyle == 2)
                {
                    _startupVolume = Math.Max(0, Math.Min(65535, reader.GetValueAsInt("volume", "startuplevel", 52428)));
                }

                isDigital = reader.GetValueAsBool("volume", "digital", false);

                _showVolumeOSD = reader.GetValueAsBool("volume", "defaultVolumeOSD", true);
            }

            _mixer = new Mixer.Mixer();
            _mixer.Open(0, isDigital);
            _volumeTable           = volumeTable;
            _mixer.ControlChanged += mixer_ControlChanged;
        }
Beispiel #9
0
 public void LoadSettings()
 {
     using (Settings reader = new MPSettings())
     {
         this.enableAutoCropper.Checked  = reader.GetValueAsBool(autoCropSectionName, enableAutoCropSetting, false);
         this.enableAutoMode.Checked     = reader.GetValueAsBool(autoCropSectionName, enableAutoModeSetting, false);
         this.enableManualMode.Checked   = reader.GetValueAsBool(autoCropSectionName, enableManualModeSetting, true);
         this.topScanStartInput.Value    = reader.GetValueAsInt(autoCropSectionName, parmTopStartSetting, 35);
         this.topScanEndInput.Value      = reader.GetValueAsInt(autoCropSectionName, parmTopEndSetting, 80);
         this.bottomScanStartInput.Value = reader.GetValueAsInt(autoCropSectionName, parmBottomStartSetting, 0);
         this.bottomScanEndInput.Value   = reader.GetValueAsInt(autoCropSectionName, parmBottomEndSetting, 100);
         //this.manualSampleLengthInput.Value = reader.GetValueAsInt(autoCropSectionName, parmManualSampleLength, 30);
         this.minSubtitleHeightInput.Value = reader.GetValueAsInt(autoCropSectionName, parmMinSubtitleHeight, 10);
         this.topMemLength.Value           = reader.GetValueAsInt(autoCropSectionName, parmTopMemoryLength, 10);
         // 10 seconds default
         this.bottomMemLength.Value = reader.GetValueAsInt(autoCropSectionName, parmBottomMemoryLength, 60);
         // 60 seconds default
         this.rbDefaultManual.Checked     = reader.GetValueAsBool(autoCropSectionName, parmDefaultModeIsManual, true);
         this.cbVerboseLog.Checked        = reader.GetValueAsBool(autoCropSectionName, parmVerboseLog, false);
         this.rbDefaultAutomatic.Checked  = !rbDefaultManual.Checked;
         this.cbUseForVideos.Checked      = reader.GetValueAsBool(autoCropSectionName, parmUseForMyVideos, false);
         this.sampleIntervalInput.Maximum = 10000;
         this.sampleIntervalInput.Minimum = 0;
         this.sampleIntervalInput.Value   = reader.GetValueAsInt(autoCropSectionName, parmSampleInterval, 500);
         // 2 times a second default
         this.minBrightnessTresholdInput.Value = reader.GetValueAsInt(autoCropSectionName, parmMinBrightnessTreshold, 4);
         this.maxBrightnessTresholdInput.Value = reader.GetValueAsInt(autoCropSectionName, parmMaxBrightnessTreshold, 40);
     }
 }
Beispiel #10
0
        private RedEye(OnRemoteCommand remoteCommandCallback)
        {
            try
            {
                using (Settings xmlreader = new MPSettings())
                {
                    recInternalCommands = xmlreader.GetValueAsString("RedEye", "internal", "false") == "true";
                    commport            = xmlreader.GetValueAsString("RedEye", "commport", "COM1:");
                    baudrate            = xmlreader.GetValueAsInt("RedEye", "baudrate", 9600);
                    handshake           = xmlreader.GetValueAsString("RedEye", "handshake", "none");
                    irbytes             = xmlreader.GetValueAsInt("RedEye", "irbytes", 6);
                    uirirmaninit        = xmlreader.GetValueAsString("RedEye", "uirirmaninit", "true") == "true";
                    LearningTimeOut     = 1000 * xmlreader.GetValueAsInt("RedEye", "timeout", 4);
                    CommandDelay        = xmlreader.GetValueAsInt("RedEye", "delay", 300);
                }
                this.remoteCommandCallback = remoteCommandCallback;

                if (InternalCommandsActive)
                {
                    base.Open();
                }
            }
            catch (Exception)
            {
                //most users dont have serial device on their system so will get a exception here
            }
        }
Beispiel #11
0
        private static void LoadSettings()
        {
            if (!_settingsLoaded)
            {
                Log.Debug("Tvhome: LoadSettings()");
                using (Settings xmlreader = new MPSettings())
                {
                    if (PluginMain.DisableRadio)
                    {
                        xmlreader.SetValueAsBool("pluginswindows", "ArgusTV.UI.MediaPortal.RadioHome", false);
                        xmlreader.SetValueAsBool("home", "ARGUS Radio", false);
                        xmlreader.SetValueAsBool("myplugins", "ARGUS Radio", false);
                    }

                    string strValue = xmlreader.GetValueAsString("mytv", "defaultar", "Normal");
                    _preNotifyConfig          = xmlreader.GetValueAsInt("mytv", "notifyTVBefore", 300);
                    _notifyTVTimeout          = xmlreader.GetValueAsInt("mytv", "notifyTVTimeout", 15);
                    _playNotifyBeep           = xmlreader.GetValueAsBool("mytv", "notifybeep", true);
                    _enableRecNotification    = xmlreader.GetValueAsBool("mytv", "enableRecNotifier", false);
                    _autoTurnOnTv             = xmlreader.GetValueAsBool("mytv", "autoturnontv", false);
                    _showlastactivemodule     = xmlreader.GetValueAsBool("general", "showlastactivemodule", false);
                    GUIGraphicsContext.ARType = global::MediaPortal.Util.Utils.GetAspectRatio(strValue);
                    _settingsLoaded           = true;
                }
            }
        }
Beispiel #12
0
        internal static ServerSettings LoadServerSettings()
        {
            using (Settings xmlreader = new MPSettings())
            {
                ServerSettings serverSettings = new ServerSettings();
                serverSettings.ServerName = xmlreader.GetValueAsString(_settingSection, TvHome.SettingName.Server, "localhost");
#if DEBUG
                if (!Dns.GetHostName().Equals("tcf") && !Dns.GetHostName().Equals("Iznajar"))
                {
                    serverSettings.ServerName = "mediaserver";
                }
#endif
                serverSettings.Port = xmlreader.GetValueAsInt(_settingSection, TvHome.SettingName.TcpPort, ServerSettings.DefaultHttpPort);
                if (serverSettings.Port == 49942)
                {
                    // Auto-adjust old net.tcp port to HTTP.
                    serverSettings.Port = 49943;
                }
                serverSettings.WakeOnLan.MacAddresses   = xmlreader.GetValueAsString(_settingSection, TvHome.SettingName.MacAddresses, String.Empty);
                serverSettings.WakeOnLan.IPAddress      = xmlreader.GetValueAsString(_settingSection, TvHome.SettingName.IPAddress, String.Empty);
                serverSettings.WakeOnLan.Enabled        = xmlreader.GetValueAsBool(_settingSection, TvHome.SettingName.UseWakeOnLan, false);
                serverSettings.WakeOnLan.TimeoutSeconds = xmlreader.GetValueAsInt(_settingSection, TvHome.SettingName.WakeOnLanTimeoutSeconds, 10);
                return(serverSettings);
            }
        }
Beispiel #13
0
        public VolumeHandler(int[] volumeTable)
        {
            bool isDigital = true;

            //string mixerControlledComponent = "Wave";

            using (Settings reader = new MPSettings())
            {
                int levelStyle = reader.GetValueAsInt("volume", "startupstyle", 0);

                if (levelStyle == 0)
                {
                    _startupVolume = Math.Max(0, Math.Min(65535, reader.GetValueAsInt("volume", "lastknown", 52428)));
                }

                if (levelStyle == 1)
                {
                    _startupVolume = _mixer.Volume;
                }

                if (levelStyle == 2)
                {
                    _startupVolume = Math.Max(0, Math.Min(65535, reader.GetValueAsInt("volume", "startuplevel", 52428)));
                }

                //mixerControlledComponent = reader.GetValueAsString("volume", "controlledMixer", "Wave");
                isDigital = reader.GetValueAsBool("volume", "digital", false);

                _showVolumeOSD = reader.GetValueAsBool("volume", "defaultVolumeOSD", true);
            }

            _mixer = new Mixer.Mixer();
            _mixer.Open(0, isDigital);
            _volumeTable = volumeTable;
        }
Beispiel #14
0
    public override void LoadSettings()
    {
      //Load parameters from XML File
      string preferredAudioLanguages;
      string preferredSubLanguages;

      using (Settings xmlreader = new MPSettings())
      {
        cbTurnOnTv.Checked = xmlreader.GetValueAsBool("mytv", "autoturnontv", false);
        cbAutoFullscreen.Checked = xmlreader.GetValueAsBool("mytv", "autofullscreen", false);
        byIndexCheckBox.Checked = xmlreader.GetValueAsBool("mytv", "byindex", true);
        showChannelNumberCheckBox.Checked = xmlreader.GetValueAsBool("mytv", "showchannelnumber", false);

        int channelNumberMaxLen = xmlreader.GetValueAsInt("mytv", "channelnumbermaxlength", 3);
        channelNumberMaxLengthNumUpDn.Value = channelNumberMaxLen;

        int DeInterlaceMode = xmlreader.GetValueAsInt("mytv", "deinterlace", 0);
        if (DeInterlaceMode < 0 || DeInterlaceMode > 3)
        {
          DeInterlaceMode = 3;
        }
        cbDeinterlace.SelectedIndex = DeInterlaceMode;

        mpCheckBoxPrefAC3.Checked = xmlreader.GetValueAsBool("tvservice", "preferac3", false);
        mpCheckBoxPrefAudioOverLang.Checked = xmlreader.GetValueAsBool("tvservice", "preferAudioTypeOverLang", true);
        preferredAudioLanguages = xmlreader.GetValueAsString("tvservice", "preferredaudiolanguages", "");
        preferredSubLanguages = xmlreader.GetValueAsString("tvservice", "preferredsublanguages", "");

        mpCheckBoxEnableDVBSub.Checked = xmlreader.GetValueAsBool("tvservice", "dvbbitmapsubtitles", false);
        mpCheckBoxEnableTTXTSub.Checked = xmlreader.GetValueAsBool("tvservice", "dvbttxtsubtitles", false);
        mpCheckBoxEnableCCSub.Checked = xmlreader.GetValueAsBool("tvservice", "ccsubtitles", false);
        mpCheckBoxAutoShowSubWhenTvStarts.Checked = xmlreader.GetValueAsBool("tvservice", "autoshowsubwhentvstarts", true);
        enableAudioDualMonoModes.Checked = xmlreader.GetValueAsBool("tvservice", "audiodualmono", false);
        cbHideAllChannels.Checked = xmlreader.GetValueAsBool("mytv", "hideAllChannelsGroup", false);
        cbShowChannelStateIcons.Checked = xmlreader.GetValueAsBool("mytv", "showChannelStateIcons", true);
        cbContinuousScrollGuide.Checked = xmlreader.GetValueAsBool("mytv", "continuousScrollGuide", false);
        cbRelaxTsReader.Checked = xmlreader.GetValueAsBool("mytv", "relaxTsReader", false);

        chkRecnotifications.Checked = xmlreader.GetValueAsBool("mytv", "enableRecNotifier", false);
        txtNotifyBefore.Text = xmlreader.GetValueAsString("mytv", "notifyTVBefore", "300");
        txtNotifyAfter.Text = xmlreader.GetValueAsString("mytv", "notifyTVTimeout", "15");
        checkBoxNotifyPlaySound.Checked = xmlreader.GetValueAsBool("mytv", "notifybeep", true);
        cbConfirmTimeshiftStop.Checked = xmlreader.GetValueAsBool("mytv", "confirmTimeshiftStop", true);
        int showEpisodeinfo = xmlreader.GetValueAsInt("mytv", "showEpisodeInfo", 0);
        if (showEpisodeinfo > this.ShowEpisodeOptions.Length)
        {
          showEpisodeinfo = 0;
        }
        comboboxShowEpisodeInfo.SelectedIndex = showEpisodeinfo;
      }

      // Enable this Panel if the TvPlugin exists in the plug-in Directory
      Enabled = true;

      // Retrieve the languages and language codes for the Epg.
      List<KeyValuePair<String, String>> langs = TvLibrary.Epg.Languages.Instance.GetLanguagePairs();
      FillLists(mpListViewAvailAudioLang, mpListViewPreferredAudioLang, preferredAudioLanguages, langs);
      FillLists(mpListViewAvailSubLang, mpListViewPreferredSubLang, preferredSubLanguages, langs);
      _SingleSeat = Network.IsSingleSeat();
    }
    private void LoadSettings()
    {
      // load settings
      using (Settings reader = new MPSettings())
      {
        int hours, minutes;
        hours = reader.GetValueAsInt("musicdbreorg", "hours", 0);
        minutes = reader.GetValueAsInt("musicdbreorg", "minutes", 0);
        VerifySchedule(ref hours, ref minutes);
        hoursTextBox.Text = hours.ToString();
        minutesTextBox.Text = minutes.ToString();
        if (hoursTextBox.Text.Length == 1)
        {
          hoursTextBox.Text = "0" + hoursTextBox.Text;
        }
        if (minutesTextBox.Text.Length == 1)
        {
          minutesTextBox.Text = "0" + minutesTextBox.Text;
        }

        cbMonday.Checked = reader.GetValueAsBool("musicdbreorg", "monday", true);
        cbTuesday.Checked = reader.GetValueAsBool("musicdbreorg", "tuesday", true);
        cbWednesday.Checked = reader.GetValueAsBool("musicdbreorg", "wednesday", true);
        cbThursday.Checked = reader.GetValueAsBool("musicdbreorg", "thursday", true);
        cbFriday.Checked = reader.GetValueAsBool("musicdbreorg", "friday", true);
        cbSaturday.Checked = reader.GetValueAsBool("musicdbreorg", "saturday", true);
        cbSunday.Checked = reader.GetValueAsBool("musicdbreorg", "sunday", true);
      }
    }
Beispiel #16
0
        public override void LoadSettings()
        {
            if (_init == false)
            {
                return;
            }

            using (Settings xmlreader = new MPSettings())
            {
                cbTurnOnTv.Checked                = xmlreader.GetValueAsBool("mytv", "autoturnontv", false);
                cbAutoFullscreen.Checked          = xmlreader.GetValueAsBool("mytv", "autofullscreen", false);
                byIndexCheckBox.Checked           = xmlreader.GetValueAsBool("mytv", "byindex", true);
                showChannelNumberCheckBox.Checked = xmlreader.GetValueAsBool("mytv", "showchannelnumber", false);

                int channelNumberMaxLen = xmlreader.GetValueAsInt("mytv", "channelnumbermaxlength", 3);
                channelNumberMaxLengthNumUpDn.Value = channelNumberMaxLen;


                int DeInterlaceMode = xmlreader.GetValueAsInt("mytv", "deinterlace", 0);
                if (DeInterlaceMode < 0 || DeInterlaceMode > 3)
                {
                    DeInterlaceMode = 3;
                }
                cbDeinterlace.SelectedIndex = DeInterlaceMode;
            }
        }
        private void LoadSettings()
        {
            // load settings
            using (Settings reader = new MPSettings())
            {
                int hours, minutes;
                hours   = reader.GetValueAsInt("musicdbreorg", "hours", 0);
                minutes = reader.GetValueAsInt("musicdbreorg", "minutes", 0);
                VerifySchedule(ref hours, ref minutes);
                hoursTextBox.Text   = hours.ToString();
                minutesTextBox.Text = minutes.ToString();
                if (hoursTextBox.Text.Length == 1)
                {
                    hoursTextBox.Text = "0" + hoursTextBox.Text;
                }
                if (minutesTextBox.Text.Length == 1)
                {
                    minutesTextBox.Text = "0" + minutesTextBox.Text;
                }

                cbMonday.Checked    = reader.GetValueAsBool("musicdbreorg", "monday", true);
                cbTuesday.Checked   = reader.GetValueAsBool("musicdbreorg", "tuesday", true);
                cbWednesday.Checked = reader.GetValueAsBool("musicdbreorg", "wednesday", true);
                cbThursday.Checked  = reader.GetValueAsBool("musicdbreorg", "thursday", true);
                cbFriday.Checked    = reader.GetValueAsBool("musicdbreorg", "friday", true);
                cbSaturday.Checked  = reader.GetValueAsBool("musicdbreorg", "saturday", true);
                cbSunday.Checked    = reader.GetValueAsBool("musicdbreorg", "sunday", true);
            }
        }
Beispiel #18
0
        public void RegisterHidDevices()
        {
            SharpLib.Win32.RAWINPUTDEVICE[] rid = new SharpLib.Win32.RAWINPUTDEVICE[1];

            rid[0].usUsagePage = (ushort)SharpLib.Hid.UsagePage.WindowsMediaCenterRemoteControl;
            rid[0].usUsage     = (ushort)SharpLib.Hid.UsageCollection.WindowsMediaCenter.WindowsMediaCenterRemoteControl;
            rid[0].dwFlags     = RawInputDeviceFlags.RIDEV_EXINPUTSINK;
            rid[0].hwndTarget  = Handle;

            int repeatDelay = -1;
            int repeatSpeed = -1;

            using (Settings settings = new MPSettings())
            {
                repeatDelay = settings.GetValueAsInt("remote", "HidRepeatDelayInMs", repeatDelay);
                repeatSpeed = settings.GetValueAsInt("remote", "HidRepeatSpeedInMs", repeatSpeed);
            }

            _handler = new SharpLib.Hid.Handler(rid, true, repeatDelay, repeatSpeed);

            if (!_handler.IsRegistered)
            {
                Debug.WriteLine("Failed to register raw input devices: " + Marshal.GetLastWin32Error().ToString());
            }

            _handler.OnHidEvent += HandleHidEventThreadSafe;
        }
    public VolumeHandler(int[] volumeTable)
    {
      bool isDigital;

      using (Settings reader = new MPSettings())
      {
        int levelStyle = reader.GetValueAsInt("volume", "startupstyle", 0);

        if (levelStyle == 0)
        {
          _startupVolume = Math.Max(0, Math.Min(65535, reader.GetValueAsInt("volume", "lastknown", 52428)));
        }

        if (levelStyle == 1)
        {
        }

        if (levelStyle == 2)
        {
          _startupVolume = Math.Max(0, Math.Min(65535, reader.GetValueAsInt("volume", "startuplevel", 52428)));
        }

        isDigital = reader.GetValueAsBool("volume", "digital", false);

        _showVolumeOSD = reader.GetValueAsBool("volume", "defaultVolumeOSD", true);
      }

      _mixer = new Mixer.Mixer();
      _mixer.Open(0, isDigital);
      _volumeTable = volumeTable;
      _mixer.ControlChanged += mixer_ControlChanged;
    }
Beispiel #20
0
 public override void LoadSettings()
 {
     using (Settings xmlreader = new MPSettings())
     {
         textBoxDisplayTimeout.Text = Convert.ToString(xmlreader.GetValueAsInt("movieplayer", "osdtimeout", 0));
         textBoxZapDelay.Text       = Convert.ToString(xmlreader.GetValueAsInt("movieplayer", "zapdelay", 2));
         textBoxZapTimeout.Text     = Convert.ToString(xmlreader.GetValueAsInt("movieplayer", "zaptimeout", 5));
     }
 }
        public override void LoadSettings()
        {
            Log.Info("load volume");
            // default default
            _useClassicHandler.Checked = true;

            using (Settings reader = new MPSettings())
            {
                int  volumeStyle = reader.GetValueAsInt("volume", "handler", 1);
                bool isDigital   = reader.GetValueAsBool("volume", "digital", true);

                // Force a couple of settings for Vista / Windows 7
                if (OSInfo.OSInfo.VistaOrLater())
                {
                    volumeStyle = 4;
                    groupBoxMixerControl.Enabled = false;
                }

                if (OSInfo.OSInfo.Win7OrLater())
                {
                    isDigital             = true;
                    groupBoxScale.Enabled = false;
                }

                _useClassicHandler.Checked     = volumeStyle == 0;
                _useWindowsHandler.Checked     = volumeStyle == 1;
                _useLogarithmicHandler.Checked = volumeStyle == 2;
                _useCustomHandler.Checked      = volumeStyle == 3;
                _useVistaHandler.Checked       = volumeStyle == 4;
                _customText = reader.GetValueAsString("volume", "table",
                                                      "0, 4095, 8191, 12287, 16383, 20479, 24575, 28671, 32767, 36863, 40959, 45055, 49151, 53247, 57343, 61439, 65535");

                int startupStyle = reader.GetValueAsInt("volume", "startupstyle", 0);

                _useLastKnownLevel.Checked = startupStyle == 0;
                _useSystemCurrent.Checked  = startupStyle == 1;
                _useCustomLevel.Checked    = startupStyle == 2;
                _customLevel = reader.GetValueAsInt("volume", "startuplevel", 52428);

                // When Upmixing has selected, we need to use Wave Volume
                if (SettingsForm.audioplayer_mixing)
                {
                    isDigital = true;
                    groupBoxMixerControl.Enabled = false;
                }
                _useMasterVolume.Checked = !isDigital;
                _useWave.Checked         = isDigital;

                _useVolumeOSD.Checked = reader.GetValueAsBool("volume", "defaultVolumeOSD", true);
            }

            _customTextbox.Enabled = _useCustomHandler.Checked;
            _customTextbox.Text    = _customTextbox.Enabled ? _customText : string.Empty;

            _levelTextbox.Enabled = _useCustomLevel.Checked;
            _levelTextbox.Text    = _levelTextbox.Enabled ? _customLevel.ToString() : string.Empty;
        }
Beispiel #22
0
 private void LoadSettings()
 {
     using (Settings xmlreader = new MPSettings())
     {
         _displayTimeout = xmlreader.GetValueAsInt("movieplayer", "osdtimeout", 0);
         _zapDelay       = xmlreader.GetValueAsInt("movieplayer", "zapdelay", 2);
         _zapTimeout     = xmlreader.GetValueAsInt("movieplayer", "zaptimeout", 5);
     }
 }
Beispiel #23
0
 public override void LoadSettings()
 {
   using (Settings xmlreader = new MPSettings())
   {
     textBoxDisplayTimeout.Text = Convert.ToString(xmlreader.GetValueAsInt("movieplayer", "osdtimeout", 0));
     textBoxZapDelay.Text = Convert.ToString(xmlreader.GetValueAsInt("movieplayer", "zapdelay", 2));
     textBoxZapTimeout.Text = Convert.ToString(xmlreader.GetValueAsInt("movieplayer", "zaptimeout", 5));
   }
 }
Beispiel #24
0
 /// <summary>
 /// 
 /// </summary>
 public override void LoadSettings()
 {
   using (Settings xmlreader = new MPSettings())
   {
     HorizontalScrollSpeedUpDown.Value = xmlreader.GetValueAsInt("gui", "ScrollSpeedRight", 1);
     VerticalScrollSpeedUpDown.Value = xmlreader.GetValueAsInt("gui", "ScrollSpeedDown", 4);
     listLoopDelayUpDown.Value = xmlreader.GetValueAsInt("gui", "listLoopDelay", 100);
   }
 }
 /// <summary>
 ///
 /// </summary>
 public override void LoadSettings()
 {
     using (Settings xmlreader = new MPSettings())
     {
         HorizontalScrollSpeedUpDown.Value = xmlreader.GetValueAsInt("gui", "ScrollSpeedRight", 1);
         VerticalScrollSpeedUpDown.Value   = xmlreader.GetValueAsInt("gui", "ScrollSpeedDown", 4);
         listLoopDelayUpDown.Value         = xmlreader.GetValueAsInt("gui", "listLoopDelay", 100);
     }
 }
 private void LoadSettings()
 {
   using (Settings xmlreader = new MPSettings())
   {
     _displayTimeout = xmlreader.GetValueAsInt("movieplayer", "osdtimeout", 0);
     _zapDelay = xmlreader.GetValueAsInt("movieplayer", "zapdelay", 2);
     _zapTimeout = xmlreader.GetValueAsInt("movieplayer", "zaptimeout", 5);
   }
 }
Beispiel #27
0
        // PLEASE NOTE: when adding items, adjust the box so it doesn't get scrollbars
        //              AND be careful cause depending on where you add a setting, the indexes might have changed!!!

        public override void LoadSettings()
        {
            cbScreen.Items.Clear();
            foreach (Screen screen in Screen.AllScreens)
            {
                int            dwf         = 0;
                DISPLAY_DEVICE info        = new DISPLAY_DEVICE();
                string         monitorname = null;
                info.cb = Marshal.SizeOf(info);
                if (EnumDisplayDevices(screen.DeviceName, 0, info, dwf))
                {
                    monitorname = info.DeviceString;
                }
                if (monitorname == null)
                {
                    monitorname = "";
                }

                foreach (AdapterInformation adapter in Manager.Adapters)
                {
                    if (screen.DeviceName.StartsWith(adapter.Information.DeviceName.Trim()))
                    {
                        cbScreen.Items.Add(string.Format("{0} ({1}x{2}) on {3}",
                                                         monitorname, screen.Bounds.Width, screen.Bounds.Height,
                                                         adapter.Information.Description));
                    }
                }
            }

            using (Settings xmlreader = new MPSettings())
            {
                // Load general settings
                for (int index = 0; index < sectionEntries.Length; index++)
                {
                    string[] currentSection = sectionEntries[index];
                    settingsCheckedListBox.SetItemChecked(index,
                                                          xmlreader.GetValueAsBool(currentSection[0], currentSection[1],
                                                                                   bool.Parse(currentSection[2])));
                }

                screennumber = xmlreader.GetValueAsInt("screenselector", "screennumber", 0);

                while (cbScreen.Items.Count <= screennumber)
                {
                    cbScreen.Items.Add("screen nr :" + cbScreen.Items.Count + " (currently unavailable)");
                }
                cbScreen.SelectedIndex = screennumber;

                nudDelay.Value = xmlreader.GetValueAsInt("general", "delay", 0);
                mpCheckBoxMpStartup.Checked = xmlreader.GetValueAsBool("general", "delay startup", false);
                mpCheckBoxMpResume.Checked  = xmlreader.GetValueAsBool("general", "delay resume", false);
            }

            // On single seat WaitForTvService is forced enabled !
            cbWaitForTvService.Checked = Network.IsSingleSeat();
        }
Beispiel #28
0
        public DlgWol()
        {
            InitializeComponent();

            using (Settings xmlreader = new MPSettings())
            {
                mpUpDownWolTimeout.Value = xmlreader.GetValueAsInt("WOL", "WolTimeout", 10);
                mpUpDownWolResend.Value  = xmlreader.GetValueAsInt("WOL", "WolResendTime", 1);
                mpUpDownWaitTime.Value   = xmlreader.GetValueAsInt("WOL", "WaitTimeAfterWOL", 0);
            }
        }
Beispiel #29
0
    public DlgWol()
    {
      InitializeComponent();

      using (Settings xmlreader = new MPSettings())
      {
        mpUpDownWolTimeout.Value = xmlreader.GetValueAsInt("WOL", "WolTimeout", 10);
        mpUpDownWolResend.Value = xmlreader.GetValueAsInt("WOL", "WolResendTime", 1);
        mpUpDownWaitTime.Value = xmlreader.GetValueAsInt("WOL", "WaitTimeAfterWOL", 0);
      }
    }
 public void LoadSettings()
 {
   using (Settings reader = new MPSettings())
   {
     homeOnlyCheckBox.Checked = reader.GetValueAsBool("psclientplugin", "homeonly", true);
     extLogCheckBox.Checked = reader.GetValueAsBool("psclientplugin", "extensivelogging", false);
     shutModeComboBox.SelectedIndex = reader.GetValueAsInt("psclientplugin", "shutdownmode", 1);
     forceCheckBox.Checked = reader.GetValueAsBool("psclientplugin", "forceshutdown", false);
     enableShutdownCheckBox.Checked = reader.GetValueAsBool("psclientplugin", "shutdownenabled", false);
     idleNumericUpDown.Value = reader.GetValueAsInt("psclientplugin", "idletimeout", 5);
   }
 }
 private static void LoadSettings()
 {
   using (Settings xmlreader = new MPSettings())
   {
     PreviewColumns = xmlreader.GetValueAsInt("thumbnails", "videothumbcols", 1);
     PreviewRows = xmlreader.GetValueAsInt("thumbnails", "videothumbrows", 1);
     LeaveShareThumb = xmlreader.GetValueAsBool("thumbnails", "videosharepreview", false);
     preRecordInterval = xmlreader.GetValueAsInt("thumbnails", "preRecordInterval", 1);
     Log.Debug("VideoThumbCreator: Settings loaded - using {0} columns and {1} rows. Share thumb = {2}, preRecordInterval = {3}.",
               PreviewColumns, PreviewRows, LeaveShareThumb, preRecordInterval);
   }
 }
 private static void LoadSettings()
 {
     using (Settings xmlreader = new MPSettings())
     {
         PreviewColumns  = xmlreader.GetValueAsInt("thumbnails", "videothumbcols", 1);
         PreviewRows     = xmlreader.GetValueAsInt("thumbnails", "videothumbrows", 1);
         LeaveShareThumb = xmlreader.GetValueAsBool("thumbnails", "videosharepreview", false);
         Log.Debug("VideoThumbCreator: Settings loaded - using {0} columns and {1} rows. Share thumb = {2}",
                   PreviewColumns, PreviewRows, LeaveShareThumb);
         NeedsConfigRefresh = false;
     }
 }
Beispiel #33
0
 private static void LoadSettings()
 {
     using (Settings xmlreader = new MPSettings())
     {
         PreviewColumns    = xmlreader.GetValueAsInt("thumbnails", "videothumbcols", 1);
         PreviewRows       = xmlreader.GetValueAsInt("thumbnails", "videothumbrows", 1);
         LeaveShareThumb   = xmlreader.GetValueAsBool("thumbnails", "videosharepreview", false);
         preRecordInterval = xmlreader.GetValueAsInt("thumbnails", "preRecordInterval", 1);
         Log.Debug("VideoThumbCreator: Settings loaded - using {0} columns and {1} rows. Share thumb = {2}, preRecordInterval = {3}.",
                   PreviewColumns, PreviewRows, LeaveShareThumb, preRecordInterval);
     }
 }
 private static void LoadSettings()
 {
   using (Settings xmlreader = new MPSettings())
   {
     PreviewColumns = xmlreader.GetValueAsInt("thumbnails", "videothumbcols", 1);
     PreviewRows = xmlreader.GetValueAsInt("thumbnails", "videothumbrows", 1);
     LeaveShareThumb = xmlreader.GetValueAsBool("thumbnails", "videosharepreview", false);
     Log.Debug("VideoThumbCreator: Settings loaded - using {0} columns and {1} rows. Share thumb = {2}",
               PreviewColumns, PreviewRows, LeaveShareThumb);
     NeedsConfigRefresh = false;
   }
 }
 public void LoadSettings()
 {
     using (Settings reader = new MPSettings())
     {
         homeOnlyCheckBox.Checked       = reader.GetValueAsBool("psclientplugin", "homeonly", true);
         extLogCheckBox.Checked         = reader.GetValueAsBool("psclientplugin", "extensivelogging", false);
         shutModeComboBox.SelectedIndex = reader.GetValueAsInt("psclientplugin", "shutdownmode", 1);
         forceCheckBox.Checked          = reader.GetValueAsBool("psclientplugin", "forceshutdown", false);
         enableShutdownCheckBox.Checked = reader.GetValueAsBool("psclientplugin", "shutdownenabled", false);
         idleNumericUpDown.Value        = reader.GetValueAsInt("psclientplugin", "idletimeout", 5);
     }
 }
Beispiel #36
0
 public override void LoadSettings()
 {
     using (Settings xmlreader = new MPSettings())
     {
         trackBarQuality.Value = xmlreader.GetValueAsInt("thumbnails", "quality", 3);
         checkBoxFolderThumbOnDemand.Checked = xmlreader.GetValueAsBool("thumbnails", "musicfolderondemand", true);
         checkBoxPicThumbOnDemand.Checked    = xmlreader.GetValueAsBool("thumbnails", "picturenolargethumbondemand", false);
         checkBoxVideoThumbs.Checked         = xmlreader.GetValueAsBool("thumbnails", "videoondemand", true);
         checkBoxShareThumb.Checked          = xmlreader.GetValueAsBool("thumbnails", "videosharepreview", false);
         numericUpDownThumbColumns.Value     = xmlreader.GetValueAsInt("thumbnails", "videothumbcols", 1);
         numericUpDownThumbRows.Value        = xmlreader.GetValueAsInt("thumbnails", "videothumbrows", 1);
     }
 }
 private void LoadSettings()
 {
     using (Settings xmlreader = new MPSettings())
     {
         _iQuality = xmlreader.GetValueAsInt("thumbnails", "quality", 3);
         _iQuality++;
         btnEnableMusicThumbs.Selected        = xmlreader.GetValueAsBool("thumbnails", "musicfolderondemand", true);
         btnEnablePicturesThumbs.Selected     = xmlreader.GetValueAsBool("thumbnails", "picturenolargethumbondemand", false);
         btnEnableVideosThumbs.Selected       = xmlreader.GetValueAsBool("thumbnails", "videoondemand", true);
         btnEnableLeaveThumbInFolder.Selected = xmlreader.GetValueAsBool("thumbnails", "videosharepreview", false);
         _iColumns = xmlreader.GetValueAsInt("thumbnails", "videothumbcols", 1);
         _iRows    = xmlreader.GetValueAsInt("thumbnails", "videothumbrows", 1);
     }
 }
 private void MpcHcSubsForm_Load(object sender, EventArgs e)
 {
     using (Settings xmlreader = new MPSettings())
     {
         int subPicsBufferAhead = xmlreader.GetValueAsInt("subtitles", "subPicsBufferAhead", 3);
         subPicsAheadUpDown.Value = subPicsBufferAhead;
         bool pow2textures = xmlreader.GetValueAsBool("subtitles", "pow2tex", false);
         pow2texCheckBox.Checked = pow2textures;
         string textureSize = xmlreader.GetValueAsString("subtitles", "textureSize", "Medium");
         textureComboBox.SelectedItem = textureSize;
         bool disableAnimation = xmlreader.GetValueAsBool("subtitles", "disableAnimation", true);
         disableAnimCheckBox.Checked = disableAnimation;
         posYUpDown.Value            = xmlreader.GetValueAsInt("subtitles", "adjustY", 0);
     }
 }
    private void LoadSettings()
    {
      using (Settings xmlreader = new MPSettings())
      {

        _iQuality = xmlreader.GetValueAsInt("thumbnails", "quality", 3);
        _iQuality++;
        btnEnableMusicThumbs.Selected = xmlreader.GetValueAsBool("thumbnails", "musicfolderondemand", true);
        btnEnablePicturesThumbs.Selected = xmlreader.GetValueAsBool("thumbnails", "picturenolargethumbondemand", false);
        btnEnableVideosThumbs.Selected = xmlreader.GetValueAsBool("thumbnails", "videoondemand", true);
        btnEnableLeaveThumbInFolder.Selected = xmlreader.GetValueAsBool("thumbnails", "videosharepreview", false);
        _iColumns = xmlreader.GetValueAsInt("thumbnails", "videothumbcols", 1);
        _iRows = xmlreader.GetValueAsInt("thumbnails", "videothumbrows", 1);
      }
    }
Beispiel #40
0
        static Logger()
        {
            using (Settings xmlreader = new MPSettings())
            {
                logLevel = xmlreader.GetValueAsInt("general", "loglevel", 1);
            }

            if (File.Exists(logFilename))
            {
                if (File.Exists(backupFilename))
                {
                    try
                    {
                        File.Delete(backupFilename);
                    }
                    catch
                    {
                        Error("Failed to remove old backup log");
                    }
                }
                try
                {
                    File.Move(logFilename, backupFilename);
                }
                catch
                {
                    Error("Failed to move logfile to backup");
                }
            }
        }
Beispiel #41
0
    public LastFMConfig()
    {
      InitializeComponent();
      using (var xmlreader = new MPSettings())
      {
        chkAutoDJ.Checked = xmlreader.GetValueAsBool("lastfm:test", "autoDJ", true);
        numRandomness.Value = xmlreader.GetValueAsInt("lastfm:test", "randomness", 100);
        chkAnnounce.Checked = xmlreader.GetValueAsBool("lastfm:test", "announce", true);
        chkScrobble.Checked = xmlreader.GetValueAsBool("lastfm:test", "scrobble", true);
        chkDiferentVersions.Checked = xmlreader.GetValueAsBool("lastfm:test", "allowDiffVersions", true);
      }

      if (string.IsNullOrEmpty(MusicDatabase.Instance.GetLastFMSK())) return;

      LastFMUser user;
      try
      {
        user = LastFMLibrary.GetUserInfo(MusicDatabase.Instance.GetLastFMUser());
      }
      catch (Exception ex)
      {
        Log.Error("Error getting user info for: {0}", MusicDatabase.Instance.GetLastFMUser());
        Log.Error(ex);
        return;
      }

      if (user == null || string.IsNullOrEmpty(user.UserImgURL)) return;

      pbLastFMUser.ImageLocation = user.UserImgURL;
    }
Beispiel #42
0
        public bool LoadPostProcessing(IGraphBuilder graphBuilder)
        {
            //LoadSettings();

            using (Settings xmlreader = new MPSettings())
            {
                audiodelayInterval = xmlreader.GetValueAsInt("FFDShow", "audiodelayInterval", 50);
            }

            IBaseFilter baseFilter = null;

            // No Postprocessing for FFDShow DXVA decoder
            DirectShowUtil.FindFilterByClassID(graphBuilder, FFDShowAPI.FFDShowVideoGuid, out baseFilter);
            if (baseFilter == null)
            {
                DirectShowUtil.FindFilterByClassID(graphBuilder, FFDShowAPI.FFDShowVideoRawGuid, out baseFilter);
            }
            if (baseFilter == null)
            {
                return(false);
            }
            ffdshowAPI        = new FFDShowAPI((object)baseFilter);
            hasPostProcessing = true;
            return(true);
        }
Beispiel #43
0
        private void LoadSettings()
        {
            using (Settings xmlreader = new MPSettings())
            {
                int  volumeStyle = xmlreader.GetValueAsInt("volume", "handler", 1);
                bool isDigital   = xmlreader.GetValueAsBool("volume", "digital", true);
                btnClassic.Selected     = volumeStyle == 0;
                btnWinXP.Selected       = volumeStyle == 1;
                btnLogarithmic.Selected = volumeStyle == 2;
                btnCustom.Selected      = volumeStyle == 3;
                btnVistaWin7.Selected   = volumeStyle == 4;
                _customVolume           = xmlreader.GetValueAsString("volume", "table",
                                                                     "0, 4095, 8191, 12287, 16383, 20479, 24575, 28671, 32767, 36863, 40959, 45055, 49151, 53247, 57343, 61439, 65535");

                // When Upmixing has selected, we need to use Wave Volume
                _useMixing = xmlreader.GetValueAsBool("audioplayer", "mixing", false);

                if (_useMixing)
                {
                    isDigital = true;
                }

                btnMasterVolume.Selected = !isDigital;
                btnWave.Selected         = isDigital;

                btnEnableOSDVolume.Selected = xmlreader.GetValueAsBool("volume", "defaultVolumeOSD", true);
            }
        }
    public TvNotifyManager()
    {
      using (Settings xmlreader = new MPSettings())
      {
        _enableRecNotification = xmlreader.GetValueAsBool("mytv", "enableRecNotifier", false);
        _preNotifyConfig = xmlreader.GetValueAsInt("mytv", "notifyTVBefore", 300);
      }

      _busy = false;
      _timer = new Timer();
      _timer.Stop();
      // check every 15 seconds for notifies
      _dummyuser = new User();
      _dummyuser.IsAdmin = false;
      _dummyuser.Name = "Free channel checker";
      _timer.Interval = 15000;
      _timer.Enabled = true;
      // Execute TvNotifyManager in a separate thread, so that it doesn't block the Main UI Render thread when Tvservice connection died
      new Thread(() =>
                   {
                     _timer.Tick += new EventHandler(_timer_Tick);

                   }
        ) {Name = "TvNotifyManager"}.Start();
      _notifiedRecordings = new ArrayList();
    }
    public override void DoModal(int dwParentId)
    {
      int nagCount;
      using (Settings xmlreader = new MPSettings())
      {
        nagCount = xmlreader.GetValueAsInt("general", "skinobsoletecount", 0);
      }

      //if (chkIgnore != null)
      //{
        chkIgnore.Visible = nagCount > 4;
      //}
      
      GUIPropertyManager.SetProperty("#userskin", _userSkin);
      _timeLeft = 0;
      timeStart = DateTime.Now;
      UpdateCountDown(0);
      base.DoModal(dwParentId);
      GUIPropertyManager.SetProperty("#userskin", "");
      GUIPropertyManager.SetProperty("#countdownseconds", "");

      if (RevertToUserSkin)
      {
        nagCount++; 
      }

      using (Settings xmlwriter = new MPSettings())
      {
        xmlwriter.SetValueAsBool("general", "dontshowskinversion", chkIgnore.Selected);
        xmlwriter.SetValue("general", "skinobsoletecount", nagCount);
      }
    }
 private void LoadSettings()
 {
     using (Settings xmlreader = new MPSettings())
     {
         //Video Codecs
         _strVideoCodec     = xmlreader.GetValueAsString("movieplayer", "mpeg2videocodec", "");
         _strH264VideoCodec = xmlreader.GetValueAsString("movieplayer", "h264videocodec", "");
         _strAudioCodec     = xmlreader.GetValueAsString("movieplayer", "mpeg2audiocodec", "");
         _strVC1VideoCodec  = xmlreader.GetValueAsString("movieplayer", "vc1videocodec", "");
         _strVC1iVideoCodec = xmlreader.GetValueAsString("movieplayer", "vc1ivideocodec", "");
         _strDivXVideoCodec = xmlreader.GetValueAsString("movieplayer", "xvidvideocodec", "");
         // AR
         string aspectRatioText = xmlreader.GetValueAsString("movieplayer", "defaultar", "Normal");
         _aspectRatio = Utils.GetAspectRatio(aspectRatioText);
         // Audio codecs
         _strAudioRenderer        = xmlreader.GetValueAsString("movieplayer", "audiorenderer", "Default DirectSound Device");
         _strAACAudioCodec        = xmlreader.GetValueAsString("movieplayer", "aacaudiocodec", "");
         _defaultSubtitleLanguage = xmlreader.GetValueAsString("subtitles", "language", "EN");
         _defaultAudioLanguage    = xmlreader.GetValueAsString("movieplayer", "audiolanguage", "EN");
         // Splitter
         _strSplitterFilter         = xmlreader.GetValueAsString("movieplayer", "splitterfilter", "");
         _strSplitterFilesyncFilter = xmlreader.GetValueAsString("movieplayer", "splitterfilefilter", "");
         // Subs/Language
         _subtitleSettings           = xmlreader.GetValueAsBool("subtitles", "enabled", false);
         btnEnableSubtitles.Selected = _subtitleSettings;
         _playAll = xmlreader.GetValueAsInt("movies", "playallinfolder", 3);
     }
 }
    private void LoadSettings()
    {
      using (Settings xmlreader = new MPSettings())
      {
        int volumeStyle = xmlreader.GetValueAsInt("volume", "handler", 1);
        bool isDigital = xmlreader.GetValueAsBool("volume", "digital", true);
        btnClassic.Selected = volumeStyle == 0;
        btnWinXP.Selected = volumeStyle == 1;
        btnLogarithmic.Selected= volumeStyle == 2;
        btnCustom.Selected = volumeStyle == 3;
        btnVistaWin7.Selected = volumeStyle == 4;
        _customVolume = xmlreader.GetValueAsString("volume", "table",
                                              "0, 4095, 8191, 12287, 16383, 20479, 24575, 28671, 32767, 36863, 40959, 45055, 49151, 53247, 57343, 61439, 65535");

        // When Upmixing has selected, we need to use Wave Volume
        _useMixing = xmlreader.GetValueAsBool("audioplayer", "mixing", false);
        
        if (_useMixing)
        {
          isDigital = true;
        }

        btnMasterVolume.Selected = !isDigital;
        btnWave.Selected = isDigital;

        btnEnableOSDVolume.Selected = xmlreader.GetValueAsBool("volume", "defaultVolumeOSD", true);
      }
    }
Beispiel #48
0
        private void LoadRemotes()
        {
            using (Settings xmlreader = new MPSettings())
            {
                XmlNodeList listRemotes = doc.DocumentElement.SelectNodes("/mappings/remote");

                foreach (XmlNode nodeRemote in listRemotes)
                {
                    mpRemotenumber.Items.Add(nodeRemote.Attributes["family"].Value.ToString());
                }

                int Index = xmlreader.GetValueAsInt("remote", "remotenumberindex" + m_sRemoteClass, -1);

                if (mpRemotenumber.Items.Count > 1 && Index == -1)
                {
                    MessageBox.Show("Please select the correct remote control model");
                    mpRemotenumber.SelectedIndex = 0;
                }
                else if (Index == -1)
                {
                    mpRemotenumber.SelectedIndex = 0;
                }
                else
                {
                    mpRemotenumber.SelectedIndex = Index;
                }
            }
        }
Beispiel #49
0
    public void LoadSettings()
    {
      using (Settings xmlreader = new MPSettings())
      {
        defStyle = new SubtitleStyle();
        defStyle.Load(xmlreader);
        delayInterval = xmlreader.GetValueAsInt("subtitles", "delayInterval", 250);

        bool save = xmlreader.GetValueAsBool("subtitles", "saveNever", true);
        if (save)
        {
          autoSaveType = AutoSaveTypeEnum.NEVER;
        }
        else
        {
          save = xmlreader.GetValueAsBool("subtitles", "saveAsk", false);
          autoSaveType = (save ? AutoSaveTypeEnum.ASK : AutoSaveTypeEnum.ALWAYS);
        }

        posRelativeToFrame = xmlreader.GetValueAsBool("subtitles", "subPosRelative", false);
        overrideASSStyle = xmlreader.GetValueAsBool("subtitles", "subStyleOverride", false);
        subPaths = xmlreader.GetValueAsString("subtitles", "paths", @".\");
        adjustPosY = xmlreader.GetValueAsInt("subtitles", "adjustY", 0);
        autoShow = xmlreader.GetValueAsBool("subtitles", "enabled", true);
        selectionOff = xmlreader.GetValueAsBool("subtitles", "selectionoff", true);
        LoadAdvancedSettings(xmlreader);
      }
    }
Beispiel #50
0
    private bool restartIRApp = false; // Restart Haupp. IR-app. after MP quit

    /// <summary>
    /// Initialization
    /// </summary>
    public HcwHelper()
    {
      InitializeComponent();

      using (Settings xmlreader = new MPSettings())
      {
        logVerbose = xmlreader.GetValueAsBool("remote", "HCWVerboseLog", false);
        port = xmlreader.GetValueAsInt("remote", "HCWHelperPort", 2110);
        hcwEnabled = xmlreader.GetValueAsBool("remote", "HCW", false);
      }

      connection = new Connection(logVerbose);
      if (hcwEnabled && (GetDllPath() != string.Empty) && connection.Start(port) &&
          irremote.IRSetDllDirectory(GetDllPath()))
      {
        Thread checkThread = new Thread(new ThreadStart(CheckThread));
        checkThread.IsBackground = true;
        checkThread.Priority = ThreadPriority.Highest;
        checkThread.Name = "HcwHelperChecker";
        checkThread.Start();
        connection.ReceiveEvent += new Connection.ReceiveEventHandler(OnReceive);
        StartIR();
      }
      else
      {
        connection.Send(port + 1, "APP", "STOP", DateTime.Now);
        Application.Exit();
      }
    }
Beispiel #51
0
    public VolumeHandler(int[] volumeTable)
    {
      if (GUIGraphicsContext.DeviceAudioConnected > 0)
      {
        bool isDigital;

        using (Settings reader = new MPSettings())
        {
          int levelStyle = reader.GetValueAsInt("volume", "startupstyle", 0);

          if (levelStyle == 0)
          {
            _startupVolume = Math.Max(0, Math.Min(65535, reader.GetValueAsInt("volume", "lastknown", 52428)));
          }

          if (levelStyle == 1)
          {
          }

          if (levelStyle == 2)
          {
            _startupVolume = Math.Max(0, Math.Min(65535, reader.GetValueAsInt("volume", "startuplevel", 52428)));
          }

          isDigital = reader.GetValueAsBool("volume", "digital", false);

          _showVolumeOSD = reader.GetValueAsBool("volume", "defaultVolumeOSD", true);
        }

        try
        {
          _mixer = new Mixer.Mixer();
          _mixer.Open(0, isDigital);
          _volumeTable = volumeTable;
          _mixer.ControlChanged += mixer_ControlChanged;
        }
        catch (Exception ex)
        {
          Log.Error("VolumeHandler: Mixer exception when init {0}", ex);
        }
      }
      else
      {
        _volumeTable = volumeTable;
      }
    }
Beispiel #52
0
    public MusicDBReorg()
    {
      // load settings
      using (Settings reader = new MPSettings())
      {
        _runMondays = reader.GetValueAsBool("musicdbreorg", "monday", false);
        _runTuesdays = reader.GetValueAsBool("musicdbreorg", "tuesday", false);
        _runWednesdays = reader.GetValueAsBool("musicdbreorg", "wednesday", false);
        _runThursdays = reader.GetValueAsBool("musicdbreorg", "thursday", false);
        _runFridays = reader.GetValueAsBool("musicdbreorg", "friday", false);
        _runSaturdays = reader.GetValueAsBool("musicdbreorg", "saturday", false);
        _runSundays = reader.GetValueAsBool("musicdbreorg", "sunday", false);
        _runHours = reader.GetValueAsInt("musicdbreorg", "hours", 0);
        _runMinutes = reader.GetValueAsInt("musicdbreorg", "minutes", 0);
      }

      mDB = MusicDatabase.Instance;
    }
    public override void LoadSettings()
    {
      Log.Info("load volume");
      // default default
      _useClassicHandler.Checked = true;

      using (Settings reader = new MPSettings())
      {
        int volumeStyle = reader.GetValueAsInt("volume", "handler", 1);
        bool isDigital = reader.GetValueAsBool("volume", "digital", true);

        // Force a couple of settings for Vista / Windows 7
        if (OSInfo.OSInfo.VistaOrLater())
        {
          volumeStyle = 4;
          groupBoxMixerControl.Enabled = false;
        }

        if (OSInfo.OSInfo.Win7OrLater())
        {
          isDigital = true;
          groupBoxScale.Enabled = false;
        }

        _useClassicHandler.Checked = volumeStyle == 0;
        _useWindowsHandler.Checked = volumeStyle == 1;
        _useLogarithmicHandler.Checked = volumeStyle == 2;
        _useCustomHandler.Checked = volumeStyle == 3;
        _useVistaHandler.Checked = volumeStyle == 4;
        _customText = reader.GetValueAsString("volume", "table",
                                              "0, 4095, 8191, 12287, 16383, 20479, 24575, 28671, 32767, 36863, 40959, 45055, 49151, 53247, 57343, 61439, 65535");

        int startupStyle = reader.GetValueAsInt("volume", "startupstyle", 0);

        _useLastKnownLevel.Checked = startupStyle == 0;
        _useSystemCurrent.Checked = startupStyle == 1;
        _useCustomLevel.Checked = startupStyle == 2;
        _customLevel = reader.GetValueAsInt("volume", "startuplevel", 52428);

        // When Upmixing has selected, we need to use Wave Volume
        if (SettingsForm.audioplayer_mixing)
        {
          isDigital = true;
          groupBoxMixerControl.Enabled = false;
        }
        _useMasterVolume.Checked = !isDigital;
        _useWave.Checked = isDigital;

        _useVolumeOSD.Checked = reader.GetValueAsBool("volume", "defaultVolumeOSD", true);
      }

      _customTextbox.Enabled = _useCustomHandler.Checked;
      _customTextbox.Text = _customTextbox.Enabled ? _customText : string.Empty;

      _levelTextbox.Enabled = _useCustomLevel.Checked;
      _levelTextbox.Text = _levelTextbox.Enabled ? _customLevel.ToString() : string.Empty;
    }
 public override bool Init()
 {
     bool bResult = Load(GUIGraphicsContext.Skin + @"\HeadWebFullScreen.xml");
     using (Settings settings = new MPSettings())
     {
         typeof(GUIVideoFullscreen).InvokeMember("_immediateSeekIsRelative", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.SetField, null, this, new object[] { settings.GetValueAsBool("movieplayer", "immediateskipstepsisrelative", true) });
         typeof(GUIVideoFullscreen).InvokeMember("_immediateSeekValue", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.SetField, null, this, new object[] { settings.GetValueAsInt("movieplayer", "immediateskipstepsize", 10) });
     }
     return bResult;
 }
    public override bool Init()
    {
      bool bResult = Load(GUIGraphicsContext.Skin + @"\topbar.xml");
      GetID = (int)Window.WINDOW_TOPBAR;
      m_bEnabled = PluginManager.IsPluginNameEnabled("Topbar");

      using (Settings xmlreader = new MPSettings())
      {
        m_iAutoHideTimeOut = xmlreader.GetValueAsInt("TopBar", "autohidetimeout", 15);

        m_bOverrideSkinAutoHide = false;
        if (xmlreader.GetValueAsInt("TopBar", "overrideskinautohide", 0) == 1)
        {
          m_bOverrideSkinAutoHide = true;
        }

        GUIGraphicsContext.DefaultTopBarHide = this.AutoHideTopbar; // default autohide option
        m_bTopBarAutoHide = this.AutoHideTopbar; // Get topbar skin setting
        m_bTopBarHidden = m_bTopBarAutoHide;

        if (m_bOverrideSkinAutoHide)
        {
          m_bTopBarAutoHide = false;
          if (xmlreader.GetValueAsInt("TopBar", "autohide", 0) == 1)
          {
            m_bTopBarAutoHide = true;
          }
          GUIGraphicsContext.TopBarHidden = m_bTopBarAutoHide;
        }
      }

      // Topbar region
      foreach (CPosition pos in _listPositions)
      {
        if ((pos.YPos + pos.control.Height) > m_iTopbarRegion)
        {
          m_iTopbarRegion = pos.YPos + pos.control.Height;
        }
      }

      GUILayerManager.RegisterLayer(this, GUILayerManager.LayerType.Topbar2);
      return bResult;
    }
Beispiel #56
0
 private void LoadSettings()
 {
     using (Settings xmlreader = new MPSettings())
     {
         _serveradress = xmlreader.GetValueAsString("MPDomoticz", "ServerAdress", "localhost");
         _serverport = xmlreader.GetValueAsString("MPDomoticz", "ServerPort", "8080");
         _username = xmlreader.GetValueAsString("MPDomoticz", "Username", "");
         _password = xmlreader.GetValueAsString("MPDomoticz", "Password", "");
         RefreshInterval = xmlreader.GetValueAsInt("MPDomoticz", "RefreshInterval", 30);
     }
 }
Beispiel #57
0
    public override void LoadSettings()
    {
      using (Settings xmlreader = new MPSettings())
      {
        durationTextBox.Text = Convert.ToString(xmlreader.GetValueAsInt("pictures", "speed", 3));
        transitionTextBox.Text = Convert.ToString(xmlreader.GetValueAsInt("pictures", "transition", 15));
        kenburnsTextBox.Text = Convert.ToString(xmlreader.GetValueAsInt("pictures", "kenburnsspeed", 15));
        radioButtonRandom.Checked = xmlreader.GetValueAsBool("pictures", "random", false);
        radioButtonKenBurns.Checked = xmlreader.GetValueAsBool("pictures", "kenburns", false);
        radioButtonXFade.Checked = !radioButtonRandom.Checked && !radioButtonKenBurns.Checked;

        autoShuffleCheckBox.Checked = xmlreader.GetValueAsBool("pictures", "autoShuffle", false);
        repeatSlideshowCheckBox.Checked = xmlreader.GetValueAsBool("pictures", "autoRepeat", true);

        checkBoxUseExif.Checked = xmlreader.GetValueAsBool("pictures", "useExif", true);
        checkBoxUsePicasa.Checked = xmlreader.GetValueAsBool("pictures", "usePicasa", false);

        checkBoxGroupDays.Checked = xmlreader.GetValueAsBool("pictures", "useDayGrouping", false);
        checkBoxEnableVideo.Checked = xmlreader.GetValueAsBool("pictures", "enableVideoPlayback", false);
        checkBoxPlayVideosInSlideshow.Checked = xmlreader.GetValueAsBool("pictures", "playVideosInSlideshows", false);
      }
    }
Beispiel #58
0
    public override void LoadSettings()
    {
      using (Settings xmlreader = new MPSettings())
      {
        loglevel = xmlreader.GetValueAsString("general", "loglevel", "3"); // set loglevel to 2:info 3:debug
        cbDebug.SelectedIndex = Convert.ToInt16(loglevel);

        string prio = xmlreader.GetValueAsString("general", "ThreadPriority", "Normal");
        // Set the selected index, otherwise the SelectedItem in SaveSettings will be null, if the box isn't checked
        mpThreadPriority.SelectedIndex = mpThreadPriority.Items.IndexOf(prio);

        checkBoxEnableWatchdog.Checked = xmlreader.GetValueAsBool("general", "watchdogEnabled", false);
        checkBoxAutoRestart.Checked = xmlreader.GetValueAsBool("general", "restartOnError", true);
        numericUpDownDelay.Value = xmlreader.GetValueAsInt("general", "restart delay", 10);
      }
    }
    private static void LoadSettings()
    {
      using (var xmlreader = new MPSettings())
      {
        //TODO: Is randomness still required?
        _randomness = xmlreader.GetValueAsInt("lastfm:test", "randomness", 100);
        _allowMultipleVersions = xmlreader.GetValueAsBool("lastfm:test", "allowDiffVersions", true);
        _announceTracks = xmlreader.GetValueAsBool("lastfm:test", "announce", true);
        _scrobbleTracks = xmlreader.GetValueAsBool("lastfm:test", "scrobble", true);
        _avoidDuplicates = xmlreader.GetValueAsBool("lastfm:test", "avoidDuplicates", true);
        _autoDJFilter = xmlreader.GetValueAsString("lastfm:test", "autoDJFilter", string.Empty);
      }

      var sk = MusicDatabase.Instance.GetLastFMSK();
      if (string.IsNullOrEmpty(sk))
      {
        _userDefined = false;
      }
    }
    public override void LoadSettings()
    {
      base.LoadSettings();
      if (_init == false)
      {
        using (Settings xmlreader = new MPSettings())
        {
          //VMR9 settings
          checkboxMpNonsquare.Checked = xmlreader.GetValueAsBool("general", "nonsquare", true);
          // http://msdn2.microsoft.com/en-us/library/ms787438(VS.85).aspx
          checkboxDXEclusive.Checked = xmlreader.GetValueAsBool("general", "exclusivemode", true);
          mpVMR9FilterMethod.Text = xmlreader.GetValueAsString("general", "dx9filteringmode", "Gaussian Quad Filtering");
          // http://msdn2.microsoft.com/en-us/library/ms788066.aspx
          checkBoxVMRWebStreams.Checked = xmlreader.GetValueAsBool("general", "usevrm9forwebstreams", true);
          checkBoxDecimateMask.Checked = xmlreader.GetValueAsBool("general", "dx9decimatemask", false);
          // http://msdn2.microsoft.com/en-us/library/ms787452(VS.85).aspx

          bool ValueEVR = false;

          try
          {
            //EVR - VMR9 selection
            ValueEVR = OSInfo.OSInfo.VistaOrLater() ? true : false;
          }
          catch (Exception ex)
          {
            Log.Error("FilterVideoRendererConfig: Os detection unsuccessful - {0}", ex.Message);
          }

          radioButtonEVR.Checked = xmlreader.GetValueAsBool("general", "useEVRenderer", ValueEVR);
          radioButtonMadVR.Checked = xmlreader.GetValueAsBool("general", "useMadVideoRenderer", false);
          UseEVRMadVRForTV.Checked = xmlreader.GetValueAsBool("general", "useEVRMadVRForTV", false);
          DisableLowLatencyMode.Checked = xmlreader.GetValueAsBool("general", "disableLowLatencyMode", false);
          UseMadVideoRenderer3D.Checked = xmlreader.GetValueAsBool("general", "useMadVideoRenderer3D", false);
          numericUpDownFrame.Value = xmlreader.GetValueAsInt("general", "reduceMadvrFrame", 0);
          reduceMadvrFrame.Checked = xmlreader.GetValueAsBool("general", "useReduceMadvrFrame", false);
          DRCheckBox.Checked = xmlreader.GetValueAsBool("general", "useInternalDRC", false);
        }
        _init = true;
      }
    }