From 69ad5656f43f7bf476aaccd81c9632f0eb711f0b Mon Sep 17 00:00:00 2001 From: Joshua Bahnsen Date: Wed, 23 Jan 2013 23:08:20 -0700 Subject: [PATCH] Add starred song support, added further album lists --- .../sourceforge/subsonic/androidapp/R.java | 622 +++++++++--------- res/layout/main_buttons.xml | 36 +- res/values/strings.xml | 90 +-- .../androidapp/activity/DownloadActivity.java | 1 - .../androidapp/activity/MainActivity.java | 25 +- .../activity/SelectAlbumActivity.java | 21 +- .../service/CachedMusicService.java | 5 + .../androidapp/service/MusicService.java | 2 + .../service/OfflineMusicService.java | 5 + .../androidapp/service/RESTMusicService.java | 10 + .../subsonic/androidapp/util/Constants.java | 3 +- .../subsonic/androidapp/util/Util.java | 12 + 12 files changed, 469 insertions(+), 363 deletions(-) diff --git a/gen/net/sourceforge/subsonic/androidapp/R.java b/gen/net/sourceforge/subsonic/androidapp/R.java index 4ff303ed..6e3d184d 100644 --- a/gen/net/sourceforge/subsonic/androidapp/R.java +++ b/gen/net/sourceforge/subsonic/androidapp/R.java @@ -144,20 +144,20 @@ public final class R { public static final int unknown_album_large=0x7f020058; } public static final class id { - public static final int album=0x7f0d0049; + 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=0x7f0d0087; - public static final int album_menu_play_last=0x7f0d0086; - public static final int album_menu_play_now=0x7f0d0085; + 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=0x7f0d008a; - public static final int artist_menu_play_last=0x7f0d0089; - public static final int artist_menu_play_now=0x7f0d0088; + 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; @@ -167,7 +167,7 @@ public final class R { 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=0x7f0d004a; + 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; @@ -176,8 +176,8 @@ public final class R { 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=0x7f0d007b; - public static final int download_jukebox=0x7f0d007d; + 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; @@ -192,7 +192,7 @@ public final class R { 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=0x7f0d007c; + 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; @@ -204,7 +204,7 @@ public final class R { 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=0x7f0d0070; + 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; @@ -213,80 +213,84 @@ public final class R { 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=0x7f0d003e; - public static final int main_albums_frequent=0x7f0d0041; - public static final int main_albums_highest=0x7f0d0042; - public static final int main_albums_newest=0x7f0d003f; - public static final int main_albums_random=0x7f0d0044; - public static final int main_albums_recent=0x7f0d0040; - public static final int main_albums_starred=0x7f0d0043; + 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=0x7f0d007a; - public static final int menu_exit=0x7f0d0079; - public static final int menu_help=0x7f0d0078; - public static final int menu_lyrics=0x7f0d0082; - public static final int menu_refresh=0x7f0d008b; - public static final int menu_remove=0x7f0d0083; - public static final int menu_remove_all=0x7f0d007f; - public static final int menu_save_playlist=0x7f0d007e; - public static final int menu_screen_on_off=0x7f0d0080; - public static final int menu_settings=0x7f0d0077; - public static final int menu_show_album=0x7f0d0081; - public static final int menu_shuffle=0x7f0d0084; - public static final int notification_image=0x7f0d0046; - public static final int play_video_contents=0x7f0d004b; - public static final int progress_message=0x7f0d004c; - public static final int save_playlist_name=0x7f0d004e; - public static final int save_playlist_root=0x7f0d004d; - public static final int search_albums=0x7f0d0052; - public static final int search_artists=0x7f0d0051; - public static final int search_list=0x7f0d004f; - public static final int search_more_albums=0x7f0d0055; - public static final int search_more_artists=0x7f0d0054; - public static final int search_more_songs=0x7f0d0056; - public static final int search_search=0x7f0d0050; - public static final int search_songs=0x7f0d0053; - public static final int select_album_cover_art=0x7f0d0060; - public static final int select_album_delete=0x7f0d005e; - public static final int select_album_empty=0x7f0d0057; - public static final int select_album_entries=0x7f0d0058; - public static final int select_album_more=0x7f0d005f; - public static final int select_album_pin=0x7f0d005c; - public static final int select_album_play_all=0x7f0d0063; - public static final int select_album_play_last=0x7f0d005b; - public static final int select_album_play_now=0x7f0d005a; - public static final int select_album_select=0x7f0d0059; - public static final int select_album_text1=0x7f0d0061; - public static final int select_album_text2=0x7f0d0062; - public static final int select_album_unpin=0x7f0d005d; - public static final int select_artist_folder=0x7f0d0065; - public static final int select_artist_folder_1=0x7f0d0066; - public static final int select_artist_folder_2=0x7f0d0067; - public static final int select_artist_list=0x7f0d0064; - public static final int select_playlist_empty=0x7f0d0068; - public static final int select_playlist_list=0x7f0d0069; - public static final int song_artist=0x7f0d006d; - public static final int song_check=0x7f0d006a; - public static final int song_duration=0x7f0d006e; - public static final int song_menu_play_last=0x7f0d008e; - public static final int song_menu_play_next=0x7f0d008d; - public static final int song_menu_play_now=0x7f0d008c; - public static final int song_star=0x7f0d006f; - public static final int song_status=0x7f0d006c; - public static final int song_title=0x7f0d006b; - public static final int status_icon=0x7f0d0047; - public static final int status_media_collapse=0x7f0d0074; - public static final int status_media_next=0x7f0d0073; - public static final int status_media_play=0x7f0d0072; - public static final int status_media_prev=0x7f0d0071; - public static final int statusbar=0x7f0d0045; - public static final int tab_progress=0x7f0d0075; - public static final int tab_progress_message=0x7f0d0076; + 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=0x7f0d0048; + public static final int trackname=0x7f0d004c; } public static final class integer { public static final int config_activityDefaultDur=0x7f080001; @@ -343,12 +347,12 @@ public final class R { public static final int select_album_n_songs_downloading=0x7f0a0001; } public static final class string { - public static final int background_task_loading=0x7f0900e3; - public static final int background_task_network_error=0x7f0900e5; - public static final int background_task_no_network=0x7f0900e4; - public static final int background_task_not_found=0x7f0900e6; - public static final int background_task_parse_error=0x7f0900e7; - public static final int background_task_wait=0x7f0900e2; + public static final int background_task_loading=0x7f0900e7; + public static final int background_task_network_error=0x7f0900e9; + public static final int background_task_no_network=0x7f0900e8; + public static final int background_task_not_found=0x7f0900ea; + public static final int background_task_parse_error=0x7f0900eb; + public static final int background_task_wait=0x7f0900e6; 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; @@ -364,49 +368,51 @@ public final class R { 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=0x7f090044; - public static final int download_jukebox_not_authorized=0x7f090063; - public static final int download_jukebox_off=0x7f09005f; - public static final int download_jukebox_offline=0x7f090062; - public static final int download_jukebox_on=0x7f09005e; - public static final int download_jukebox_server_too_old=0x7f090061; - public static final int download_jukebox_volume=0x7f090060; - public static final int download_menu_equalizer=0x7f090050; - public static final int download_menu_jukebox=0x7f090052; - public static final int download_menu_lyrics=0x7f090049; - public static final int download_menu_remove=0x7f09004a; - public static final int download_menu_remove_all=0x7f09004b; - public static final int download_menu_save=0x7f09004f; - public static final int download_menu_screen_off=0x7f09004d; - public static final int download_menu_screen_on=0x7f09004c; - public static final int download_menu_show_album=0x7f090048; - public static final int download_menu_shuffle=0x7f09004e; - public static final int download_menu_shuffle_notification=0x7f090053; - public static final int download_menu_visualizer=0x7f090051; - public static final int download_playerstate_buffering=0x7f090046; - public static final int download_playerstate_downloading=0x7f090045; - public static final int download_playerstate_playing_shuffle=0x7f090047; - public static final int download_playlist_done=0x7f090057; - public static final int download_playlist_error=0x7f090058; - public static final int download_playlist_name=0x7f090055; - public static final int download_playlist_saving=0x7f090056; - public static final int download_playlist_title=0x7f090054; - public static final int download_repeat_all=0x7f09005a; - public static final int download_repeat_off=0x7f090059; - public static final int download_repeat_single=0x7f09005b; - public static final int download_visualizer_off=0x7f09005d; - public static final int download_visualizer_on=0x7f09005c; - public static final int equalizer_enabled=0x7f0900f4; - public static final int equalizer_label=0x7f0900f3; - public static final int equalizer_preset=0x7f0900f5; - public static final int error_label=0x7f090067; - public static final int help_back=0x7f090023; - public static final int help_close=0x7f090024; - public static final int help_label=0x7f090021; - public static final int help_loading=0x7f090026; - public static final int help_title=0x7f090022; - public static final int help_url=0x7f090025; - public static final int lyrics_nomatch=0x7f090066; + 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=0x7f0900f8; + public static final int equalizer_label=0x7f0900f7; + public static final int equalizer_preset=0x7f0900f9; + 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; @@ -418,198 +424,200 @@ public final class R { 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=0x7f09001c; - public static final int menu_help=0x7f09001e; - public static final int menu_search=0x7f09001f; - public static final int menu_settings=0x7f09001d; - public static final int music_library_label=0x7f090032; - public static final int music_library_label_offline=0x7f090033; + 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=0x7f0900e1; - public static final int parser_artist_count=0x7f0900ef; - public static final int parser_not_authenticated=0x7f0900ed; - public static final int parser_not_authorized=0x7f0900ee; - public static final int parser_reading=0x7f0900e9; - public static final int parser_reading_done=0x7f0900ea; - public static final int parser_upgrade_client=0x7f0900eb; - public static final int parser_upgrade_server=0x7f0900ec; - public static final int play_video_loading=0x7f090027; - public static final int play_video_noplugin=0x7f090028; + public static final int music_service_retry=0x7f0900e5; + public static final int parser_artist_count=0x7f0900f3; + public static final int parser_not_authenticated=0x7f0900f1; + public static final int parser_not_authorized=0x7f0900f2; + public static final int parser_reading=0x7f0900ed; + public static final int parser_reading_done=0x7f0900ee; + public static final int parser_upgrade_client=0x7f0900ef; + public static final int parser_upgrade_server=0x7f0900f0; + 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=0x7f090020; - public static final int progress_wait=0x7f090031; - public static final int search_albums=0x7f09002e; - public static final int search_artists=0x7f09002d; - public static final int search_label=0x7f090029; - public static final int search_more=0x7f090030; - public static final int search_no_match=0x7f09002c; - public static final int search_search=0x7f09002b; - public static final int search_songs=0x7f09002f; - public static final int search_title=0x7f09002a; - public static final int select_album_donate_dialog_0_trial_days_left=0x7f090042; - public static final int select_album_donate_dialog_later=0x7f090041; - public static final int select_album_donate_dialog_message=0x7f09003f; - public static final int select_album_donate_dialog_now=0x7f090040; - public static final int select_album_empty=0x7f090034; + 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=0x7f090038; - public static final int select_album_n_selected=0x7f090036; - public static final int select_album_n_unselected=0x7f090037; - public static final int select_album_no_network=0x7f09003d; - public static final int select_album_no_sdcard=0x7f09003c; - public static final int select_album_not_licensed=0x7f09003e; - public static final int select_album_offline=0x7f090039; - public static final int select_album_play_all=0x7f09003b; - public static final int select_album_searching=0x7f09003a; - public static final int select_album_select=0x7f090035; - public static final int select_artist_all_folders=0x7f0900f2; - public static final int select_artist_folder=0x7f0900f1; - public static final int select_artist_refresh=0x7f0900f0; - public static final int select_playlist_empty=0x7f090043; - public static final int service_connecting=0x7f0900e8; - public static final int settings_appearance_title=0x7f09007c; - public static final int settings_buffer_length=0x7f0900ae; - public static final int settings_buffer_length_10=0x7f0900b3; - public static final int settings_buffer_length_12=0x7f0900b4; - public static final int settings_buffer_length_15=0x7f0900b5; - public static final int settings_buffer_length_2=0x7f0900b0; - public static final int settings_buffer_length_20=0x7f0900b6; - public static final int settings_buffer_length_30=0x7f0900b7; - public static final int settings_buffer_length_5=0x7f0900b1; - public static final int settings_buffer_length_8=0x7f0900b2; - public static final int settings_cache_location=0x7f090074; - public static final int settings_cache_location_error=0x7f090075; - public static final int settings_cache_size=0x7f090073; - public static final int settings_cache_size_100=0x7f090098; - public static final int settings_cache_size_1000=0x7f09009b; - public static final int settings_cache_size_10000=0x7f09009e; - public static final int settings_cache_size_200=0x7f090099; - public static final int settings_cache_size_2000=0x7f09009c; - public static final int settings_cache_size_20000=0x7f09009f; - public static final int settings_cache_size_500=0x7f09009a; - public static final int settings_cache_size_5000=0x7f09009d; - public static final int settings_cache_size_unlimited=0x7f0900a0; - public static final int settings_cache_title=0x7f090071; - public static final int settings_clear_search_history=0x7f0900a1; - public static final int settings_connection_failure=0x7f090079; - public static final int settings_hide_media_summary=0x7f0900a8; + 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=0x7f0900f6; + public static final int select_artist_folder=0x7f0900f5; + public static final int select_artist_refresh=0x7f0900f4; + public static final int select_playlist_empty=0x7f090047; + public static final int service_connecting=0x7f0900ec; + 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_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=0x7f0900a7; - public static final int settings_hide_media_toast=0x7f0900a9; - public static final int settings_invalid_url=0x7f09007a; - public static final int settings_invalid_username=0x7f09007b; - public static final int settings_max_albums=0x7f0900c2; - public static final int settings_max_albums_10=0x7f0900c5; - public static final int settings_max_albums_100=0x7f0900ca; - public static final int settings_max_albums_20=0x7f0900c6; - public static final int settings_max_albums_250=0x7f0900cb; - public static final int settings_max_albums_30=0x7f0900c7; - public static final int settings_max_albums_40=0x7f0900c8; - public static final int settings_max_albums_5=0x7f0900c4; - public static final int settings_max_albums_50=0x7f0900c9; - public static final int settings_max_albums_500=0x7f0900cc; - public static final int settings_max_albums_summary=0x7f0900c3; - public static final int settings_max_artists=0x7f0900d7; - public static final int settings_max_artists_10=0x7f0900da; - public static final int settings_max_artists_100=0x7f0900de; - public static final int settings_max_artists_200=0x7f0900df; - public static final int settings_max_artists_25=0x7f0900db; - public static final int settings_max_artists_5=0x7f0900d9; - public static final int settings_max_artists_50=0x7f0900dc; - public static final int settings_max_artists_500=0x7f0900e0; - public static final int settings_max_artists_75=0x7f0900dd; - public static final int settings_max_artists_summary=0x7f0900d8; - public static final int settings_max_bitrate_112=0x7f090089; - public static final int settings_max_bitrate_128=0x7f09008a; - public static final int settings_max_bitrate_160=0x7f09008b; - public static final int settings_max_bitrate_192=0x7f09008c; - public static final int settings_max_bitrate_256=0x7f09008d; - public static final int settings_max_bitrate_32=0x7f090085; - public static final int settings_max_bitrate_320=0x7f09008e; - public static final int settings_max_bitrate_64=0x7f090086; - public static final int settings_max_bitrate_80=0x7f090087; - public static final int settings_max_bitrate_96=0x7f090088; - public static final int settings_max_bitrate_mobile=0x7f090084; - public static final int settings_max_bitrate_unlimited=0x7f09008f; - public static final int settings_max_bitrate_wifi=0x7f090083; - public static final int settings_max_songs=0x7f0900cd; - public static final int settings_max_songs_10=0x7f0900d0; - public static final int settings_max_songs_100=0x7f0900d4; - public static final int settings_max_songs_200=0x7f0900d5; - public static final int settings_max_songs_25=0x7f0900d1; - public static final int settings_max_songs_5=0x7f0900cf; - public static final int settings_max_songs_50=0x7f0900d2; - public static final int settings_max_songs_500=0x7f0900d6; - public static final int settings_max_songs_75=0x7f0900d3; - public static final int settings_max_songs_summary=0x7f0900ce; - public static final int settings_media_button_summary=0x7f0900ab; - public static final int settings_media_button_title=0x7f0900aa; - public static final int settings_network_timeout=0x7f0900af; - public static final int settings_network_timeout_105000=0x7f0900be; - public static final int settings_network_timeout_120000=0x7f0900bf; - public static final int settings_network_timeout_15000=0x7f0900b8; - public static final int settings_network_timeout_30000=0x7f0900b9; - public static final int settings_network_timeout_45000=0x7f0900ba; - public static final int settings_network_timeout_60000=0x7f0900bb; - public static final int settings_network_timeout_75000=0x7f0900bc; - public static final int settings_network_timeout_90000=0x7f0900bd; - public static final int settings_network_title=0x7f090082; - public static final int settings_other_title=0x7f0900a3; - public static final int settings_preload=0x7f090072; - public static final int settings_preload_1=0x7f090092; - public static final int settings_preload_10=0x7f090096; - public static final int settings_preload_2=0x7f090093; - public static final int settings_preload_3=0x7f090094; - public static final int settings_preload_5=0x7f090095; - public static final int settings_preload_unlimited=0x7f090097; - public static final int settings_screen_lit_summary=0x7f0900ad; - public static final int settings_screen_lit_title=0x7f0900ac; - public static final int settings_scrobble_summary=0x7f0900a6; - public static final int settings_scrobble_title=0x7f0900a5; - public static final int settings_search_history_cleared=0x7f0900a2; - public static final int settings_search_title=0x7f0900a4; - public static final int settings_server_address=0x7f09006e; - public static final int settings_server_name=0x7f09006d; - public static final int settings_server_password=0x7f090070; - public static final int settings_server_unused1=0x7f09006b; - public static final int settings_server_unused2=0x7f09006c; - public static final int settings_server_username=0x7f09006f; - public static final int settings_servers_title=0x7f09006a; - public static final int settings_show_notification=0x7f0900c0; - public static final int settings_show_notification_summary=0x7f0900c1; - public static final int settings_test_connection_title=0x7f090069; - public static final int settings_testing_connection=0x7f090076; - public static final int settings_testing_ok=0x7f090077; - public static final int settings_testing_unlicensed=0x7f090078; - public static final int settings_theme_dark=0x7f090081; - public static final int settings_theme_fullscreen=0x7f09007e; - public static final int settings_theme_fullscreenlight=0x7f09007f; - public static final int settings_theme_light=0x7f090080; - public static final int settings_theme_title=0x7f09007d; - public static final int settings_theme_wheat=0x7f0900fd; - public static final int settings_title=0x7f090068; - public static final int settings_wifi_required_summary=0x7f090091; - public static final int settings_wifi_required_title=0x7f090090; - public static final int song_details_all=0x7f090064; - public static final int song_details_kbps=0x7f090065; - public static final int util_bytes_format_byte=0x7f0900fc; - public static final int util_bytes_format_gigabyte=0x7f0900f9; - public static final int util_bytes_format_kilobyte=0x7f0900fb; - public static final int util_bytes_format_megabyte=0x7f0900fa; - public static final int widget_initial_text=0x7f0900f6; - public static final int widget_sdcard_busy=0x7f0900f7; - public static final int widget_sdcard_missing=0x7f0900f8; + 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=0x7f0900c6; + public static final int settings_max_albums_10=0x7f0900c9; + public static final int settings_max_albums_100=0x7f0900ce; + public static final int settings_max_albums_20=0x7f0900ca; + public static final int settings_max_albums_250=0x7f0900cf; + public static final int settings_max_albums_30=0x7f0900cb; + public static final int settings_max_albums_40=0x7f0900cc; + public static final int settings_max_albums_5=0x7f0900c8; + public static final int settings_max_albums_50=0x7f0900cd; + public static final int settings_max_albums_500=0x7f0900d0; + public static final int settings_max_albums_summary=0x7f0900c7; + 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_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_artists_summary=0x7f0900dc; + 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=0x7f0900d1; + 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_max_songs_summary=0x7f0900d2; + 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_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=0x7f090101; + 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=0x7f090100; + public static final int util_bytes_format_gigabyte=0x7f0900fd; + public static final int util_bytes_format_kilobyte=0x7f0900ff; + public static final int util_bytes_format_megabyte=0x7f0900fe; + public static final int widget_initial_text=0x7f0900fa; + public static final int widget_sdcard_busy=0x7f0900fb; + public static final int widget_sdcard_missing=0x7f0900fc; } public static final class style { public static final int Dark=0x7f0b0000; diff --git a/res/layout/main_buttons.xml b/res/layout/main_buttons.xml index db868082..9e2d3eda 100644 --- a/res/layout/main_buttons.xml +++ b/res/layout/main_buttons.xml @@ -1,6 +1,6 @@ + a:orientation="vertical" a:layout_width="fill_parent" a:layout_height="fill_parent"> + a:layout_height="fill_parent"> + + + + + + + + + + + - - diff --git a/res/values/strings.xml b/res/values/strings.xml index 479e4397..a4f4c5f4 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -5,33 +5,37 @@ OK Save Cancel - Play now - Play next - Play last + Play Now + Play Next + Play Last Pin Unpin Delete - Subsonic home - Media library + Subsonic Home + Media Library Search Playlists - Now playing + 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 + Select Server + Shuffle Play Offline Settings Albums - Recently added - Recently played - Most played - Top rated + Recently Added + Recently Played + Most Played + Top Rated Random - Starred + Starred Albums + By Name + By Artist + Songs + Starred Songs Exit Settings @@ -57,21 +61,21 @@ Artists Albums Songs - Show more + Show More Please wait… - Media library - Offline media + Media Library + Offline Media No media found - Select all + Select All %d tracks selected. %d tracks unselected. More Offline Searching… - Play all + Play All Error: No SD card available. Warning: No network available. Server not licensed. %d trial days left. @@ -87,31 +91,31 @@ Downloading - %s Buffering Playing shuffle - Show album + Show Album Lyrics - Remove song - Remove all - Screen on - Screen off + Remove Song + Remove All + Screen On + Screen Off Shuffle - Save playlist + Save Playlist Equalizer Visualizer Jukebox Playlist was shuffled - Save playlist + 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 + 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 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. @@ -123,19 +127,19 @@ Error - Subsonic settings - Test connection + Subsonic Settings + Test Connection Servers Unused 1 Unused 2 Name - Server address + Server Address Username Password - Music cache + Music Cache Songs to preload - Cache size - Cache location + Cache Size + Cache Location Invalid cache location. Using default. Testing connection… Connection is OK @@ -150,8 +154,8 @@ Light Dark Network - Max bitrate - Wi-Fi - Max bitrate - Mobile + Max Bitrate - Wi-Fi + Max Bitrate - Mobile 32 Kbps 64 Kbps 80 Kbps @@ -182,16 +186,16 @@ Unlimited Clear search history Search history cleared - Other settings - Search settings - Scrobble to Last.fm + 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 From Other Hide music files from other apps. Takes effect next time Android scans your phone for music. - Media buttons + Media Buttons Respond to phone, headset and Bluetooth media buttons - Keep screen on + Keep Screen On Keeping the screen on while downloading improves download speed. Buffer length Network timeout diff --git a/src/net/sourceforge/subsonic/androidapp/activity/DownloadActivity.java b/src/net/sourceforge/subsonic/androidapp/activity/DownloadActivity.java index 6a3707b0..684cd43b 100644 --- a/src/net/sourceforge/subsonic/androidapp/activity/DownloadActivity.java +++ b/src/net/sourceforge/subsonic/androidapp/activity/DownloadActivity.java @@ -31,7 +31,6 @@ import android.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; import android.content.Intent; -import android.graphics.Color; import android.os.Bundle; import android.os.Handler; import android.view.ContextMenu; diff --git a/src/net/sourceforge/subsonic/androidapp/activity/MainActivity.java b/src/net/sourceforge/subsonic/androidapp/activity/MainActivity.java index 647e57b7..d05e5b5e 100644 --- a/src/net/sourceforge/subsonic/androidapp/activity/MainActivity.java +++ b/src/net/sourceforge/subsonic/androidapp/activity/MainActivity.java @@ -25,11 +25,14 @@ import net.sourceforge.subsonic.androidapp.R; import net.sourceforge.subsonic.androidapp.service.DownloadFile; 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.MergeAdapter; import net.sourceforge.subsonic.androidapp.util.Util; import net.sourceforge.subsonic.androidapp.util.FileUtil; import android.app.ActionBar; +import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; @@ -67,6 +70,7 @@ public class MainActivity extends SubsonicTabActivity { if (getIntent().hasExtra(Constants.INTENT_EXTRA_NAME_EXIT)) { exit(); } + setContentView(R.layout.main); loadSettings(); @@ -77,12 +81,16 @@ public class MainActivity extends SubsonicTabActivity { final TextView serverTextView = (TextView) serverButton.findViewById(R.id.main_select_server_2); final View albumsTitle = buttons.findViewById(R.id.main_albums); + final View songsTitle = buttons.findViewById(R.id.main_songs); final View albumsNewestButton = buttons.findViewById(R.id.main_albums_newest); final View albumsRandomButton = buttons.findViewById(R.id.main_albums_random); final View albumsHighestButton = buttons.findViewById(R.id.main_albums_highest); final View albumsStarredButton = buttons.findViewById(R.id.main_albums_starred); final View albumsRecentButton = buttons.findViewById(R.id.main_albums_recent); final View albumsFrequentButton = buttons.findViewById(R.id.main_albums_frequent); + final View albumsAlphaByNameButton = buttons.findViewById(R.id.main_albums_alphaByName); + final View albumsAlphaByArtistButton = buttons.findViewById(R.id.main_albums_alphaByArtist); + final View songsStarredButton = buttons.findViewById(R.id.main_songs_starred); final View dummyView = findViewById(R.id.main_dummy); @@ -95,9 +103,12 @@ public class MainActivity extends SubsonicTabActivity { MergeAdapter adapter = new MergeAdapter(); adapter.addViews(Arrays.asList(serverButton), true); + if (!Util.isOffline(this)) { + adapter.addView(songsTitle, false); + adapter.addViews(Arrays.asList(songsStarredButton), true); adapter.addView(albumsTitle, false); - adapter.addViews(Arrays.asList(albumsNewestButton, albumsRecentButton, albumsFrequentButton, albumsHighestButton, albumsStarredButton, albumsRandomButton), true); + adapter.addViews(Arrays.asList(albumsNewestButton, albumsRecentButton, albumsFrequentButton, albumsHighestButton, albumsRandomButton, albumsStarredButton, albumsAlphaByNameButton, albumsAlphaByArtistButton), true); } list.setAdapter(adapter); @@ -120,6 +131,12 @@ public class MainActivity extends SubsonicTabActivity { showAlbumList("frequent"); } else if (view == albumsStarredButton) { showAlbumList("starred"); + } else if (view == albumsAlphaByNameButton) { + showAlbumList("alphabeticalByName"); + } else if (view == albumsAlphaByArtistButton) { + showAlbumList("alphabeticalByArtist"); + } else if (view == songsStarredButton) { + showStarredSongs(); } } }); @@ -279,4 +296,10 @@ public class MainActivity extends SubsonicTabActivity { intent.putExtra(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_OFFSET, 0); Util.startActivityWithoutTransition(this, intent); } + + private void showStarredSongs() { + Intent intent = new Intent(this, SelectAlbumActivity.class); + intent.putExtra(Constants.INTENT_EXTRA_NAME_STARRED, 1); + Util.startActivityWithoutTransition(this, intent); + } } \ No newline at end of file diff --git a/src/net/sourceforge/subsonic/androidapp/activity/SelectAlbumActivity.java b/src/net/sourceforge/subsonic/androidapp/activity/SelectAlbumActivity.java index e0dbd942..d5be485e 100644 --- a/src/net/sourceforge/subsonic/androidapp/activity/SelectAlbumActivity.java +++ b/src/net/sourceforge/subsonic/androidapp/activity/SelectAlbumActivity.java @@ -30,11 +30,8 @@ import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; -import android.view.Window; import android.widget.AdapterView; import android.widget.Button; -import android.widget.ImageButton; -import android.widget.ImageView; import android.widget.ListView; import net.sourceforge.subsonic.androidapp.R; import net.sourceforge.subsonic.androidapp.domain.MusicDirectory; @@ -162,6 +159,7 @@ public class SelectAlbumActivity extends SubsonicTabActivity { String playlistId = getIntent().getStringExtra(Constants.INTENT_EXTRA_NAME_PLAYLIST_ID); String playlistName = getIntent().getStringExtra(Constants.INTENT_EXTRA_NAME_PLAYLIST_NAME); String albumListType = getIntent().getStringExtra(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_TYPE); + int getStarredTracks = getIntent().getIntExtra(Constants.INTENT_EXTRA_NAME_STARRED, 0); int albumListSize = getIntent().getIntExtra(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_SIZE, 0); int albumListOffset = getIntent().getIntExtra(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_OFFSET, 0); @@ -169,6 +167,8 @@ public class SelectAlbumActivity extends SubsonicTabActivity { getPlaylist(playlistId, playlistName); } else if (albumListType != null) { getAlbumList(albumListType, albumListSize, albumListOffset); + } else if (getStarredTracks != 0) { + getStarred(); } else { getMusicDirectory(id, name); } @@ -318,6 +318,17 @@ public class SelectAlbumActivity extends SubsonicTabActivity { } }.execute(); } + + private void getStarred() { + setTitle(R.string.main_songs_starred); + + new LoadTask() { + @Override + protected MusicDirectory load(MusicService service) throws Exception { + return Util.getSongsFromSearchResult(service.getStarred(SelectAlbumActivity.this, this)); + } + }.execute(); + } private void getPlaylist(final String playlistId, String playlistName) { setTitle(playlistName); @@ -344,6 +355,10 @@ public class SelectAlbumActivity extends SubsonicTabActivity { setTitle(R.string.main_albums_frequent); } else if ("starred".equals(albumListType)) { setTitle(R.string.main_albums_starred); + } else if ("alphabeticalByName".equals(albumListType)) { + setTitle(R.string.main_albums_alphaByName); + } else if ("alphabeticalByArtist".equals(albumListType)) { + setTitle(R.string.main_albums_alphaByArtist); } new LoadTask() { diff --git a/src/net/sourceforge/subsonic/androidapp/service/CachedMusicService.java b/src/net/sourceforge/subsonic/androidapp/service/CachedMusicService.java index 9665fc62..5b59e32b 100644 --- a/src/net/sourceforge/subsonic/androidapp/service/CachedMusicService.java +++ b/src/net/sourceforge/subsonic/androidapp/service/CachedMusicService.java @@ -164,6 +164,11 @@ public class CachedMusicService implements MusicService { public MusicDirectory getRandomSongs(int size, Context context, ProgressListener progressListener) throws Exception { return musicService.getRandomSongs(size, context, progressListener); } + + @Override + public SearchResult getStarred(Context context, ProgressListener progressListener) throws Exception { + return musicService.getStarred(context, progressListener); + } @Override public Bitmap getCoverArt(Context context, MusicDirectory.Entry entry, int size, boolean saveToFile, ProgressListener progressListener) throws Exception { diff --git a/src/net/sourceforge/subsonic/androidapp/service/MusicService.java b/src/net/sourceforge/subsonic/androidapp/service/MusicService.java index f1770bdb..bd6e351a 100644 --- a/src/net/sourceforge/subsonic/androidapp/service/MusicService.java +++ b/src/net/sourceforge/subsonic/androidapp/service/MusicService.java @@ -70,6 +70,8 @@ public interface MusicService { MusicDirectory getAlbumList(String type, int size, int offset, Context context, ProgressListener progressListener) throws Exception; MusicDirectory getRandomSongs(int size, Context context, ProgressListener progressListener) throws Exception; + + SearchResult getStarred(Context context, ProgressListener progressListener) throws Exception; Bitmap getCoverArt(Context context, MusicDirectory.Entry entry, int size, boolean saveToFile, ProgressListener progressListener) throws Exception; diff --git a/src/net/sourceforge/subsonic/androidapp/service/OfflineMusicService.java b/src/net/sourceforge/subsonic/androidapp/service/OfflineMusicService.java index 5bc8f00b..989c40ad 100644 --- a/src/net/sourceforge/subsonic/androidapp/service/OfflineMusicService.java +++ b/src/net/sourceforge/subsonic/androidapp/service/OfflineMusicService.java @@ -222,6 +222,11 @@ public class OfflineMusicService extends RESTMusicService { public JukeboxStatus setJukeboxGain(float gain, Context context, ProgressListener progressListener) throws Exception { throw new OfflineException("Jukebox not available in offline mode"); } + + @Override + public SearchResult getStarred(Context context, ProgressListener progressListener) throws Exception { + throw new OfflineException("Starred not available in offline mode"); + } @Override public MusicDirectory getRandomSongs(int size, Context context, ProgressListener progressListener) throws Exception { diff --git a/src/net/sourceforge/subsonic/androidapp/service/RESTMusicService.java b/src/net/sourceforge/subsonic/androidapp/service/RESTMusicService.java index c8deb9bf..dc45b9fc 100644 --- a/src/net/sourceforge/subsonic/androidapp/service/RESTMusicService.java +++ b/src/net/sourceforge/subsonic/androidapp/service/RESTMusicService.java @@ -410,6 +410,16 @@ public class RESTMusicService implements MusicService { Util.close(reader); } } + + @Override + public SearchResult getStarred(Context context, ProgressListener progressListener) throws Exception { + Reader reader = getReader(context, progressListener, "getStarred", null); + try { + return new SearchResult2Parser(context).parse(reader, progressListener); + } finally { + Util.close(reader); + } + } @Override public Version getLocalVersion(Context context) throws Exception { diff --git a/src/net/sourceforge/subsonic/androidapp/util/Constants.java b/src/net/sourceforge/subsonic/androidapp/util/Constants.java index 2e98d710..399023f0 100644 --- a/src/net/sourceforge/subsonic/androidapp/util/Constants.java +++ b/src/net/sourceforge/subsonic/androidapp/util/Constants.java @@ -48,7 +48,8 @@ public final class Constants { public static final String INTENT_EXTRA_NAME_SHUFFLE = "subsonic.shuffle"; public static final String INTENT_EXTRA_NAME_REFRESH = "subsonic.refresh"; public static final String INTENT_EXTRA_REQUEST_SEARCH = "subsonic.requestsearch"; - public static final String INTENT_EXTRA_NAME_EXIT = "subsonic.exit" ; + public static final String INTENT_EXTRA_NAME_EXIT = "subsonic.exit"; + public static final String INTENT_EXTRA_NAME_STARRED = "subsonic.starred"; // Notification IDs. public static final int NOTIFICATION_ID_PLAYING = 100; diff --git a/src/net/sourceforge/subsonic/androidapp/util/Util.java b/src/net/sourceforge/subsonic/androidapp/util/Util.java index 3394ceac..259d814f 100644 --- a/src/net/sourceforge/subsonic/androidapp/util/Util.java +++ b/src/net/sourceforge/subsonic/androidapp/util/Util.java @@ -49,7 +49,9 @@ import net.sourceforge.subsonic.androidapp.activity.MainActivity; import net.sourceforge.subsonic.androidapp.domain.MusicDirectory; import net.sourceforge.subsonic.androidapp.domain.PlayerState; import net.sourceforge.subsonic.androidapp.domain.RepeatMode; +import net.sourceforge.subsonic.androidapp.domain.SearchResult; import net.sourceforge.subsonic.androidapp.domain.Version; +import net.sourceforge.subsonic.androidapp.domain.MusicDirectory.Entry; import net.sourceforge.subsonic.androidapp.provider.SubsonicAppWidgetProvider4x1; import net.sourceforge.subsonic.androidapp.receiver.MediaButtonIntentReceiver; import net.sourceforge.subsonic.androidapp.service.DownloadServiceImpl; @@ -730,6 +732,16 @@ public class Util extends DownloadActivity { Log.i(TAG, "Service.stopForeground() not available. Using work-around."); } } + + public static MusicDirectory getSongsFromSearchResult(SearchResult searchResult) { + MusicDirectory musicDirectory = new MusicDirectory(); + + for (Entry entry : searchResult.getSongs()) { + musicDirectory.addChild(entry); + } + + return musicDirectory; + } /** *

Broadcasts the given song info as the new song being played.