Package com.jitcaforwin.extended.api.track

Examples of com.jitcaforwin.extended.api.track.Track


    if (itTrackCollection == null) {
      return; // ITTrackCollection is empty
    }
    try {
      for (int i = 1; i < itTrackCollection.getCount() + 1; i++) {
        Track track = this.trackFactory.getTrack(itTrackCollection.itemByPlayOrder(i));
        this.add(track, i - 1);
      }
    } catch (PlaylistDeletedException e) {
      throw new JitcaUnexpectedError();
    } catch (ObjectDeletedException e) {
View Full Code Here


  @Test
  public void testGetNoneId3Genres() {
    Playlist playlistMock = EasyMock.createMock(Playlist.class);
    TrackCollection tracksMock = EasyMock.createMock(TrackCollection.class);
    Set<Track> tracks = new HashSet<Track>();
    Track trackMock1 = EasyMock.createMock(Track.class);
    Track trackMock2 = EasyMock.createMock(Track.class);
    Track trackMock3 = EasyMock.createMock(Track.class);
    Genre genreMockA = EasyMock.createMock(Genre.class);
    Genre genreMockB = EasyMock.createMock(Genre.class);

    tracks.add(trackMock1);
    tracks.add(trackMock2);
    tracks.add(trackMock3);
    EasyMock.expect(playlistMock.getTracks()).andReturn(tracksMock);
    EasyMock.expect(tracksMock.iterator()).andReturn(tracks.iterator());
    EasyMock.expect(trackMock1.getGenre()).andReturn(genreMockA).anyTimes();
    EasyMock.expect(trackMock2.getGenre()).andReturn(genreMockA).anyTimes();
    EasyMock.expect(trackMock3.getGenre()).andReturn(genreMockB).anyTimes();
    EasyMock.expect(genreMockA.isId3TagGenre()).andReturn(true).anyTimes();
    EasyMock.expect(genreMockB.isId3TagGenre()).andReturn(false).anyTimes();
   
    EasyMock.replay(playlistMock, tracksMock, trackMock1, trackMock2, trackMock3, genreMockA, genreMockB);
   
View Full Code Here

  @Test
  public void testGetId3Genres() {
    Playlist playlistMock = EasyMock.createMock(Playlist.class);
    TrackCollection tracksMock = EasyMock.createMock(TrackCollection.class);
    Set<Track> tracks = new HashSet<Track>();
    Track trackMock1 = EasyMock.createMock(Track.class);
    Track trackMock2 = EasyMock.createMock(Track.class);
    Track trackMock3 = EasyMock.createMock(Track.class);
    Genre genreMockA = EasyMock.createMock(Genre.class);
    Genre genreMockB = EasyMock.createMock(Genre.class);

    tracks.add(trackMock1);
    tracks.add(trackMock2);
    tracks.add(trackMock3);
    EasyMock.expect(playlistMock.getTracks()).andReturn(tracksMock);
    EasyMock.expect(tracksMock.iterator()).andReturn(tracks.iterator());
    EasyMock.expect(trackMock1.getGenre()).andReturn(genreMockA).anyTimes();
    EasyMock.expect(trackMock2.getGenre()).andReturn(genreMockA).anyTimes();
    EasyMock.expect(trackMock3.getGenre()).andReturn(genreMockB).anyTimes();
    EasyMock.expect(genreMockA.isId3TagGenre()).andReturn(true).anyTimes();
    EasyMock.expect(genreMockB.isId3TagGenre()).andReturn(false).anyTimes();
   
    EasyMock.replay(playlistMock, tracksMock, trackMock1, trackMock2, trackMock3, genreMockA, genreMockB);
   
View Full Code Here

  @Test
  public void testGetNoneBasicId3Genres() {
    Playlist playlistMock = EasyMock.createMock(Playlist.class);
    TrackCollection tracksMock = EasyMock.createMock(TrackCollection.class);
    Set<Track> tracks = new HashSet<Track>();
    Track trackMock1 = EasyMock.createMock(Track.class);
    Track trackMock2 = EasyMock.createMock(Track.class);
    Track trackMock3 = EasyMock.createMock(Track.class);
    Genre genreMockA = EasyMock.createMock(Genre.class);
    Genre genreMockB = EasyMock.createMock(Genre.class);

    tracks.add(trackMock1);
    tracks.add(trackMock2);
    tracks.add(trackMock3);
    EasyMock.expect(playlistMock.getTracks()).andReturn(tracksMock);
    EasyMock.expect(tracksMock.iterator()).andReturn(tracks.iterator());
    EasyMock.expect(trackMock1.getGenre()).andReturn(genreMockA).anyTimes();
    EasyMock.expect(trackMock2.getGenre()).andReturn(genreMockA).anyTimes();
    EasyMock.expect(trackMock3.getGenre()).andReturn(genreMockB).anyTimes();
    EasyMock.expect(genreMockA.isBasicId3TagGenre()).andReturn(true).anyTimes();
    EasyMock.expect(genreMockB.isBasicId3TagGenre()).andReturn(false).anyTimes();
   
    EasyMock.replay(playlistMock, tracksMock, trackMock1, trackMock2, trackMock3, genreMockA, genreMockB);
   
View Full Code Here

  public Track addFile(File file) throws JitcaException {
    try {
      IITOperationStatus addOperationStatus = this.itLibrary.addFile(file);
      addOperationStatus.waitForCompletion();
      TrackCollection tracks = new TrackCollection(this, addOperationStatus.getTracks());
      Track newTrack = tracks.getFirst();
      this.addTrack(newTrack);
      return newTrack;
    } catch (PlaylistDeletedException e) {
      throw new ITObjectDeletedError(this);
    } catch (PlaylistReadOnlyException e) {
View Full Code Here

  }

  @Test
  public void testExtendedTrack() throws ID3TagException {
    File fileMock = EasyMock.createMock(File.class);
    Track trackMock = EasyMock.createMock(Track.class);
    FileOrCDTrack fileTrackMock = EasyMock.createMock(FileOrCDTrack.class);
    EasyMock.expect(trackMock.isFileOrCDTrack()).andReturn(true);
    EasyMock.expect(trackMock.getFileOrCDTrack()).andReturn(fileTrackMock);
    EasyMock.expect(fileTrackMock.getFile()).andReturn(fileMock);
    ITagFactory factoryMock = EasyMock.createMock(ITagFactory.class);
    EasyMock.expect(factoryMock.getTag((File) fileMock)).andReturn(null);
   
    EasyMock.replay(fileMock, factoryMock, trackMock, fileTrackMock);
View Full Code Here

    EasyMock.verify(fileMock, factoryMock, trackMock, fileTrackMock);
  }
 
  @Test(expected=ID3TagException.class)
  public void testInvalidExtendedTrack() throws ID3TagException {
    Track trackMock = EasyMock.createMock(Track.class);
    EasyMock.expect(trackMock.isFileOrCDTrack()).andReturn(false);
   
    EasyMock.replay(trackMock);
   
    ID3TagFactory.getID3Tag(trackMock);
View Full Code Here

  @Test
  public void testGetAllGenres() {
    Playlist playlistMock = EasyMock.createMock(Playlist.class);
    TrackCollection tracksMock = EasyMock.createMock(TrackCollection.class);
    Set<Track> tracks = new HashSet<Track>();
    Track trackMock1 = EasyMock.createMock(Track.class);
    Track trackMock2 = EasyMock.createMock(Track.class);
    Track trackMock3 = EasyMock.createMock(Track.class);
    Genre genreMockA = EasyMock.createMock(Genre.class);
    Genre genreMockB = EasyMock.createMock(Genre.class);

    tracks.add(trackMock1);
    tracks.add(trackMock2);
    tracks.add(trackMock3);
    EasyMock.expect(playlistMock.getTracks()).andReturn(tracksMock);
    EasyMock.expect(tracksMock.iterator()).andReturn(tracks.iterator());
    EasyMock.expect(trackMock1.getGenre()).andReturn(genreMockA).anyTimes();
    EasyMock.expect(trackMock2.getGenre()).andReturn(genreMockA).anyTimes();
    EasyMock.expect(trackMock3.getGenre()).andReturn(genreMockB).anyTimes();
   
    EasyMock.replay(playlistMock, tracksMock, trackMock1, trackMock2, trackMock3, genreMockA, genreMockB);
   
    GenreCollection actualGenres = PlaylistUtilities.getAllGenres(playlistMock);
   
View Full Code Here

import com.jitcaforwin.extended.api.track.Track;

public class CurrentTrackDemo {
  public static void main(String args[]) {
    IJitcaITunesController iTunes = new JitcaiTunesController(true);
    Track track = iTunes.getPlayerController().currentTrack();

    if (track == null) {
      System.out.println("Currently no track played!");
    } else {
      System.out.println(track.getTitle() + " by " + track.getArtist()
          + " is currently played. \n");
    }

    iTunes.close();
View Full Code Here

    if (itTrackCollection == null) {
      return; // ITTrackCollection is empty
    }
    try {
      for (int i = 1; i < itTrackCollection.getCount() + 1; i++) {
        Track track = this.trackFactory.getTrack(itTrackCollection.itemByPlayOrder(i));
        this.add(track, i - 1);
      }
    } catch (PlaylistDeletedException e) {
      throw new JitcaUnexpectedError();
    } catch (ObjectDeletedException e) {
View Full Code Here

TOP

Related Classes of com.jitcaforwin.extended.api.track.Track

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.