mute implementat

This commit is contained in:
2022-07-11 19:52:13 +02:00
parent 3b79bf2575
commit e0b349496a
3 changed files with 18 additions and 9 deletions

View File

@@ -160,6 +160,7 @@ int main(int argc, char* argv[]) {
for (int i=0; i<4; ++i) {
if ((sdlEvent.button.x >= 12+i*35) && (sdlEvent.button.x <= 45+i*35) && (sdlEvent.button.y >= 2) && (sdlEvent.button.y <= 13) ) {
muted[i] = not muted[i];
channel[i].setMute(muted[i]);
}
}
}
@@ -208,18 +209,18 @@ int main(int argc, char* argv[]) {
SDL_PauseAudioDevice(sdlAudioDevice, 0);
}
if (key == SDL_SCANCODE_F4) {
channel[0].setup(song.GetCurrentNote(0, selected_row));
channel[1].setup(song.GetCurrentNote(1, selected_row));
channel[2].setup(song.GetCurrentNote(2, selected_row));
channel[3].setup(song.GetCurrentNote(3, selected_row));
for (int i=0;i<4;++i) {
channel[i].setup(song.GetCurrentNote(i, selected_row));
channel[i].setMute(muted[i]);
}
SDL_PauseAudioDevice(sdlAudioDevice, 0);
}
if (key == SDL_SCANCODE_F5) {
song.Play();
channel[0].setup(song.GetCurrentNote(0));
channel[1].setup(song.GetCurrentNote(1));
channel[2].setup(song.GetCurrentNote(2));
channel[3].setup(song.GetCurrentNote(3));
for (int i=0;i<4;++i) {
channel[i].setup(song.GetCurrentNote(i));
channel[i].setMute(muted[i]);
}
SDL_PauseAudioDevice(sdlAudioDevice, 0);
}
if (key == SDL_SCANCODE_F8) {