Beispiel #1
0
        public void RefreshSetting()
        {
            OutputDir             = Config.OutputDir();
            OnlyM4a               = Config.OnlyM4a();
            AddHyphen             = Config.AddHyphen();
            ToChinese             = Config.ToChinese();
            CheckExist            = Config.CheckExist();
            ArtistBeforeTitle     = Config.ArtistBeforeTitle();
            ThreadNum             = AIGS.Common.Convert.ConverStringToInt(Config.ThreadNum()) - 1;
            SearchNum             = AIGS.Common.Convert.ConverStringToInt(Config.SearchNum()) / 10 - 1;
            QualityList           = TidalTool.getQualityList();
            ResolutionList        = TidalTool.getResolutionList();
            SelectQualityIndex    = QualityList.IndexOf(Config.Quality().ToUpper());
            SelectResolutionIndex = ResolutionList.IndexOf(Config.Resolution().ToUpper());

            if (SelectQualityIndex < 0)
            {
                SelectQualityIndex = 0;
            }
            if (SelectResolutionIndex < 0)
            {
                SelectResolutionIndex = 0;
            }
            if (ThreadNum < 0)
            {
                ThreadNum = 0;
            }
            if (SearchNum < 0 || SearchNum > 5)
            {
                SearchNum = 0;
            }
        }
Beispiel #2
0
        public void Setting()
        {
            VMSetting.RefreshSetting();
            Manager.ShowDialog(VMSetting);
            string sValue = Config.ThreadNum();

            ThreadTool.SetThreadNum(int.Parse(sValue));

            SelectQualityIndex    = QualityList.IndexOf(Config.Quality().ToUpper());
            SelectResolutionIndex = ResolutionList.IndexOf(Config.Resolution().ToUpper());
        }
Beispiel #3
0
 private void initQuality(SelectListItem emptyItem)
 {
     for (int i = 1; i <= 5; ++i)
     {
         QualityList.Add(new SelectListItem()
         {
             Text  = i.ToString(),
             Value = i.ToString()
         });
     }
     QualityList.Add(emptyItem);
 }
Beispiel #4
0
        public void RefreshSetting()
        {
            OutputDir              = Config.OutputDir();
            OnlyM4a                = Config.OnlyM4a();
            AddExplicitTag         = Config.AddExplicitTag();
            IncludeEPSingle        = Config.IncludeEP();
            AddHyphen              = Config.AddHyphen();
            SaveCovers             = Config.SaveCovers();
            ToChinese              = Config.ToChinese();
            MaxFileName            = CheckMaxName(Config.MaxFileName());
            MaxDirName             = CheckMaxName(Config.MaxDirName());
            CheckExist             = Config.CheckExist();
            ArtistBeforeTitle      = Config.ArtistBeforeTitle();
            AddYearIndex           = Config.AddYear();
            ThreadNum              = AIGS.Common.Convert.ConverStringToInt(Config.ThreadNum()) - 1;
            SearchNum              = AIGS.Common.Convert.ConverStringToInt(Config.SearchNum()) / 10 - 1;
            QualityList            = TidalTool.getQualityList();
            ResolutionList         = TidalTool.getResolutionList();
            SelectQualityIndex     = QualityList.IndexOf(Config.Quality().ToUpper());
            SelectResolutionIndex  = ResolutionList.IndexOf(Config.Resolution().ToUpper());
            UseTrackNumber         = Config.UseTrackNumber();
            AddAlbumIDBeforeFolder = Config.AddAlbumIDBeforeFolder();

            if (SelectQualityIndex < 0)
            {
                SelectQualityIndex = 0;
            }
            if (SelectResolutionIndex < 0)
            {
                SelectResolutionIndex = 0;
            }
            if (ThreadNum < 0)
            {
                ThreadNum = 0;
            }
            if (SearchNum < 0 || SearchNum > 5)
            {
                SearchNum = 0;
            }
        }
Beispiel #5
0
        public MainViewModel(IWindowManager manager,
                             SettingViewModel setting,
                             AboutViewModel about,
                             InfoViewModel albuminfo,
                             SearchViewModel search,
                             DllistViewModel dllist)
        {
            Manager   = manager;
            VMSetting = setting;
            VMAbout   = about;
            VMInfo    = albuminfo;
            VMSearch  = search;
            VMDllist  = dllist;
            ThreadTool.SetThreadNum(int.Parse(Config.ThreadNum()));

            UpdateThread = new Thread(ThreadUpdateFunc);
            UpdateThread.IsBackground = true;
            UpdateThread.Start();

            QualityList        = TidalTool.getQualityList();
            SelectQualityIndex = QualityList.IndexOf(Config.Quality().ToUpper());
            if (SelectQualityIndex < 0)
            {
                SelectQualityIndex = 0;
            }

            ResolutionList        = TidalTool.getResolutionList();
            SelectResolutionIndex = ResolutionList.IndexOf(Config.Resolution().ToUpper());
            if (SelectResolutionIndex < 0)
            {
                SelectResolutionIndex = 0;
            }

            TidalTool.SetSearchMaxNum(int.Parse(Config.SearchNum()));

            //test
            //VMDllist.Convert();
            //return;
        }
        public SettingViewModel()
        {
            OutputDir             = Config.OutputDir();
            OnlyM4a               = Config.OnlyM4a();
            ThreadNum             = AIGS.Common.Convert.ConverStringToInt(Config.ThreadNum()) - 1;
            QualityList           = TidalTool.getQualityList();
            ResolutionList        = TidalTool.getResolutionList();
            SelectQualityIndex    = QualityList.IndexOf(Config.Quality().ToUpper());
            SelectResolutionIndex = ResolutionList.IndexOf(Config.Resolution().ToUpper());

            if (SelectQualityIndex < 0)
            {
                SelectQualityIndex = 0;
            }
            if (SelectResolutionIndex < 0)
            {
                SelectResolutionIndex = 0;
            }
            if (ThreadNum < 0)
            {
                ThreadNum = 0;
            }
        }