playmus.c (Menu): added seek testing cases '0' ... '4':
authorOzkan Sezer <sezeroz@gmail.com>
Sat, 28 Dec 2019 01:55:20 +0300
changeset 1127d2686bcfcba2
parent 1123 d40dacdd4ab1
child 1129 888c7be704ce
playmus.c (Menu): added seek testing cases '0' ... '4':

0 seeks to 0, 1 seeks to 10 secs, and so on. guarded by SEEK_TEST
ifdefs, not defined by default.
playmus.c
     1.1 --- a/playmus.c	Thu Dec 26 17:25:50 2019 +0300
     1.2 +++ b/playmus.c	Sat Dec 28 01:55:20 2019 +0300
     1.3 @@ -67,6 +67,7 @@
     1.4      SDL_Log("Usage: %s [-i] [-l] [-8] [-f32] [-r rate] [-c channels] [-b buffers] [-v N] [-rwops] <musicfile>\n", argv0);
     1.5  }
     1.6  
     1.7 +/*#define SEEK_TEST */
     1.8  void Menu(void)
     1.9  {
    1.10      char buf[10];
    1.11 @@ -75,6 +76,13 @@
    1.12      fflush(stdin);
    1.13      if (scanf("%s",buf) == 1) {
    1.14          switch(buf[0]){
    1.15 +#if defined(SEEK_TEST)
    1.16 +        case '0': Mix_SetMusicPosition(0); break;
    1.17 +        case '1': Mix_SetMusicPosition(10);break;
    1.18 +        case '2': Mix_SetMusicPosition(20);break;
    1.19 +        case '3': Mix_SetMusicPosition(30);break;
    1.20 +        case '4': Mix_SetMusicPosition(40);break;
    1.21 +#endif /* SEEK_TEST */
    1.22          case 'p': case 'P':
    1.23              Mix_PauseMusic();
    1.24              break;