diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2005-04-04 12:06:29 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2005-04-04 12:06:29 +0000 |
commit | 8a237a829e0f63b61536f315209a6d0ea1477e31 (patch) | |
tree | 1fe54329fe776aa7bc982a37203cb61c13244a48 /apps/wps.c | |
parent | ec4e9b8d600c53add3c8bf6eb7fe1975dba141a7 (diff) | |
download | rockbox-8a237a829e0f63b61536f315209a6d0ea1477e31.tar.gz rockbox-8a237a829e0f63b61536f315209a6d0ea1477e31.zip |
More audio code restructuring, mostly renaming functions so far
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6246 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/wps.c')
-rw-r--r-- | apps/wps.c | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/apps/wps.c b/apps/wps.c index d5f921c350..e281131836 100644 --- a/apps/wps.c +++ b/apps/wps.c | |||
@@ -33,7 +33,7 @@ | |||
33 | #include "settings.h" | 33 | #include "settings.h" |
34 | #include "wps.h" | 34 | #include "wps.h" |
35 | #include "wps-display.h" | 35 | #include "wps-display.h" |
36 | #include "mpeg.h" | 36 | #include "audio.h" |
37 | #include "mp3_playback.h" | 37 | #include "mp3_playback.h" |
38 | #include "usb.h" | 38 | #include "usb.h" |
39 | #include "status.h" | 39 | #include "status.h" |
@@ -262,11 +262,11 @@ static bool ffwd_rew(int button) | |||
262 | } | 262 | } |
263 | else | 263 | else |
264 | { | 264 | { |
265 | if ( (mpeg_status() & MPEG_STATUS_PLAY) && | 265 | if ( (audio_status() & AUDIO_STATUS_PLAY) && |
266 | id3 && id3->length ) | 266 | id3 && id3->length ) |
267 | { | 267 | { |
268 | if (!paused) | 268 | if (!paused) |
269 | mpeg_pause(); | 269 | audio_pause(); |
270 | #if CONFIG_KEYPAD == PLAYER_PAD | 270 | #if CONFIG_KEYPAD == PLAYER_PAD |
271 | lcd_stop_scroll(); | 271 | lcd_stop_scroll(); |
272 | #endif | 272 | #endif |
@@ -308,12 +308,12 @@ static bool ffwd_rew(int button) | |||
308 | 308 | ||
309 | case WPS_PREV: | 309 | case WPS_PREV: |
310 | case WPS_NEXT: | 310 | case WPS_NEXT: |
311 | mpeg_ff_rewind(id3->elapsed+ff_rewind_count); | 311 | audio_ff_rewind(id3->elapsed+ff_rewind_count); |
312 | ff_rewind_count = 0; | 312 | ff_rewind_count = 0; |
313 | ff_rewind = false; | 313 | ff_rewind = false; |
314 | status_set_ffmode(0); | 314 | status_set_ffmode(0); |
315 | if (!paused) | 315 | if (!paused) |
316 | mpeg_resume(); | 316 | audio_resume(); |
317 | #ifdef HAVE_LCD_CHARCELLS | 317 | #ifdef HAVE_LCD_CHARCELLS |
318 | wps_display(id3, nid3); | 318 | wps_display(id3, nid3); |
319 | #endif | 319 | #endif |
@@ -332,7 +332,7 @@ static bool ffwd_rew(int button) | |||
332 | button = button_get(true); | 332 | button = button_get(true); |
333 | } | 333 | } |
334 | 334 | ||
335 | /* let mpeg thread update id3->elapsed before calling wps_refresh */ | 335 | /* let audio thread update id3->elapsed before calling wps_refresh */ |
336 | yield(); | 336 | yield(); |
337 | wps_refresh(id3, nid3, 0, WPS_REFRESH_ALL); | 337 | wps_refresh(id3, nid3, 0, WPS_REFRESH_ALL); |
338 | return usb; | 338 | return usb; |
@@ -340,14 +340,14 @@ static bool ffwd_rew(int button) | |||
340 | 340 | ||
341 | static bool update(void) | 341 | static bool update(void) |
342 | { | 342 | { |
343 | bool track_changed = mpeg_has_changed_track(); | 343 | bool track_changed = audio_has_changed_track(); |
344 | bool retcode = false; | 344 | bool retcode = false; |
345 | 345 | ||
346 | nid3 = mpeg_next_track(); | 346 | nid3 = audio_next_track(); |
347 | if (track_changed) | 347 | if (track_changed) |
348 | { | 348 | { |
349 | lcd_stop_scroll(); | 349 | lcd_stop_scroll(); |
350 | id3 = mpeg_current_track(); | 350 | id3 = audio_current_track(); |
351 | if (wps_display(id3, nid3)) | 351 | if (wps_display(id3, nid3)) |
352 | retcode = true; | 352 | retcode = true; |
353 | else | 353 | else |
@@ -391,8 +391,8 @@ static void fade(bool fade_in) | |||
391 | /* zero out the sound */ | 391 | /* zero out the sound */ |
392 | sound_set(SOUND_VOLUME, current_volume); | 392 | sound_set(SOUND_VOLUME, current_volume); |
393 | 393 | ||
394 | sleep(HZ/10); /* let mpeg thread run */ | 394 | sleep(HZ/10); /* let audio thread run */ |
395 | mpeg_resume(); | 395 | audio_resume(); |
396 | 396 | ||
397 | while (current_volume < global_settings.volume) { | 397 | while (current_volume < global_settings.volume) { |
398 | current_volume += 2; | 398 | current_volume += 2; |
@@ -410,8 +410,8 @@ static void fade(bool fade_in) | |||
410 | sleep(1); | 410 | sleep(1); |
411 | sound_set(SOUND_VOLUME, current_volume); | 411 | sound_set(SOUND_VOLUME, current_volume); |
412 | } | 412 | } |
413 | mpeg_pause(); | 413 | audio_pause(); |
414 | sleep(HZ/5); /* let mpeg thread run */ | 414 | sleep(HZ/5); /* let audio thread run */ |
415 | 415 | ||
416 | /* reset volume to what it was before the fade */ | 416 | /* reset volume to what it was before the fade */ |
417 | sound_set(SOUND_VOLUME, global_settings.volume); | 417 | sound_set(SOUND_VOLUME, global_settings.volume); |
@@ -451,10 +451,10 @@ long wps_show(void) | |||
451 | 451 | ||
452 | ff_rewind = false; | 452 | ff_rewind = false; |
453 | 453 | ||
454 | if(mpeg_status() & MPEG_STATUS_PLAY) | 454 | if(audio_status() & AUDIO_STATUS_PLAY) |
455 | { | 455 | { |
456 | id3 = mpeg_current_track(); | 456 | id3 = audio_current_track(); |
457 | nid3 = mpeg_next_track(); | 457 | nid3 = audio_next_track(); |
458 | if (id3) { | 458 | if (id3) { |
459 | if (wps_display(id3, nid3)) | 459 | if (wps_display(id3, nid3)) |
460 | return 0; | 460 | return 0; |
@@ -468,13 +468,13 @@ long wps_show(void) | |||
468 | 468 | ||
469 | while ( 1 ) | 469 | while ( 1 ) |
470 | { | 470 | { |
471 | bool mpeg_paused = (mpeg_status() & MPEG_STATUS_PAUSE)?true:false; | 471 | bool audio_paused = (audio_status() & AUDIO_STATUS_PAUSE)?true:false; |
472 | 472 | ||
473 | /* did someone else (i.e power thread) change mpeg pause mode? */ | 473 | /* did someone else (i.e power thread) change audio pause mode? */ |
474 | if (paused != mpeg_paused) { | 474 | if (paused != audio_paused) { |
475 | paused = mpeg_paused; | 475 | paused = audio_paused; |
476 | 476 | ||
477 | /* if another thread paused mpeg, we are probably in car mode, | 477 | /* if another thread paused audio, we are probably in car mode, |
478 | about to shut down. lets save the settings. */ | 478 | about to shut down. lets save the settings. */ |
479 | if (paused && global_settings.resume) { | 479 | if (paused && global_settings.resume) { |
480 | settings_save(); | 480 | settings_save(); |
@@ -560,10 +560,10 @@ long wps_show(void) | |||
560 | } | 560 | } |
561 | #endif | 561 | #endif |
562 | 562 | ||
563 | /* Exit if mpeg has stopped playing. This can happen if using the | 563 | /* Exit if audio has stopped playing. This can happen if using the |
564 | sleep timer with the charger plugged or if starting a recording | 564 | sleep timer with the charger plugged or if starting a recording |
565 | from F1 */ | 565 | from F1 */ |
566 | if (!mpeg_status()) | 566 | if (!audio_status()) |
567 | exit = true; | 567 | exit = true; |
568 | 568 | ||
569 | switch(button) | 569 | switch(button) |
@@ -598,7 +598,7 @@ long wps_show(void) | |||
598 | if ( global_settings.fade_on_stop ) | 598 | if ( global_settings.fade_on_stop ) |
599 | fade(1); | 599 | fade(1); |
600 | else | 600 | else |
601 | mpeg_resume(); | 601 | audio_resume(); |
602 | } | 602 | } |
603 | else | 603 | else |
604 | { | 604 | { |
@@ -606,7 +606,7 @@ long wps_show(void) | |||
606 | if ( global_settings.fade_on_stop ) | 606 | if ( global_settings.fade_on_stop ) |
607 | fade(0); | 607 | fade(0); |
608 | else | 608 | else |
609 | mpeg_pause(); | 609 | audio_pause(); |
610 | if (global_settings.resume) { | 610 | if (global_settings.resume) { |
611 | settings_save(); | 611 | settings_save(); |
612 | #ifndef HAVE_RTC | 612 | #ifndef HAVE_RTC |
@@ -662,16 +662,16 @@ long wps_show(void) | |||
662 | case WPS_RC_PREV: | 662 | case WPS_RC_PREV: |
663 | #endif | 663 | #endif |
664 | if (!id3 || (id3->elapsed < 3*1000)) { | 664 | if (!id3 || (id3->elapsed < 3*1000)) { |
665 | mpeg_prev(); | 665 | audio_prev(); |
666 | } | 666 | } |
667 | else { | 667 | else { |
668 | if (!paused) | 668 | if (!paused) |
669 | mpeg_pause(); | 669 | audio_pause(); |
670 | 670 | ||
671 | mpeg_ff_rewind(0); | 671 | audio_ff_rewind(0); |
672 | 672 | ||
673 | if (!paused) | 673 | if (!paused) |
674 | mpeg_resume(); | 674 | audio_resume(); |
675 | } | 675 | } |
676 | break; | 676 | break; |
677 | 677 | ||
@@ -684,7 +684,7 @@ long wps_show(void) | |||
684 | #ifdef WPS_RC_NEXT | 684 | #ifdef WPS_RC_NEXT |
685 | case WPS_RC_NEXT: | 685 | case WPS_RC_NEXT: |
686 | #endif | 686 | #endif |
687 | mpeg_next(); | 687 | audio_next(); |
688 | break; | 688 | break; |
689 | 689 | ||
690 | /* menu key functions */ | 690 | /* menu key functions */ |
@@ -789,7 +789,7 @@ long wps_show(void) | |||
789 | 789 | ||
790 | lcd_stop_scroll(); | 790 | lcd_stop_scroll(); |
791 | bookmark_autobookmark(); | 791 | bookmark_autobookmark(); |
792 | mpeg_stop(); | 792 | audio_stop(); |
793 | 793 | ||
794 | /* Keys can be locked when exiting, so either unlock here | 794 | /* Keys can be locked when exiting, so either unlock here |
795 | or implement key locking in tree.c too */ | 795 | or implement key locking in tree.c too */ |