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.stream.shoutcast;
20  
21  import java.util.Map;
22  
23  /***
24   * Listens for {@link ShoutcastInputStream SHOUTcast reader} events.
25   * 
26   * @author Martin Vysny
27   */
28  public interface IShoutcastListener {
29  	/***
30  	 * The stream was opened and the SHOUTcast metadata was read.
31  	 * 
32  	 * @param name
33  	 *            the name of the radio station
34  	 * @param genre
35  	 *            the genre
36  	 * @param hasMetaint
37  	 *            if <code>true</code> then the radio stream will periodically
38  	 *            transmit metadata (and the
39  	 *            {@link #metadataReceived(String, Map)} will be invoked).
40  	 * @param metadata
41  	 *            all present metadata.
42  	 */
43  	void opened(final String name, final String genre,
44  			final boolean hasMetaint, final Map<String, String> metadata);
45  
46  	/***
47  	 * Invoked when the radio transmits additional metadata.
48  	 * 
49  	 * @param title
50  	 *            the 'StreamTitle' metadata
51  	 * @param metadata
52  	 *            all metadata
53  	 */
54  	void metadataReceived(final String title, final Map<String, String> metadata);
55  }