Search in sources :

Example 1 with TranscodeTargetListener

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();
            }
        }
    });
}
Also used : TranscodeTargetListener(com.biglybt.core.devices.TranscodeTargetListener) TranscodeFile(com.biglybt.core.devices.TranscodeFile)

Aggregations

TranscodeFile (com.biglybt.core.devices.TranscodeFile)1 TranscodeTargetListener (com.biglybt.core.devices.TranscodeTargetListener)1