Problems with Mute with G4P and SoundCipher
in
Contributed Library Questions
•
2 months ago
HI, I have a problem I´m using the SoundCipher Library and the G4P Library for all my project and it´s almost finished, I have a slider that controls the volumen, and also I have a button that I want to works like muting but I don´t know how can I do it, I tried with switch and case in the button events and also in the normal way but don´t works, any ideas?
in the draw I have this
switch(mute){
case 6:
sdrVolumen.setLimits(0, 1, 100);
break;
case 7:
int j = Integer.parseInt(sdrVolumen.getValueS());
break;
}
and in the
public void handleToggleButtonEvents(GImageToggleButton button, GEvent event){
if(button == btnSpeaker)
mute = 6;
else if(button == btnSpeaker)
mute = 7;
}
also I tried with
if(button == btnSpeaker){
loop();
sdrVolumen.setLimits(1, 1, 100);
}
else if (button == btnSpeaker){
loop();
int j = Integer.parseInt(sdrVolumen.getValueS());
and my slider is
sdrVolumen = new GCustomSlider(this, 700, y+160, 200, 50, null);
sdrVolumen.setShowDecor(false, true, true, true);
sdrVolumen.setNbrTicks(9);
sdrVolumen.setLimits(50, 1, 100);
lblVolumen = new GLabel(this, 600, y+160, 80, 50, "Volumen");
lblVolumen.setTextAlign(GAlign.RIGHT, null);
lblVolumen.setTextBold();
that controls this song
part1.playNote(pitches[a], j, durations[a]);
with this
int j = Integer.parseInt(sdrVolumen.getValueS());
please help me!!!
1