Examples of Podcast


Examples of org.jampa.model.podcasts.Podcast

      Menu playPodcastMenu = new Menu(trayMenu);
      playPodcastItem.setMenu(playPodcastMenu);
     
      Iterator<Podcast> podcastIter = Controller.getInstance().getPlaylistController().getPodcastListAsList().iterator();
      while (podcastIter.hasNext()) {
        Podcast podcastItem = podcastIter.next();
        final MenuItem podcastMenuItem = new MenuItem(playPodcastMenu, SWT.PUSH);
        podcastMenuItem.setText(podcastItem.getName() + " - " + podcastItem.getTitle());
        podcastMenuItem.setData(podcastItem);
       
        podcastMenuItem.addSelectionListener(new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            new PlayPodcastAction(((Podcast) podcastMenuItem.getData()).getName()).run();
View Full Code Here

Examples of org.jampa.model.podcasts.Podcast

    } else
      return null;
  }
 
  public void addPodcast(String name, String url) {
    Podcast podcast = new Podcast(name, "", url, "");
    podcast.setPosition(_podcastItems.size());
    podcast.download();
    podcast.parseData();
    _podcastItems.put(podcast.getName(), podcast);
   
    Controller.getInstance().getEventController().firePlaylistChange(EventConstants.EVT_ADD_PLAYLIST, null, name);
  }
View Full Code Here

Examples of org.jampa.model.podcasts.Podcast

  }
 
  public boolean renamePodcast(String newPodcastName, String oldPodcastName) {
    if (_podcastItems.containsKey(oldPodcastName)) {
     
      Podcast newPodcast = new Podcast(_podcastItems.get(oldPodcastName));
      newPodcast.setName(newPodcastName);
      _podcastItems.put(newPodcastName, newPodcast);
     
      removePodcast(oldPodcastName);
     
      Controller.getInstance().getEventController().firePlaylistChange(EventConstants.EVT_ADD_PLAYLIST, null, newPodcast);
View Full Code Here

Examples of org.jampa.model.podcasts.Podcast

    }
  }
 
  public void removePodcast(String podcastName) {
    if (_podcastItems.containsKey(podcastName)) {
      Podcast podcast;
      podcast = _podcastItems.remove(podcastName);
     
      if (podcast.hasAudioItemPlaying()) {
        stopPlayback();
      }
     
      if (!_podcastItemsToDelete.containsKey(podcastName)) {
        _podcastItemsToDelete.put(podcastName, podcast);
View Full Code Here

Examples of org.jampa.model.podcasts.Podcast

  public List<Podcast> getPodcastListAsList() {
    List<Podcast> tmpList = new ArrayList<Podcast>();
   
    Set<String> keys = _podcastItems.keySet();
    Iterator<String> iter = keys.iterator();
    Podcast item;
    while (iter.hasNext()) {
      item = _podcastItems.get(iter.next());     
      tmpList.add(item);
    }
   
View Full Code Here

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

Examples of org.jampa.model.podcasts.Podcast

      }
    }
  }
 
  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

Examples of org.jampa.model.podcasts.Podcast

      }
    };
   
    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

Examples of org.jampa.model.podcasts.Podcast

  }
 
  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

Examples of org.jampa.model.podcasts.Podcast

      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
Copyright © 2018 www.massapi.com. 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.