Examples of Playlist


Examples of net.roarsoftware.lastfm.Playlist

    }
    return recentStations.get(0);
  }

  private List<Track> getPlayListTracks(Radio radio) {
    Playlist playlist = radio.getPlaylist();
    return new ArrayList<Track>(playlist.getTracks());
  }
View Full Code Here

Examples of org.internna.iwebmvc.model.core.PlayList

    }

    @Override
    @SuppressWarnings("unchecked")
    public void setAsText(String text) throws IllegalArgumentException {
        PlayList docs = (PlayList) getValue();
        if (docs == null) docs = new PlayList();
        for (String doc : text.split("##")) {
            if (StringUtils.hasText(doc)) {
                if (doc.startsWith("-")) {
                    Iterator<Audio> it = docs.getPlayList().iterator();
                    while (it.hasNext()) {
                        Audio d = it.next();
                        if (doc.substring(1).equals(d.getUri())) it.remove();
                    }
                } else {
                    Audio document = getAudio(doc);
                    if (document != null) docs.addAudio(document);
                }
            }
        }
        setValue(docs);
    }
View Full Code Here

Examples of org.jampa.model.playlists.Playlist

   
    byte[] buf = new byte[1024];
    try {
      ZipOutputStream out = new ZipOutputStream(new FileOutputStream(_path));
     
      Playlist playlist;
      InputStream in;
      String name;
      Iterator<String> iter = _playlists.iterator();
      while (iter.hasNext()) {
        if (monitor.isCanceled()) {
          out.close();
          return;
        }       
       
        playlist = Controller.getInstance().getPlaylistController().getPlaylistByName(iter.next());
       
        monitor.subTask(Messages.getString("PlaylistExporter.ExportPlaylist") + " " + playlist.getName()); //$NON-NLS-1$ //$NON-NLS-2$
       
        if (playlist != null) {     
          if (_format == PlaylistFormat.XSPF) {
            name = playlist.getName() + SystemUtils.playlistXSPFExtension;
            in = playlist.getPlaylistStreamAsXSPF();
          } else {
            name = playlist.getName() + SystemUtils.playlistM3UExtension;
            in = playlist.getPlaylistStreamAsM3U();
          }
         
          // Add ZIP entry to output stream.
                out.putNextEntry(new ZipEntry(name));
View Full Code Here

Examples of org.jampa.model.playlists.Playlist

      Log.getInstance(PlaylistExporter.class).error("Error while writting file : " + _path);     //$NON-NLS-1$
    }   
  }
 
  private void writeSelectedPlaylistsToDirectory(IProgressMonitor monitor) {
    Playlist playlist;
    Iterator<String> iter = _playlists.iterator();
    while (iter.hasNext()) {
      if (monitor.isCanceled())
        return;     
     
      playlist = Controller.getInstance().getPlaylistController().getPlaylistByName(iter.next());
     
      monitor.subTask(Messages.getString("PlaylistExporter.ExportPlaylist") + " " + playlist.getName()); //$NON-NLS-1$ //$NON-NLS-2$
     
      if (playlist != null) {
        playlist.writePlaylistToDirectory(_path, _format);
      }
      monitor.worked(1);
    }
  }
View Full Code Here

Examples of org.jampa.model.playlists.Playlist

  @Override
  public Object execute(ExecutionEvent event) throws ExecutionException {
    IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
    ISelection selection = window.getActivePage().getSelection();

    Playlist item;
    Iterator iter = ((IStructuredSelection)selection).iterator();
   
    while (iter.hasNext()) {
      item = (Playlist) iter.next();
      Log.getInstance(MenuOpenPlaylistHandler.class).debug("Openning playlist: " + item.getName()); //$NON-NLS-1$
      new OpenPlaylistAction(item.getName()).run();
    }
    return null;
  }
View Full Code Here

Examples of org.jampa.model.playlists.Playlist

 
  private void doCheckPlaylists(IProgressMonitor monitor) {
   
    _removedList = new HashMap<AudioItem, String>();
   
    Playlist item;
    AudioItem audioItem;
    File file;
    List<AudioItem> _toRemove = new ArrayList<AudioItem>();
   
    for (int i = 0; i < _playlists.length; i++) {
      if (monitor.isCanceled())
        return;
      item = (Playlist)_playlists[i];
      monitor.subTask(item.getName());
     
      _toRemove.clear();

      Iterator<AudioItem> iter = item.getAudioList().iterator();     
      while (iter.hasNext()) {
        audioItem = iter.next();
        file = new File(audioItem.getFileName());
        if (!file.exists()) {
          Log.getInstance(PlaylistChecker.class).info("File not found in playlist: " + item.getName() + " / " + audioItem.getFileName()); //$NON-NLS-1$ //$NON-NLS-2$         
          _removedList.put(audioItem, item.getName());
          _toRemove.add(audioItem);
        }
      }
                 
      monitor.worked(1);
View Full Code Here

Examples of org.jampa.model.playlists.Playlist

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

Examples of org.jampa.model.playlists.Playlist

  @Override
  public Object execute(ExecutionEvent event) throws ExecutionException {
    IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
    ISelection selection = window.getActivePage().getSelection();

    Playlist item;
    Playlist firstItem = null;
    Iterator iter = ((IStructuredSelection)selection).iterator();
   
    while (iter.hasNext()) {
      item = (Playlist) iter.next();
     
      if (firstItem == null) {
        firstItem = item;
      }
     
      Log.getInstance(MenuOpenPlaylistHandler.class).debug("Openning playlist: " + item.getName()); //$NON-NLS-1$
      new OpenPlaylistAction(item.getName()).run();
    }
   
    if (firstItem != null) {
      IAudioItem firstAudioItem = firstItem.getAudioItemByIndex(0);
      Controller.getInstance().getPlaylistController().playFile(firstItem, firstAudioItem);
    }
    return null;
  }
View Full Code Here

Examples of org.jampa.model.playlists.Playlist

  public void run() {
    if ((_playlistName != null) &&
        (!_playlistName.isEmpty())) {
     
      try {
        Playlist playlistItem = Controller.getInstance().getPlaylistController().getPlaylistByName(_playlistName);
        IAudioItem firstAudioItem = playlistItem.getAudioItemByIndex(0);
       
        new OpenPlaylistAction(playlistItem.getName()).run();
        Controller.getInstance().getPlaylistController().playFile(playlistItem, firstAudioItem);
       
      } catch (Exception e) {
        Log.getInstance(OpenAndPlayPlaylistAction.class).error("Error while opening and playing playlist: " + e.getMessage());   //$NON-NLS-1$
      }
View Full Code Here

Examples of org.jampa.model.playlists.Playlist

    }
  }   
 
  public void importPlaylist(String playlistName, String fileName) {
    if (!_items.containsKey(playlistName)) {
      Playlist newPlaylist = new Playlist(playlistName, fileName);
      newPlaylist.setPosition(_items.size());
      newPlaylist.updateFileName();
      _items.put(playlistName, newPlaylist);
      Controller.getInstance().getEventController().firePlaylistChange(EventConstants.EVT_ADD_PLAYLIST, null, newPlaylist);
    }
  }
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.