playmus.c (Menu): added seek testing cases '0' ... '4': SDL-1.2
authorOzkan Sezer <sezeroz@gmail.com>
Sat, 28 Dec 2019 01:55:00 +0300
branchSDL-1.2
changeset 11260a038da72ba2
parent 1125 cf41cf196597
child 1128 f3ba2c5e2bef
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	Sat Dec 28 01:20:02 2019 +0300
     1.2 +++ b/playmus.c	Sat Dec 28 01:55:00 2019 +0300
     1.3 @@ -64,6 +64,7 @@
     1.4  	fprintf(stderr, "Usage: %s [-i] [-l] [-8] [-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 @@ -72,6 +73,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;