From: David ‘Bombe’ Roden Date: Sat, 16 Mar 2013 17:54:52 +0000 (+0100) Subject: Inject event bus. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=cea54dd0028f59f9d670f7941366d96848fb25f7;p=sonitus.git Inject event bus. --- diff --git a/pom.xml b/pom.xml index 56eda58..b78f4ba 100644 --- a/pom.xml +++ b/pom.xml @@ -15,6 +15,11 @@ 14.0-rc1 + com.google.inject + guice + 3.0 + + org.jcraft jorbis 0.0.17 diff --git a/src/main/java/net/pterodactylus/sonitus/data/filter/MultiSourceFilter.java b/src/main/java/net/pterodactylus/sonitus/data/filter/MultiSourceFilter.java index 38e7473..3c3dc7a 100644 --- a/src/main/java/net/pterodactylus/sonitus/data/filter/MultiSourceFilter.java +++ b/src/main/java/net/pterodactylus/sonitus/data/filter/MultiSourceFilter.java @@ -35,6 +35,9 @@ import net.pterodactylus.sonitus.data.Format; import net.pterodactylus.sonitus.data.ReusableSink; import net.pterodactylus.sonitus.data.Source; +import com.google.common.eventbus.EventBus; +import com.google.inject.Inject; + /** * {@link ReusableSink} implementation that supports changing the source without * letting the {@link net.pterodactylus.sonitus.data.Sink} know. @@ -49,12 +52,20 @@ public class MultiSourceFilter implements Filter, ReusableSink { /** Object used for synchronization. */ private final Object syncObject = new Object(); + /** The event bus. */ + private final EventBus eventBus; + /** The connection. */ private Connection connection; /** The format. */ private Format format; + @Inject + public MultiSourceFilter(EventBus eventBus) { + this.eventBus = eventBus; + } + @Override public Format format() { return format;