diff options
author | William Wilgus <wilgus.william@gmail.com> | 2024-06-20 01:40:05 -0400 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2024-06-20 11:14:27 -0400 |
commit | 4d0d41a0f434842636a65b3bb230b83c2c5c50b1 (patch) | |
tree | 6f0e9d58d191e4c4592222f4e7e5e31ede0fc26a /apps/abrepeat.c | |
parent | 547b6a570dbad844e79b4ba5eb934f043bab6318 (diff) | |
download | rockbox-4d0d41a0f434842636a65b3bb230b83c2c5c50b1.tar.gz rockbox-4d0d41a0f434842636a65b3bb230b83c2c5c50b1.zip |
[Cleanup] abrepeat.c
ab_repeat_init() doesn't do anything and some of the checks are redundant
Change-Id: Icc861c57b119f541c0cbdb9e0074b78f1f4f10bb
Diffstat (limited to 'apps/abrepeat.c')
-rw-r--r-- | apps/abrepeat.c | 17 |
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 | ||
50 | void ab_repeat_init(void) | 51 | void 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; |
60 | intended for use in handling the jump NEXT and PREV commands */ | 62 | intended for use in handling the jump NEXT and PREV commands */ |
61 | bool ab_before_A_marker(unsigned int song_position) | 63 | bool 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 */ | |||
97 | void ab_set_A_marker(unsigned int song_position) | 98 | void 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 | ||
107 | void ab_set_B_marker(unsigned int song_position) | 108 | void 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 | ||