Exemplo n.º 1
0
        private ComposeSettings getComposeSettingFromPreference()
        {
            ComposeSettings composeSetting = new ComposeSettings();

            if ((Preference.Get("compose.randomKeyEnable") == "1"))
            {
                composeSetting.randomKeyEnable  = true;
                composeSetting.minorKeyEnable   = (Preference.Get("compose.minorKeyEnable") == "1");
                composeSetting.sharpedKeyEnable = (Preference.Get("compose.sharpedKeyEnable") == "1");
            }
            else
            {
                composeSetting.keyDegree    = Int16.Parse(Preference.Get("compose.keyDegree"));
                composeSetting.minorKeyFlag = (Preference.Get("compose.minorKeyFlag") == "1");
            }
            composeSetting.substituteChordEnable = (Preference.Get("compose.substituteChordEnable") == "1");

            return(composeSetting);
        }
Exemplo n.º 2
0
        private void runToolStripMenuItem_Click(object sender, EventArgs e)
        {
            List <String> errors = new List <String>();

            if (!validateInput(errors))
            {
                errorMessage.Text = "";
                foreach (String errorStr in errors)
                {
                    errorMessage.Text += errorStr + "\n";
                }

                ControllerEffect.SlideDown effect = new ControllerEffect.SlideDown(ErrorMessagePanel, 150, 50);
                tickHandlers.Add(effect);
                return;
            }


            loadPreferenceFromInput();

            song = new Song(Int16.Parse(Preference.Get("compose.barCount")));

            ChordTypeMapper chordTypeMapper = new ChordTypeMapper();

            chordTypeMapper.Map(song);

            ComposeSettings composeSetting = getComposeSettingFromPreference();
            ChordMapper     chordMapper    = new ChordMapper(composeSetting);

            chordMapper.Map(song);

            FlatSecondFilter flatSecondFilter = new FlatSecondFilter(Int16.Parse(Preference.Get("base_line_filter.frequency")));

            flatSecondFilter.Run(song);

            DominantFilter dominantFilter = new DominantFilter(Int16.Parse(Preference.Get("dominant_filter.frequency")));

            dominantFilter.Run(song);

            canvas.Invalidate();
        }
Exemplo n.º 3
0
        public static void Set(String key, String value)
        {
            Preference pref = Preference.GetInstance();

            pref.SetInner(key, value);
        }
Exemplo n.º 4
0
        public static String Get(String key)
        {
            Preference pref = Preference.GetInstance();

            return(pref.GetInner(key));
        }