Create all controlled components with an event bus.
[sonitus.git] / src / main / java / net / pterodactylus / sonitus / data / source / StreamSource.java
index 9a624e0..a116d80 100644 (file)
@@ -35,6 +35,7 @@ import net.pterodactylus.sonitus.io.MetadataStream;
 
 import com.google.common.base.Optional;
 import com.google.common.collect.Maps;
+import com.google.common.eventbus.EventBus;
 import com.google.common.primitives.Ints;
 
 /**
@@ -47,6 +48,9 @@ import com.google.common.primitives.Ints;
  */
 public class StreamSource implements Source {
 
+       /** The event bus. */
+       private final EventBus eventBus;
+
        /** The URL of the stream. */
        private final String streamUrl;
 
@@ -64,12 +68,15 @@ public class StreamSource implements Source {
         * the response header for vital information (sampling frequency, number of
         * channels, etc.).
         *
+        * @param eventBus
+        *              The event bus
         * @param streamUrl
         *              The URL of the stream
         * @throws IOException
         *              if an I/O error occurs
         */
-       public StreamSource(String streamUrl) throws IOException {
+       public StreamSource(EventBus eventBus, String streamUrl) throws IOException {
+               this.eventBus = eventBus;
                this.streamUrl = streamUrl;
                URL url = new URL(streamUrl);