diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 3d414f02..df4c8860 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,8 +1,8 @@ + a:versionCode="61" + a:versionName="3.9.9.20" a:installLocation="auto"> diff --git a/gen/net/sourceforge/subsonic/androidapp/R.java b/gen/net/sourceforge/subsonic/androidapp/R.java index 4c623096..6e60c3dc 100644 --- a/gen/net/sourceforge/subsonic/androidapp/R.java +++ b/gen/net/sourceforge/subsonic/androidapp/R.java @@ -1,641 +1,643 @@ -/* AUTO-GENERATED FILE. DO NOT MODIFY. - * - * This class was automatically generated by the - * aapt tool from the resource data it found. It - * should not be modified by hand. - */ - -package net.sourceforge.subsonic.androidapp; - -public final class R { - public static final class anim { - public static final int push_down_in=0x7f040000; - public static final int push_down_out=0x7f040001; - public static final int push_up_in=0x7f040002; - public static final int push_up_out=0x7f040003; - } - public static final class array { - public static final int bufferLengthNames=0x7f060009; - public static final int bufferLengthValues=0x7f060008; - public static final int cacheSizeNames=0x7f060005; - public static final int cacheSizeValues=0x7f060004; - public static final int defaultSearchNames=0x7f060013; - public static final int defaultSearchValues=0x7f060012; - public static final int maxAlbumsNames=0x7f06000d; - public static final int maxAlbumsValues=0x7f06000c; - public static final int maxArtistsNames=0x7f060011; - public static final int maxArtistsValues=0x7f060010; - public static final int maxBitrateNames=0x7f060007; - public static final int maxBitrateValues=0x7f060006; - public static final int maxSongsNames=0x7f06000f; - public static final int maxSongsValues=0x7f06000e; - public static final int networkTimeoutNames=0x7f06000b; - public static final int networkTimeoutValues=0x7f06000a; - public static final int preloadCountNames=0x7f060003; - public static final int preloadCountValues=0x7f060002; - public static final int themeNames=0x7f060001; - public static final int themeValues=0x7f060000; - } - public static final class attr { - } - public static final class color { - public static final int appwidget_text=0x7f070003; - public static final int black=0x7f070009; - public static final int buttonoff=0x7f070006; - public static final int buttonon=0x7f070007; - public static final int cyan=0x7f07000c; - public static final int dividerColor=0x7f070002; - public static final int grey=0x7f07000b; - public static final int ics_opaque=0x7f07000d; - public static final int mediaControlBackground=0x7f070000; - public static final int mediaControlForeground=0x7f070001; - public static final int notificationArtist=0x7f070004; - public static final int notificationTitle=0x7f070005; - public static final int transparent=0x7f07000a; - public static final int white=0x7f070008; - } - public static final class drawable { - public static final int action_bar_bg=0x7f020000; - public static final int album_art_background=0x7f020001; - public static final int appwidget_art_default=0x7f020002; - public static final int appwidget_bg=0x7f020003; - public static final int bg_separator=0x7f020004; - public static final int bkgd_tile_black=0x7f020005; - public static final int btn_bg=0x7f020006; - public static final int btn_check_buttonless_off=0x7f020007; - public static final int btn_check_buttonless_on=0x7f020008; - public static final int btn_check_custom=0x7f020009; - public static final int btn_collapse_group_normal_holo_dark=0x7f02000a; - public static final int buttonbar_selector=0x7f02000b; - public static final int ic_appwidget_music_next=0x7f02000c; - public static final int ic_appwidget_music_pause=0x7f02000d; - public static final int ic_appwidget_music_play=0x7f02000e; - public static final int ic_appwidget_music_previous=0x7f02000f; - public static final int ic_launcher=0x7f020010; - public static final int ic_menu_browse=0x7f020011; - public static final int ic_menu_compass=0x7f020012; - public static final int ic_menu_exit=0x7f020013; - public static final int ic_menu_help=0x7f020014; - public static final int ic_menu_home=0x7f020015; - public static final int ic_menu_moreoverflow=0x7f020016; - public static final int ic_menu_offline=0x7f020017; - public static final int ic_menu_play_all=0x7f020018; - public static final int ic_menu_playlists=0x7f020019; - public static final int ic_menu_refresh=0x7f02001a; - public static final int ic_menu_remove_all=0x7f02001b; - public static final int ic_menu_save=0x7f02001c; - public static final int ic_menu_screen_on_off=0x7f02001d; - public static final int ic_menu_search=0x7f02001e; - public static final int ic_menu_select_artist_folder=0x7f02001f; - public static final int ic_menu_settings=0x7f020020; - public static final int ic_menu_share=0x7f020021; - public static final int ic_menu_shuffle=0x7f020022; - public static final int ic_stat_downloaded=0x7f020023; - public static final int ic_stat_downloading=0x7f020024; - public static final int ic_stat_play=0x7f020025; - public static final int ic_stat_saved=0x7f020026; - public static final int ic_stat_subsonic=0x7f020027; - public static final int list_background=0x7f020028; - public static final int list_focused_holo=0x7f020029; - public static final int list_item_more=0x7f02002a; - public static final int list_longpressed_holo=0x7f02002b; - public static final int list_pressed_holo_dark=0x7f02002c; - public static final int list_pressed_holo_light=0x7f02002d; - public static final int list_selector_background_transition_holo_dark=0x7f02002e; - public static final int list_selector_background_transition_holo_light=0x7f02002f; - public static final int list_selector_disabled_holo_dark=0x7f020030; - public static final int list_selector_disabled_holo_light=0x7f020031; - public static final int list_selector_holo_dark=0x7f020032; - public static final int list_selector_holo_light=0x7f020033; - public static final int main_header_icon=0x7f020034; - public static final int media_backward_normal=0x7f020035; - public static final int media_forward_normal=0x7f020036; - public static final int media_pause_normal=0x7f020037; - public static final int media_repeat_all=0x7f020038; - public static final int media_repeat_off=0x7f020039; - public static final int media_repeat_single=0x7f02003a; - public static final int media_shuffle_normal=0x7f02003b; - public static final int media_start_normal=0x7f02003c; - public static final int media_start_pressed=0x7f02003d; - public static final int media_stop_normal=0x7f02003e; - public static final int media_toggle_list_normal=0x7f02003f; - public static final int menubar_button_disabled=0x7f020040; - public static final int menubar_button_normal=0x7f020041; - public static final int notify_panel_notification_icon_bg=0x7f020042; - public static final int pinstripe_tile=0x7f020043; - public static final int preview=0x7f020044; - public static final int preview_two=0x7f020045; - public static final int progress_bg_holo_dark=0x7f020046; - public static final int progress_horizontal_holo_dark=0x7f020047; - public static final int progress_primary_holo_dark=0x7f020048; - public static final int progress_secondary_holo_dark=0x7f020049; - public static final int select_album_play_all=0x7f02004a; - public static final int select_album_play_all_normal=0x7f02004b; - public static final int select_album_play_all_pressed=0x7f02004c; - public static final int slider_knob=0x7f02004d; - public static final int star=0x7f02004e; - public static final int star_hollow=0x7f02004f; - public static final int status_bg=0x7f020050; - public static final int status_next=0x7f020051; - public static final int status_pause=0x7f020052; - public static final int status_play=0x7f020053; - public static final int status_prev=0x7f020054; - public static final int status_stop=0x7f020055; - public static final int title_bar_shadow=0x7f020056; - public static final int unknown_album=0x7f020057; - public static final int unknown_album_large=0x7f020058; - } - public static final class id { - public static final int album=0x7f0d004d; - public static final int album_artist=0x7f0d0002; - public static final int album_coverart=0x7f0d0000; - public static final int album_menu_pin=0x7f0d008b; - public static final int album_menu_play_last=0x7f0d008a; - public static final int album_menu_play_now=0x7f0d0089; - public static final int album_star=0x7f0d0003; - public static final int album_title=0x7f0d0001; - public static final int appwidget_coverart=0x7f0d0004; - public static final int appwidget_top=0x7f0d0006; - public static final int artist=0x7f0d0008; - public static final int artist_menu_pin=0x7f0d008e; - public static final int artist_menu_play_last=0x7f0d008d; - public static final int artist_menu_play_now=0x7f0d008c; - public static final int button_bar=0x7f0d000c; - public static final int button_bar_home=0x7f0d000d; - public static final int button_bar_music=0x7f0d000e; - public static final int button_bar_now_playing=0x7f0d0011; - public static final int button_bar_playlists=0x7f0d0010; - public static final int button_bar_search=0x7f0d000f; - public static final int control_next=0x7f0d000b; - public static final int control_play=0x7f0d000a; - public static final int control_previous=0x7f0d0009; - public static final int control_stop=0x7f0d004e; - public static final int download_album=0x7f0d0025; - public static final int download_album_art_image=0x7f0d001f; - public static final int download_album_art_layout=0x7f0d001e; - public static final int download_artist=0x7f0d0024; - public static final int download_button_bar_flipper=0x7f0d0021; - public static final int download_control_layout=0x7f0d0012; - public static final int download_duration=0x7f0d0023; - public static final int download_empty=0x7f0d0026; - public static final int download_equalizer=0x7f0d007f; - public static final int download_jukebox=0x7f0d0081; - public static final int download_list=0x7f0d0027; - public static final int download_next=0x7f0d0018; - public static final int download_pause=0x7f0d0015; - public static final int download_playlist_flipper=0x7f0d001d; - public static final int download_position=0x7f0d0022; - public static final int download_previous=0x7f0d0014; - public static final int download_progress_bar=0x7f0d0028; - public static final int download_repeat=0x7f0d0019; - public static final int download_shuffle=0x7f0d0013; - public static final int download_song_title=0x7f0d001c; - public static final int download_start=0x7f0d0017; - public static final int download_status=0x7f0d001b; - public static final int download_stop=0x7f0d0016; - public static final int download_toggle_list=0x7f0d001a; - public static final int download_visualizer=0x7f0d0080; - public static final int download_visualizer_view_layout=0x7f0d0020; - public static final int equalizer_bar=0x7f0d002e; - public static final int equalizer_frequency=0x7f0d002c; - public static final int equalizer_level=0x7f0d002d; - public static final int equalizer_enabled=0x7f0d0029; - public static final int equalizer_layout=0x7f0d002a; - public static final int equalizer_preset=0x7f0d002b; - public static final int help_back=0x7f0d0030; - public static final int help_buttons=0x7f0d002f; - public static final int help_close=0x7f0d0031; - public static final int help_contents=0x7f0d0032; - public static final int icon=0x7f0d0074; - public static final int jukebox_volume_progress_bar=0x7f0d0034; - public static final int linearLayout1=0x7f0d0005; - public static final int lyrics_artist=0x7f0d0036; - public static final int lyrics_scrollview=0x7f0d0035; - public static final int lyrics_text=0x7f0d0038; - public static final int lyrics_title=0x7f0d0037; - public static final int main_select_server_1=0x7f0d003c; - public static final int main_select_server_2=0x7f0d003d; - public static final int main_albums=0x7f0d0040; - public static final int main_albums_alphaByArtist=0x7f0d0048; - public static final int main_albums_alphaByName=0x7f0d0047; - public static final int main_albums_frequent=0x7f0d0043; - public static final int main_albums_highest=0x7f0d0044; - public static final int main_albums_newest=0x7f0d0041; - public static final int main_albums_random=0x7f0d0045; - public static final int main_albums_recent=0x7f0d0042; - public static final int main_albums_starred=0x7f0d0046; - public static final int main_dummy=0x7f0d003a; - public static final int main_list=0x7f0d0039; - public static final int main_select_server=0x7f0d003b; - public static final int main_shuffle=0x7f0d007e; - public static final int main_songs=0x7f0d003e; - public static final int main_songs_starred=0x7f0d003f; - public static final int menu_exit=0x7f0d007d; - public static final int menu_help=0x7f0d007c; - public static final int menu_lyrics=0x7f0d0086; - public static final int menu_refresh=0x7f0d008f; - public static final int menu_remove=0x7f0d0087; - public static final int menu_remove_all=0x7f0d0083; - public static final int menu_save_playlist=0x7f0d0082; - public static final int menu_screen_on_off=0x7f0d0084; - public static final int menu_settings=0x7f0d007b; - public static final int menu_show_album=0x7f0d0085; - public static final int menu_shuffle=0x7f0d0088; - public static final int notification_image=0x7f0d004a; - public static final int play_video_contents=0x7f0d004f; - public static final int progress_message=0x7f0d0050; - public static final int save_playlist_name=0x7f0d0052; - public static final int save_playlist_root=0x7f0d0051; - public static final int search_albums=0x7f0d0056; - public static final int search_artists=0x7f0d0055; - public static final int search_list=0x7f0d0053; - public static final int search_more_albums=0x7f0d0059; - public static final int search_more_artists=0x7f0d0058; - public static final int search_more_songs=0x7f0d005a; - public static final int search_search=0x7f0d0054; - public static final int search_songs=0x7f0d0057; - public static final int select_album_cover_art=0x7f0d0064; - public static final int select_album_delete=0x7f0d0062; - public static final int select_album_empty=0x7f0d005b; - public static final int select_album_entries=0x7f0d005c; - public static final int select_album_more=0x7f0d0063; - public static final int select_album_pin=0x7f0d0060; - public static final int select_album_play_all=0x7f0d0067; - public static final int select_album_play_last=0x7f0d005f; - public static final int select_album_play_now=0x7f0d005e; - public static final int select_album_select=0x7f0d005d; - public static final int select_album_text1=0x7f0d0065; - public static final int select_album_text2=0x7f0d0066; - public static final int select_album_unpin=0x7f0d0061; - public static final int select_artist_folder=0x7f0d0069; - public static final int select_artist_folder_1=0x7f0d006a; - public static final int select_artist_folder_2=0x7f0d006b; - public static final int select_artist_list=0x7f0d0068; - public static final int select_playlist_empty=0x7f0d006c; - public static final int select_playlist_list=0x7f0d006d; - public static final int song_artist=0x7f0d0071; - public static final int song_check=0x7f0d006e; - public static final int song_duration=0x7f0d0072; - public static final int song_menu_play_last=0x7f0d0092; - public static final int song_menu_play_next=0x7f0d0091; - public static final int song_menu_play_now=0x7f0d0090; - public static final int song_star=0x7f0d0073; - public static final int song_status=0x7f0d0070; - public static final int song_title=0x7f0d006f; - public static final int status_icon=0x7f0d004b; - public static final int status_media_collapse=0x7f0d0078; - public static final int status_media_next=0x7f0d0077; - public static final int status_media_play=0x7f0d0076; - public static final int status_media_prev=0x7f0d0075; - public static final int statusbar=0x7f0d0049; - public static final int tab_progress=0x7f0d0079; - public static final int tab_progress_message=0x7f0d007a; - public static final int title=0x7f0d0007; - public static final int toast_layout_root=0x7f0d0033; - public static final int trackname=0x7f0d004c; - } - public static final class integer { - public static final int config_activityDefaultDur=0x7f080001; - public static final int config_activityShortDur=0x7f080000; - } - public static final class layout { - public static final int album_list_item=0x7f030000; - public static final int appwidget4x1=0x7f030001; - public static final int artist_list_item=0x7f030002; - public static final int button_bar=0x7f030003; - public static final int download=0x7f030004; - public static final int download_button_bar_flipper=0x7f030005; - public static final int download_playlist=0x7f030006; - public static final int download_slider=0x7f030007; - public static final int equalizer=0x7f030008; - public static final int equalizer_bar=0x7f030009; - public static final int help=0x7f03000a; - public static final int jukebox_volume=0x7f03000b; - public static final int lyrics=0x7f03000c; - public static final int main=0x7f03000d; - public static final int main_buttons=0x7f03000e; - public static final int notification=0x7f03000f; - public static final int play_video=0x7f030010; - public static final int playlist_list_item=0x7f030011; - public static final int progress=0x7f030012; - public static final int save_playlist=0x7f030013; - public static final int search=0x7f030014; - public static final int search_buttons=0x7f030015; - public static final int select_album=0x7f030016; - public static final int select_album_footer=0x7f030017; - public static final int select_album_header=0x7f030018; - public static final int select_artist=0x7f030019; - public static final int select_artist_header=0x7f03001a; - public static final int select_playlist=0x7f03001b; - public static final int song_list_item=0x7f03001c; - public static final int statusbar=0x7f03001d; - public static final int tab_progress=0x7f03001e; - } - public static final class menu { - public static final int common=0x7f0c0000; - public static final int main=0x7f0c0001; - public static final int nowplaying=0x7f0c0002; - public static final int nowplaying_context=0x7f0c0003; - public static final int select_album=0x7f0c0004; - public static final int select_album_context=0x7f0c0005; - public static final int select_artist_context=0x7f0c0006; - public static final int select_common=0x7f0c0007; - public static final int select_song_context=0x7f0c0008; - } - public static final class plurals { - public static final int select_album_donate_dialog_n_trial_days_left=0x7f0a0003; - public static final int select_album_n_songs=0x7f0a0000; - public static final int select_album_n_songs_added=0x7f0a0002; - public static final int select_album_n_songs_downloading=0x7f0a0001; - } - public static final class string { - public static final int background_task_loading=0x7f0900ea; - public static final int background_task_network_error=0x7f0900ec; - public static final int background_task_no_network=0x7f0900eb; - public static final int background_task_not_found=0x7f0900ed; - public static final int background_task_parse_error=0x7f0900ee; - public static final int background_task_wait=0x7f0900e9; - public static final int button_bar_browse=0x7f09000b; - public static final int button_bar_home=0x7f09000a; - public static final int button_bar_now_playing=0x7f09000e; - public static final int button_bar_playlists=0x7f09000d; - public static final int button_bar_search=0x7f09000c; - public static final int common_appname=0x7f090000; - public static final int common_cancel=0x7f090003; - public static final int common_delete=0x7f090009; - public static final int common_ok=0x7f090001; - public static final int common_pin=0x7f090007; - public static final int common_play_last=0x7f090006; - public static final int common_play_next=0x7f090005; - public static final int common_play_now=0x7f090004; - public static final int common_save=0x7f090002; - public static final int common_unpin=0x7f090008; - public static final int download_empty=0x7f090048; - public static final int download_jukebox_not_authorized=0x7f090067; - public static final int download_jukebox_off=0x7f090063; - public static final int download_jukebox_offline=0x7f090066; - public static final int download_jukebox_on=0x7f090062; - public static final int download_jukebox_server_too_old=0x7f090065; - public static final int download_jukebox_volume=0x7f090064; - public static final int download_menu_equalizer=0x7f090054; - public static final int download_menu_jukebox=0x7f090056; - public static final int download_menu_lyrics=0x7f09004d; - public static final int download_menu_remove=0x7f09004e; - public static final int download_menu_remove_all=0x7f09004f; - public static final int download_menu_save=0x7f090053; - public static final int download_menu_screen_off=0x7f090051; - public static final int download_menu_screen_on=0x7f090050; - public static final int download_menu_show_album=0x7f09004c; - public static final int download_menu_shuffle=0x7f090052; - public static final int download_menu_shuffle_notification=0x7f090057; - public static final int download_menu_visualizer=0x7f090055; - public static final int download_playerstate_buffering=0x7f09004a; - public static final int download_playerstate_downloading=0x7f090049; - public static final int download_playerstate_playing_shuffle=0x7f09004b; - public static final int download_playlist_done=0x7f09005b; - public static final int download_playlist_error=0x7f09005c; - public static final int download_playlist_name=0x7f090059; - public static final int download_playlist_saving=0x7f09005a; - public static final int download_playlist_title=0x7f090058; - public static final int download_repeat_all=0x7f09005e; - public static final int download_repeat_off=0x7f09005d; - public static final int download_repeat_single=0x7f09005f; - public static final int download_visualizer_off=0x7f090061; - public static final int download_visualizer_on=0x7f090060; - public static final int equalizer_enabled=0x7f0900fb; - public static final int equalizer_label=0x7f0900fa; - public static final int equalizer_preset=0x7f0900fc; - public static final int error_label=0x7f09006b; - public static final int help_back=0x7f090027; - public static final int help_close=0x7f090028; - public static final int help_label=0x7f090025; - public static final int help_loading=0x7f09002a; - public static final int help_title=0x7f090026; - public static final int help_url=0x7f090029; - public static final int lyrics_nomatch=0x7f09006a; - public static final int main_albums_alphaByArtist=0x7f09001d; - public static final int main_albums_alphaByName=0x7f09001c; - public static final int main_albums_frequent=0x7f090018; - public static final int main_albums_highest=0x7f090019; - public static final int main_albums_newest=0x7f090016; - public static final int main_albums_random=0x7f09001a; - public static final int main_albums_recent=0x7f090017; - public static final int main_albums_starred=0x7f09001b; - public static final int main_albums_title=0x7f090015; - public static final int main_offline=0x7f090013; - public static final int main_select_server=0x7f090011; - public static final int main_settings=0x7f090014; - public static final int main_shuffle=0x7f090012; - public static final int main_songs_starred=0x7f09001f; - public static final int main_songs_title=0x7f09001e; - public static final int main_welcome_text=0x7f090010; - public static final int main_welcome_title=0x7f09000f; - public static final int menu_exit=0x7f090020; - public static final int menu_help=0x7f090022; - public static final int menu_search=0x7f090023; - public static final int menu_settings=0x7f090021; - public static final int music_library_label=0x7f090036; - public static final int music_library_label_offline=0x7f090037; - /** TODO: Keep screen on -TODO: Keeping the screen on when downloading may improve download speed - */ - public static final int music_service_retry=0x7f0900e8; - public static final int parser_artist_count=0x7f0900f6; - public static final int parser_not_authenticated=0x7f0900f4; - public static final int parser_not_authorized=0x7f0900f5; - public static final int parser_reading=0x7f0900f0; - public static final int parser_reading_done=0x7f0900f1; - public static final int parser_upgrade_client=0x7f0900f2; - public static final int parser_upgrade_server=0x7f0900f3; - public static final int play_video_loading=0x7f09002b; - public static final int play_video_noplugin=0x7f09002c; - /** TODO: Exit -TODO: Settings -TODO: Help - */ - public static final int playlist_label=0x7f090024; - public static final int progress_wait=0x7f090035; - public static final int search_albums=0x7f090032; - public static final int search_artists=0x7f090031; - public static final int search_label=0x7f09002d; - public static final int search_more=0x7f090034; - public static final int search_no_match=0x7f090030; - public static final int search_search=0x7f09002f; - public static final int search_songs=0x7f090033; - public static final int search_title=0x7f09002e; - public static final int select_album_donate_dialog_0_trial_days_left=0x7f090046; - public static final int select_album_donate_dialog_later=0x7f090045; - public static final int select_album_donate_dialog_message=0x7f090043; - public static final int select_album_donate_dialog_now=0x7f090044; - public static final int select_album_empty=0x7f090038; - /** TODO: %d tracks selected. -TODO: %d tracks unselected. - */ - public static final int select_album_more=0x7f09003c; - public static final int select_album_n_selected=0x7f09003a; - public static final int select_album_n_unselected=0x7f09003b; - public static final int select_album_no_network=0x7f090041; - public static final int select_album_no_sdcard=0x7f090040; - public static final int select_album_not_licensed=0x7f090042; - public static final int select_album_offline=0x7f09003d; - public static final int select_album_play_all=0x7f09003f; - public static final int select_album_searching=0x7f09003e; - public static final int select_album_select=0x7f090039; - public static final int select_artist_all_folders=0x7f0900f9; - public static final int select_artist_folder=0x7f0900f8; - public static final int select_artist_refresh=0x7f0900f7; - public static final int select_playlist_empty=0x7f090047; - public static final int service_connecting=0x7f0900ef; - public static final int settings_appearance_title=0x7f090080; - public static final int settings_buffer_length=0x7f0900b2; - public static final int settings_buffer_length_10=0x7f0900b7; - public static final int settings_buffer_length_12=0x7f0900b8; - public static final int settings_buffer_length_15=0x7f0900b9; - public static final int settings_buffer_length_2=0x7f0900b4; - public static final int settings_buffer_length_20=0x7f0900ba; - public static final int settings_buffer_length_30=0x7f0900bb; - public static final int settings_buffer_length_5=0x7f0900b5; - public static final int settings_buffer_length_8=0x7f0900b6; - public static final int settings_cache_location=0x7f090078; - public static final int settings_cache_location_error=0x7f090079; - public static final int settings_cache_size=0x7f090077; - public static final int settings_cache_size_100=0x7f09009c; - public static final int settings_cache_size_1000=0x7f09009f; - public static final int settings_cache_size_10000=0x7f0900a2; - public static final int settings_cache_size_200=0x7f09009d; - public static final int settings_cache_size_2000=0x7f0900a0; - public static final int settings_cache_size_20000=0x7f0900a3; - public static final int settings_cache_size_500=0x7f09009e; - public static final int settings_cache_size_5000=0x7f0900a1; - public static final int settings_cache_size_unlimited=0x7f0900a4; - public static final int settings_cache_title=0x7f090075; - public static final int settings_clear_search_history=0x7f0900a5; - public static final int settings_connection_failure=0x7f09007d; - public static final int settings_default_albums=0x7f0900e6; - public static final int settings_default_artists=0x7f0900e5; - public static final int settings_default_songs=0x7f0900e7; - public static final int settings_hide_media_summary=0x7f0900ac; - /** TODO: Scrobble to Last.fm -TODO: Remember to set up your Last.fm user and password on the Subsonic server - */ - public static final int settings_hide_media_title=0x7f0900ab; - public static final int settings_hide_media_toast=0x7f0900ad; - public static final int settings_invalid_url=0x7f09007e; - public static final int settings_invalid_username=0x7f09007f; - public static final int settings_max_albums=0x7f0900c8; - public static final int settings_max_albums_10=0x7f0900ca; - public static final int settings_max_albums_100=0x7f0900cf; - public static final int settings_max_albums_20=0x7f0900cb; - public static final int settings_max_albums_250=0x7f0900d0; - public static final int settings_max_albums_30=0x7f0900cc; - public static final int settings_max_albums_40=0x7f0900cd; - public static final int settings_max_albums_5=0x7f0900c9; - public static final int settings_max_albums_50=0x7f0900ce; - public static final int settings_max_albums_500=0x7f0900d1; - public static final int settings_max_artists=0x7f0900db; - public static final int settings_max_artists_10=0x7f0900de; - public static final int settings_max_artists_100=0x7f0900e2; - public static final int settings_max_artists_200=0x7f0900e3; - public static final int settings_max_artists_25=0x7f0900df; - public static final int settings_max_artists_3=0x7f0900dc; - public static final int settings_max_artists_5=0x7f0900dd; - public static final int settings_max_artists_50=0x7f0900e0; - public static final int settings_max_artists_500=0x7f0900e4; - public static final int settings_max_artists_75=0x7f0900e1; - public static final int settings_max_bitrate_112=0x7f09008d; - public static final int settings_max_bitrate_128=0x7f09008e; - public static final int settings_max_bitrate_160=0x7f09008f; - public static final int settings_max_bitrate_192=0x7f090090; - public static final int settings_max_bitrate_256=0x7f090091; - public static final int settings_max_bitrate_32=0x7f090089; - public static final int settings_max_bitrate_320=0x7f090092; - public static final int settings_max_bitrate_64=0x7f09008a; - public static final int settings_max_bitrate_80=0x7f09008b; - public static final int settings_max_bitrate_96=0x7f09008c; - public static final int settings_max_bitrate_mobile=0x7f090088; - public static final int settings_max_bitrate_unlimited=0x7f090093; - public static final int settings_max_bitrate_wifi=0x7f090087; - public static final int settings_max_songs=0x7f0900d2; - public static final int settings_max_songs_10=0x7f0900d4; - public static final int settings_max_songs_100=0x7f0900d8; - public static final int settings_max_songs_200=0x7f0900d9; - public static final int settings_max_songs_25=0x7f0900d5; - public static final int settings_max_songs_5=0x7f0900d3; - public static final int settings_max_songs_50=0x7f0900d6; - public static final int settings_max_songs_500=0x7f0900da; - public static final int settings_max_songs_75=0x7f0900d7; - public static final int settings_media_button_summary=0x7f0900af; - public static final int settings_media_button_title=0x7f0900ae; - public static final int settings_network_timeout=0x7f0900b3; - public static final int settings_network_timeout_105000=0x7f0900c2; - public static final int settings_network_timeout_120000=0x7f0900c3; - public static final int settings_network_timeout_15000=0x7f0900bc; - public static final int settings_network_timeout_30000=0x7f0900bd; - public static final int settings_network_timeout_45000=0x7f0900be; - public static final int settings_network_timeout_60000=0x7f0900bf; - public static final int settings_network_timeout_75000=0x7f0900c0; - public static final int settings_network_timeout_90000=0x7f0900c1; - public static final int settings_network_title=0x7f090086; - public static final int settings_other_title=0x7f0900a7; - public static final int settings_preload=0x7f090076; - public static final int settings_preload_1=0x7f090096; - public static final int settings_preload_10=0x7f09009a; - public static final int settings_preload_2=0x7f090097; - public static final int settings_preload_3=0x7f090098; - public static final int settings_preload_5=0x7f090099; - public static final int settings_preload_unlimited=0x7f09009b; - public static final int settings_screen_lit_summary=0x7f0900b1; - public static final int settings_screen_lit_title=0x7f0900b0; - public static final int settings_scrobble_summary=0x7f0900aa; - public static final int settings_scrobble_title=0x7f0900a9; - public static final int settings_search_history_cleared=0x7f0900a6; - public static final int settings_search_title=0x7f0900a8; - public static final int settings_server_address=0x7f090072; - public static final int settings_server_name=0x7f090071; - public static final int settings_server_password=0x7f090074; - public static final int settings_server_unused1=0x7f09006f; - public static final int settings_server_unused2=0x7f090070; - public static final int settings_server_username=0x7f090073; - public static final int settings_servers_title=0x7f09006e; - public static final int settings_show_lockscreen_controls=0x7f0900c6; - public static final int settings_show_lockscreen_controls_summary=0x7f0900c7; - public static final int settings_show_notification=0x7f0900c4; - public static final int settings_show_notification_summary=0x7f0900c5; - public static final int settings_test_connection_title=0x7f09006d; - public static final int settings_testing_connection=0x7f09007a; - public static final int settings_testing_ok=0x7f09007b; - public static final int settings_testing_unlicensed=0x7f09007c; - public static final int settings_theme_dark=0x7f090085; - public static final int settings_theme_fullscreen=0x7f090082; - public static final int settings_theme_fullscreenlight=0x7f090083; - public static final int settings_theme_light=0x7f090084; - public static final int settings_theme_title=0x7f090081; - public static final int settings_theme_wheat=0x7f090104; - public static final int settings_title=0x7f09006c; - public static final int settings_wifi_required_summary=0x7f090095; - public static final int settings_wifi_required_title=0x7f090094; - public static final int song_details_all=0x7f090068; - public static final int song_details_kbps=0x7f090069; - public static final int util_bytes_format_byte=0x7f090103; - public static final int util_bytes_format_gigabyte=0x7f090100; - public static final int util_bytes_format_kilobyte=0x7f090102; - public static final int util_bytes_format_megabyte=0x7f090101; - public static final int widget_initial_text=0x7f0900fd; - public static final int widget_sdcard_busy=0x7f0900fe; - public static final int widget_sdcard_missing=0x7f0900ff; - } - public static final class style { - public static final int Dark=0x7f0b0000; - public static final int Fullscreen=0x7f0b0002; - public static final int Fullscreenlight=0x7f0b0003; - public static final int Light=0x7f0b0001; - public static final int customprogress=0x7f0b0006; - public static final int listselect=0x7f0b0004; - public static final int listselectlight=0x7f0b0005; - } - public static final class xml { - public static final int appwidget_info_4x1=0x7f050000; - public static final int searchable=0x7f050001; - public static final int settings=0x7f050002; - } -} +/* AUTO-GENERATED FILE. DO NOT MODIFY. + * + * This class was automatically generated by the + * aapt tool from the resource data it found. It + * should not be modified by hand. + */ + +package net.sourceforge.subsonic.androidapp; + +public final class R { + public static final class anim { + public static final int push_down_in=0x7f040000; + public static final int push_down_out=0x7f040001; + public static final int push_up_in=0x7f040002; + public static final int push_up_out=0x7f040003; + } + public static final class array { + public static final int bufferLengthNames=0x7f060009; + public static final int bufferLengthValues=0x7f060008; + public static final int cacheSizeNames=0x7f060005; + public static final int cacheSizeValues=0x7f060004; + public static final int defaultSearchNames=0x7f060013; + public static final int defaultSearchValues=0x7f060012; + public static final int maxAlbumsNames=0x7f06000d; + public static final int maxAlbumsValues=0x7f06000c; + public static final int maxArtistsNames=0x7f060011; + public static final int maxArtistsValues=0x7f060010; + public static final int maxBitrateNames=0x7f060007; + public static final int maxBitrateValues=0x7f060006; + public static final int maxSongsNames=0x7f06000f; + public static final int maxSongsValues=0x7f06000e; + public static final int networkTimeoutNames=0x7f06000b; + public static final int networkTimeoutValues=0x7f06000a; + public static final int preloadCountNames=0x7f060003; + public static final int preloadCountValues=0x7f060002; + public static final int themeNames=0x7f060001; + public static final int themeValues=0x7f060000; + } + public static final class attr { + } + public static final class color { + public static final int appwidget_text=0x7f070003; + public static final int black=0x7f070009; + public static final int buttonoff=0x7f070006; + public static final int buttonon=0x7f070007; + public static final int cyan=0x7f07000c; + public static final int dividerColor=0x7f070002; + public static final int grey=0x7f07000b; + public static final int ics_opaque=0x7f07000d; + public static final int mediaControlBackground=0x7f070000; + public static final int mediaControlForeground=0x7f070001; + public static final int notificationArtist=0x7f070004; + public static final int notificationTitle=0x7f070005; + public static final int transparent=0x7f07000a; + public static final int white=0x7f070008; + } + public static final class drawable { + public static final int action_bar_bg=0x7f020000; + public static final int album_art_background=0x7f020001; + public static final int appwidget_art_default=0x7f020002; + public static final int appwidget_bg=0x7f020003; + public static final int bg_separator=0x7f020004; + public static final int bkgd_tile_black=0x7f020005; + public static final int btn_bg=0x7f020006; + public static final int btn_check_buttonless_off=0x7f020007; + public static final int btn_check_buttonless_on=0x7f020008; + public static final int btn_check_custom=0x7f020009; + public static final int btn_collapse_group_normal_holo_dark=0x7f02000a; + public static final int buttonbar_selector=0x7f02000b; + public static final int ic_appwidget_music_next=0x7f02000c; + public static final int ic_appwidget_music_pause=0x7f02000d; + public static final int ic_appwidget_music_play=0x7f02000e; + public static final int ic_appwidget_music_previous=0x7f02000f; + public static final int ic_launcher=0x7f020010; + public static final int ic_menu_browse=0x7f020011; + public static final int ic_menu_compass=0x7f020012; + public static final int ic_menu_exit=0x7f020013; + public static final int ic_menu_help=0x7f020014; + public static final int ic_menu_home=0x7f020015; + public static final int ic_menu_moreoverflow=0x7f020016; + public static final int ic_menu_offline=0x7f020017; + public static final int ic_menu_play_all=0x7f020018; + public static final int ic_menu_playlists=0x7f020019; + public static final int ic_menu_refresh=0x7f02001a; + public static final int ic_menu_remove_all=0x7f02001b; + public static final int ic_menu_save=0x7f02001c; + public static final int ic_menu_screen_on_off=0x7f02001d; + public static final int ic_menu_search=0x7f02001e; + public static final int ic_menu_select_artist_folder=0x7f02001f; + public static final int ic_menu_settings=0x7f020020; + public static final int ic_menu_share=0x7f020021; + public static final int ic_menu_shuffle=0x7f020022; + public static final int ic_stat_downloaded=0x7f020023; + public static final int ic_stat_downloading=0x7f020024; + public static final int ic_stat_play=0x7f020025; + public static final int ic_stat_saved=0x7f020026; + public static final int ic_stat_subsonic=0x7f020027; + public static final int list_background=0x7f020028; + public static final int list_focused_holo=0x7f020029; + public static final int list_item_more=0x7f02002a; + public static final int list_longpressed_holo=0x7f02002b; + public static final int list_pressed_holo_dark=0x7f02002c; + public static final int list_pressed_holo_light=0x7f02002d; + public static final int list_selector_background_transition_holo_dark=0x7f02002e; + public static final int list_selector_background_transition_holo_light=0x7f02002f; + public static final int list_selector_disabled_holo_dark=0x7f020030; + public static final int list_selector_disabled_holo_light=0x7f020031; + public static final int list_selector_holo_dark=0x7f020032; + public static final int list_selector_holo_light=0x7f020033; + public static final int main_header_icon=0x7f020034; + public static final int media_backward_normal=0x7f020035; + public static final int media_forward_normal=0x7f020036; + public static final int media_pause_normal=0x7f020037; + public static final int media_repeat_all=0x7f020038; + public static final int media_repeat_off=0x7f020039; + public static final int media_repeat_single=0x7f02003a; + public static final int media_shuffle_normal=0x7f02003b; + public static final int media_start_normal=0x7f02003c; + public static final int media_start_pressed=0x7f02003d; + public static final int media_stop_normal=0x7f02003e; + public static final int media_toggle_list_normal=0x7f02003f; + public static final int menubar_button_disabled=0x7f020040; + public static final int menubar_button_normal=0x7f020041; + public static final int notify_panel_notification_icon_bg=0x7f020042; + public static final int pinstripe_tile=0x7f020043; + public static final int preview=0x7f020044; + public static final int preview_two=0x7f020045; + public static final int progress_bg_holo_dark=0x7f020046; + public static final int progress_horizontal_holo_dark=0x7f020047; + public static final int progress_primary_holo_dark=0x7f020048; + public static final int progress_secondary_holo_dark=0x7f020049; + public static final int select_album_play_all=0x7f02004a; + public static final int select_album_play_all_normal=0x7f02004b; + public static final int select_album_play_all_pressed=0x7f02004c; + public static final int slider_knob=0x7f02004d; + public static final int star=0x7f02004e; + public static final int star_hollow=0x7f02004f; + public static final int status_bg=0x7f020050; + public static final int status_next=0x7f020051; + public static final int status_pause=0x7f020052; + public static final int status_play=0x7f020053; + public static final int status_prev=0x7f020054; + public static final int status_stop=0x7f020055; + public static final int title_bar_shadow=0x7f020056; + public static final int unknown_album=0x7f020057; + public static final int unknown_album_large=0x7f020058; + } + public static final class id { + public static final int album=0x7f0d004d; + public static final int album_artist=0x7f0d0002; + public static final int album_coverart=0x7f0d0000; + public static final int album_menu_pin=0x7f0d008b; + public static final int album_menu_play_last=0x7f0d008a; + public static final int album_menu_play_now=0x7f0d0089; + public static final int album_star=0x7f0d0003; + public static final int album_title=0x7f0d0001; + public static final int appwidget_coverart=0x7f0d0004; + public static final int appwidget_top=0x7f0d0006; + public static final int artist=0x7f0d0008; + public static final int artist_menu_pin=0x7f0d008e; + public static final int artist_menu_play_last=0x7f0d008d; + public static final int artist_menu_play_now=0x7f0d008c; + public static final int button_bar=0x7f0d000c; + public static final int button_bar_home=0x7f0d000d; + public static final int button_bar_music=0x7f0d000e; + public static final int button_bar_now_playing=0x7f0d0011; + public static final int button_bar_playlists=0x7f0d0010; + public static final int button_bar_search=0x7f0d000f; + public static final int control_next=0x7f0d000b; + public static final int control_play=0x7f0d000a; + public static final int control_previous=0x7f0d0009; + public static final int control_stop=0x7f0d004e; + public static final int download_album=0x7f0d0025; + public static final int download_album_art_image=0x7f0d001f; + public static final int download_album_art_layout=0x7f0d001e; + public static final int download_artist=0x7f0d0024; + public static final int download_button_bar_flipper=0x7f0d0021; + public static final int download_control_layout=0x7f0d0012; + public static final int download_duration=0x7f0d0023; + public static final int download_empty=0x7f0d0026; + public static final int download_equalizer=0x7f0d007f; + public static final int download_jukebox=0x7f0d0081; + public static final int download_list=0x7f0d0027; + public static final int download_next=0x7f0d0018; + public static final int download_pause=0x7f0d0015; + public static final int download_playlist_flipper=0x7f0d001d; + public static final int download_position=0x7f0d0022; + public static final int download_previous=0x7f0d0014; + public static final int download_progress_bar=0x7f0d0028; + public static final int download_repeat=0x7f0d0019; + public static final int download_shuffle=0x7f0d0013; + public static final int download_song_title=0x7f0d001c; + public static final int download_start=0x7f0d0017; + public static final int download_status=0x7f0d001b; + public static final int download_stop=0x7f0d0016; + public static final int download_toggle_list=0x7f0d001a; + public static final int download_visualizer=0x7f0d0080; + public static final int download_visualizer_view_layout=0x7f0d0020; + public static final int equalizer_bar=0x7f0d002e; + public static final int equalizer_frequency=0x7f0d002c; + public static final int equalizer_level=0x7f0d002d; + public static final int equalizer_enabled=0x7f0d0029; + public static final int equalizer_layout=0x7f0d002a; + public static final int equalizer_preset=0x7f0d002b; + public static final int help_back=0x7f0d0030; + public static final int help_buttons=0x7f0d002f; + public static final int help_close=0x7f0d0031; + public static final int help_contents=0x7f0d0032; + public static final int icon=0x7f0d0074; + public static final int jukebox_volume_progress_bar=0x7f0d0034; + public static final int linearLayout1=0x7f0d0005; + public static final int lyrics_artist=0x7f0d0036; + public static final int lyrics_scrollview=0x7f0d0035; + public static final int lyrics_text=0x7f0d0038; + public static final int lyrics_title=0x7f0d0037; + public static final int main_select_server_1=0x7f0d003c; + public static final int main_select_server_2=0x7f0d003d; + public static final int main_albums=0x7f0d0040; + public static final int main_albums_alphaByArtist=0x7f0d0048; + public static final int main_albums_alphaByName=0x7f0d0047; + public static final int main_albums_frequent=0x7f0d0043; + public static final int main_albums_highest=0x7f0d0044; + public static final int main_albums_newest=0x7f0d0041; + public static final int main_albums_random=0x7f0d0045; + public static final int main_albums_recent=0x7f0d0042; + public static final int main_albums_starred=0x7f0d0046; + public static final int main_dummy=0x7f0d003a; + public static final int main_list=0x7f0d0039; + public static final int main_select_server=0x7f0d003b; + public static final int main_shuffle=0x7f0d007e; + public static final int main_songs=0x7f0d003e; + public static final int main_songs_starred=0x7f0d003f; + public static final int menu_exit=0x7f0d007d; + public static final int menu_help=0x7f0d007c; + public static final int menu_lyrics=0x7f0d0086; + public static final int menu_refresh=0x7f0d008f; + public static final int menu_remove=0x7f0d0087; + public static final int menu_remove_all=0x7f0d0083; + public static final int menu_save_playlist=0x7f0d0082; + public static final int menu_screen_on_off=0x7f0d0084; + public static final int menu_settings=0x7f0d007b; + public static final int menu_show_album=0x7f0d0085; + public static final int menu_shuffle=0x7f0d0088; + public static final int notification_image=0x7f0d004a; + public static final int play_video_contents=0x7f0d004f; + public static final int progress_message=0x7f0d0050; + public static final int save_playlist_name=0x7f0d0052; + public static final int save_playlist_root=0x7f0d0051; + public static final int search_albums=0x7f0d0056; + public static final int search_artists=0x7f0d0055; + public static final int search_list=0x7f0d0053; + public static final int search_more_albums=0x7f0d0059; + public static final int search_more_artists=0x7f0d0058; + public static final int search_more_songs=0x7f0d005a; + public static final int search_search=0x7f0d0054; + public static final int search_songs=0x7f0d0057; + public static final int select_album_cover_art=0x7f0d0064; + public static final int select_album_delete=0x7f0d0062; + public static final int select_album_empty=0x7f0d005b; + public static final int select_album_entries=0x7f0d005c; + public static final int select_album_more=0x7f0d0063; + public static final int select_album_pin=0x7f0d0060; + public static final int select_album_play_all=0x7f0d0067; + public static final int select_album_play_last=0x7f0d005f; + public static final int select_album_play_now=0x7f0d005e; + public static final int select_album_select=0x7f0d005d; + public static final int select_album_text1=0x7f0d0065; + public static final int select_album_text2=0x7f0d0066; + public static final int select_album_unpin=0x7f0d0061; + public static final int select_artist_folder=0x7f0d0069; + public static final int select_artist_folder_1=0x7f0d006a; + public static final int select_artist_folder_2=0x7f0d006b; + public static final int select_artist_list=0x7f0d0068; + public static final int select_playlist_empty=0x7f0d006c; + public static final int select_playlist_list=0x7f0d006d; + public static final int song_artist=0x7f0d0071; + public static final int song_check=0x7f0d006e; + public static final int song_duration=0x7f0d0072; + public static final int song_menu_play_last=0x7f0d0092; + public static final int song_menu_play_next=0x7f0d0091; + public static final int song_menu_play_now=0x7f0d0090; + public static final int song_star=0x7f0d0073; + public static final int song_status=0x7f0d0070; + public static final int song_title=0x7f0d006f; + public static final int status_icon=0x7f0d004b; + public static final int status_media_collapse=0x7f0d0078; + public static final int status_media_next=0x7f0d0077; + public static final int status_media_play=0x7f0d0076; + public static final int status_media_prev=0x7f0d0075; + public static final int statusbar=0x7f0d0049; + public static final int tab_progress=0x7f0d0079; + public static final int tab_progress_message=0x7f0d007a; + public static final int title=0x7f0d0007; + public static final int toast_layout_root=0x7f0d0033; + public static final int trackname=0x7f0d004c; + } + public static final class integer { + public static final int config_activityDefaultDur=0x7f080001; + public static final int config_activityShortDur=0x7f080000; + } + public static final class layout { + public static final int album_list_item=0x7f030000; + public static final int appwidget4x1=0x7f030001; + public static final int artist_list_item=0x7f030002; + public static final int button_bar=0x7f030003; + public static final int download=0x7f030004; + public static final int download_button_bar_flipper=0x7f030005; + public static final int download_playlist=0x7f030006; + public static final int download_slider=0x7f030007; + public static final int equalizer=0x7f030008; + public static final int equalizer_bar=0x7f030009; + public static final int help=0x7f03000a; + public static final int jukebox_volume=0x7f03000b; + public static final int lyrics=0x7f03000c; + public static final int main=0x7f03000d; + public static final int main_buttons=0x7f03000e; + public static final int notification=0x7f03000f; + public static final int play_video=0x7f030010; + public static final int playlist_list_item=0x7f030011; + public static final int progress=0x7f030012; + public static final int save_playlist=0x7f030013; + public static final int search=0x7f030014; + public static final int search_buttons=0x7f030015; + public static final int select_album=0x7f030016; + public static final int select_album_footer=0x7f030017; + public static final int select_album_header=0x7f030018; + public static final int select_artist=0x7f030019; + public static final int select_artist_header=0x7f03001a; + public static final int select_playlist=0x7f03001b; + public static final int song_list_item=0x7f03001c; + public static final int statusbar=0x7f03001d; + public static final int tab_progress=0x7f03001e; + } + public static final class menu { + public static final int common=0x7f0c0000; + public static final int main=0x7f0c0001; + public static final int nowplaying=0x7f0c0002; + public static final int nowplaying_context=0x7f0c0003; + public static final int select_album=0x7f0c0004; + public static final int select_album_context=0x7f0c0005; + public static final int select_artist_context=0x7f0c0006; + public static final int select_common=0x7f0c0007; + public static final int select_song_context=0x7f0c0008; + } + public static final class plurals { + public static final int select_album_donate_dialog_n_trial_days_left=0x7f0a0003; + public static final int select_album_n_songs=0x7f0a0000; + public static final int select_album_n_songs_added=0x7f0a0002; + public static final int select_album_n_songs_downloading=0x7f0a0001; + } + public static final class string { + public static final int background_task_loading=0x7f0900ec; + public static final int background_task_network_error=0x7f0900ee; + public static final int background_task_no_network=0x7f0900ed; + public static final int background_task_not_found=0x7f0900ef; + public static final int background_task_parse_error=0x7f0900f0; + public static final int background_task_wait=0x7f0900eb; + public static final int button_bar_browse=0x7f09000b; + public static final int button_bar_home=0x7f09000a; + public static final int button_bar_now_playing=0x7f09000e; + public static final int button_bar_playlists=0x7f09000d; + public static final int button_bar_search=0x7f09000c; + public static final int common_appname=0x7f090000; + public static final int common_cancel=0x7f090003; + public static final int common_delete=0x7f090009; + public static final int common_ok=0x7f090001; + public static final int common_pin=0x7f090007; + public static final int common_play_last=0x7f090006; + public static final int common_play_next=0x7f090005; + public static final int common_play_now=0x7f090004; + public static final int common_save=0x7f090002; + public static final int common_unpin=0x7f090008; + public static final int download_empty=0x7f090048; + public static final int download_jukebox_not_authorized=0x7f090067; + public static final int download_jukebox_off=0x7f090063; + public static final int download_jukebox_offline=0x7f090066; + public static final int download_jukebox_on=0x7f090062; + public static final int download_jukebox_server_too_old=0x7f090065; + public static final int download_jukebox_volume=0x7f090064; + public static final int download_menu_equalizer=0x7f090054; + public static final int download_menu_jukebox=0x7f090056; + public static final int download_menu_lyrics=0x7f09004d; + public static final int download_menu_remove=0x7f09004e; + public static final int download_menu_remove_all=0x7f09004f; + public static final int download_menu_save=0x7f090053; + public static final int download_menu_screen_off=0x7f090051; + public static final int download_menu_screen_on=0x7f090050; + public static final int download_menu_show_album=0x7f09004c; + public static final int download_menu_shuffle=0x7f090052; + public static final int download_menu_shuffle_notification=0x7f090057; + public static final int download_menu_visualizer=0x7f090055; + public static final int download_playerstate_buffering=0x7f09004a; + public static final int download_playerstate_downloading=0x7f090049; + public static final int download_playerstate_playing_shuffle=0x7f09004b; + public static final int download_playlist_done=0x7f09005b; + public static final int download_playlist_error=0x7f09005c; + public static final int download_playlist_name=0x7f090059; + public static final int download_playlist_saving=0x7f09005a; + public static final int download_playlist_title=0x7f090058; + public static final int download_repeat_all=0x7f09005e; + public static final int download_repeat_off=0x7f09005d; + public static final int download_repeat_single=0x7f09005f; + public static final int download_visualizer_off=0x7f090061; + public static final int download_visualizer_on=0x7f090060; + public static final int equalizer_enabled=0x7f0900fd; + public static final int equalizer_label=0x7f0900fc; + public static final int equalizer_preset=0x7f0900fe; + public static final int error_label=0x7f09006b; + public static final int help_back=0x7f090027; + public static final int help_close=0x7f090028; + public static final int help_label=0x7f090025; + public static final int help_loading=0x7f09002a; + public static final int help_title=0x7f090026; + public static final int help_url=0x7f090029; + public static final int lyrics_nomatch=0x7f09006a; + public static final int main_albums_alphaByArtist=0x7f09001d; + public static final int main_albums_alphaByName=0x7f09001c; + public static final int main_albums_frequent=0x7f090018; + public static final int main_albums_highest=0x7f090019; + public static final int main_albums_newest=0x7f090016; + public static final int main_albums_random=0x7f09001a; + public static final int main_albums_recent=0x7f090017; + public static final int main_albums_starred=0x7f09001b; + public static final int main_albums_title=0x7f090015; + public static final int main_offline=0x7f090013; + public static final int main_select_server=0x7f090011; + public static final int main_settings=0x7f090014; + public static final int main_shuffle=0x7f090012; + public static final int main_songs_starred=0x7f09001f; + public static final int main_songs_title=0x7f09001e; + public static final int main_welcome_text=0x7f090010; + public static final int main_welcome_title=0x7f09000f; + public static final int menu_exit=0x7f090020; + public static final int menu_help=0x7f090022; + public static final int menu_search=0x7f090023; + public static final int menu_settings=0x7f090021; + public static final int music_library_label=0x7f090036; + public static final int music_library_label_offline=0x7f090037; + /** TODO: Keep screen on +TODO: Keeping the screen on when downloading may improve download speed + */ + public static final int music_service_retry=0x7f0900ea; + public static final int parser_artist_count=0x7f0900f8; + public static final int parser_not_authenticated=0x7f0900f6; + public static final int parser_not_authorized=0x7f0900f7; + public static final int parser_reading=0x7f0900f2; + public static final int parser_reading_done=0x7f0900f3; + public static final int parser_upgrade_client=0x7f0900f4; + public static final int parser_upgrade_server=0x7f0900f5; + public static final int play_video_loading=0x7f09002b; + public static final int play_video_noplugin=0x7f09002c; + /** TODO: Exit +TODO: Settings +TODO: Help + */ + public static final int playlist_label=0x7f090024; + public static final int progress_wait=0x7f090035; + public static final int search_albums=0x7f090032; + public static final int search_artists=0x7f090031; + public static final int search_label=0x7f09002d; + public static final int search_more=0x7f090034; + public static final int search_no_match=0x7f090030; + public static final int search_search=0x7f09002f; + public static final int search_songs=0x7f090033; + public static final int search_title=0x7f09002e; + public static final int select_album_donate_dialog_0_trial_days_left=0x7f090046; + public static final int select_album_donate_dialog_later=0x7f090045; + public static final int select_album_donate_dialog_message=0x7f090043; + public static final int select_album_donate_dialog_now=0x7f090044; + public static final int select_album_empty=0x7f090038; + /** TODO: %d tracks selected. +TODO: %d tracks unselected. + */ + public static final int select_album_more=0x7f09003c; + public static final int select_album_n_selected=0x7f09003a; + public static final int select_album_n_unselected=0x7f09003b; + public static final int select_album_no_network=0x7f090041; + public static final int select_album_no_sdcard=0x7f090040; + public static final int select_album_not_licensed=0x7f090042; + public static final int select_album_offline=0x7f09003d; + public static final int select_album_play_all=0x7f09003f; + public static final int select_album_searching=0x7f09003e; + public static final int select_album_select=0x7f090039; + public static final int select_artist_all_folders=0x7f0900fb; + public static final int select_artist_folder=0x7f0900fa; + public static final int select_artist_refresh=0x7f0900f9; + public static final int select_playlist_empty=0x7f090047; + public static final int service_connecting=0x7f0900f1; + public static final int settings_appearance_title=0x7f090080; + public static final int settings_buffer_length=0x7f0900b2; + public static final int settings_buffer_length_10=0x7f0900b7; + public static final int settings_buffer_length_12=0x7f0900b8; + public static final int settings_buffer_length_15=0x7f0900b9; + public static final int settings_buffer_length_2=0x7f0900b4; + public static final int settings_buffer_length_20=0x7f0900ba; + public static final int settings_buffer_length_30=0x7f0900bb; + public static final int settings_buffer_length_5=0x7f0900b5; + public static final int settings_buffer_length_8=0x7f0900b6; + public static final int settings_cache_location=0x7f090078; + public static final int settings_cache_location_error=0x7f090079; + public static final int settings_cache_size=0x7f090077; + public static final int settings_cache_size_100=0x7f09009c; + public static final int settings_cache_size_1000=0x7f09009f; + public static final int settings_cache_size_10000=0x7f0900a2; + public static final int settings_cache_size_200=0x7f09009d; + public static final int settings_cache_size_2000=0x7f0900a0; + public static final int settings_cache_size_20000=0x7f0900a3; + public static final int settings_cache_size_500=0x7f09009e; + public static final int settings_cache_size_5000=0x7f0900a1; + public static final int settings_cache_size_unlimited=0x7f0900a4; + public static final int settings_cache_title=0x7f090075; + public static final int settings_clear_search_history=0x7f0900a5; + public static final int settings_connection_failure=0x7f09007d; + public static final int settings_default_albums=0x7f0900e8; + public static final int settings_default_artists=0x7f0900e7; + public static final int settings_default_songs=0x7f0900e9; + public static final int settings_hide_media_summary=0x7f0900ac; + /** TODO: Scrobble to Last.fm +TODO: Remember to set up your Last.fm user and password on the Subsonic server + */ + public static final int settings_hide_media_title=0x7f0900ab; + public static final int settings_hide_media_toast=0x7f0900ad; + public static final int settings_invalid_url=0x7f09007e; + public static final int settings_invalid_username=0x7f09007f; + public static final int settings_max_albums=0x7f0900ca; + public static final int settings_max_albums_10=0x7f0900cc; + public static final int settings_max_albums_100=0x7f0900d1; + public static final int settings_max_albums_20=0x7f0900cd; + public static final int settings_max_albums_250=0x7f0900d2; + public static final int settings_max_albums_30=0x7f0900ce; + public static final int settings_max_albums_40=0x7f0900cf; + public static final int settings_max_albums_5=0x7f0900cb; + public static final int settings_max_albums_50=0x7f0900d0; + public static final int settings_max_albums_500=0x7f0900d3; + public static final int settings_max_artists=0x7f0900dd; + public static final int settings_max_artists_10=0x7f0900e0; + public static final int settings_max_artists_100=0x7f0900e4; + public static final int settings_max_artists_200=0x7f0900e5; + public static final int settings_max_artists_25=0x7f0900e1; + public static final int settings_max_artists_3=0x7f0900de; + public static final int settings_max_artists_5=0x7f0900df; + public static final int settings_max_artists_50=0x7f0900e2; + public static final int settings_max_artists_500=0x7f0900e6; + public static final int settings_max_artists_75=0x7f0900e3; + public static final int settings_max_bitrate_112=0x7f09008d; + public static final int settings_max_bitrate_128=0x7f09008e; + public static final int settings_max_bitrate_160=0x7f09008f; + public static final int settings_max_bitrate_192=0x7f090090; + public static final int settings_max_bitrate_256=0x7f090091; + public static final int settings_max_bitrate_32=0x7f090089; + public static final int settings_max_bitrate_320=0x7f090092; + public static final int settings_max_bitrate_64=0x7f09008a; + public static final int settings_max_bitrate_80=0x7f09008b; + public static final int settings_max_bitrate_96=0x7f09008c; + public static final int settings_max_bitrate_mobile=0x7f090088; + public static final int settings_max_bitrate_unlimited=0x7f090093; + public static final int settings_max_bitrate_wifi=0x7f090087; + public static final int settings_max_songs=0x7f0900d4; + public static final int settings_max_songs_10=0x7f0900d6; + public static final int settings_max_songs_100=0x7f0900da; + public static final int settings_max_songs_200=0x7f0900db; + public static final int settings_max_songs_25=0x7f0900d7; + public static final int settings_max_songs_5=0x7f0900d5; + public static final int settings_max_songs_50=0x7f0900d8; + public static final int settings_max_songs_500=0x7f0900dc; + public static final int settings_max_songs_75=0x7f0900d9; + public static final int settings_media_button_summary=0x7f0900af; + public static final int settings_media_button_title=0x7f0900ae; + public static final int settings_network_timeout=0x7f0900b3; + public static final int settings_network_timeout_105000=0x7f0900c2; + public static final int settings_network_timeout_120000=0x7f0900c3; + public static final int settings_network_timeout_15000=0x7f0900bc; + public static final int settings_network_timeout_30000=0x7f0900bd; + public static final int settings_network_timeout_45000=0x7f0900be; + public static final int settings_network_timeout_60000=0x7f0900bf; + public static final int settings_network_timeout_75000=0x7f0900c0; + public static final int settings_network_timeout_90000=0x7f0900c1; + public static final int settings_network_title=0x7f090086; + public static final int settings_other_title=0x7f0900a7; + public static final int settings_preload=0x7f090076; + public static final int settings_preload_1=0x7f090096; + public static final int settings_preload_10=0x7f09009a; + public static final int settings_preload_2=0x7f090097; + public static final int settings_preload_3=0x7f090098; + public static final int settings_preload_5=0x7f090099; + public static final int settings_preload_unlimited=0x7f09009b; + public static final int settings_screen_lit_summary=0x7f0900b1; + public static final int settings_screen_lit_title=0x7f0900b0; + public static final int settings_scrobble_summary=0x7f0900aa; + public static final int settings_scrobble_title=0x7f0900a9; + public static final int settings_search_history_cleared=0x7f0900a6; + public static final int settings_search_title=0x7f0900a8; + public static final int settings_server_address=0x7f090072; + public static final int settings_server_name=0x7f090071; + public static final int settings_server_password=0x7f090074; + public static final int settings_server_unused1=0x7f09006f; + public static final int settings_server_unused2=0x7f090070; + public static final int settings_server_username=0x7f090073; + public static final int settings_servers_title=0x7f09006e; + public static final int settings_show_lockscreen_controls=0x7f0900c6; + public static final int settings_show_lockscreen_controls_summary=0x7f0900c7; + public static final int settings_show_notification=0x7f0900c4; + public static final int settings_show_notification_summary=0x7f0900c5; + public static final int settings_test_connection_title=0x7f09006d; + public static final int settings_testing_connection=0x7f09007a; + public static final int settings_testing_ok=0x7f09007b; + public static final int settings_testing_unlicensed=0x7f09007c; + public static final int settings_theme_dark=0x7f090085; + public static final int settings_theme_fullscreen=0x7f090082; + public static final int settings_theme_fullscreenlight=0x7f090083; + public static final int settings_theme_light=0x7f090084; + public static final int settings_theme_title=0x7f090081; + public static final int settings_theme_wheat=0x7f090106; + public static final int settings_title=0x7f09006c; + public static final int settings_use_stream_proxy=0x7f0900c8; + public static final int settings_use_stream_proxy_summary=0x7f0900c9; + public static final int settings_wifi_required_summary=0x7f090095; + public static final int settings_wifi_required_title=0x7f090094; + public static final int song_details_all=0x7f090068; + public static final int song_details_kbps=0x7f090069; + public static final int util_bytes_format_byte=0x7f090105; + public static final int util_bytes_format_gigabyte=0x7f090102; + public static final int util_bytes_format_kilobyte=0x7f090104; + public static final int util_bytes_format_megabyte=0x7f090103; + public static final int widget_initial_text=0x7f0900ff; + public static final int widget_sdcard_busy=0x7f090100; + public static final int widget_sdcard_missing=0x7f090101; + } + public static final class style { + public static final int Dark=0x7f0b0000; + public static final int Fullscreen=0x7f0b0002; + public static final int Fullscreenlight=0x7f0b0003; + public static final int Light=0x7f0b0001; + public static final int customprogress=0x7f0b0006; + public static final int listselect=0x7f0b0004; + public static final int listselectlight=0x7f0b0005; + } + public static final class xml { + public static final int appwidget_info_4x1=0x7f050000; + public static final int searchable=0x7f050001; + public static final int settings=0x7f050002; + } +} diff --git a/res/values/strings.xml b/res/values/strings.xml index 3cde49dc..2ba14a3a 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -1,309 +1,311 @@ - - - - Subsonic - OK - Save - Cancel - Play Now - Play Next - Play Last - Pin - Unpin - Delete - - Subsonic Home - Media Library - Search - Playlists - Now Playing - - Welcome! - Welcome to Subsonic! The app is currently configured to use the Subsonic demo server. After you\'ve - set up your personal server (available from subsonic.org), please go to Settings and change the configuration to connect to it. - Select Server - Shuffle Play - Offline - Settings - Albums - Recently Added - Recently Played - Most Played - Top Rated - Random - Starred Albums - By Name - By Artist - Songs - Starred Songs - - Exit - Settings - Help - Search - - Playlists - - Help - Welcome to Subsonic! - Back - Close - file:///android_asset/html/en/index.html - Loading… - - Loading video… - Please install Adobe Flash Player from Android Market. - - Search - Search - Click to search - No matches, please try again - Artists - Albums - Songs - Show More - - Please wait… - - Media Library - Offline Media - - No media found - Select All - %d tracks selected. - %d tracks unselected. - More - Offline - Searching… - Play All - Error: No SD card available. - Warning: No network available. - Server not licensed. %d trial days left. - Get unlimited downloads by donating to Subsonic. - Now - Later - Trial period is over - - - No saved playlists on server - - Playlist is empty - Downloading - %s - Buffering - Playing shuffle - Show Album - Lyrics - Remove Song - Remove All - Screen On - Screen Off - Shuffle - Save Playlist - Equalizer - Visualizer - Jukebox - Playlist was shuffled - Save Playlist - Enter the playlist name: - Saving playlist \"%s\"… - Playlist was successfully saved. - Failed to save playlist, please try later. - Repeat Off - Repeat All - Repeat Song - Turned on visualizer. - Turned off visualizer. - Turned on remote control. Music is played on server. - Turned off remote control. Music is played on phone. - Remote Volume - Remote control is not supported. Please upgrade your Subsonic server. - Remote control is not available in offline mode. - Remote control is not allowed. Please enable jukebox mode in Users > Settings on your Subsonic server. - - %1$s %2$s - %d kbps - - No lyrics found - - Error - - Subsonic Settings - Test Connection - Servers - Unused 1 - Unused 2 - Name - Server Address - Username - Password - Music Cache - Songs To Preload - Cache Size - Cache Location - Invalid cache location. Using default. - Testing connection… - Connection is OK - Connection is OK. Server unlicensed. - Connection failure. - Please specify a valid URL. - Please specify a valid username (no trailing spaces). - Appearance - Theme - Fullscreen Dark - Fullscreen Light - Light - Dark - Network - Max Bitrate - Wi-Fi - Max Bitrate - Mobile - 32 Kbps - 64 Kbps - 80 Kbps - 96 Kbps - 112 Kbps - 128 Kbps - 160 Kbps - 192 Kbps - 256 Kbps - 320 Kbps - Unlimited - Wi-Fi Streaming Only - Only stream media if connected to Wi-Fi - 1 song - 2 songs - 3 songs - 5 songs - 10 songs - Unlimited - 100 MB - 200 MB - 500 MB - 1 GB - 2 GB - 5 GB - 10 GB - 20 GB - Unlimited - Clear Search History - Search history cleared - Other Settings - Search Settings - Scrobble To Last.fm - Remember to set up your Last.fm user and password on the Subsonic server - Hide From Other - Hide music files from other apps. - Takes effect next time Android scans your phone for music. - Media Buttons - Respond to phone, headset and Bluetooth media buttons - Keep Screen On - Keeping the screen on while downloading improves download speed. - Buffer Length - Network Timeout - 2 seconds - 5 seconds - 8 seconds - 10 seconds - 12 seconds - 15 seconds - 20 seconds - 30 seconds - 15 seconds - 30 seconds - 45 seconds - 60 seconds - 75 seconds - 90 seconds - 105 seconds - 120 seconds - Show Notification - Show now playing notification in the status bar - Show Lock Screen Controls - Show playback controls on the lock screen - Max Albums - 5 - 10 - 20 - 30 - 40 - 50 - 100 - 250 - 500 - Max Songs - 5 - 10 - 25 - 50 - 75 - 100 - 200 - 500 - Max Artists - 3 - 5 - 10 - 25 - 50 - 75 - 100 - 200 - 500 - Default Artists - Default Albums - Default Songs - - A network error occurred. Retrying %1$d of %2$d. - - Please wait… - Loading. - This program requires network access. Please turn on Wi-Fi or mobile network. - A network error occurred. Please check the server address or try again later. - Resource not found. Please check the server address. - Didn\'t understand the reply. Please check the server address. - - Contacting server, please wait. - - Reading from server. - Reading from server. Done! - Incompatible versions. Please upgrade Subsonic Android app. - Incompatible versions. Please upgrade Subsonic server. - Wrong username or password. - Not authorized. Check user permissions in Subsonic server. - Got %d artists. - - Refresh - Select folder - All folders - - Equalizer - Enabled - Select preset - - Touch to select music - SD card unavailable - No SD card - - 0.00 GB - 0.00 MB - 0 KB - 0 B - - - No songs - One song - %d songs - - - One song scheduled for download. - %d songs scheduled for download. - - - One song added to play queue. - %d songs added to play queue. - - - One day left of trial period - %d days left of trial period - - - + + + + Subsonic + OK + Save + Cancel + Play Now + Play Next + Play Last + Pin + Unpin + Delete + + Subsonic Home + Media Library + Search + Playlists + Now Playing + + Welcome! + Welcome to Subsonic! The app is currently configured to use the Subsonic demo server. After you\'ve + set up your personal server (available from subsonic.org), please go to Settings and change the configuration to connect to it. + Select Server + Shuffle Play + Offline + Settings + Albums + Recently Added + Recently Played + Most Played + Top Rated + Random + Starred Albums + By Name + By Artist + Songs + Starred Songs + + Exit + Settings + Help + Search + + Playlists + + Help + Welcome to Subsonic! + Back + Close + file:///android_asset/html/en/index.html + Loading… + + Loading video… + Please install Adobe Flash Player from Android Market. + + Search + Search + Click to search + No matches, please try again + Artists + Albums + Songs + Show More + + Please wait… + + Media Library + Offline Media + + No media found + Select All + %d tracks selected. + %d tracks unselected. + More + Offline + Searching… + Play All + Error: No SD card available. + Warning: No network available. + Server not licensed. %d trial days left. + Get unlimited downloads by donating to Subsonic. + Now + Later + Trial period is over + + + No saved playlists on server + + Playlist is empty + Downloading - %s + Buffering + Playing shuffle + Show Album + Lyrics + Remove Song + Remove All + Screen On + Screen Off + Shuffle + Save Playlist + Equalizer + Visualizer + Jukebox + Playlist was shuffled + Save Playlist + Enter the playlist name: + Saving playlist \"%s\"… + Playlist was successfully saved. + Failed to save playlist, please try later. + Repeat Off + Repeat All + Repeat Song + Turned on visualizer. + Turned off visualizer. + Turned on remote control. Music is played on server. + Turned off remote control. Music is played on phone. + Remote Volume + Remote control is not supported. Please upgrade your Subsonic server. + Remote control is not available in offline mode. + Remote control is not allowed. Please enable jukebox mode in Users > Settings on your Subsonic server. + + %1$s %2$s + %d kbps + + No lyrics found + + Error + + Subsonic Settings + Test Connection + Servers + Unused 1 + Unused 2 + Name + Server Address + Username + Password + Music Cache + Songs To Preload + Cache Size + Cache Location + Invalid cache location. Using default. + Testing connection… + Connection is OK + Connection is OK. Server unlicensed. + Connection failure. + Please specify a valid URL. + Please specify a valid username (no trailing spaces). + Appearance + Theme + Fullscreen Dark + Fullscreen Light + Light + Dark + Network + Max Bitrate - Wi-Fi + Max Bitrate - Mobile + 32 Kbps + 64 Kbps + 80 Kbps + 96 Kbps + 112 Kbps + 128 Kbps + 160 Kbps + 192 Kbps + 256 Kbps + 320 Kbps + Unlimited + Wi-Fi Streaming Only + Only stream media if connected to Wi-Fi + 1 song + 2 songs + 3 songs + 5 songs + 10 songs + Unlimited + 100 MB + 200 MB + 500 MB + 1 GB + 2 GB + 5 GB + 10 GB + 20 GB + Unlimited + Clear Search History + Search history cleared + Other Settings + Search Settings + Scrobble To Last.fm + Remember to set up your Last.fm user and password on the Subsonic server + Hide From Other + Hide music files from other apps. + Takes effect next time Android scans your phone for music. + Media Buttons + Respond to phone, headset and Bluetooth media buttons + Keep Screen On + Keeping the screen on while downloading improves download speed. + Buffer Length + Network Timeout + 2 seconds + 5 seconds + 8 seconds + 10 seconds + 12 seconds + 15 seconds + 20 seconds + 30 seconds + 15 seconds + 30 seconds + 45 seconds + 60 seconds + 75 seconds + 90 seconds + 105 seconds + 120 seconds + Show Notification + Show now playing notification in the status bar + Show Lock Screen Controls + Show playback controls on the lock screen + Use Stream Proxy + Stream media playback through a proxy (may help stutter) + Max Albums + 5 + 10 + 20 + 30 + 40 + 50 + 100 + 250 + 500 + Max Songs + 5 + 10 + 25 + 50 + 75 + 100 + 200 + 500 + Max Artists + 3 + 5 + 10 + 25 + 50 + 75 + 100 + 200 + 500 + Default Artists + Default Albums + Default Songs + + A network error occurred. Retrying %1$d of %2$d. + + Please wait… + Loading. + This program requires network access. Please turn on Wi-Fi or mobile network. + A network error occurred. Please check the server address or try again later. + Resource not found. Please check the server address. + Didn\'t understand the reply. Please check the server address. + + Contacting server, please wait. + + Reading from server. + Reading from server. Done! + Incompatible versions. Please upgrade Subsonic Android app. + Incompatible versions. Please upgrade Subsonic server. + Wrong username or password. + Not authorized. Check user permissions in Subsonic server. + Got %d artists. + + Refresh + Select folder + All folders + + Equalizer + Enabled + Select preset + + Touch to select music + SD card unavailable + No SD card + + 0.00 GB + 0.00 MB + 0 KB + 0 B + + + No songs + One song + %d songs + + + One song scheduled for download. + %d songs scheduled for download. + + + One song added to play queue. + %d songs added to play queue. + + + One day left of trial period + %d days left of trial period + + + diff --git a/res/xml/settings.xml b/res/xml/settings.xml index f35df746..707a84cf 100644 --- a/res/xml/settings.xml +++ b/res/xml/settings.xml @@ -1,273 +1,279 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/net/sourceforge/subsonic/androidapp/activity/SelectArtistActivity.java b/src/net/sourceforge/subsonic/androidapp/activity/SelectArtistActivity.java index b68927cb..de3a0e0f 100644 --- a/src/net/sourceforge/subsonic/androidapp/activity/SelectArtistActivity.java +++ b/src/net/sourceforge/subsonic/androidapp/activity/SelectArtistActivity.java @@ -1,251 +1,253 @@ -/* - This file is part of Subsonic. - - Subsonic is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Subsonic is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Subsonic. If not, see . - - Copyright 2009 (C) Sindre Mehus - */ - -package net.sourceforge.subsonic.androidapp.activity; - -import android.content.Intent; -import android.os.Bundle; -import android.view.ContextMenu; -import android.view.LayoutInflater; -import android.view.Menu; -import android.view.MenuInflater; -import android.view.MenuItem; -import android.view.View; -import android.widget.AdapterView; -import android.widget.ListView; -import android.widget.TextView; -import net.sourceforge.subsonic.androidapp.R; -import net.sourceforge.subsonic.androidapp.domain.Artist; -import net.sourceforge.subsonic.androidapp.domain.Indexes; -import net.sourceforge.subsonic.androidapp.domain.MusicFolder; -import net.sourceforge.subsonic.androidapp.service.MusicService; -import net.sourceforge.subsonic.androidapp.service.MusicServiceFactory; -import net.sourceforge.subsonic.androidapp.util.ArtistAdapter; -import net.sourceforge.subsonic.androidapp.util.BackgroundTask; -import net.sourceforge.subsonic.androidapp.util.Constants; -import net.sourceforge.subsonic.androidapp.util.TabActivityBackgroundTask; -import net.sourceforge.subsonic.androidapp.util.Util; - -import java.util.ArrayList; -import java.util.List; - -public class SelectArtistActivity extends SubsonicTabActivity implements AdapterView.OnItemClickListener { - - private static final int MENU_GROUP_MUSIC_FOLDER = 10; - - private ListView artistList; - private View folderButton; - private TextView folderName; - private List musicFolders; - - /** - * Called when the activity is first created. - */ - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.select_artist); - - artistList = (ListView) findViewById(R.id.select_artist_list); - artistList.setOnItemClickListener(this); - artistList.setOnTouchListener(gestureListener); - - folderButton = LayoutInflater.from(this).inflate(R.layout.select_artist_header, artistList, false); - folderName = (TextView) folderButton.findViewById(R.id.select_artist_folder_2); - - if (!Util.isOffline(this)) { - artistList.addHeaderView(folderButton); - } - - registerForContextMenu(artistList); - - setTitle(Util.isOffline(this) ? R.string.music_library_label_offline : R.string.music_library_label); - - musicFolders = null; - load(); - } - - @Override - public boolean onCreateOptionsMenu(Menu menu) { - MenuInflater inflater = getMenuInflater(); - inflater.inflate(R.menu.main, menu); - inflater.inflate(R.menu.select_common, menu); - super.onCreateOptionsMenu(menu); - - return true; - } - - private void refresh() { - finish(); - Intent intent = getIntent(); - intent.putExtra(Constants.INTENT_EXTRA_NAME_REFRESH, true); - Util.startActivityWithoutTransition(this, intent); - } - - private void selectFolder() { - folderButton.showContextMenu(); - } - - private void load() { - BackgroundTask task = new TabActivityBackgroundTask(this) { - @Override - protected Indexes doInBackground() throws Throwable { - boolean refresh = getIntent().getBooleanExtra(Constants.INTENT_EXTRA_NAME_REFRESH, false); - MusicService musicService = MusicServiceFactory.getMusicService(SelectArtistActivity.this); - if (!Util.isOffline(SelectArtistActivity.this)) { - musicFolders = musicService.getMusicFolders(SelectArtistActivity.this, this); - } - String musicFolderId = Util.getSelectedMusicFolderId(SelectArtistActivity.this); - return musicService.getIndexes(musicFolderId, refresh, SelectArtistActivity.this, this); - } - - @Override - protected void done(Indexes result) { - List artists = new ArrayList(result.getShortcuts().size() + result.getArtists().size()); - artists.addAll(result.getShortcuts()); - artists.addAll(result.getArtists()); - artistList.setAdapter(new ArtistAdapter(SelectArtistActivity.this, artists)); - - // Display selected music folder - if (musicFolders != null) { - String musicFolderId = Util.getSelectedMusicFolderId(SelectArtistActivity.this); - if (musicFolderId == null) { - folderName.setText(R.string.select_artist_all_folders); - } else { - for (MusicFolder musicFolder : musicFolders) { - if (musicFolder.getId().equals(musicFolderId)) { - folderName.setText(musicFolder.getName()); - break; - } - } - } - } - } - }; - task.execute(); - } - - @Override - public void onItemClick(AdapterView parent, View view, int position, long id) { - if (view == folderButton) { - selectFolder(); - } else { - Artist artist = (Artist) parent.getItemAtPosition(position); - Intent intent = new Intent(this, SelectAlbumActivity.class); - intent.putExtra(Constants.INTENT_EXTRA_NAME_ID, artist.getId()); - intent.putExtra(Constants.INTENT_EXTRA_NAME_NAME, artist.getName()); - Util.startActivityWithoutTransition(this, intent); - } - } - - @Override - public void onCreateContextMenu(ContextMenu menu, View view, ContextMenu.ContextMenuInfo menuInfo) { - super.onCreateContextMenu(menu, view, menuInfo); - - AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo; - - if (artistList.getItemAtPosition(info.position) instanceof Artist) { - MenuInflater inflater = getMenuInflater(); - inflater.inflate(R.menu.select_artist_context, menu); - } else if (info.position == 0) { - String musicFolderId = Util.getSelectedMusicFolderId(this); - MenuItem menuItem = menu.add(MENU_GROUP_MUSIC_FOLDER, -1, 0, R.string.select_artist_all_folders); - if (musicFolderId == null) { - menuItem.setChecked(true); - } - if (musicFolders != null) { - for (int i = 0; i < musicFolders.size(); i++) { - MusicFolder musicFolder = musicFolders.get(i); - menuItem = menu.add(MENU_GROUP_MUSIC_FOLDER, i, i + 1, musicFolder.getName()); - if (musicFolder.getId().equals(musicFolderId)) { - menuItem.setChecked(true); - } - } - } - - menu.setGroupCheckable(MENU_GROUP_MUSIC_FOLDER, true, true); - } - } - - @Override - public boolean onContextItemSelected(MenuItem menuItem) { - AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuItem.getMenuInfo(); - - Artist artist = (Artist) artistList.getItemAtPosition(info.position); - - if (artist != null) { - switch (menuItem.getItemId()) { - case R.id.artist_menu_play_now: - downloadRecursively(artist.getId(), false, false, true); - break; - case R.id.artist_menu_play_last: - downloadRecursively(artist.getId(), false, true, false); - break; - case R.id.artist_menu_pin: - downloadRecursively(artist.getId(), true, true, false); - break; - default: - return super.onContextItemSelected(menuItem); - } - } else if (info.position == 0) { - MusicFolder selectedFolder = menuItem.getItemId() == -1 ? null : musicFolders.get(menuItem.getItemId()); - String musicFolderId = selectedFolder == null ? null : selectedFolder.getId(); - String musicFolderName = selectedFolder == null ? getString(R.string.select_artist_all_folders) - : selectedFolder.getName(); - Util.setSelectedMusicFolderId(this, musicFolderId); - folderName.setText(musicFolderName); - refresh(); - } - - return true; - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - - case R.id.menu_refresh: - refresh(); - return true; - - case R.id.main_shuffle: - Intent intent = new Intent(this, DownloadActivity.class); - intent.putExtra(Constants.INTENT_EXTRA_NAME_SHUFFLE, true); - Util.startActivityWithoutTransition(this, intent); - return true; - - case R.id.menu_exit: - Intent intent1 = new Intent(this, MainActivity.class); - intent1.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); - intent1.putExtra(Constants.INTENT_EXTRA_NAME_EXIT, true); - Util.startActivityWithoutTransition(this, intent1); - return true; - - case R.id.menu_settings: - startActivity(new Intent(this, SettingsActivity.class)); - return true; - - case R.id.menu_help: - startActivity(new Intent(this, HelpActivity.class)); - return true; - } - - return false; - } +/* + This file is part of Subsonic. + + Subsonic is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Subsonic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Subsonic. If not, see . + + Copyright 2009 (C) Sindre Mehus + */ + +package net.sourceforge.subsonic.androidapp.activity; + +import android.content.Intent; +import android.os.Bundle; +import android.view.ContextMenu; +import android.view.LayoutInflater; +import android.view.Menu; +import android.view.MenuInflater; +import android.view.MenuItem; +import android.view.View; +import android.widget.AdapterView; +import android.widget.ListView; +import android.widget.TextView; +import net.sourceforge.subsonic.androidapp.R; +import net.sourceforge.subsonic.androidapp.domain.Artist; +import net.sourceforge.subsonic.androidapp.domain.Indexes; +import net.sourceforge.subsonic.androidapp.domain.MusicFolder; +import net.sourceforge.subsonic.androidapp.service.MusicService; +import net.sourceforge.subsonic.androidapp.service.MusicServiceFactory; +import net.sourceforge.subsonic.androidapp.util.ArtistAdapter; +import net.sourceforge.subsonic.androidapp.util.BackgroundTask; +import net.sourceforge.subsonic.androidapp.util.Constants; +import net.sourceforge.subsonic.androidapp.util.TabActivityBackgroundTask; +import net.sourceforge.subsonic.androidapp.util.Util; + +import java.util.ArrayList; +import java.util.List; + +public class SelectArtistActivity extends SubsonicTabActivity implements AdapterView.OnItemClickListener { + + private static final int MENU_GROUP_MUSIC_FOLDER = 10; + + private ListView artistList; + private View folderButton; + private TextView folderName; + private List musicFolders; + + /** + * Called when the activity is first created. + */ + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.select_artist); + + artistList = (ListView) findViewById(R.id.select_artist_list); + artistList.setOnItemClickListener(this); + artistList.setOnTouchListener(gestureListener); + + folderButton = LayoutInflater.from(this).inflate(R.layout.select_artist_header, artistList, false); + folderName = (TextView) folderButton.findViewById(R.id.select_artist_folder_2); + + if (!Util.isOffline(this)) { + artistList.addHeaderView(folderButton); + } + + registerForContextMenu(artistList); + + setTitle(Util.isOffline(this) ? R.string.music_library_label_offline : R.string.music_library_label); + + musicFolders = null; + load(); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + MenuInflater inflater = getMenuInflater(); + inflater.inflate(R.menu.main, menu); + inflater.inflate(R.menu.select_common, menu); + super.onCreateOptionsMenu(menu); + + return true; + } + + private void refresh() { + finish(); + Intent intent = getIntent(); + intent.putExtra(Constants.INTENT_EXTRA_NAME_REFRESH, true); + Util.startActivityWithoutTransition(this, intent); + } + + private void selectFolder() { + folderButton.showContextMenu(); + } + + private void load() { + BackgroundTask task = new TabActivityBackgroundTask(this) { + @Override + protected Indexes doInBackground() throws Throwable { + boolean refresh = getIntent().getBooleanExtra(Constants.INTENT_EXTRA_NAME_REFRESH, false); + MusicService musicService = MusicServiceFactory.getMusicService(SelectArtistActivity.this); + if (!Util.isOffline(SelectArtistActivity.this)) { + musicFolders = musicService.getMusicFolders(SelectArtistActivity.this, this); + } + String musicFolderId = Util.getSelectedMusicFolderId(SelectArtistActivity.this); + return musicService.getIndexes(musicFolderId, refresh, SelectArtistActivity.this, this); + } + + @Override + protected void done(Indexes result) { + if (result != null) { + List artists = new ArrayList(result.getShortcuts().size() + result.getArtists().size()); + artists.addAll(result.getShortcuts()); + artists.addAll(result.getArtists()); + artistList.setAdapter(new ArtistAdapter(SelectArtistActivity.this, artists)); + } + + // Display selected music folder + if (musicFolders != null) { + String musicFolderId = Util.getSelectedMusicFolderId(SelectArtistActivity.this); + if (musicFolderId == null) { + folderName.setText(R.string.select_artist_all_folders); + } else { + for (MusicFolder musicFolder : musicFolders) { + if (musicFolder.getId().equals(musicFolderId)) { + folderName.setText(musicFolder.getName()); + break; + } + } + } + } + } + }; + task.execute(); + } + + @Override + public void onItemClick(AdapterView parent, View view, int position, long id) { + if (view == folderButton) { + selectFolder(); + } else { + Artist artist = (Artist) parent.getItemAtPosition(position); + Intent intent = new Intent(this, SelectAlbumActivity.class); + intent.putExtra(Constants.INTENT_EXTRA_NAME_ID, artist.getId()); + intent.putExtra(Constants.INTENT_EXTRA_NAME_NAME, artist.getName()); + Util.startActivityWithoutTransition(this, intent); + } + } + + @Override + public void onCreateContextMenu(ContextMenu menu, View view, ContextMenu.ContextMenuInfo menuInfo) { + super.onCreateContextMenu(menu, view, menuInfo); + + AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo; + + if (artistList.getItemAtPosition(info.position) instanceof Artist) { + MenuInflater inflater = getMenuInflater(); + inflater.inflate(R.menu.select_artist_context, menu); + } else if (info.position == 0) { + String musicFolderId = Util.getSelectedMusicFolderId(this); + MenuItem menuItem = menu.add(MENU_GROUP_MUSIC_FOLDER, -1, 0, R.string.select_artist_all_folders); + if (musicFolderId == null) { + menuItem.setChecked(true); + } + if (musicFolders != null) { + for (int i = 0; i < musicFolders.size(); i++) { + MusicFolder musicFolder = musicFolders.get(i); + menuItem = menu.add(MENU_GROUP_MUSIC_FOLDER, i, i + 1, musicFolder.getName()); + if (musicFolder.getId().equals(musicFolderId)) { + menuItem.setChecked(true); + } + } + } + + menu.setGroupCheckable(MENU_GROUP_MUSIC_FOLDER, true, true); + } + } + + @Override + public boolean onContextItemSelected(MenuItem menuItem) { + AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuItem.getMenuInfo(); + + Artist artist = (Artist) artistList.getItemAtPosition(info.position); + + if (artist != null) { + switch (menuItem.getItemId()) { + case R.id.artist_menu_play_now: + downloadRecursively(artist.getId(), false, false, true); + break; + case R.id.artist_menu_play_last: + downloadRecursively(artist.getId(), false, true, false); + break; + case R.id.artist_menu_pin: + downloadRecursively(artist.getId(), true, true, false); + break; + default: + return super.onContextItemSelected(menuItem); + } + } else if (info.position == 0) { + MusicFolder selectedFolder = menuItem.getItemId() == -1 ? null : musicFolders.get(menuItem.getItemId()); + String musicFolderId = selectedFolder == null ? null : selectedFolder.getId(); + String musicFolderName = selectedFolder == null ? getString(R.string.select_artist_all_folders) + : selectedFolder.getName(); + Util.setSelectedMusicFolderId(this, musicFolderId); + folderName.setText(musicFolderName); + refresh(); + } + + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + + case R.id.menu_refresh: + refresh(); + return true; + + case R.id.main_shuffle: + Intent intent = new Intent(this, DownloadActivity.class); + intent.putExtra(Constants.INTENT_EXTRA_NAME_SHUFFLE, true); + Util.startActivityWithoutTransition(this, intent); + return true; + + case R.id.menu_exit: + Intent intent1 = new Intent(this, MainActivity.class); + intent1.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + intent1.putExtra(Constants.INTENT_EXTRA_NAME_EXIT, true); + Util.startActivityWithoutTransition(this, intent1); + return true; + + case R.id.menu_settings: + startActivity(new Intent(this, SettingsActivity.class)); + return true; + + case R.id.menu_help: + startActivity(new Intent(this, HelpActivity.class)); + return true; + } + + return false; + } } \ No newline at end of file diff --git a/src/net/sourceforge/subsonic/androidapp/activity/SettingsActivity.java b/src/net/sourceforge/subsonic/androidapp/activity/SettingsActivity.java index 10b0a16c..3c8852a5 100644 --- a/src/net/sourceforge/subsonic/androidapp/activity/SettingsActivity.java +++ b/src/net/sourceforge/subsonic/androidapp/activity/SettingsActivity.java @@ -1,323 +1,334 @@ -/* - This file is part of Subsonic. - - Subsonic is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Subsonic is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Subsonic. If not, see . - - Copyright 2009 (C) Sindre Mehus - */ -package net.sourceforge.subsonic.androidapp.activity; - -import android.content.SharedPreferences; -import android.os.Bundle; -import android.preference.EditTextPreference; -import android.preference.ListPreference; -import android.preference.Preference; -import android.preference.PreferenceActivity; -import android.preference.PreferenceScreen; -import android.provider.SearchRecentSuggestions; -import android.util.Log; -import net.sourceforge.subsonic.androidapp.R; -import net.sourceforge.subsonic.androidapp.provider.SearchSuggestionProvider; -import net.sourceforge.subsonic.androidapp.service.DownloadService; -import net.sourceforge.subsonic.androidapp.service.DownloadServiceImpl; -import net.sourceforge.subsonic.androidapp.service.MusicService; -import net.sourceforge.subsonic.androidapp.service.MusicServiceFactory; -import net.sourceforge.subsonic.androidapp.util.Constants; -import net.sourceforge.subsonic.androidapp.util.ErrorDialog; -import net.sourceforge.subsonic.androidapp.util.FileUtil; -import net.sourceforge.subsonic.androidapp.util.ModalBackgroundTask; -import net.sourceforge.subsonic.androidapp.util.Util; - -import java.io.File; -import java.net.URL; -import java.util.LinkedHashMap; -import java.util.Map; - -public class SettingsActivity extends PreferenceActivity implements SharedPreferences.OnSharedPreferenceChangeListener { - - private static final String TAG = SettingsActivity.class.getSimpleName(); - private final Map serverSettings = new LinkedHashMap(); - private boolean testingConnection; - private ListPreference theme; - private ListPreference maxBitrateWifi; - private ListPreference maxBitrateMobile; - private ListPreference cacheSize; - private EditTextPreference cacheLocation; - private ListPreference preloadCount; - private ListPreference bufferLength; - private ListPreference networkTimeout; - private ListPreference maxAlbums; - private ListPreference maxSongs; - private ListPreference maxArtists; - private ListPreference defaultAlbums; - private ListPreference defaultSongs; - private ListPreference defaultArtists; - - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - addPreferencesFromResource(R.xml.settings); - - theme = (ListPreference) findPreference(Constants.PREFERENCES_KEY_THEME); - maxBitrateWifi = (ListPreference) findPreference(Constants.PREFERENCES_KEY_MAX_BITRATE_WIFI); - maxBitrateMobile = (ListPreference) findPreference(Constants.PREFERENCES_KEY_MAX_BITRATE_MOBILE); - cacheSize = (ListPreference) findPreference(Constants.PREFERENCES_KEY_CACHE_SIZE); - cacheLocation = (EditTextPreference) findPreference(Constants.PREFERENCES_KEY_CACHE_LOCATION); - preloadCount = (ListPreference) findPreference(Constants.PREFERENCES_KEY_PRELOAD_COUNT); - bufferLength = (ListPreference) findPreference(Constants.PREFERENCES_KEY_BUFFER_LENGTH); - networkTimeout = (ListPreference) findPreference(Constants.PREFERENCES_KEY_NETWORK_TIMEOUT); - maxAlbums = (ListPreference) findPreference(Constants.PREFERENCES_KEY_MAX_ALBUMS); - maxSongs = (ListPreference) findPreference(Constants.PREFERENCES_KEY_MAX_SONGS); - maxArtists = (ListPreference) findPreference(Constants.PREFERENCES_KEY_MAX_ARTISTS); - defaultArtists = (ListPreference) findPreference(Constants.PREFERENCES_KEY_DEFAULT_ARTISTS); - defaultSongs = (ListPreference) findPreference(Constants.PREFERENCES_KEY_DEFAULT_SONGS); - defaultAlbums = (ListPreference) findPreference(Constants.PREFERENCES_KEY_DEFAULT_ALBUMS); - - findPreference("testConnection1").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { - @Override - public boolean onPreferenceClick(Preference preference) { - testConnection(1); - return false; - } - }); - - findPreference("testConnection2").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { - @Override - public boolean onPreferenceClick(Preference preference) { - testConnection(2); - return false; - } - }); - - findPreference("testConnection3").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { - @Override - public boolean onPreferenceClick(Preference preference) { - testConnection(3); - return false; - } - }); - - findPreference("clearSearchHistory").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { - @Override - public boolean onPreferenceClick(Preference preference) { - SearchRecentSuggestions suggestions = new SearchRecentSuggestions(SettingsActivity.this, SearchSuggestionProvider.AUTHORITY, SearchSuggestionProvider.MODE); - suggestions.clearHistory(); - Util.toast(SettingsActivity.this, R.string.settings_search_history_cleared); - return false; - } - }); - - for (int i = 1; i <= 3; i++) { - String instance = String.valueOf(i); - serverSettings.put(instance, new ServerSettings(instance)); - } - - SharedPreferences prefs = Util.getPreferences(this); - prefs.registerOnSharedPreferenceChangeListener(this); - - update(); - } - - @Override - protected void onDestroy() { - super.onDestroy(); - - SharedPreferences prefs = Util.getPreferences(this); - prefs.unregisterOnSharedPreferenceChangeListener(this); - } - - @Override - public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { - Log.d(TAG, "Preference changed: " + key); - update(); - - if (Constants.PREFERENCES_KEY_HIDE_MEDIA.equals(key)) { - setHideMedia(sharedPreferences.getBoolean(key, false)); - } - else if (Constants.PREFERENCES_KEY_MEDIA_BUTTONS.equals(key)) { - setMediaButtonsEnabled(sharedPreferences.getBoolean(key, true)); - } - else if (Constants.PREFERENCES_KEY_CACHE_LOCATION.equals(key)) { - setCacheLocation(sharedPreferences.getString(key, "")); - } - } - - private void update() { - if (testingConnection) { - return; - } - - theme.setSummary(theme.getEntry()); - maxBitrateWifi.setSummary(maxBitrateWifi.getEntry()); - maxBitrateMobile.setSummary(maxBitrateMobile.getEntry()); - cacheSize.setSummary(cacheSize.getEntry()); - cacheLocation.setSummary(cacheLocation.getText()); - preloadCount.setSummary(preloadCount.getEntry()); - bufferLength.setSummary(bufferLength.getEntry()); - networkTimeout.setSummary(networkTimeout.getEntry()); - maxAlbums.setSummary(maxAlbums.getEntry()); - maxArtists.setSummary(maxArtists.getEntry()); - maxSongs.setSummary(maxSongs.getEntry()); - defaultAlbums.setSummary(defaultAlbums.getEntry()); - defaultArtists.setSummary(defaultArtists.getEntry()); - defaultSongs.setSummary(defaultSongs.getEntry()); - - for (ServerSettings ss : serverSettings.values()) { - ss.update(); - } - } - - private void setHideMedia(boolean hide) { - File nomediaDir = new File(FileUtil.getSubsonicDirectory(), ".nomedia"); - if (hide && !nomediaDir.exists()) { - if (!nomediaDir.mkdir()) { - Log.w(TAG, "Failed to create " + nomediaDir); - } - } else if (nomediaDir.exists()) { - if (!nomediaDir.delete()) { - Log.w(TAG, "Failed to delete " + nomediaDir); - } - } - Util.toast(this, R.string.settings_hide_media_toast, false); - } - - private void setMediaButtonsEnabled(boolean enabled) { - if (enabled) { - Util.registerMediaButtonEventReceiver(this); - } else { - Util.unregisterMediaButtonEventReceiver(this); - } - } - - private void setCacheLocation(String path) { - File dir = new File(path); - if (!FileUtil.ensureDirectoryExistsAndIsReadWritable(dir)) { - Util.toast(this, R.string.settings_cache_location_error, false); - - // Reset it to the default. - String defaultPath = FileUtil.getDefaultMusicDirectory().getPath(); - if (!defaultPath.equals(path)) { - SharedPreferences prefs = Util.getPreferences(this); - SharedPreferences.Editor editor = prefs.edit(); - editor.putString(Constants.PREFERENCES_KEY_CACHE_LOCATION, defaultPath); - editor.commit(); - cacheLocation.setSummary(defaultPath); - cacheLocation.setText(defaultPath); - } - - // Clear download queue. - DownloadService downloadService = DownloadServiceImpl.getInstance(); - downloadService.clear(); - } - } - - private void testConnection(final int instance) { - ModalBackgroundTask task = new ModalBackgroundTask(this, false) { - private int previousInstance; - - @Override - protected Boolean doInBackground() throws Throwable { - updateProgress(R.string.settings_testing_connection); - - previousInstance = Util.getActiveServer(SettingsActivity.this); - testingConnection = true; - Util.setActiveServer(SettingsActivity.this, instance); - try { - MusicService musicService = MusicServiceFactory.getMusicService(SettingsActivity.this); - musicService.ping(SettingsActivity.this, this); - return musicService.isLicenseValid(SettingsActivity.this, null); - } finally { - Util.setActiveServer(SettingsActivity.this, previousInstance); - testingConnection = false; - } - } - - @Override - protected void done(Boolean licenseValid) { - if (licenseValid) { - Util.toast(SettingsActivity.this, R.string.settings_testing_ok); - } else { - Util.toast(SettingsActivity.this, R.string.settings_testing_unlicensed); - } - } - - @Override - protected void cancel() { - super.cancel(); - Util.setActiveServer(SettingsActivity.this, previousInstance); - } - - @Override - protected void error(Throwable error) { - Log.w(TAG, error.toString(), error); - new ErrorDialog(SettingsActivity.this, getResources().getString(R.string.settings_connection_failure) + - " " + getErrorMessage(error), false); - } - }; - task.execute(); - } - - private class ServerSettings { - private EditTextPreference serverName; - private EditTextPreference serverUrl; - private EditTextPreference username; - private PreferenceScreen screen; - - private ServerSettings(String instance) { - - screen = (PreferenceScreen) findPreference("server" + instance); - serverName = (EditTextPreference) findPreference(Constants.PREFERENCES_KEY_SERVER_NAME + instance); - serverUrl = (EditTextPreference) findPreference(Constants.PREFERENCES_KEY_SERVER_URL + instance); - username = (EditTextPreference) findPreference(Constants.PREFERENCES_KEY_USERNAME + instance); - - serverUrl.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { - @Override - public boolean onPreferenceChange(Preference preference, Object value) { - try { - String url = (String) value; - new URL(url); - if (!url.equals(url.trim()) || url.contains("@")) { - throw new Exception(); - } - } catch (Exception x) { - new ErrorDialog(SettingsActivity.this, R.string.settings_invalid_url, false); - return false; - } - return true; - } - }); - - username.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { - @Override - public boolean onPreferenceChange(Preference preference, Object value) { - String username = (String) value; - if (username == null || !username.equals(username.trim())) { - new ErrorDialog(SettingsActivity.this, R.string.settings_invalid_username, false); - return false; - } - return true; - } - }); - } - - public void update() { - serverName.setSummary(serverName.getText()); - serverUrl.setSummary(serverUrl.getText()); - username.setSummary(username.getText()); - screen.setSummary(serverUrl.getText()); - screen.setTitle(serverName.getText()); - } - } +/* + This file is part of Subsonic. + + Subsonic is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Subsonic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Subsonic. If not, see . + + Copyright 2009 (C) Sindre Mehus + */ +package net.sourceforge.subsonic.androidapp.activity; + +import android.content.SharedPreferences; +import android.os.Bundle; +import android.preference.CheckBoxPreference; +import android.preference.EditTextPreference; +import android.preference.ListPreference; +import android.preference.Preference; +import android.preference.PreferenceActivity; +import android.preference.PreferenceScreen; +import android.provider.SearchRecentSuggestions; +import android.util.Log; +import net.sourceforge.subsonic.androidapp.R; +import net.sourceforge.subsonic.androidapp.provider.SearchSuggestionProvider; +import net.sourceforge.subsonic.androidapp.service.DownloadService; +import net.sourceforge.subsonic.androidapp.service.DownloadServiceImpl; +import net.sourceforge.subsonic.androidapp.service.MusicService; +import net.sourceforge.subsonic.androidapp.service.MusicServiceFactory; +import net.sourceforge.subsonic.androidapp.util.Constants; +import net.sourceforge.subsonic.androidapp.util.ErrorDialog; +import net.sourceforge.subsonic.androidapp.util.FileUtil; +import net.sourceforge.subsonic.androidapp.util.ModalBackgroundTask; +import net.sourceforge.subsonic.androidapp.util.Util; + +import java.io.File; +import java.net.URL; +import java.util.LinkedHashMap; +import java.util.Map; + +public class SettingsActivity extends PreferenceActivity implements SharedPreferences.OnSharedPreferenceChangeListener { + + private static final String TAG = SettingsActivity.class.getSimpleName(); + private final Map serverSettings = new LinkedHashMap(); + private boolean testingConnection; + private ListPreference theme; + private ListPreference maxBitrateWifi; + private ListPreference maxBitrateMobile; + private ListPreference cacheSize; + private EditTextPreference cacheLocation; + private ListPreference preloadCount; + private ListPreference bufferLength; + private ListPreference networkTimeout; + private ListPreference maxAlbums; + private ListPreference maxSongs; + private ListPreference maxArtists; + private ListPreference defaultAlbums; + private ListPreference defaultSongs; + private ListPreference defaultArtists; + private CheckBoxPreference mediaButtonsEnabled; + private CheckBoxPreference lockScreenEnabled; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + addPreferencesFromResource(R.xml.settings); + + theme = (ListPreference) findPreference(Constants.PREFERENCES_KEY_THEME); + maxBitrateWifi = (ListPreference) findPreference(Constants.PREFERENCES_KEY_MAX_BITRATE_WIFI); + maxBitrateMobile = (ListPreference) findPreference(Constants.PREFERENCES_KEY_MAX_BITRATE_MOBILE); + cacheSize = (ListPreference) findPreference(Constants.PREFERENCES_KEY_CACHE_SIZE); + cacheLocation = (EditTextPreference) findPreference(Constants.PREFERENCES_KEY_CACHE_LOCATION); + preloadCount = (ListPreference) findPreference(Constants.PREFERENCES_KEY_PRELOAD_COUNT); + bufferLength = (ListPreference) findPreference(Constants.PREFERENCES_KEY_BUFFER_LENGTH); + networkTimeout = (ListPreference) findPreference(Constants.PREFERENCES_KEY_NETWORK_TIMEOUT); + maxAlbums = (ListPreference) findPreference(Constants.PREFERENCES_KEY_MAX_ALBUMS); + maxSongs = (ListPreference) findPreference(Constants.PREFERENCES_KEY_MAX_SONGS); + maxArtists = (ListPreference) findPreference(Constants.PREFERENCES_KEY_MAX_ARTISTS); + defaultArtists = (ListPreference) findPreference(Constants.PREFERENCES_KEY_DEFAULT_ARTISTS); + defaultSongs = (ListPreference) findPreference(Constants.PREFERENCES_KEY_DEFAULT_SONGS); + defaultAlbums = (ListPreference) findPreference(Constants.PREFERENCES_KEY_DEFAULT_ALBUMS); + mediaButtonsEnabled = (CheckBoxPreference) findPreference(Constants.PREFERENCES_KEY_MEDIA_BUTTONS); + lockScreenEnabled = (CheckBoxPreference) findPreference(Constants.PREFERENCES_KEY_SHOW_LOCK_SCREEN_CONTROLS); + + findPreference("testConnection1").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { + @Override + public boolean onPreferenceClick(Preference preference) { + testConnection(1); + return false; + } + }); + + findPreference("testConnection2").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { + @Override + public boolean onPreferenceClick(Preference preference) { + testConnection(2); + return false; + } + }); + + findPreference("testConnection3").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { + @Override + public boolean onPreferenceClick(Preference preference) { + testConnection(3); + return false; + } + }); + + findPreference("clearSearchHistory").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { + @Override + public boolean onPreferenceClick(Preference preference) { + SearchRecentSuggestions suggestions = new SearchRecentSuggestions(SettingsActivity.this, SearchSuggestionProvider.AUTHORITY, SearchSuggestionProvider.MODE); + suggestions.clearHistory(); + Util.toast(SettingsActivity.this, R.string.settings_search_history_cleared); + return false; + } + }); + + for (int i = 1; i <= 3; i++) { + String instance = String.valueOf(i); + serverSettings.put(instance, new ServerSettings(instance)); + } + + SharedPreferences prefs = Util.getPreferences(this); + prefs.registerOnSharedPreferenceChangeListener(this); + + update(); + } + + @Override + protected void onDestroy() { + super.onDestroy(); + + SharedPreferences prefs = Util.getPreferences(this); + prefs.unregisterOnSharedPreferenceChangeListener(this); + } + + @Override + public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { + Log.d(TAG, "Preference changed: " + key); + update(); + + if (Constants.PREFERENCES_KEY_HIDE_MEDIA.equals(key)) { + setHideMedia(sharedPreferences.getBoolean(key, false)); + } + else if (Constants.PREFERENCES_KEY_MEDIA_BUTTONS.equals(key)) { + setMediaButtonsEnabled(sharedPreferences.getBoolean(key, true)); + } + else if (Constants.PREFERENCES_KEY_CACHE_LOCATION.equals(key)) { + setCacheLocation(sharedPreferences.getString(key, "")); + } + } + + private void update() { + if (testingConnection) { + return; + } + + theme.setSummary(theme.getEntry()); + maxBitrateWifi.setSummary(maxBitrateWifi.getEntry()); + maxBitrateMobile.setSummary(maxBitrateMobile.getEntry()); + cacheSize.setSummary(cacheSize.getEntry()); + cacheLocation.setSummary(cacheLocation.getText()); + preloadCount.setSummary(preloadCount.getEntry()); + bufferLength.setSummary(bufferLength.getEntry()); + networkTimeout.setSummary(networkTimeout.getEntry()); + maxAlbums.setSummary(maxAlbums.getEntry()); + maxArtists.setSummary(maxArtists.getEntry()); + maxSongs.setSummary(maxSongs.getEntry()); + defaultAlbums.setSummary(defaultAlbums.getEntry()); + defaultArtists.setSummary(defaultArtists.getEntry()); + defaultSongs.setSummary(defaultSongs.getEntry()); + + if (!mediaButtonsEnabled.isChecked()) { + lockScreenEnabled.setChecked(false); + lockScreenEnabled.setEnabled(false); + } + + for (ServerSettings ss : serverSettings.values()) { + ss.update(); + } + } + + private void setHideMedia(boolean hide) { + File nomediaDir = new File(FileUtil.getSubsonicDirectory(), ".nomedia"); + if (hide && !nomediaDir.exists()) { + if (!nomediaDir.mkdir()) { + Log.w(TAG, "Failed to create " + nomediaDir); + } + } else if (nomediaDir.exists()) { + if (!nomediaDir.delete()) { + Log.w(TAG, "Failed to delete " + nomediaDir); + } + } + Util.toast(this, R.string.settings_hide_media_toast, false); + } + + private void setMediaButtonsEnabled(boolean enabled) { + if (enabled) { + lockScreenEnabled.setEnabled(true); + Util.registerMediaButtonEventReceiver(this); + } else { + lockScreenEnabled.setEnabled(false); + Util.unregisterMediaButtonEventReceiver(this); + } + } + + private void setCacheLocation(String path) { + File dir = new File(path); + if (!FileUtil.ensureDirectoryExistsAndIsReadWritable(dir)) { + Util.toast(this, R.string.settings_cache_location_error, false); + + // Reset it to the default. + String defaultPath = FileUtil.getDefaultMusicDirectory().getPath(); + if (!defaultPath.equals(path)) { + SharedPreferences prefs = Util.getPreferences(this); + SharedPreferences.Editor editor = prefs.edit(); + editor.putString(Constants.PREFERENCES_KEY_CACHE_LOCATION, defaultPath); + editor.commit(); + cacheLocation.setSummary(defaultPath); + cacheLocation.setText(defaultPath); + } + + // Clear download queue. + DownloadService downloadService = DownloadServiceImpl.getInstance(); + downloadService.clear(); + } + } + + private void testConnection(final int instance) { + ModalBackgroundTask task = new ModalBackgroundTask(this, false) { + private int previousInstance; + + @Override + protected Boolean doInBackground() throws Throwable { + updateProgress(R.string.settings_testing_connection); + + previousInstance = Util.getActiveServer(SettingsActivity.this); + testingConnection = true; + Util.setActiveServer(SettingsActivity.this, instance); + try { + MusicService musicService = MusicServiceFactory.getMusicService(SettingsActivity.this); + musicService.ping(SettingsActivity.this, this); + return musicService.isLicenseValid(SettingsActivity.this, null); + } finally { + Util.setActiveServer(SettingsActivity.this, previousInstance); + testingConnection = false; + } + } + + @Override + protected void done(Boolean licenseValid) { + if (licenseValid) { + Util.toast(SettingsActivity.this, R.string.settings_testing_ok); + } else { + Util.toast(SettingsActivity.this, R.string.settings_testing_unlicensed); + } + } + + @Override + protected void cancel() { + super.cancel(); + Util.setActiveServer(SettingsActivity.this, previousInstance); + } + + @Override + protected void error(Throwable error) { + Log.w(TAG, error.toString(), error); + new ErrorDialog(SettingsActivity.this, getResources().getString(R.string.settings_connection_failure) + + " " + getErrorMessage(error), false); + } + }; + task.execute(); + } + + private class ServerSettings { + private EditTextPreference serverName; + private EditTextPreference serverUrl; + private EditTextPreference username; + private PreferenceScreen screen; + + private ServerSettings(String instance) { + + screen = (PreferenceScreen) findPreference("server" + instance); + serverName = (EditTextPreference) findPreference(Constants.PREFERENCES_KEY_SERVER_NAME + instance); + serverUrl = (EditTextPreference) findPreference(Constants.PREFERENCES_KEY_SERVER_URL + instance); + username = (EditTextPreference) findPreference(Constants.PREFERENCES_KEY_USERNAME + instance); + + serverUrl.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { + @Override + public boolean onPreferenceChange(Preference preference, Object value) { + try { + String url = (String) value; + new URL(url); + if (!url.equals(url.trim()) || url.contains("@")) { + throw new Exception(); + } + } catch (Exception x) { + new ErrorDialog(SettingsActivity.this, R.string.settings_invalid_url, false); + return false; + } + return true; + } + }); + + username.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { + @Override + public boolean onPreferenceChange(Preference preference, Object value) { + String username = (String) value; + if (username == null || !username.equals(username.trim())) { + new ErrorDialog(SettingsActivity.this, R.string.settings_invalid_username, false); + return false; + } + return true; + } + }); + } + + public void update() { + serverName.setSummary(serverName.getText()); + serverUrl.setSummary(serverUrl.getText()); + username.setSummary(username.getText()); + screen.setSummary(serverUrl.getText()); + screen.setTitle(serverName.getText()); + } + } } \ No newline at end of file diff --git a/src/net/sourceforge/subsonic/androidapp/service/DownloadServiceImpl.java b/src/net/sourceforge/subsonic/androidapp/service/DownloadServiceImpl.java index a7b7810f..c54df363 100644 --- a/src/net/sourceforge/subsonic/androidapp/service/DownloadServiceImpl.java +++ b/src/net/sourceforge/subsonic/androidapp/service/DownloadServiceImpl.java @@ -754,7 +754,6 @@ public class DownloadServiceImpl extends Service implements DownloadService { audioManager.requestAudioFocus(_afChangeListener, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN); if (remoteControlClientCompat == null) { - audioManager = (AudioManager) this.getSystemService(Context.AUDIO_SERVICE); Intent intent = new Intent(Intent.ACTION_MEDIA_BUTTON); intent.setComponent(new ComponentName(this.getPackageName(), MediaButtonIntentReceiver.class.getName())); remoteControlClientCompat = new RemoteControlClientCompat(PendingIntent.getBroadcast(this, 0, intent, 0)); @@ -788,14 +787,14 @@ public class DownloadServiceImpl extends Service implements DownloadService { if (currentSong != currentPlaying.getSong()) { currentSong = currentPlaying.getSong(); - String album = currentPlaying.getSong().getAlbum(); - String title = currentPlaying.getSong().getArtist() + " - " + currentPlaying.getSong().getTitle(); - Integer duration = currentPlaying.getSong().getDuration(); + String album = currentSong.getAlbum(); + String title = currentSong.getArtist() + " - " + currentSong.getTitle(); + Integer duration = currentSong.getDuration(); MusicService musicService = MusicServiceFactory.getMusicService(this); DisplayMetrics metrics = this.getResources().getDisplayMetrics(); int size = Math.min(metrics.widthPixels, metrics.heightPixels); - Bitmap bitmap = musicService.getCoverArt(this, currentPlaying.getSong(), size, true, null); + Bitmap bitmap = musicService.getCoverArt(this, currentSong, size, true, null); // Update the remote controls remoteControlClientCompat @@ -821,7 +820,7 @@ public class DownloadServiceImpl extends Service implements DownloadService { bufferTask.start(); } - private synchronized void doPlay(final DownloadFile downloadFile, int position, boolean start) { + private synchronized void doPlay(final DownloadFile downloadFile, final int position, final boolean start) { try { final File file = downloadFile.isCompleteFileAvailable() ? downloadFile.getCompleteFile() : downloadFile.getPartialFile(); downloadFile.updateModificationDate(); @@ -834,7 +833,9 @@ public class DownloadServiceImpl extends Service implements DownloadService { @Override public void onBufferingUpdate(MediaPlayer mp, int percent) { SeekBar progressBar = DownloadActivity.getProgressBar(); - if (progressBar != null) { + MusicDirectory.Entry song = downloadFile.getSong(); + + if (progressBar != null && song.getTranscodedContentType() == null && Util.getMaxBitrate(getApplicationContext()) == 0) { int secondaryProgress = (int) (((double)percent / (double)100) * progressBar.getMax()); DownloadActivity.getProgressBar().setSecondaryProgress(secondaryProgress); } @@ -846,17 +847,40 @@ public class DownloadServiceImpl extends Service implements DownloadService { String url = file.getPath(); String playUrl = url; - if (proxy == null) { - proxy = new StreamProxy(this); - proxy.start(); + if (Util.isStreamProxyEnabled(this)) { + if (proxy == null) { + proxy = new StreamProxy(); + proxy.start(); + } + + proxy.setDownloadFile(downloadFile); + playUrl = String.format("http://127.0.0.1:%d/%s", proxy.getPort(), url); } - playUrl = String.format("http://127.0.0.1:%d/%s", proxy.getPort(), url); - mediaPlayer.setDataSource(playUrl); setPlayerState(PREPARING); - mediaPlayer.prepare(); - setPlayerState(PREPARED); + mediaPlayer.prepareAsync(); + + mediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { + @Override + public void onPrepared(MediaPlayer mp) { + setPlayerState(PREPARED); + + if (position != 0) { + Log.i(TAG, "Restarting player from position " + position); + mp.seekTo(position); + } + + if (start) { + mp.start(); + setPlayerState(STARTED); + } else { + setPlayerState(PAUSED); + } + + lifecycleSupport.serializeDownloadQueue(); + } + }); mediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { @Override @@ -883,6 +907,7 @@ public class DownloadServiceImpl extends Service implements DownloadService { // Work-around for apparent bug on certain phones: If close (less than ten seconds) to the end // of the song, skip to the next rather than restarting it. Integer duration = downloadFile.getSong().getDuration() == null ? null : downloadFile.getSong().getDuration() * 1000; + if (duration != null) { if (Math.abs(duration - pos) < 10000) { Log.i(TAG, "Skipping restart from " + pos + " of " + duration); @@ -898,20 +923,6 @@ public class DownloadServiceImpl extends Service implements DownloadService { } } }); - - if (position != 0) { - Log.i(TAG, "Restarting player from position " + position); - mediaPlayer.seekTo(position); - } - - if (start) { - mediaPlayer.start(); - setPlayerState(STARTED); - } else { - setPlayerState(PAUSED); - } - lifecycleSupport.serializeDownloadQueue(); - } catch (Exception x) { handleError(x); } diff --git a/src/net/sourceforge/subsonic/androidapp/util/Constants.java b/src/net/sourceforge/subsonic/androidapp/util/Constants.java index e9c46521..60070101 100644 --- a/src/net/sourceforge/subsonic/androidapp/util/Constants.java +++ b/src/net/sourceforge/subsonic/androidapp/util/Constants.java @@ -85,6 +85,7 @@ public final class Constants { public static final String PREFERENCES_KEY_DEFAULT_ALBUMS = "defaultAlbums"; public static final String PREFERENCES_KEY_DEFAULT_SONGS = "defaultSongs"; public static final String PREFERENCES_KEY_DEFAULT_ARTISTS = "defaultArtists"; + public static final String PREFERENCES_KEY_USE_STREAM_PROXY = "useStreamProxy"; // Name of the preferences file. public static final String PREFERENCES_FILE_NAME = "net.sourceforge.subsonic.androidapp_preferences"; diff --git a/src/net/sourceforge/subsonic/androidapp/util/StreamProxy.java b/src/net/sourceforge/subsonic/androidapp/util/StreamProxy.java index 814898a2..c608bbeb 100644 --- a/src/net/sourceforge/subsonic/androidapp/util/StreamProxy.java +++ b/src/net/sourceforge/subsonic/androidapp/util/StreamProxy.java @@ -22,6 +22,7 @@ import org.apache.http.Header; import org.apache.http.HttpRequest; import org.apache.http.message.BasicHttpRequest; +import net.sourceforge.subsonic.androidapp.service.DownloadFile; import net.sourceforge.subsonic.androidapp.service.DownloadService; import android.os.AsyncTask; import android.os.Looper; @@ -34,21 +35,25 @@ public class StreamProxy implements Runnable { private boolean isRunning; private ServerSocket socket; private int port; - private DownloadService downloadService; + private DownloadFile downloadFile; - public StreamProxy(DownloadService downloadService) { + public StreamProxy() { // Create listening socket try { socket = new ServerSocket(0, 0, InetAddress.getByAddress(new byte[] { 127, 0, 0, 1 })); socket.setSoTimeout(5000); port = socket.getLocalPort(); - this.downloadService = downloadService; } catch (UnknownHostException e) { // impossible } catch (IOException e) { Log.e(TAG, "IOException initializing server", e); } } + + public void setDownloadFile(DownloadFile downloadFile) { + this.downloadFile = downloadFile; + } + public int getPort() { return port; @@ -73,38 +78,41 @@ public class StreamProxy implements Runnable { public void run() { Looper.prepare(); isRunning = true; + while (isRunning) { try { Socket client = socket.accept(); + if (client == null) { continue; } + Log.d(TAG, "client connected"); StreamToMediaPlayerTask task = new StreamToMediaPlayerTask(client); + if (task.processRequest()) { task.execute(); } - } catch (SocketTimeoutException e) { // Do nothing } catch (IOException e) { Log.e(TAG, "Error connecting to client", e); } } + Log.d(TAG, "Proxy interrupted. Shutting down."); } private class StreamToMediaPlayerTask extends AsyncTask { - - String localPath; + File thisFile; Socket client; int cbSkip; public StreamToMediaPlayerTask(Socket client) { this.client = client; } - + private HttpRequest readRequest() { HttpRequest request = null; InputStream is; @@ -135,107 +143,114 @@ public class StreamProxy implements Runnable { public boolean processRequest() { HttpRequest request = readRequest(); + if (request == null) { return false; } - - // Read HTTP headers + Log.d(TAG, "Processing request"); - try { - localPath = URLDecoder.decode(request.getRequestLine().getUri(), Constants.UTF_8); - } catch (UnsupportedEncodingException e) { - Log.e(TAG, "Unsupported encoding", e); + thisFile = downloadFile.isCompleteFileAvailable() ? downloadFile.getCompleteFile() : downloadFile.getPartialFile(); + + if (!thisFile.exists()) { + Log.e(TAG, "File " + thisFile.getPath() + " does not exist"); return false; } - - File file = new File(localPath); - if (!file.exists()) { - Log.e(TAG, "File " + localPath + " does not exist"); - return false; - } - + return true; } @Override - protected Integer doInBackground(String... params) { - long fileSize = downloadService.getCurrentPlaying().getSong().getSize(); + protected Integer doInBackground(String... params) { + long fileSize = downloadFile.isCompleteFileAvailable() ? downloadFile.getCompleteFile().length() : downloadFile.getSong().getSize(); - // Create HTTP header - String headers = "HTTP/1.0 200 OK\r\n"; - headers += "Content-Type: " + "application/octet-stream" + "\r\n"; - - if (fileSize > 0) { - headers += "Content-Length: " + fileSize + "\r\n"; - } - - headers += "Connection: close\r\n"; - headers += "\r\n"; + // Create HTTP header + String headers = "HTTP/1.1 200 OK\r\n"; - long cbToSend = fileSize - cbSkip; - OutputStream output = null; - byte[] buff = new byte[64 * 1024]; - try { - output = new BufferedOutputStream(client.getOutputStream(), 32*1024); - output.write(headers.getBytes()); + if (fileSize > 0) { + headers += "Content-Length: " + fileSize + "\r\n"; + } + + headers += "Accept-Ranges: bytes\r\n"; + headers += "Content-Type: " + "application/octet-stream" + "\r\n"; + headers += "Connection: close\r\n"; + headers += "\r\n"; - // Loop as long as there's stuff to send - while (isRunning && cbToSend>0 && !client.isClosed()) { + long cbToSend = fileSize - cbSkip; + long totalBytesSent = 0; + OutputStream output = null; + byte[] buff = new byte[64 * 1024]; + + try { + output = new BufferedOutputStream(client.getOutputStream(), 32 * 1024); + output.write(headers.getBytes()); + + // Loop as long as there's stuff to send + while (isRunning && cbToSend > 0 && !client.isClosed()) { + // See if there's more to send + int cbSentThisBatch = 0; - // See if there's more to send - File file = new File(localPath); - int cbSentThisBatch = 0; - if (file.exists()) { - FileInputStream input = new FileInputStream(file); - input.skip(cbSkip); - int cbToSendThisBatch = input.available(); - while (cbToSendThisBatch > 0) { - int cbToRead = Math.min(cbToSendThisBatch, buff.length); - int cbRead = input.read(buff, 0, cbToRead); - if (cbRead == -1) { - break; - } - cbToSendThisBatch -= cbRead; - cbToSend -= cbRead; - output.write(buff, 0, cbRead); - output.flush(); - cbSkip += cbRead; - cbSentThisBatch += cbRead; - } - input.close(); - } + FileInputStream input = new FileInputStream(thisFile); + input.skip(cbSkip); + int cbToSendThisBatch = input.available(); - // If we did nothing this batch, block for a second - if (cbSentThisBatch == 0) { - Log.d(TAG, "Blocking until more data appears"); - Thread.sleep(1000); - } - } - } - catch (SocketException socketException) { - Log.e(TAG, "SocketException() thrown, proxy client has probably closed. This can exit harmlessly"); - } - catch (Exception e) { - Log.e(TAG, "Exception thrown from streaming task:"); - Log.e(TAG, e.getClass().getName() + " : " + e.getLocalizedMessage()); - e.printStackTrace(); - } + while (cbToSendThisBatch > 0) { + int cbToRead = Math.min(cbToSendThisBatch, buff.length); + int cbRead = input.read(buff, 0, cbToRead); - // Cleanup - try { - if (output != null) { - output.close(); - } - client.close(); - } - catch (IOException e) { - Log.e(TAG, "IOException while cleaning up streaming task:"); - Log.e(TAG, e.getClass().getName() + " : " + e.getLocalizedMessage()); - e.printStackTrace(); - } + if (cbRead == -1) { + break; + } - return 1; - } + cbToSendThisBatch -= cbRead; + cbToSend -= cbRead; + + output.write(buff, 0, cbRead); + output.flush(); + + cbSkip += cbRead; + cbSentThisBatch += cbRead; + totalBytesSent += cbRead; + } + + input.close(); + + if (!downloadFile.isDownloading()) { + if (downloadFile.isCompleteFileAvailable()) { + if (downloadFile.getCompleteFile().length() == totalBytesSent) { + Log.d(TAG, "Track is no longer being downloaded, sent " + totalBytesSent + " / " + fileSize); + break; + } + } + } + + // If we did nothing this batch, block for a second + if (cbSentThisBatch == 0) { + Log.d(TAG, "Blocking until more data appears"); + Thread.sleep(500); + } + } + } catch (SocketException socketException) { + Log.e(TAG, "SocketException() thrown, proxy client has probably closed. This can exit harmlessly"); + } catch (Exception e) { + Log.e(TAG, "Exception thrown from streaming task:"); + Log.e(TAG, e.getClass().getName() + " : " + e.getLocalizedMessage()); + e.printStackTrace(); + } + + // Cleanup + try { + if (output != null) { + output.close(); + } + client.close(); + } catch (IOException e) { + Log.e(TAG, "IOException while cleaning up streaming task:"); + Log.e(TAG, e.getClass().getName() + " : " + e.getLocalizedMessage()); + e.printStackTrace(); + } + + return 1; + } } } \ No newline at end of file diff --git a/src/net/sourceforge/subsonic/androidapp/util/Util.java b/src/net/sourceforge/subsonic/androidapp/util/Util.java index b43b927f..ca7bed17 100644 --- a/src/net/sourceforge/subsonic/androidapp/util/Util.java +++ b/src/net/sourceforge/subsonic/androidapp/util/Util.java @@ -146,6 +146,11 @@ public class Util extends DownloadActivity { SharedPreferences prefs = getPreferences(context); return prefs.getBoolean(Constants.PREFERENCES_KEY_SHOW_LOCK_SCREEN_CONTROLS, false); } + + public static boolean isStreamProxyEnabled(Context context) { + SharedPreferences prefs = getPreferences(context); + return prefs.getBoolean(Constants.PREFERENCES_KEY_USE_STREAM_PROXY, false); + } public static void setActiveServer(Context context, int instance) { SharedPreferences prefs = getPreferences(context);