use of com.biglybt.core.devices.TranscodeTargetListener in project BiglyBT by BiglySoftware.
the class DeviceMediaRendererManual method initialise.
@Override
protected void initialise() {
super.initialise();
if (getPersistentBooleanProperty(PP_COPY_OUTSTANDING, false)) {
setCopyOutstanding();
}
addListener(new TranscodeTargetListener() {
@Override
public void fileAdded(TranscodeFile file) {
updateStatus(file);
}
@Override
public void fileChanged(TranscodeFile file, int type, Object data) {
updateStatus(file);
}
@Override
public void fileRemoved(TranscodeFile file) {
// do this to pick up change in copy-to-device state caused by removal
setCopyOutstanding();
}
private void updateStatus(TranscodeFile file) {
if (file.isComplete() && !file.isCopiedToDevice()) {
setCopyOutstanding();
}
}
});
}
Aggregations