summaryrefslogtreecommitdiff
path: root/apps/abrepeat.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/abrepeat.c')
-rw-r--r--apps/abrepeat.c46
1 files changed, 0 insertions, 46 deletions
diff --git a/apps/abrepeat.c b/apps/abrepeat.c
index 999d9dcf38..19e9450c99 100644
--- a/apps/abrepeat.c
+++ b/apps/abrepeat.c
@@ -39,7 +39,6 @@ static inline bool ab_B_marker_set(void)
39} 39}
40 40
41 41
42#if (CONFIG_CODEC == SWCODEC)
43void ab_end_of_track_report(void) 42void ab_end_of_track_report(void)
44{ 43{
45 if ( ab_A_marker_set() && ! ab_B_marker_set() ) 44 if ( ab_A_marker_set() && ! ab_B_marker_set() )
@@ -47,38 +46,6 @@ void ab_end_of_track_report(void)
47 ab_jump_to_A_marker(); 46 ab_jump_to_A_marker();
48 } 47 }
49} 48}
50#else
51static int ab_audio_event_handler(unsigned short event, unsigned long data)
52{
53 int rc = AUDIO_EVENT_RC_IGNORED;
54 if ( ab_repeat_mode_enabled() )
55 {
56 switch(event)
57 {
58 case AUDIO_EVENT_POS_REPORT:
59 {
60 if ( ! (audio_status() & AUDIO_STATUS_PAUSE) &&
61 ab_reached_B_marker(data) )
62 {
63 ab_jump_to_A_marker();
64 rc = AUDIO_EVENT_RC_HANDLED;
65 }
66 break;
67 }
68 case AUDIO_EVENT_END_OF_TRACK:
69 {
70 if ( ab_A_marker_set() && ! ab_B_marker_set() )
71 {
72 ab_jump_to_A_marker();
73 rc = AUDIO_EVENT_RC_HANDLED;
74 }
75 break;
76 }
77 }
78 }
79 return rc;
80}
81#endif
82 49
83void ab_repeat_init(void) 50void ab_repeat_init(void)
84{ 51{
@@ -86,10 +53,6 @@ void ab_repeat_init(void)
86 if ( ! ab_initialized ) 53 if ( ! ab_initialized )
87 { 54 {
88 ab_initialized = true; 55 ab_initialized = true;
89#if (CONFIG_CODEC != SWCODEC)
90 audio_register_event_handler(ab_audio_event_handler,
91 AUDIO_EVENT_POS_REPORT | AUDIO_EVENT_END_OF_TRACK );
92#endif
93 } 56 }
94} 57}
95 58
@@ -116,16 +79,7 @@ reasonable amount of time for the typical user to react */
116 79
117void ab_jump_to_A_marker(void) 80void ab_jump_to_A_marker(void)
118{ 81{
119#if (CONFIG_CODEC != SWCODEC)
120 bool paused = (audio_status() & AUDIO_STATUS_PAUSE) != 0;
121 if ( ! paused )
122 audio_pause();
123#endif
124 audio_ff_rewind(ab_A_marker); 82 audio_ff_rewind(ab_A_marker);
125#if (CONFIG_CODEC != SWCODEC)
126 if ( ! paused )
127 audio_resume();
128#endif
129} 83}
130 84
131void ab_reset_markers(void) 85void ab_reset_markers(void)