protected void OnClaveRhythmsBoxChanged(object sender, EventArgs e) { ComboBox box = sender as ComboBox; CLAVE_RHYTHMS_TYPE rhythmType = CSetup.GetEnumFromStr_ClaveRhythmsType(box.ActiveText); SoundLibraryInterface.SetInstrumentRhythm( (uint)INSTRUMENTS_TYPE.INSTRUMENT_CLAVE, (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_ClaveRhythmsType(CLAVE_RHYTHMS_TYPE iType) { switch (iType) { case CLAVE_RHYTHMS_TYPE.CLA_RUMBA_2_3: return("Rumba 2/3"); case CLAVE_RHYTHMS_TYPE.CLA_RUMBA_3_2: return("Rumba 3/2"); case CLAVE_RHYTHMS_TYPE.CLA_SON_2_3: return("Son 2/3"); case CLAVE_RHYTHMS_TYPE.CLA_SON_3_2: return("Son 3/2"); default: return("None"); } }