protected void OnCongasRhythmsBoxChanged(object sender, EventArgs e) { ComboBox box = sender as ComboBox; CONGA_RHYTHMS_TYPE rhythmType = CSetup.GetEnumFromStr_CongaRhythmsType(box.ActiveText); SoundLibraryInterface.SetInstrumentRhythm( (uint)INSTRUMENTS_TYPE.INSTRUMENT_CONGAS, (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_CongaRhythmsType(CONGA_RHYTHMS_TYPE iType) { switch (iType) { case CONGA_RHYTHMS_TYPE.CON_BASIC_OFFBEAT: return("Basic Offbeat"); case CONGA_RHYTHMS_TYPE.CON_BASIC_ENDBEAT: return("Basic Endbeat"); case CONGA_RHYTHMS_TYPE.CON_CLAVE_ALIGNED: return("Clave Aligned"); default: return("None"); } }