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.

abrepeat add dummy functions and remove some of the ifdefs

Change-Id: Icae7e334e87bb1974712a7a76296cf69bbdbffba

+39 -22
+31 -2
apps/abrepeat.h
··· 20 20 ****************************************************************************/ 21 21 #ifndef _ABREPEAT_H_ 22 22 #define _ABREPEAT_H_ 23 + #include <stdbool.h> 24 + 25 + #ifndef AB_REPEAT_ENABLE /* Dummy functions */ 26 + static inline bool ab_repeat_mode_enabled(void) 27 + { 28 + return false; 29 + } 30 + static inline bool ab_bool_dummy_marker(unsigned int song_position) 31 + { 32 + (void) song_position; 33 + return false; 34 + } 35 + static inline void ab_void_dummy_marker(unsigned int song_position) 36 + { 37 + (void) song_position; 38 + } 39 + static inline void ab_dummy_voidfn(void){} 23 40 24 - #ifdef AB_REPEAT_ENABLE 25 - #include <stdbool.h> 41 + #define ab_repeat_init ab_dummy_voidfn 42 + #define ab_before_A_marker ab_bool_dummy_marker 43 + #define ab_after_A_marker ab_bool_dummy_marker 44 + #define ab_jump_to_A_marker ab_dummy_voidfn 45 + #define ab_reset_markers ab_dummy_voidfn 46 + #define ab_set_A_marker ab_void_dummy_marker 47 + #define ab_set_B_marker ab_void_dummy_marker 48 + #define ab_get_A_marker ab_bool_dummy_marker 49 + #define ab_get_B_marker ab_bool_dummy_marker 50 + #define ab_end_of_track_report ab_dummy_voidfn 51 + #define ab_reached_B_marker ab_bool_dummy_marker 52 + #define ab_position_report ab_void_dummy_marker 53 + 54 + #else /*def AB_REPEAT_ENABLE*/ 26 55 #include "audio.h" 27 56 #include "kernel.h" /* needed for HZ */ 28 57
+7 -18
apps/gui/wps.c
··· 613 613 if (bookmark) 614 614 bookmark_autobookmark(true); 615 615 audio_stop(); 616 - #ifdef AB_REPEAT_ENABLE 616 + 617 617 ab_reset_markers(); 618 - #endif 618 + 619 619 gwps_leave_wps(true); 620 620 #ifdef HAVE_RECORDING 621 621 if (action == ACTION_WPS_REC) ··· 678 678 long last_left = 0, last_right = 0; 679 679 struct wps_state *state = get_wps_state(); 680 680 681 - #ifdef AB_REPEAT_ENABLE 682 681 ab_repeat_init(); 683 682 ab_reset_markers(); 684 - #endif 683 + 685 684 wps_state_init(); 686 685 while ( 1 ) 687 686 { ··· 904 903 /* prev / restart */ 905 904 case ACTION_WPS_SKIPPREV: 906 905 last_left = current_tick; 907 - #ifdef AB_REPEAT_ENABLE 906 + 908 907 /* if we're in A/B repeat mode and the current position 909 908 is past the A marker, jump back to the A marker... */ 910 909 if ( ab_repeat_mode_enabled() && ab_after_A_marker(state->id3->elapsed) ) ··· 912 911 ab_jump_to_A_marker(); 913 912 break; 914 913 } 915 - else 916 - /* ...otherwise, do it normally */ 917 - #endif 914 + else /* ...otherwise, do it normally */ 918 915 play_hop(-1); 919 916 break; 920 917 ··· 922 919 OR if skip length set, hop by predetermined amount. */ 923 920 case ACTION_WPS_SKIPNEXT: 924 921 last_right = current_tick; 925 - #ifdef AB_REPEAT_ENABLE 922 + 926 923 /* if we're in A/B repeat mode and the current position is 927 924 before the A marker, jump to the A marker... */ 928 925 if ( ab_repeat_mode_enabled() ) ··· 933 930 break; 934 931 } 935 932 } 936 - else 937 - /* ...otherwise, do it normally */ 938 - #endif 933 + else /* ...otherwise, do it normally */ 939 934 play_hop(1); 940 935 break; 941 936 /* next / prev directories */ 942 937 /* and set A-B markers if in a-b mode */ 943 938 case ACTION_WPS_ABSETB_NEXTDIR: 944 - #if defined(AB_REPEAT_ENABLE) 945 939 if (ab_repeat_mode_enabled()) 946 940 { 947 941 ab_set_B_marker(state->id3->elapsed); 948 942 ab_jump_to_A_marker(); 949 943 } 950 944 else 951 - #endif 952 945 { 953 946 change_dir(1); 954 947 } 955 948 break; 956 949 case ACTION_WPS_ABSETA_PREVDIR: 957 - #if defined(AB_REPEAT_ENABLE) 958 950 if (ab_repeat_mode_enabled()) 959 951 ab_set_A_marker(state->id3->elapsed); 960 952 else 961 - #endif 962 953 { 963 954 change_dir(-1); 964 955 } ··· 1010 1001 break; 1011 1002 #endif /* HAVE_PITCHCONTROL */ 1012 1003 1013 - #ifdef AB_REPEAT_ENABLE 1014 1004 /* reset A&B markers */ 1015 1005 case ACTION_WPS_ABRESET: 1016 1006 if (ab_repeat_mode_enabled()) ··· 1019 1009 update = true; 1020 1010 } 1021 1011 break; 1022 - #endif /* AB_REPEAT_ENABLE */ 1023 1012 1024 1013 /* stop and exit wps */ 1025 1014 case ACTION_WPS_STOP:
+1 -2
apps/playback.c
··· 3479 3479 /* Update elapsed time for next PCM insert */ 3480 3480 void audio_codec_update_elapsed(unsigned long elapsed) 3481 3481 { 3482 - #ifdef AB_REPEAT_ENABLE 3483 3482 ab_position_report(elapsed); 3484 - #endif 3483 + 3485 3484 /* Save in codec's id3 where it is used at next pcm insert */ 3486 3485 id3_get(CODEC_ID3)->elapsed = elapsed; 3487 3486 }