Exemple #1
0
        /// <summary>
        /// コントロールカーブの時間解像度の設定値を設定します
        /// </summary>
        /// <param name="value">設定する時間解像度</param>
        public void setControlCurveResolution(ClockResolution value)
        {
            int count = -1;

            foreach (var vt in ClockResolutionUtility.iterator())
            {
                count++;
                if (vt.Equals(value))
                {
                    comboResolControlCurve.SelectedIndex = count;
                    break;
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// コントロールカーブの時間解像度の設定値を取得します
        /// </summary>
        /// <returns>コントロールカーブの時間解像度の設定値</returns>
        public ClockResolution getControlCurveResolution()
        {
            int count = -1;
            int index = comboResolControlCurve.SelectedIndex;

            foreach (var vt in ClockResolutionUtility.iterator())
            {
                count++;
                if (count == index)
                {
                    return(vt);
                }
            }
            comboResolControlCurve.SelectedIndex = 0;
            return(ClockResolution.L30);
        }
 public int getControlCurveResolutionValue()
 {
     return(ClockResolutionUtility.getValue(ControlCurveResolution));
 }
Exemple #4
0
        public Preference()
        {
            InitializeComponent();
            fontDialog = new FontDialog();
            fontDialog.AllowVectorFonts   = false;
            fontDialog.AllowVerticalFonts = false;
            fontDialog.FontMustExist      = true;
            fontDialog.ShowEffects        = false;
            openUtauCore = new OpenFileDialog();

            folderBrowserSingers = new FolderBrowserDialog();
            folderBrowserSingers.ShowNewFolderButton = false;
            applyLanguage();

            comboVibratoLength.Items.Clear();
            foreach (DefaultVibratoLengthEnum dvl in Enum.GetValues(typeof(DefaultVibratoLengthEnum)))
            {
                comboVibratoLength.Items.Add(DefaultVibratoLengthUtil.toString(dvl));
            }
            comboVibratoLength.SelectedIndex = 1;

            txtAutoVibratoThresholdLength.Text = "480";

            comboAutoVibratoType1.Items.Clear();
            foreach (var vconfig in VocaloSysUtil.vibratoConfigIterator(SynthesizerType.VOCALOID1))
            {
                comboAutoVibratoType1.Items.Add(vconfig);
            }
            if (comboAutoVibratoType1.Items.Count > 0)
            {
                comboAutoVibratoType1.SelectedIndex = 0;
            }

            comboAutoVibratoType2.Items.Clear();
            foreach (var vconfig in VocaloSysUtil.vibratoConfigIterator(SynthesizerType.VOCALOID2))
            {
                comboAutoVibratoType2.Items.Add(vconfig);
            }
            if (comboAutoVibratoType2.Items.Count > 0)
            {
                comboAutoVibratoType2.SelectedIndex = 0;
            }

            updateCustomVibrato();

            comboResolControlCurve.Items.Clear();
            foreach (var cr in ClockResolutionUtility.iterator())
            {
                comboResolControlCurve.Items.Add(ClockResolutionUtility.toString(cr));
            }
            comboResolControlCurve.SelectedIndex = 0;

            comboLanguage.Items.Clear();
            string[] list  = Messaging.getRegisteredLanguage();
            int      index = 0;

            comboLanguage.Items.Add("Default");
            int count = 0;

            foreach (string s in list)
            {
                count++;
                comboLanguage.Items.Add(s);
                if (s.Equals(Messaging.getLanguage()))
                {
                    index = count;
                }
            }
            comboLanguage.SelectedIndex = index;

            SingerConfig[] dict = VocaloSysUtil.getSingerConfigs(SynthesizerType.VOCALOID2);
            m_program_change = new List <string>();
            comboDefualtSinger.Items.Clear();
            foreach (SingerConfig kvp in dict)
            {
                m_program_change.Add(kvp.VOICENAME);
                comboDefualtSinger.Items.Add(kvp.VOICENAME);
            }
            comboDefualtSinger.Enabled = (comboDefualtSinger.Items.Count > 0);
            if (comboDefualtSinger.Items.Count > 0)
            {
                comboDefualtSinger.SelectedIndex = 0;
            }

            updateMidiDevice();

            listSingers.Columns[0].Width = columnWidthHeaderProgramChange;
            listSingers.Columns[1].Width = columnWidthHeaderName;
            listSingers.Columns[2].Width = columnWidthHeaderPath;


            numBuffer.Maximum = EditorConfig.MAX_BUFFER_MILLISEC;
            numBuffer.Minimum = EditorConfig.MIN_BUFFER_MILLIXEC;

            registerEventHandlers();
            setResources();
        }