- chirp_stop() implemented

- chirps stop playing when ESC or F5
This commit is contained in:
2022-12-28 16:09:11 +01:00
parent 40c2b009a9
commit 97902594ad
5 changed files with 21 additions and 1 deletions

View File

@@ -217,6 +217,7 @@ int main(int argc,char*argv[]){
if (mini_eve.type == SDL_QUIT) { should_exit=true; should_quit=true; break; }
if (mini_eve.type == SDL_KEYDOWN) {
if (mini_eve.key.keysym.scancode == SDL_SCANCODE_ESCAPE) {
chirp_stop();
if (lua_is_playing()) {
lua_quit();
quitaudio();
@@ -228,6 +229,7 @@ int main(int argc,char*argv[]){
//lua_call_init();
}
} else if (mini_eve.key.keysym.scancode == SDL_SCANCODE_F5) {
chirp_stop();
should_exit=true;
//lua_quit();
//reinit();
@@ -987,6 +989,10 @@ void playchirp(const char *song, const bool lock) {
chirp_play(song, lock);
}
void stopchirp() {
chirp_stop();
}
void exit() {
should_exit = true;
}