public MainWindow()
        {
            InitializeComponent();

            // InitializeComponent()によって、チェックボックスのチェックイベントが発生し
            // mPreferenceの内容が変わるので、InitializeComponent()の後にロードする。

            mPreference = PreferenceStore.Load();

            mDataGridPlayListHandler = new DataGridPlayListHandler(mDataGridPlayList);
            mLabelAlbumName.Content  = "";
            mBackgroundLoad.WorkerSupportsCancellation = true;
            mBackgroundPlay.WorkerSupportsCancellation = true;
            mTextBoxBufferSizeMs.Text = string.Format(CultureInfo.InvariantCulture, "{0}", mPreference.BufferSizeMillisec);
            switch (mPreference.WasapiDataFeedMode)
            {
            case WasapiPcmUtil.WasapiDataFeedModeType.TimerDriven:
                mRadioButtonTimer.IsChecked = true;
                break;

            case WasapiPcmUtil.WasapiDataFeedModeType.EventDriven:
            default:
                mRadioButtonEvent.IsChecked = true;
                break;
            }

            switch (mPreference.SharedOrExlusive)
            {
            case WasapiPcmUtil.WasapiSharedOrExclusiveType.Shared:
                mRadioButtonShared.IsChecked = true;
                break;

            case WasapiPcmUtil.WasapiSharedOrExclusiveType.Exclusive:
            default:
                mRadioButtonExclusive.IsChecked = true;
                break;
            }

            Title = string.Format(CultureInfo.InvariantCulture, "PlayPcmWinAlbum {0} {1}",
                                  AssemblyVersion, IntPtr.Size == 8 ? "64bit" : "32bit");

            LocalizeTexts();
        }
Exemple #2
0
        public static bool Save(Preference p)
        {
            var xmlRW = new WWXmlRW.XmlRW <Preference>(m_fileName);

            return(xmlRW.Save(p));
        }