Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

[Cleanup] abrepeat.c

ab_repeat_init() doesn't do anything and some of the checks are redundant

Change-Id: Icc861c57b119f541c0cbdb9e0074b78f1f4f10bb

authored by

William Wilgus and committed by
William Wilgus
4d0d41a0 547b6a57

+9 -11
+9 -8
apps/abrepeat.c
··· 47 47 } 48 48 } 49 49 50 + #if 0 50 51 void ab_repeat_init(void) 51 52 { 52 53 static bool ab_initialized = false; ··· 55 56 ab_initialized = true; 56 57 } 57 58 } 59 + #endif 58 60 59 61 /* determines if the given song position is earlier than the A mark; 60 62 intended for use in handling the jump NEXT and PREV commands */ 61 63 bool ab_before_A_marker(unsigned int song_position) 62 64 { 63 - return (ab_A_marker != AB_MARKER_NONE) 64 - && (song_position < ab_A_marker); 65 + return (song_position < ab_A_marker); 65 66 } 66 67 67 68 /* determines if the given song position is later than the A mark; ··· 97 98 void ab_set_A_marker(unsigned int song_position) 98 99 { 99 100 ab_A_marker = song_position; 100 - ab_A_marker = (ab_A_marker >= EAR_TO_HAND_LATENCY_FUDGE) 101 - ? (ab_A_marker - EAR_TO_HAND_LATENCY_FUDGE) : 0; 101 + ab_A_marker = (ab_A_marker >= EAR_TO_HAND_LATENCY_FUDGE) 102 + ? (ab_A_marker - EAR_TO_HAND_LATENCY_FUDGE) : AB_MARKER_NONE; 102 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 105 ab_B_marker = AB_MARKER_NONE; 105 106 } 106 107 107 108 void ab_set_B_marker(unsigned int song_position) 108 109 { 109 110 ab_B_marker = song_position; 110 - ab_B_marker = (ab_B_marker >= EAR_TO_HAND_LATENCY_FUDGE) 111 - ? (ab_B_marker - EAR_TO_HAND_LATENCY_FUDGE) : 0; 111 + ab_B_marker = (ab_B_marker >= EAR_TO_HAND_LATENCY_FUDGE) 112 + ? (ab_B_marker - EAR_TO_HAND_LATENCY_FUDGE) : AB_MARKER_NONE; 112 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 115 ab_A_marker = AB_MARKER_NONE; 115 116 } 116 117
-2
apps/abrepeat.h
··· 38 38 } 39 39 static inline void ab_dummy_voidfn(void){} 40 40 41 - #define ab_repeat_init ab_dummy_voidfn 42 41 #define ab_before_A_marker ab_bool_dummy_marker 43 42 #define ab_after_A_marker ab_bool_dummy_marker 44 43 #define ab_jump_to_A_marker ab_dummy_voidfn ··· 59 58 60 59 #include "settings.h" 61 60 62 - void ab_repeat_init(void); 63 61 bool ab_before_A_marker(unsigned int song_position); 64 62 bool ab_after_A_marker(unsigned int song_position); 65 63 void ab_jump_to_A_marker(void);
-1
apps/gui/wps.c
··· 692 692 long last_left = 0, last_right = 0; 693 693 struct wps_state *state = get_wps_state(); 694 694 695 - ab_repeat_init(); 696 695 ab_reset_markers(); 697 696 698 697 wps_state_init();