public void setDefaultVibratoLength(DefaultVibratoLengthEnum value) { int count = -1; foreach (DefaultVibratoLengthEnum dvl in Enum.GetValues(typeof(DefaultVibratoLengthEnum))) { count++; if (dvl == value) { comboVibratoLength.SelectedIndex = count; break; } } }
public static string toString(DefaultVibratoLengthEnum value) { if (value == DefaultVibratoLengthEnum.L50) { return("50"); } else if (value == DefaultVibratoLengthEnum.L66) { return("66"); } else if (value == DefaultVibratoLengthEnum.L75) { return("75"); } else { return("100"); } }
/// <summary> /// コンストラクタ.引数vibrato_handleには,Cloneしたものを渡さなくてよい. /// </summary> /// <param name="vibrato_handle"></param> /// <param name="note_length"></param> /// <param name="default_vibrato_length"></param> /// <param name="type"></param> /// <param name="use_original"></param> public FormVibratoConfig( VibratoHandle vibrato_handle, int note_length, DefaultVibratoLengthEnum default_vibrato_length, SynthesizerType type, bool use_original) { InitializeComponent(); #if DEBUG AppManager.debugWriteLine("FormVibratoConfig.ctor(Vsqhandle,int,DefaultVibratoLength)"); AppManager.debugWriteLine(" (vibrato_handle==null)=" + (vibrato_handle == null)); sout.println(" type=" + type); #endif if (use_original) { radioUserDefined.Checked = true; } else { if (type == SynthesizerType.VOCALOID1) { radioVocaloid1.Checked = true; } else { radioVocaloid2.Checked = true; } } if (vibrato_handle != null) { m_vibrato = (VibratoHandle)vibrato_handle.clone(); } // 選択肢の状態を更新 updateComboBoxStatus(); // どれを選ぶか? if (vibrato_handle != null) { #if DEBUG sout.println("FormVibratoConfig#.ctor; vibrato_handle.IconID=" + vibrato_handle.IconID); #endif for (int i = 0; i < comboVibratoType.Items.Count; i++) { VibratoHandle handle = (VibratoHandle)comboVibratoType.Items[i]; #if DEBUG sout.println("FormVibratoConfig#.ctor; handle.IconID=" + handle.IconID); #endif if (vibrato_handle.IconID.Equals(handle.IconID)) { comboVibratoType.SelectedIndex = i; break; } } } txtVibratoLength.Enabled = (vibrato_handle != null); if (vibrato_handle != null) { txtVibratoLength.Text = (int)((float)vibrato_handle.getLength() / (float)note_length * 100.0f) + ""; } else { string s = ""; if (default_vibrato_length == DefaultVibratoLengthEnum.L100) { s = "100"; } else if (default_vibrato_length == DefaultVibratoLengthEnum.L50) { s = "50"; } else if (default_vibrato_length == DefaultVibratoLengthEnum.L66) { s = "66"; } else if (default_vibrato_length == DefaultVibratoLengthEnum.L75) { s = "75"; } txtVibratoLength.Text = s; } m_note_length = note_length; registerEventHandlers(); setResources(); applyLanguage(); Util.applyFontRecurse(this, AppManager.editorConfig.getBaseFont()); }
public void setDefaultVibratoLength( DefaultVibratoLengthEnum value ) { int count = -1; foreach ( DefaultVibratoLengthEnum dvl in Enum.GetValues( typeof( DefaultVibratoLengthEnum ) ) ) { count++; if ( dvl == value ) { comboVibratoLength.SelectedIndex = count; break; } } }