Package com.jitcaforwin.basic.api

Examples of com.jitcaforwin.basic.api.IITTrackCollection


   * @return All tracks in the library of the specified artist.
   * @throws JitcaException
   *             if an error occurs.
   */
  public TrackCollection getTracksOfArtist(String artist) {
    IITTrackCollection itTracks = this.tracksArtist.get(artist);
    if (itTracks == null) {
      itTracks = this.loadTracksOfArtist(artist);
      this.tracksArtist.put(artist, itTracks);
    }
    return this.createTrackCollection(itTracks);
View Full Code Here


   * @return All tracks in the library of the specified composer.
   * @throws JitcaException
   *             if an error occurs.
   */
  public TrackCollection getTracksOfComposer(String composer) {
    IITTrackCollection itTracks = this.tracksComposer.get(composer);
    if (itTracks == null) {
      itTracks = this.loadTracksOfComposer(composer);
      this.tracksComposer.put(composer, itTracks);
    }
    return this.createTrackCollection(itTracks);
View Full Code Here

   * @return All tracks of the specified album.
   * @throws JitcaException
   *             if an error occurs.
   */
  public TrackCollection getTracksOfAlbum(String album) {
    IITTrackCollection itTracks = this.tracksAlbum.get(album);
    if (itTracks == null) {
      itTracks = this.loadTracksOfAlbum(album);
      this.tracksAlbum.put(album, itTracks);
    }
    return this.createTrackCollection(itTracks);
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public Track getTrack(String name) throws LibrarySearchException {
    try {
      IITTrackCollection searchResult = this.itLibrary.search(name, ITPlaylistSearchField.SongNames());
      if (searchResult.getCount() > 1) {
        throw new LibrarySearchException("There are multiple tracks with the specified name \"" + name + "\"");
      } else if (searchResult.getCount() == 0) {
        return null; // no track found
      }
      return new TrackCollection(this, searchResult).getFirst();
    } catch (ObjectDeletedException e) {
      throw new ITObjectDeletedError(this);
View Full Code Here

  /**
   * {@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

  public static void main(String args[]) {
    try {
      IiTunes iTunes = new iTunesApp();

      IITTrackCollection selectedTracks = iTunes.getSelectedTracks();

      if (selectedTracks == null) {
        System.out.println("No tracks selected!");
      } else {
        IITUserPlaylist newPlaylist = iTunes.createPlaylist(
            "SelectedTracks").getUserPlaylist();

        boolean hasNext = true;
        int i = 1;

        while (hasNext) {
          IITTrack track = selectedTracks.item(i);
          if (track == null) {
            hasNext = false;
          } else {
            System.out.println(track.getName() + " by "
                + track.getArtist() + " added to playlist.");
View Full Code Here

public class TrackBufferTest {

  @Test
  public void testTrackBuffer(){
    IITTrackCollection collectionMock = EasyMock.createMock(IITTrackCollection.class);
    Clock clockMock = EasyMock.createMock(Clock.class);
   
    EasyMock.expect(clockMock.currentTime()).andReturn(System.currentTimeMillis()).anyTimes();
    EasyMock.replay(collectionMock);
    EasyMock.replay(clockMock);
View Full Code Here

    assertTrue(buffer.get("Test-Collection").equals(collectionMock));
  }
 
  @Test
  public void testTrackBufferCleanup(){
    IITTrackCollection collectionMock = EasyMock.createMock(IITTrackCollection.class);
    Clock clockMock = EasyMock.createMock(Clock.class);
   
    EasyMock.expect(clockMock.currentTime()).andReturn(0l);
    EasyMock.expect(clockMock.currentTime()).andReturn(0l);
    EasyMock.expect(clockMock.currentTime()).andReturn(0l);
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public Track getTrack(String name) throws LibrarySearchException {
    try {
      IITTrackCollection searchResult = this.itLibrary.search(name, ITPlaylistSearchField.SongNames());
      if (searchResult.getCount() > 1) {
        throw new LibrarySearchException("There are multiple tracks with the specified name \"" + name + "\"");
      } else if (searchResult.getCount() == 0) {
        return null; // no track found
      }
      return new TrackCollectionImpl(this, searchResult).getFirst();
    } catch (ObjectDeletedException e) {
      throw new ITObjectDeletedError(this);
View Full Code Here

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

View Full Code Here

TOP

Related Classes of com.jitcaforwin.basic.api.IITTrackCollection

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.