protected void OnCowbellRhythmsBoxChanged(object sender, EventArgs e) { ComboBox box = sender as ComboBox; COWBELL_RHYTHMS_TYPE rhythmType = CSetup.GetEnumFromStr_CowbellRhythmsType(box.ActiveText); SoundLibraryInterface.SetInstrumentRhythm( (uint)INSTRUMENTS_TYPE.INSTRUMENT_COWBELL, (short)rhythmType); }
//private Button cowbellButton; public MainWindow() : base(Gtk.WindowType.Toplevel) { Build(); SoundLibraryInterface.SetBeatsPerMinute((uint)bpmSlider.Value); SoundLibraryInterface.SetMasterVolume((float)masterVolumeSlider.Value); AssignImageToButton(ref claveButton, "SalsaMusicalityGUI.claves.jpg"); AssignImageToButton(ref cowbellButton, "SalsaMusicalityGUI.cowbell.jpg"); AssignImageToButton(ref bongosButton, "SalsaMusicalityGUI.bongos.jpg"); AssignImageToButton(ref congasButton, "SalsaMusicalityGUI.congas.jpg"); // Populate the clave rhythms box for (CLAVE_RHYTHMS_TYPE i = 0; i < CLAVE_RHYTHMS_TYPE.NUM_CLAVE_RHYTHMS; i++) { claveRhythmsBox.InsertText((int)i, CSetup.GetStr_ClaveRhythmsType(i)); } Gtk.TreeIter iter; claveRhythmsBox.Model.IterNthChild(out iter, (int)CLAVE_RHYTHMS_TYPE.CLA_SON_2_3); claveRhythmsBox.SetActiveIter(iter); // Populate the conga rhythms box for (CONGA_RHYTHMS_TYPE i = 0; i < CONGA_RHYTHMS_TYPE.NUM_CONGA_RHYTHMS; i++) { congasRhythmsBox.InsertText((int)i, CSetup.GetStr_CongaRhythmsType(i)); } congasRhythmsBox.Model.IterNthChild(out iter, (int)CONGA_RHYTHMS_TYPE.CON_BASIC_OFFBEAT); congasRhythmsBox.SetActiveIter(iter); // Populate the cowbell rhythms box for (COWBELL_RHYTHMS_TYPE i = 0; i < COWBELL_RHYTHMS_TYPE.NUM_COWBELL_RHYTHMS; i++) { cowbellRhythmsBox.InsertText((int)i, CSetup.GetStr_CowbellRhythmsType(i)); } cowbellRhythmsBox.Model.IterNthChild(out iter, (int)COWBELL_RHYTHMS_TYPE.COW_DOWN_BEATS); cowbellRhythmsBox.SetActiveIter(iter); // Populate the bongos rhythms box for (BONGO_RHYTHMS_TYPE i = 0; i < BONGO_RHYTHMS_TYPE.NUM_BONGO_RHYTHMS; i++) { bongosRhythmsBox.InsertText((int)i, CSetup.GetStr_BongosRhythmsType(i)); } bongosRhythmsBox.Model.IterNthChild(out iter, (int)BONGO_RHYTHMS_TYPE.BON_MARTILLO); bongosRhythmsBox.SetActiveIter(iter); }
internal static string GetStr_CowbellRhythmsType(COWBELL_RHYTHMS_TYPE iType) { switch (iType) { case COWBELL_RHYTHMS_TYPE.COW_ALL_BEATS: return("All Beats"); case COWBELL_RHYTHMS_TYPE.COW_CLAVE_ALIGNED: return("Clave Aligned"); case COWBELL_RHYTHMS_TYPE.COW_DOWN_BEATS: return("Down Beats"); default: return("None"); } }