Package org.jampa.model.podcasts

Examples of org.jampa.model.podcasts.Podcast


    return tmpList;
  }
 
  private void updatePodcastsPosition(List<Podcast> list) {
    int index = 0;
    Podcast item;
    Iterator<Podcast> iter = list.iterator();
    while (iter.hasNext()) {
      item = iter.next();
      if (_podcastItems.containsKey(item.getName())) {
        _podcastItems.get(item.getName()).setPosition(index);
        index++;
      }
    }
  }
View Full Code Here


      }
    }
  }
 
  public void movePodcast(Podcast podcast, int toIndex) {
    Podcast item;
    int fromIndex = podcast.getPosition();
    boolean directionDown = (toIndex > fromIndex);
   
    Set<String> keySet = _podcastItems.keySet();
    Iterator<String> iter = keySet.iterator();
    while (iter.hasNext()) {
      item = _podcastItems.get(iter.next());
     
      if (item != podcast) {
        if (directionDown) {
          if ((item.getPosition() > fromIndex) &&
              (item.getPosition() <= toIndex)) {
            item.setPosition(item.getPosition() - 1);
          }
        } else {
          if ((item.getPosition() >= toIndex) &&
              (item.getPosition() < fromIndex)) {
            item.setPosition(item.getPosition() + 1);
          }
        }
      }
    }
    podcast.setPosition(toIndex);
View Full Code Here

      }
    };
   
    String name;
    String[] files = podcastDir.list(filter);
    Podcast podcast;

    for (int i = 0; i < files.length; i++) {
      name = files[i].substring(0, files[i].lastIndexOf(SystemUtils.podcastExtension));
      podcast = new Podcast(name, "", "", "");
      podcast.loadFromDisk();
      _podcastItems.put(name, podcast);
    }
   
  }
View Full Code Here

  }
 
  public void writePodcasts() {
    Log.getInstance(PlaylistController.class).debug("Writting podcasts to: " + SystemUtils.podcastDirectory); //$NON-NLS-1$
   
    Podcast item;
    Set<String> keys;
    Iterator<String> iter;
   
    keys = _podcastItemsToDelete.keySet();
    iter = keys.iterator();
   
    while (iter.hasNext()) {
      item = _podcastItemsToDelete.get(iter.next());
      item.deletePodcast();
    }
   
    keys = _podcastItems.keySet();
    iter = keys.iterator();
   
    while (iter.hasNext()) {
      item = _podcastItems.get(iter.next());
      item.writeToDisk();
    }
  }
View Full Code Here

      nbTask++;
    }
   
    monitor.beginTask(Messages.getString("PodcastUpdaterJob.MainTask"), nbTask);
   
    Podcast podcast;
    PodcastUpdater downloader;
    Iterator<Podcast> iter = _list.iterator();
    while (iter.hasNext()) {
      podcast = iter.next();
     
      Log.getInstance(PodcastUpdaterJob.class).debug("Refreshing podcast: " + podcast.getName());
      monitor.subTask(podcast.getName());
     
      if (monitor.isCanceled()) {
        return Status.CANCEL_STATUS;
      }
     
      downloader = new PodcastUpdater(podcast.getUrl());
      if (downloader.download()) {
        podcast.setData(downloader.getData());
        Log.getInstance(PodcastUpdaterJob.class).debug("Parsing data for podcast: " + podcast.getName());
        _newItemsCount += podcast.parseData();
       
        Controller.getInstance().getEventController().fireAudioItemChange(EventConstants.EVT_ITEM_CHANGE_IN_PLAYLIST, null, null);
      }
      monitor.worked(1);
    }
View Full Code Here

TOP

Related Classes of org.jampa.model.podcasts.Podcast

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.