diff --git a/libs/jaudiotagger.jar b/libs/jaudiotagger.jar deleted file mode 100644 index 51d7774..0000000 Binary files a/libs/jaudiotagger.jar and /dev/null differ diff --git a/res/layout/lyrics_base.xml b/res/layout/lyrics_base.xml deleted file mode 100644 index 821a8f2..0000000 --- a/res/layout/lyrics_base.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/res/menu/audio_player.xml b/res/menu/audio_player.xml index 8625074..74af706 100644 --- a/res/menu/audio_player.xml +++ b/res/menu/audio_player.xml @@ -25,12 +25,8 @@ android:showAsAction="never" android:title="@string/menu_equalizer"/> - - \ No newline at end of file + diff --git a/res/values/strings.xml b/res/values/strings.xml index 0f0296d..6ea3bc3 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -38,9 +38,6 @@ Save queue Clear Favorites Share - Save lyrics - Delete lyrics - Fetch lyrics Place on Home screen Equalizer Simple @@ -126,8 +123,6 @@ \"%s\" set as ringtone Playlist renamed set as the theme - lyrics saved - lyrics deleted Interface @@ -183,7 +178,5 @@ No search results found Songs you mark as favorites will be shown here. Albums you\'ve listened to will show up here. Try playing some music. - Lyrics for \"%s\" could not be found - To fetch lyrics for \"%s\" use \"Fetch lyrics\" in the menu. - \ No newline at end of file + diff --git a/res/values/themeconfig.xml b/res/values/themeconfig.xml index bb5fb21..d41a5b7 100644 --- a/res/values/themeconfig.xml +++ b/res/values/themeconfig.xml @@ -25,9 +25,6 @@ @color/transparent_white - - @color/white - @color/white @color/transparent_white @@ -51,4 +48,4 @@ @color/transparent_white @color/transparent_white - \ No newline at end of file + diff --git a/src/com/andrew/apollo/lyrics/LyricsProvider.java b/src/com/andrew/apollo/lyrics/LyricsProvider.java deleted file mode 100644 index 0ca57be..0000000 --- a/src/com/andrew/apollo/lyrics/LyricsProvider.java +++ /dev/null @@ -1,22 +0,0 @@ - -package com.andrew.apollo.lyrics; - -public interface LyricsProvider { - - /** - * Gives the lyrics of the song, or null if they werent found - * - * @param artist Artist name - * @param song Song name - * @return Full lyrics as a {@link String} - */ - public String getLyrics(String artist, String song); - - /** - * Gives the name of the provider implementation - * - * @return The name of the lyrics provider - */ - public String getProviderName(); - -} diff --git a/src/com/andrew/apollo/lyrics/LyricsProviderFactory.java b/src/com/andrew/apollo/lyrics/LyricsProviderFactory.java deleted file mode 100644 index 2aff457..0000000 --- a/src/com/andrew/apollo/lyrics/LyricsProviderFactory.java +++ /dev/null @@ -1,27 +0,0 @@ - -package com.andrew.apollo.lyrics; - -public final class LyricsProviderFactory { - - /* This class is never initiated. */ - public LyricsProviderFactory() { - } - - /** - * @param filePath The path to save the lyrics. - * @return A new instance of {@link OfflineLyricsProvider}. - */ - public static final LyricsProvider getOfflineProvider(String filePath) { - return new OfflineLyricsProvider(filePath); - } - - /** - * @return The current lyrics provider. - */ - public static final LyricsProvider getMainOnlineProvider() { - return new LyricsWikiProvider(); - } - - // TODO Implement more providers, and also a system to iterate over them - -} diff --git a/src/com/andrew/apollo/lyrics/OfflineLyricsProvider.java b/src/com/andrew/apollo/lyrics/OfflineLyricsProvider.java deleted file mode 100644 index dac8738..0000000 --- a/src/com/andrew/apollo/lyrics/OfflineLyricsProvider.java +++ /dev/null @@ -1,138 +0,0 @@ - -package com.andrew.apollo.lyrics; - -import org.jaudiotagger.audio.AudioFile; -import org.jaudiotagger.audio.AudioFileIO; -import org.jaudiotagger.audio.exceptions.CannotReadException; -import org.jaudiotagger.audio.exceptions.CannotWriteException; -import org.jaudiotagger.audio.exceptions.InvalidAudioFrameException; -import org.jaudiotagger.audio.exceptions.ReadOnlyFileException; -import org.jaudiotagger.tag.FieldKey; -import org.jaudiotagger.tag.Tag; -import org.jaudiotagger.tag.TagException; - -import java.io.File; -import java.io.IOException; - -public class OfflineLyricsProvider implements LyricsProvider { - - private File mAudioFile; - - /** - * Constructor of OfflineLyricsProvider - * - * @param filePath The path to save the lyrics - */ - public OfflineLyricsProvider(final String filePath) { - setTrackFile(filePath); - } - - /** - * @param path The file to save our {@link File} - */ - public void setTrackFile(final String path) { - if (path == null) { - return; - } - mAudioFile = new File(path); - } - - /** - * {@inheritDoc} - */ - @Override - public String getLyrics(final String artist, final String song) { - String lyrics = null; - try { - if (mAudioFile == null) { - return null; - } - if (mAudioFile.exists()) { - // Use jAudioTagger library to get the file's lyrics - final AudioFile file = AudioFileIO.read(mAudioFile); - final Tag tag = file.getTag(); - lyrics = tag.getFirst(FieldKey.LYRICS); - } - } catch (final ReadOnlyFileException e) { - e.printStackTrace(); - } catch (final CannotReadException e) { - e.printStackTrace(); - } catch (final IOException e) { - e.printStackTrace(); - } catch (final TagException e) { - e.printStackTrace(); - } catch (final InvalidAudioFrameException e) { - e.printStackTrace(); - } catch (final UnsupportedOperationException e) { - e.printStackTrace(); - } - return lyrics; - } - - /** - * {@inheritDoc} - */ - @Override - public String getProviderName() { - return "File metadata"; - } - - /** - * @param lyrics The lyrics to save - * @param filePath The path to save them - */ - public static void saveLyrics(final String lyrics, final String filePath) { - try { - final File file = new File(filePath); - if (file.exists()) { - // Use jAudioTagger library to set the file's lyrics - final AudioFile audioFile = AudioFileIO.read(file); - final Tag tag = audioFile.getTag(); - tag.setField(FieldKey.LYRICS, lyrics); - audioFile.commit(); - } - } catch (final ReadOnlyFileException e) { - e.printStackTrace(); - } catch (final CannotReadException e) { - e.printStackTrace(); - } catch (final IOException e) { - e.printStackTrace(); - } catch (final TagException e) { - e.printStackTrace(); - } catch (final InvalidAudioFrameException e) { - e.printStackTrace(); - } catch (final CannotWriteException e) { - e.printStackTrace(); - } catch (final NullPointerException e) { - e.printStackTrace(); - } - } - - /** - * @param filePath The path to the lyrics we're deleting - */ - public static void deleteLyrics(final String filePath) { - try { - final File file = new File(filePath); - if (file.exists()) { - // Use jAudioTagger library to delete the file's lyrics - final AudioFile audioFile = AudioFileIO.read(file); - final Tag tag = audioFile.getTag(); - tag.deleteField(FieldKey.LYRICS); - audioFile.commit(); - } - } catch (final ReadOnlyFileException e) { - e.printStackTrace(); - } catch (final CannotReadException e) { - e.printStackTrace(); - } catch (final IOException e) { - e.printStackTrace(); - } catch (final TagException e) { - e.printStackTrace(); - } catch (final InvalidAudioFrameException e) { - e.printStackTrace(); - } catch (final CannotWriteException e) { - e.printStackTrace(); - } - } -} diff --git a/src/com/andrew/apollo/ui/activities/AudioPlayerActivity.java b/src/com/andrew/apollo/ui/activities/AudioPlayerActivity.java index a952f74..840bbdb 100644 --- a/src/com/andrew/apollo/ui/activities/AudioPlayerActivity.java +++ b/src/com/andrew/apollo/ui/activities/AudioPlayerActivity.java @@ -51,7 +51,6 @@ import com.andrew.apollo.MusicPlaybackService; import com.andrew.apollo.R; import com.andrew.apollo.adapters.PagerAdapter; import com.andrew.apollo.cache.ImageFetcher; -import com.andrew.apollo.ui.fragments.LyricsFragment; import com.andrew.apollo.ui.fragments.QueueFragment; import com.andrew.apollo.utils.ApolloUtils; import com.andrew.apollo.utils.MusicUtils; @@ -351,10 +350,6 @@ public class AudioPlayerActivity extends SherlockFragmentActivity implements Ser // Sound effects NavUtils.openEffectsPanel(this); return true; - case R.id.menu_download_lyrics: - updateLyrics(true); - hideAlbumArt(); - return true; case R.id.menu_settings: // Settings NavUtils.openSettings(this); @@ -471,8 +466,6 @@ public class AudioPlayerActivity extends SherlockFragmentActivity implements Ser mPagerAdapter = new PagerAdapter(this); // Queue mPagerAdapter.add(QueueFragment.class, null); - // Lyrics - mPagerAdapter.add(LyricsFragment.class, null); // Initialize the ViewPager mViewPager = (ViewPager)findViewById(R.id.audio_player_pager); @@ -548,15 +541,6 @@ public class AudioPlayerActivity extends SherlockFragmentActivity implements Ser mRepeatButton.updateRepeatState(); } - /** - * Refreshes the lyrics and moves the view pager to the lyrics fragment. - */ - public void updateLyrics(final boolean force) { - ((LyricsFragment)mPagerAdapter.getFragment(1)).fetchLyrics(force); - if (force && mViewPager.getCurrentItem() != 1) { - mViewPager.setCurrentItem(1, true); - } - } /** * @param delay When to update @@ -884,8 +868,6 @@ public class AudioPlayerActivity extends SherlockFragmentActivity implements Ser mReference.get().updateNowPlayingInfo(); // Update the favorites icon mReference.get().invalidateOptionsMenu(); - // Update the lyrics - mReference.get().updateLyrics(false); } else if (action.equals(MusicPlaybackService.PLAYSTATE_CHANGED)) { // Set the play and pause image mReference.get().mPlayPauseButton.updateState();