public String name();
/**
+ * Returns the current metadata of this component.
+ *
+ * @return The current metadata of this component
+ */
+ public Metadata metadata();
+
+ /**
* Returns the controllers offered by this component.
*
* @return The controllers of this component
}
@Override
+ public Metadata metadata() {
+ return metadata;
+ }
+
+ @Override
public List<Controller<?>> controllers() {
return Arrays.<Controller<?>>asList(volumeFader, muteSwitch);
}
@Override
public void metadataUpdated(Metadata metadata) {
logger.info(String.format("Now playing %s.", metadata));
+ this.metadata = metadata;
}
@Override
private FileOutputStream fileOutputStream;
+ /** The current metadata. */
+ private Metadata metadata;
+
/**
* Creates a new file sink that will write to the given path.
*
}
@Override
+ public Metadata metadata() {
+ return metadata;
+ }
+
+ @Override
public List<Controller<?>> controllers() {
return Collections.emptyList();
}
@Override
public void open(Metadata metadata) throws IOException {
fileOutputStream = new FileOutputStream(path);
+ metadataUpdated(metadata);
}
@Override
@Override
public void metadataUpdated(Metadata metadata) {
- /* ignore. */
+ this.metadata = metadata;
}
@Override
private OutputStream socketOutputStream;
+ /** The current metadata. */
+ private Metadata metadata;
+
/**
* Creates a new Icecast2 sink.
*
}
@Override
+ public Metadata metadata() {
+ return metadata;
+ }
+
+ @Override
public List<Controller<?>> controllers() {
return Collections.emptyList();
}
@Override
public void metadataUpdated(final Metadata metadata) {
+ this.metadata = metadata;
new Thread(new Runnable() {
@Override
if (!streamMetadata.isPresent()) {
return metadata;
}
- return metadata = metadata.title(streamMetadata.get().title());
+ metadata = metadata.title(streamMetadata.get().title());
+ return metadata;
}
@Override