Search in sources :

Example 11 with TranscodeFile

use of com.biglybt.core.devices.TranscodeFile in project BiglyBT by BiglySoftware.

the class ColumnTJ_Category method refresh.

// @see com.biglybt.pif.ui.tables.TableCellRefreshListener#refresh(com.biglybt.pif.ui.tables.TableCell)
@Override
public void refresh(TableCell cell) {
    TranscodeFile tf = (TranscodeFile) cell.getDataSource();
    if (tf == null) {
        return;
    }
    String[] cats = tf.getCategories();
    String str = "";
    for (String cat : cats) {
        str += (str.length() == 0 ? "" : ",") + cat;
    }
    cell.setText(str);
}
Also used : TranscodeFile(com.biglybt.core.devices.TranscodeFile)

Example 12 with TranscodeFile

use of com.biglybt.core.devices.TranscodeFile in project BiglyBT by BiglySoftware.

the class ColumnTJ_CopiedToDevice method refresh.

@Override
public void refresh(TableCell cell) {
    TranscodeFile tf = (TranscodeFile) cell.getDataSource();
    if (tf == null) {
        return;
    }
    Device d = tf.getDevice();
    String value = null;
    if (d instanceof DeviceMediaRenderer) {
        DeviceMediaRenderer dmr = (DeviceMediaRenderer) d;
        if (!(dmr.canCopyToDevice() || dmr.canCopyToFolder())) {
            value = na_text;
        }
    }
    if (value == null) {
        value = DisplayFormatters.getYesNo(tf.isCopiedToDevice());
    }
    if (cell.setSortValue(value) || !cell.isValid()) {
        cell.setText(value);
    }
}
Also used : Device(com.biglybt.core.devices.Device) DeviceMediaRenderer(com.biglybt.core.devices.DeviceMediaRenderer) TranscodeFile(com.biglybt.core.devices.TranscodeFile)

Example 13 with TranscodeFile

use of com.biglybt.core.devices.TranscodeFile 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)

Example 14 with TranscodeFile

use of com.biglybt.core.devices.TranscodeFile in project BiglyBT by BiglySoftware.

the class ColumnTJ_Resolution method refresh.

// @see com.biglybt.pif.ui.tables.TableCellRefreshListener#refresh(com.biglybt.pif.ui.tables.TableCell)
@Override
public void refresh(TableCell cell) {
    TranscodeFile tf = (TranscodeFile) cell.getDataSource();
    if (tf == null) {
        return;
    }
    long width = tf.getVideoWidth();
    long height = tf.getVideoHeight();
    cell.setText((width == 0 || height == 0) ? "" : (width + "x" + height));
}
Also used : TranscodeFile(com.biglybt.core.devices.TranscodeFile)

Aggregations

TranscodeFile (com.biglybt.core.devices.TranscodeFile)14 TranscodeJob (com.biglybt.core.devices.TranscodeJob)4 DownloadManager (com.biglybt.core.download.DownloadManager)2 DiskManagerFileInfo (com.biglybt.pif.disk.DiskManagerFileInfo)2 DownloadException (com.biglybt.pif.download.DownloadException)2 ISelectedContent (com.biglybt.ui.selectedcontent.ISelectedContent)2 ActivitiesEntry (com.biglybt.activities.ActivitiesEntry)1 Device (com.biglybt.core.devices.Device)1 DeviceMediaRenderer (com.biglybt.core.devices.DeviceMediaRenderer)1 TranscodeTargetListener (com.biglybt.core.devices.TranscodeTargetListener)1 GlobalManager (com.biglybt.core.global.GlobalManager)1 TagDownload (com.biglybt.core.tag.TagDownload)1 TOTorrent (com.biglybt.core.torrent.TOTorrent)1 HashWrapper (com.biglybt.core.util.HashWrapper)1 Download (com.biglybt.pif.download.Download)1 Torrent (com.biglybt.pif.torrent.Torrent)1 ImageLoader (com.biglybt.ui.swt.imageloader.ImageLoader)1