コード例 #1
0
ファイル: PlayUtils.java プロジェクト: nuclearrussian/LPS
  public static boolean canStreamDS(Object ds, int file_index) {
    if (!(Constants.isWindows || Constants.isOSX)) {

      return (false);
    }

    if (ds == null) {

      return (false);
    }

    if (ds instanceof org.gudy.azureus2.core3.disk.DiskManagerFileInfo) {
      org.gudy.azureus2.core3.disk.DiskManagerFileInfo fi =
          (org.gudy.azureus2.core3.disk.DiskManagerFileInfo) ds;
      return canStreamDS(fi.getDownloadManager(), fi.getIndex());
    }

    DownloadManager dm = DataSourceUtils.getDM(ds);

    if (dm != null) {

      return (canStream(dm, file_index));
    }

    return (false);
  }
コード例 #2
0
ファイル: PlayUtils.java プロジェクト: nuclearrussian/LPS
  public static boolean canPlayDS(Object ds, int file_index) {

    if (!(Constants.isWindows || Constants.isOSX)) {

      return (false);
    }

    if (ds == null) {
      return false;
    }

    if (ds instanceof org.gudy.azureus2.core3.disk.DiskManagerFileInfo) {
      org.gudy.azureus2.core3.disk.DiskManagerFileInfo fi =
          (org.gudy.azureus2.core3.disk.DiskManagerFileInfo) ds;
      return canPlayDS(fi.getDownloadManager(), fi.getIndex());
    }

    DownloadManager dm = DataSourceUtils.getDM(ds);
    if (dm != null) {
      return canPlay(dm, file_index);
    }
    TOTorrent torrent = DataSourceUtils.getTorrent(ds);
    if (torrent != null) {
      return canPlay(torrent, file_index);
    }
    if (ds instanceof VuzeActivitiesEntry) {
      return ((VuzeActivitiesEntry) ds).isPlayable();
    }

    if (ds instanceof SelectedContentV3) {
      SelectedContentV3 sel = (SelectedContentV3) ds;
      return sel.canPlay();
    }

    return false;
  }
コード例 #3
0
 @Before
 public void setUp() {
   dataSource = DataSourceUtils.createLocal();
   dbUtils = new DbUtils(dataSource);
 }