package net.pterodactylus.sonitus.data.filter;
-import net.pterodactylus.sonitus.data.ConnectException;
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.io.IOException;
+
import net.pterodactylus.sonitus.data.Metadata;
-import net.pterodactylus.sonitus.data.Source;
-import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
+import com.google.common.eventbus.EventBus;
/**
* Ogg Vorbis decoder that uses {@code oggdec} (from the {@code vorbis-tools}
/**
* Creates a new Ogg Vorbis decoder.
*
+ * @param eventBus
+ * The event bus
* @param binary
* The location of the binary
*/
- public OggVorbisDecoder(String binary) {
+ public OggVorbisDecoder(EventBus eventBus, String binary) {
+ super(eventBus, "Ogg Vorbis Decoder");
this.binary = binary;
}
}
@Override
- public void connect(Source source) throws ConnectException {
- Preconditions.checkNotNull(source, "source must not be null");
- Preconditions.checkArgument(source.metadata().encoding().equalsIgnoreCase("Vorbis"), "source must be Vorbis-encoded");
+ public void open(Metadata metadata) throws IOException {
+ checkNotNull(metadata, "metadata must not be null");
+ checkArgument(metadata.encoding().equalsIgnoreCase("Vorbis"), "source must be Vorbis-encoded");
- super.connect(source);
+ super.open(metadata);
}
//