From 8d5a6609a33f3269bc80975b81e0e859a056d952 Mon Sep 17 00:00:00 2001 From: Brandon Low Date: Sat, 21 Jan 2006 23:43:57 +0000 Subject: AB-repeat mode for software codecs. Accessible through menu as a repeat mode, with buttom mappings much like those on other rockbox targets for now. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8409 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/gwps.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 47 insertions(+), 8 deletions(-) (limited to 'apps/gui/gwps.c') diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c index efe207f94a..f75dd80d0f 100644 --- a/apps/gui/gwps.c +++ b/apps/gui/gwps.c @@ -392,11 +392,17 @@ long gui_wps_show(void) #ifdef AB_REPEAT_ENABLE /* if we're in A/B repeat mode and the current position is past the A marker, jump back to the A marker... */ - if ( ab_repeat_mode_enabled() - && ab_after_A_marker(wps_state.id3->elapsed) ) + if ( ab_repeat_mode_enabled() ) { - ab_jump_to_A_marker(); - break; + if ( ab_after_A_marker(wps_state.id3->elapsed) ) + { + ab_jump_to_A_marker(); + break; +#if (AB_REPEAT_ENABLE == 2) + } else { + ab_reset_markers(); +#endif + } } /* ...otherwise, do it normally */ #endif @@ -451,11 +457,17 @@ long gui_wps_show(void) #ifdef AB_REPEAT_ENABLE /* if we're in A/B repeat mode and the current position is before the A marker, jump to the A marker... */ - if ( ab_repeat_mode_enabled() - && ab_before_A_marker(wps_state.id3->elapsed) ) + if ( ab_repeat_mode_enabled() ) { - ab_jump_to_A_marker(); - break; + if ( ab_before_A_marker(wps_state.id3->elapsed) ) + { + ab_jump_to_A_marker(); + break; +#if (AB_REPEAT_ENABLE == 2) + } else { + ab_reset_markers(); +#endif + } } /* ...otherwise, do it normally */ #endif @@ -545,6 +557,33 @@ long gui_wps_show(void) #ifdef AB_REPEAT_ENABLE +#ifdef WPS_AB_SINGLE + case WPS_AB_SINGLE: +#ifdef WPS_AB_SINGLE_PRE + if (lastbutton != WPS_AB_SINGLE_PRE) + break; +#endif +/* If we are using the menu option to enable ab_repeat mode, don't do anything + * when it's disabled */ +#if (AB_REPEAT_ENABLE == 1) + if (!ab_repeat_mode_enabled()) + break; +#endif + if (ab_A_marker_set()) { + update_track = true; + if (ab_B_marker_set()) { + ab_reset_markers(); + break; + } + ab_set_B_marker(wps_state.id3->elapsed); + ab_jump_to_A_marker(); + break; + } + ab_set_A_marker(wps_state.id3->elapsed); + break; +#endif + + #ifdef WPS_AB_SET_A_MARKER /* set A marker for A-B repeat */ case WPS_AB_SET_A_MARKER: -- cgit v1.2.3