From 7c0955003c1eb215da5f763e986e99e68206a086 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 16 Mar 2013 19:52:52 +0100 Subject: [PATCH] Add method to notify sink when a source has updated its metadata. --- src/main/java/net/pterodactylus/sonitus/data/Sink.java | 3 +++ .../java/net/pterodactylus/sonitus/data/filter/ExternalFilter.java | 5 +++++ .../net/pterodactylus/sonitus/data/filter/MultiSourceFilter.java | 5 +++++ .../net/pterodactylus/sonitus/data/filter/RateLimitingFilter.java | 5 +++++ src/main/java/net/pterodactylus/sonitus/data/sink/AudioSink.java | 5 +++++ src/main/java/net/pterodactylus/sonitus/data/sink/FileSink.java | 5 +++++ src/main/java/net/pterodactylus/sonitus/data/sink/Icecast2Sink.java | 4 ++++ 7 files changed, 32 insertions(+) diff --git a/src/main/java/net/pterodactylus/sonitus/data/Sink.java b/src/main/java/net/pterodactylus/sonitus/data/Sink.java index 5ca6a79..7f6ce6b 100644 --- a/src/main/java/net/pterodactylus/sonitus/data/Sink.java +++ b/src/main/java/net/pterodactylus/sonitus/data/Sink.java @@ -36,4 +36,7 @@ public interface Sink { */ void connect(Source source) throws ConnectException; + /** Notifies the sink that a source has updated its metadata. */ + void metadataUpdated(); + } diff --git a/src/main/java/net/pterodactylus/sonitus/data/filter/ExternalFilter.java b/src/main/java/net/pterodactylus/sonitus/data/filter/ExternalFilter.java index 3bfb774..3452c76 100644 --- a/src/main/java/net/pterodactylus/sonitus/data/filter/ExternalFilter.java +++ b/src/main/java/net/pterodactylus/sonitus/data/filter/ExternalFilter.java @@ -130,6 +130,11 @@ public abstract class ExternalFilter implements Filter { } } + @Override + public void metadataUpdated() { + /* ignore. */ + } + // // SUBCLASS METHODS // 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 33424ac..a505c92 100644 --- a/src/main/java/net/pterodactylus/sonitus/data/filter/MultiSourceFilter.java +++ b/src/main/java/net/pterodactylus/sonitus/data/filter/MultiSourceFilter.java @@ -108,6 +108,11 @@ public class MultiSourceFilter implements Filter, ReusableSink { } } + @Override + public void metadataUpdated() { + /* ignore. */ + } + /** * The connection feeds the input from the currently connected source to the * input stream that {@link #get(int)} will get its data from. diff --git a/src/main/java/net/pterodactylus/sonitus/data/filter/RateLimitingFilter.java b/src/main/java/net/pterodactylus/sonitus/data/filter/RateLimitingFilter.java index a573295..66ca8a7 100644 --- a/src/main/java/net/pterodactylus/sonitus/data/filter/RateLimitingFilter.java +++ b/src/main/java/net/pterodactylus/sonitus/data/filter/RateLimitingFilter.java @@ -133,4 +133,9 @@ public class RateLimitingFilter implements Filter { } } + @Override + public void metadataUpdated() { + /* ignore. */ + } + } diff --git a/src/main/java/net/pterodactylus/sonitus/data/sink/AudioSink.java b/src/main/java/net/pterodactylus/sonitus/data/sink/AudioSink.java index 1e4f6ec..520be04 100644 --- a/src/main/java/net/pterodactylus/sonitus/data/sink/AudioSink.java +++ b/src/main/java/net/pterodactylus/sonitus/data/sink/AudioSink.java @@ -76,4 +76,9 @@ public class AudioSink implements Sink { } } + @Override + public void metadataUpdated() { + /* ignore. */ + } + } diff --git a/src/main/java/net/pterodactylus/sonitus/data/sink/FileSink.java b/src/main/java/net/pterodactylus/sonitus/data/sink/FileSink.java index 015dd6f..61e0a27 100644 --- a/src/main/java/net/pterodactylus/sonitus/data/sink/FileSink.java +++ b/src/main/java/net/pterodactylus/sonitus/data/sink/FileSink.java @@ -81,4 +81,9 @@ public class FileSink implements Sink { } } + @Override + public void metadataUpdated() { + /* ignore. */ + } + } diff --git a/src/main/java/net/pterodactylus/sonitus/data/sink/Icecast2Sink.java b/src/main/java/net/pterodactylus/sonitus/data/sink/Icecast2Sink.java index 30801c6..7423588 100644 --- a/src/main/java/net/pterodactylus/sonitus/data/sink/Icecast2Sink.java +++ b/src/main/java/net/pterodactylus/sonitus/data/sink/Icecast2Sink.java @@ -157,6 +157,10 @@ public class Icecast2Sink implements Sink { } } + @Override + public void metadataUpdated() { + } + // // PRIVATE METHODS // -- 2.7.4