View Javadoc

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  
19  package sk.baka.ambient;
20  
21  import java.util.List;
22  
23  import sk.baka.ambient.collection.TrackMetadataBean;
24  import sk.baka.ambient.lrc.lyrdb.LyrdbTrack;
25  
26  /***
27   * Generates events that some kind of a content is available.
28   * 
29   * @author Martin Vysny
30   */
31  public interface IContentListener {
32  	/***
33  	 * A cover for given track has been successfully downloaded. Note that if
34  	 * the cache size is set to a very small value the image may already be
35  	 * purged from the cache. To avoid this either set a sensible cache size
36  	 * value, e.g. 128kb, or turn off the image downloading by setting offline
37  	 * mode to <code>true</code>.
38  	 * 
39  	 * @param track
40  	 *            the track.
41  	 */
42  	void coverLoaded(final TrackMetadataBean track);
43  
44  	/***
45  	 * A lyrics event. Either lyrics for given track has been successfully
46  	 * downloaded or user needs to select one from given lyrics list.
47  	 * 
48  	 * @param track
49  	 *            the track.
50  	 * @param lyrics
51  	 *            if non-<code>null</code> then user needs to select the correct
52  	 *            karaoke from this list. The list may be empty - in this case
53  	 *            no karaoke files are available. If <code>null</code> then the
54  	 *            karaoke file is available locally. If non-<code>null</code>
55  	 *            and is empty then no karaoke files are available.
56  	 */
57  	void lyricsLoaded(final TrackMetadataBean track,
58  			final List<LyrdbTrack> lyrics);
59  }