summaryrefslogtreecommitdiff
path: root/apps/abrepeat.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/abrepeat.c')
-rw-r--r--apps/abrepeat.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/apps/abrepeat.c b/apps/abrepeat.c
index 19e9450c99..886564aaa5 100644
--- a/apps/abrepeat.c
+++ b/apps/abrepeat.c
@@ -47,6 +47,7 @@ void ab_end_of_track_report(void)
47 } 47 }
48} 48}
49 49
50#if 0
50void ab_repeat_init(void) 51void ab_repeat_init(void)
51{ 52{
52 static bool ab_initialized = false; 53 static bool ab_initialized = false;
@@ -55,13 +56,13 @@ void ab_repeat_init(void)
55 ab_initialized = true; 56 ab_initialized = true;
56 } 57 }
57} 58}
59#endif
58 60
59/* determines if the given song position is earlier than the A mark; 61/* determines if the given song position is earlier than the A mark;
60intended for use in handling the jump NEXT and PREV commands */ 62intended for use in handling the jump NEXT and PREV commands */
61bool ab_before_A_marker(unsigned int song_position) 63bool ab_before_A_marker(unsigned int song_position)
62{ 64{
63 return (ab_A_marker != AB_MARKER_NONE) 65 return (song_position < ab_A_marker);
64 && (song_position < ab_A_marker);
65} 66}
66 67
67/* determines if the given song position is later than the A mark; 68/* determines if the given song position is later than the A mark;
@@ -97,20 +98,20 @@ by this fudge factor when setting a mark */
97void ab_set_A_marker(unsigned int song_position) 98void ab_set_A_marker(unsigned int song_position)
98{ 99{
99 ab_A_marker = song_position; 100 ab_A_marker = song_position;
100 ab_A_marker = (ab_A_marker >= EAR_TO_HAND_LATENCY_FUDGE) 101 ab_A_marker = (ab_A_marker >= EAR_TO_HAND_LATENCY_FUDGE)
101 ? (ab_A_marker - EAR_TO_HAND_LATENCY_FUDGE) : 0; 102 ? (ab_A_marker - EAR_TO_HAND_LATENCY_FUDGE) : AB_MARKER_NONE;
102 /* check if markers are out of order */ 103 /* check if markers are out of order */
103 if ( (ab_B_marker != AB_MARKER_NONE) && (ab_A_marker > ab_B_marker) ) 104 if (ab_A_marker > ab_B_marker)
104 ab_B_marker = AB_MARKER_NONE; 105 ab_B_marker = AB_MARKER_NONE;
105} 106}
106 107
107void ab_set_B_marker(unsigned int song_position) 108void ab_set_B_marker(unsigned int song_position)
108{ 109{
109 ab_B_marker = song_position; 110 ab_B_marker = song_position;
110 ab_B_marker = (ab_B_marker >= EAR_TO_HAND_LATENCY_FUDGE) 111 ab_B_marker = (ab_B_marker >= EAR_TO_HAND_LATENCY_FUDGE)
111 ? (ab_B_marker - EAR_TO_HAND_LATENCY_FUDGE) : 0; 112 ? (ab_B_marker - EAR_TO_HAND_LATENCY_FUDGE) : AB_MARKER_NONE;
112 /* check if markers are out of order */ 113 /* check if markers are out of order */
113 if ( (ab_A_marker != AB_MARKER_NONE) && (ab_B_marker < ab_A_marker) ) 114 if (ab_B_marker < ab_A_marker)
114 ab_A_marker = AB_MARKER_NONE; 115 ab_A_marker = AB_MARKER_NONE;
115} 116}
116 117