1 /***
2 * Ambient - A music player for the Android platform
3 Copyright (C) 2007 Martin Vysny
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 package sk.baka.ambient.library;
19
20 import java.util.List;
21
22 import sk.baka.ambient.collection.TrackMetadataBean;
23 import sk.baka.ambient.lrc.lyrdb.LyrdbTrack;
24
25 /***
26 * Listens for library events.
27 *
28 * @author Martin Vysny
29 */
30 public interface ILibraryListener {
31 /***
32 * Informs that the file rescan is complete and the database is updated.
33 * Invoked in Scanner thread.
34 *
35 * @param updateStarted
36 * if <code>true</code> then the library update just started. If
37 * <code>false</code> then the update finished.
38 * @param interrupted
39 * if <code>true</code> then the scan was interrupted.
40 * @param userNotified
41 * if <code>true</code> then the user is already notified about
42 * the library being updated.
43 */
44 void libraryUpdate(final boolean updateStarted, final boolean interrupted,
45 final boolean userNotified);
46
47 /***
48 * A cover for given track has been successfully downloaded. Note that if
49 * the cache size is set to a very small value the image may already be
50 * purged from the cache. To avoid this either set a sensible cache size
51 * value, e.g. 128kb, or turn off the image downloading by setting offline
52 * mode to <code>true</code>.
53 *
54 * @param track
55 * the track.
56 */
57 void coverLoaded(final TrackMetadataBean track);
58
59 /***
60 * A lyrics event. Either lyrics for given track has been successfully
61 * downloaded or user needs to select one from given lyrics list.
62 *
63 * @param track
64 * the track.
65 * @param lyrics
66 * if non-<code>null</code> then user needs to select the correct
67 * karaoke from this list. The list may be empty - in this case
68 * no karaoke files are available. If <code>null</code> then the
69 * karaoke file is available locally. If non-<code>null</code>
70 * and is empty then no karaoke files are available.
71 */
72 void lyricsLoaded(final TrackMetadataBean track,
73 final List<LyrdbTrack> lyrics);
74 }