Package org.jampa.model.podcasts

Examples of org.jampa.model.podcasts.Podcast


    if ((_podcastName != null) &&
        (!_podcastName.isEmpty())) {
     
      try {
       
        Podcast podcastItem = Controller.getInstance().getPlaylistController().getPodcastByName(_podcastName);
        IAudioItem firstAudioItem = podcastItem.getAudioItemByIndex(0);
       
        new OpenPodcastAction(podcastItem.getName()).run();
        Controller.getInstance().getPlaylistController().playFile(podcastItem, firstAudioItem);
       
      } catch (Exception e) {
        Log.getInstance(OpenAndPlayPodcastAction.class).error("Error while opening and playing podcast: " + e.getMessage());   //$NON-NLS-1$
      }
View Full Code Here


 
  public void run() {
    if ((_podcastName != null) &&
        (!_podcastName.isEmpty())) {
      try {
      Podcast podcast = Controller.getInstance().getPlaylistController().getPodcastByName(_podcastName);
      IAudioItem firstAudioItem = podcast.getAudioItemByIndex(0);
      Controller.getInstance().getPlaylistController().playFile(podcast, firstAudioItem);
      } catch (Exception e) {
        Log.getInstance(PlayPodcastAction.class).error("Error while playing podcast: " + e.getMessage());   //$NON-NLS-1$
      }
    }
View Full Code Here

        if (Controller.getInstance().getDNDController().isPodcastListViewSource()) {
          // Get the current item.
          Point pt = Display.getCurrent().map(null, viewer.getTable(), event.x, event.y);
          TableItem item = viewer.getTable().getItem(pt);
         
          Podcast sourcePodcast = (Podcast) ((IStructuredSelection) viewer.getSelection()).getFirstElement();       
         
          int toIndex;
          if (item != null) {
            Podcast podcast = Controller.getInstance().getPlaylistController().getPodcastByName(((Podcast) item.getData()).getName());
            toIndex = podcast.getPosition();
          } else {
            toIndex = -1;
          }
         
          if (toIndex != -1) {
View Full Code Here

      return Controller.getInstance().getPlaylistController().getPodcastList();
    }
  } 
  class ViewLabelProvider extends LabelProvider implements ITableLabelProvider {
    public Image getImage(Object obj) {
      Podcast podcast = (Podcast) obj;
     
      if (Controller.getInstance().getPlaylistController().getCurrentPlaylist() == podcast) {
        if (Controller.getInstance().getEngine().isPaused()) {
          return _podcastPauseImage;
        } else {
View Full Code Here

    }
   
    public String getColumnText(Object obj, int index) {
      switch(index) {
      case 0 : {
        Podcast podcast = (Podcast) obj;
        String result = podcast.getName();
       
        int unreadCount = podcast.getUnreadItemsCount();
        if (unreadCount > 0) {
          result = "(" + Integer.toString(unreadCount) + ") " + result;
        }
       
        return result;     
View Full Code Here

      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

    } 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

  }
 
  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

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

  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

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.