Examples of TrackCollection


Examples of com.jitcaforwin.extended.collections.TrackCollection

   * {@inheritDoc}
   */
  public TrackCollection getTracks(String name) {
    try {
      IITTrackCollection searchResult = this.itLibrary.search(name, ITPlaylistSearchField.SongNames());
      return new TrackCollection(this, searchResult);
    } catch (PlaylistDeletedException e) {
      throw new ITObjectDeletedError(this);
    }

  }
View Full Code Here

Examples of com.jitcaforwin.extended.collections.TrackCollection

  protected ArtistImpl(String name, Source source) {
    super(source.isLazy());
    this.source = source;
    this.name = name;
    this.tracks = new TrackCollection(this.source, TrackCollection.DUPLICATES_NOT_ALLOWED);
    this.tracksAsComposer = new TrackCollection(this.source, TrackCollection.DUPLICATES_NOT_ALLOWED);
    if (!this.lazy) {
      this.loadAllTracks();
    }
  }
View Full Code Here

Examples of com.jitcaforwin.extended.collections.TrackCollection

   */
  public TrackCollection lastPlayed(int num) {
    try {
      PlayedTracksList playedTracks = new PlayedTracksList(this.library, this.iTunes.getLibraryPlaylist()
          .getTracks());
      TrackCollection tracks = new TrackCollection(this.library, TrackCollection.DUPLICATES_NOT_ALLOWED);

      for (int i = playedTracks.size() - 1; i >= playedTracks.size() - num; i--) {
        tracks.add(playedTracks.get(i).getTrack());
      }
      return tracks;
    } catch (PlaylistDeletedException e) {
      throw new ITObjectDeletedError(null);
    }
View Full Code Here

Examples of com.jitcaforwin.extended.collections.TrackCollection

   */
  public TrackCollection lastPlayed(JitcaDate since) {
    try {
      PlayedTracksList playedTracks = new PlayedTracksList(this.library, this.iTunes.getLibraryPlaylist()
          .getTracks(), since);
      TrackCollection tracks = new TrackCollection(this.library, TrackCollection.DUPLICATES_NOT_ALLOWED);

      for (PlayedTracksListElement playedTrack : playedTracks) {
        tracks.add(playedTrack.getTrack());
      }
      return tracks;
    } catch (PlaylistDeletedException e) {
      throw new ITObjectDeletedError(null);
    }
View Full Code Here

Examples of com.jitcaforwin.extended.collections.TrackCollection

      IJitcaITunesController iTunes = new JitcaiTunesController(true);
      UserLibrary library = iTunes.getLibrary();
   
      Artist michaelJackson = library.getArtist("Michael Jackson");
      michaelJackson.loadAllTracks();
      TrackCollection tracks = michaelJackson.getTracks();
     
     
      System.out.println("The following tracks of \"" + michaelJackson.getName() + "\" are in your library:");
      for (Track track : tracks){
        System.out.println("\"" + track.getTitle() + "\" (" + track.getAlbum() + ")");
View Full Code Here

Examples of com.jitcaforwin.extended.collections.TrackCollection

  public static void main(String args[]){
    try {
      System.out.println("Note: The following operations could take a while for large libraries.");
      IJitcaITunesController iTunes = new JitcaiTunesController(true);
     
      TrackCollection tracksLastPlayed = iTunes.getTrackController().lastPlayed(10);
     
      System.out.println("The following tracks were played recently:");
      for (Track track : tracksLastPlayed){
        System.out.println("\"" + track.getTitle() + "\" (" + track.getAlbum() + ")");
      }
     
      final long millisecondsOfDay = 24 * 60 * 60 * 1000;
      TrackCollection tracksPlayedToday = iTunes.getTrackController().lastPlayed(new JitcaDate(new Date(System.currentTimeMillis()-millisecondsOfDay)));
     
      System.out.println("The following tracks were played during the last 24 hours:");
      for (Track track : tracksPlayedToday){
        System.out.println("\"" + track.getTitle() + "\" (" + track.getAlbum() + ")");
      }
View Full Code Here

Examples of com.jitcaforwin.extended.collections.TrackCollection

    IJitcaITunesController iTunes = new JitcaiTunesController(true);
    UserLibrary library = iTunes.getLibrary();

    Artist michaelJackson = library.getArtist("Michael Jackson");
    michaelJackson.loadAllTracks();
    TrackCollection tracks = michaelJackson.getTracks();

    System.out.println("The following tracks of \"" + michaelJackson.getName() + "\" are in your library:");
    for (Track track : tracks) {
      System.out.println("\"" + track.getTitle() + "\" (" + track.getAlbum() + ")");
    }
View Full Code Here

Examples of com.jitcaforwin.extended.collections.TrackCollection

 
  public static void main(String args[]){
    System.out.println("Note: The following operations could take a while for large libraries.");
    IJitcaITunesController iTunes = new JitcaiTunesController(true);
   
    TrackCollection tracksLastPlayed = iTunes.getTrackController().lastPlayed(10);
   
    System.out.println("The following tracks were played recently:");
    for (Track track : tracksLastPlayed){
      System.out.println("\"" + track.getTitle() + "\" (" + track.getAlbum() + ")");
    }
   
    final long millisecondsOfDay = 24 * 60 * 60 * 1000;
    TrackCollection tracksPlayedToday = iTunes.getTrackController().lastPlayed(new JitcaDate(new Date(System.currentTimeMillis()-millisecondsOfDay)));
   
    System.out.println("The following tracks were played during the last 24 hours:");
    for (Track track : tracksPlayedToday){
      System.out.println("\"" + track.getTitle() + "\" (" + track.getAlbum() + ")");
    }
View Full Code Here

Examples of com.jitcaforwin.extended.collections.TrackCollection

  private boolean loadedFromITunes;
 
  public GenreImpl(String name, Source source){
    this.source = source;
    this.name = name;
    tracks = new TrackCollection(this.source, TrackCollection.DUPLICATES_NOT_ALLOWED);
    this.loadedFromITunes = false; // All tracks of a genre are loaded from iTunes, when they are needed.
  }
View Full Code Here

Examples of com.jitcaforwin.extended.collections.TrackCollection

  public AlbumImpl(String title, Artist artist, Source source) {
    super(source.isLazy());
    this.source = source;
    this.title = title;
    this.artist = artist;
    this.tracks = new TrackCollection(this.source.isLazy(), this.source, TrackCollection.DUPLICATES_NOT_ALLOWED);
    if (!this.lazy){
      this.loadAllTracks();
    }
  }
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.