FILE *fout;
#endif
+extern uint8 cur_pos;
+extern uint8 cur_row;
+extern uint32 rows_played;
+extern float current_time;
+extern float row_duration;
#ifdef DEBUG
int main(int argc, char *argv[])
{
if (ev.type == SDL_KEYDOWN)
{
- if (ev.key.keysym.sym == SDLK_SPACE) {
+ switch (ev.key.keysym.sym) {
+ case SDLK_SPACE:
paused = !paused;
SDL_PauseAudio(paused);
+ break;
+
+ case SDLK_LEFT:
+ cur_pos-=2;
+ cur_row=TRACK_LENGTH-1;
+ rows_played = cur_pos*TRACK_LENGTH;
+ current_time = rows_played*row_duration;
+ printf("cur_pos = %d\n", cur_pos+1);
+ break;
+
+ case SDLK_RIGHT:
+ if (cur_row == TRACK_LENGTH-1) cur_pos++;
+ cur_row=TRACK_LENGTH-1;
+ rows_played = cur_pos*TRACK_LENGTH;
+ current_time = rows_played*row_duration;
+ printf("cur_pos = %d\n", cur_pos+1);
+ break;
+
+ default:
+ goto end;
}
- else
- goto end;
}
if (ev.type == SDL_QUIT) goto end;