public class StreamSource extends AbstractControlledComponent implements Source {
*/
public class StreamSource extends AbstractControlledComponent implements Source {
- /** The event bus. */
- private final EventBus eventBus;
-
/** The URL of the stream. */
private final String streamUrl;
/** The URL of the stream. */
private final String streamUrl;
@@ -62,9+57,6 @@ public class StreamSource extends AbstractControlledComponent implements Source
/** The metadata stream. */
private final MetadataStream metadataStream;
/** The metadata stream. */
private final MetadataStream metadataStream;
- /** The current metadata. */
- private Metadata metadata;
-
/**
* Creates a new stream source. This will also connect to the server and parse
* the response header for vital information (sampling frequency, number of
/**
* Creates a new stream source. This will also connect to the server and parse
* the response header for vital information (sampling frequency, number of
@@ -77,8+69,8 @@ public class StreamSource extends AbstractControlledComponent implements Source
* @throws IOException
* if an I/O error occurs
*/
* @throws IOException
* if an I/O error occurs
*/
- public StreamSource(EventBus eventBus, String streamUrl) throws IOException {
- this.eventBus = eventBus;
+ public StreamSource(String streamUrl) throws IOException {
+ super(null);
this.streamUrl = streamUrl;
URL url = new URL(streamUrl);
this.streamUrl = streamUrl;
URL url = new URL(streamUrl);
@@ -124,7+116,7 @@ public class StreamSource extends AbstractControlledComponent implements Source
throw new IllegalArgumentException(String.format("Invalid Metadata Interval header: %s", metadataIntervalHeader));
}
throw new IllegalArgumentException(String.format("Invalid Metadata Interval header: %s", metadataIntervalHeader));
}
- metadata = new Metadata(new FormatMetadata(audioParameters.get("ice-channels"), audioParameters.get("ice-samplerate"), "MP3"), new ContentMetadata());
+ metadataUpdated(new Metadata(new FormatMetadata(audioParameters.get("ice-channels"), audioParameters.get("ice-samplerate"), "MP3"), new ContentMetadata()));
metadataStream = new MetadataStream(new BufferedInputStream(httpUrlConnection.getInputStream()), metadataInterval);