From 25e9e4841329a5c219501bb5442f118e4a84011e Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Tue, 6 Mar 2018 22:56:05 +0000 Subject: [PATCH] ac97snd: try to fix '-h' key, force player to close itself when the song ends git-svn-id: svn://kolibrios.org@7174 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/media/ac97snd/ac97snd/ac97wav.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/programs/media/ac97snd/ac97snd/ac97wav.c b/programs/media/ac97snd/ac97snd/ac97wav.c index ba50893074..b773c31ce3 100644 --- a/programs/media/ac97snd/ac97snd/ac97wav.c +++ b/programs/media/ac97snd/ac97snd/ac97wav.c @@ -449,9 +449,9 @@ void update_dynamic_content() //Asper + void draw_window() { - BeginDraw(); if (!hidden) { + BeginDraw(); DrawWindow(100,100,299,main_wh,main_wc,4,0,0,0); //Asper+ make_button(7,24,45,13, 0x10|BT_NORMAL,main_bc); @@ -474,8 +474,8 @@ void draw_window() write_text(276,74,main_wc|FONT0,button_PL,sizeof(button_PL)-1); //Asper+ PL button text write_text(275,73,0xA0FFA0|FONT0,button_PL,sizeof(button_PL)-1); //Asper+ redraw_R_button(); + EndDraw(); } - EndDraw(); }; void draw_progress_bar() @@ -705,6 +705,7 @@ int main(int argc, char *argv[]) switch(status) { case ST_TRACK: StopBuffer(hBuff); + if (hidden) ExitInHiddenMode(); if (LoadTrack(++currActive)) { if (LoadFile(full_filename)) @@ -733,6 +734,7 @@ int main(int argc, char *argv[]) case ST_STOP: StopBuffer(hBuff); status = ST_DONE; + if (hidden) ExitInHiddenMode(); continue; case ST_EXIT: @@ -1106,6 +1108,14 @@ void _stdcall thread_proc(void *param) }; }; +void ExitInHiddenMode() +{ + uFMOD_StopSong(); + StopBuffer(hBuff); + DestroyBuffer(hBuff); + exit(); +} + void delay (int val) { _asm