summaryrefslogtreecommitdiffstats
path: root/apps/plugins/mpegplayer/mpegplayer.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2011-07-08 22:31:15 +0000
committerMichael Sevakis <jethead71@rockbox.org>2011-07-08 22:31:15 +0000
commit5663e1cd0afc62e212c43c8fb374c791d554fb1b (patch)
tree488e7cc83aaf2ee61184fad46a3b4891a95b0f13 /apps/plugins/mpegplayer/mpegplayer.c
parentf1a5a25dac4c61bf178ee5361998d205bb71b2d1 (diff)
downloadrockbox-5663e1cd0afc62e212c43c8fb374c791d554fb1b.tar.gz
rockbox-5663e1cd0afc62e212c43c8fb374c791d554fb1b.tar.bz2
rockbox-5663e1cd0afc62e212c43c8fb374c791d554fb1b.zip
Have mpegplayer use the mixer (the playback channel, since it's mutually exclusive to audio playback) so the clicks and skip beep can be used according to user settings. Introduce some system sound functions to make easier playing event sounds from various places and convert files calling 'beep_play' to use 'system_sound_play' and 'keyclick_click'. Event sound could be become themeable.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30130 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/mpegplayer/mpegplayer.c')
-rw-r--r--apps/plugins/mpegplayer/mpegplayer.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c
index 41f6b2e868..c6e1f4dded 100644
--- a/apps/plugins/mpegplayer/mpegplayer.c
+++ b/apps/plugins/mpegplayer/mpegplayer.c
@@ -386,6 +386,7 @@ enum video_action
VIDEO_STOP = 0,
VIDEO_PREV,
VIDEO_NEXT,
+ VIDEO_ACTION_MANUAL = 0x8000, /* Flag that says user did it */
};
/* OSD status - same order as icon array */
@@ -2139,7 +2140,7 @@ static int button_loop(void)
/* Release within 3 seconds of start: skip to previous
* file */
osd_stop();
- next_action = VIDEO_PREV;
+ next_action = VIDEO_PREV | VIDEO_ACTION_MANUAL;
}
}
else if ((button & ~BUTTON_REPEAT) == old_button) {
@@ -2169,7 +2170,7 @@ static int button_loop(void)
if ((old_button | BUTTON_REL) == button) {
/* If button has been released: skip to next file */
osd_stop();
- next_action = VIDEO_NEXT;
+ next_action = VIDEO_NEXT | VIDEO_ACTION_MANUAL;
}
else if ((button & ~BUTTON_REPEAT) == old_button) {
button = osd_seek_btn(old_button);
@@ -2251,11 +2252,10 @@ enum plugin_status plugin_start(const void* parameter)
while (!quit)
{
- int result;
-
init_settings(videofile);
- result = stream_open(videofile);
+ int result = stream_open(videofile);
+ bool manual_skip = false;
if (result >= STREAM_OK) {
/* start menu */
@@ -2267,6 +2267,8 @@ enum plugin_status plugin_start(const void* parameter)
if (result != MPEG_START_QUIT) {
/* Enter button loop and process UI */
next_action = button_loop();
+ manual_skip = next_action & VIDEO_ACTION_MANUAL;
+ next_action &= ~VIDEO_ACTION_MANUAL;
}
stream_close();
@@ -2341,6 +2343,13 @@ enum plugin_status plugin_start(const void* parameter)
sizeof(videofile));
/* quit after finished the last videofile */
quit = !get_videofile_says;
+
+ if (manual_skip)
+ {
+ rb->system_sound_play(get_videofile_says ?
+ SOUND_TRACK_SKIP : SOUND_TRACK_NO_MORE);
+ }
+
break;
}
case VIDEO_PREV:
@@ -2348,6 +2357,13 @@ enum plugin_status plugin_start(const void* parameter)
get_videofile_says = get_videofile(VIDEO_PREV, videofile,
sizeof(videofile));
/* if there is no previous file, play the same videofile */
+
+ if (manual_skip)
+ {
+ rb->system_sound_play(get_videofile_says ?
+ SOUND_TRACK_SKIP : SOUND_TRACK_NO_MORE);
+ }
+
break;
}
case VIDEO_STOP: