Package com.jitcaforwin.basic.api

Examples of com.jitcaforwin.basic.api.IiTunes


public class CurrentTrackDemo {

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

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

      iTunes.close();

    } catch (JitcaException e) {
      e.printStackTrace();
    }
View Full Code Here


public class CreatingPlaylistDemo {

  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.");
            newPlaylist.addTrack(track);
            i++;
          }
        }

        double sizeMB = newPlaylist.getSize() / 1000000;
        String duration = newPlaylist.getTime();
        String name = newPlaylist.getName();

        System.out.println("Playlist \"" + name
            + "\" created. \nSize of the playlist: " + sizeMB
            + "MB. \nDuration of playlist: " + duration);
      }

      iTunes.close();

    } catch (JitcaException e) {
      e.printStackTrace();
    }
View Full Code Here

import com.jitcaforwin.basic.exceptions.ObjectDeletedException;
import com.jitcaforwin.basic.exceptions.TrackDeletedException;

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

    IiTunesEventsListener demoListener = new DemoEventHandler();
    iTunes.addEventListener(demoListener);

    System.out.println("Enter for exit!");
    Scanner in = new Scanner(System.in);
    in.nextLine();

    iTunes.close();

  }
View Full Code Here

import com.jitcaforwin.main.exceptions.JitcaException;

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

      IiTunesEventsListener demoListener = new DemoEventHandler();
      iTunes.addEventListener(demoListener);

      System.out.println("Enter for exit!");
      Scanner in = new Scanner(System.in);
      in.nextLine();

      iTunes.close();
    } catch (JitcaException e) {
      e.printStackTrace();
    }

  }
View Full Code Here

public class GroupArtistTest {

 
  @Test
  public void factoryTest(){
    IiTunes iTunesMock = EasyMock.createMock(IiTunes.class);
    EasyMock.expect(iTunesMock.getLibrarySource()).andReturn(null);
    EasyMock.expect(iTunesMock.getLibraryPlaylist()).andReturn(null).anyTimes();
    EasyMock.replay(iTunesMock);
   
    Source source = new UserLibraryImpl(true, iTunesMock);
   
    Artist michaelAndPaul = source.getArtist("Michael Jackson, Paul McCartney");
View Full Code Here

import com.jitcaforwin.main.exceptions.JitcaGeneralException;

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

      IiTunesEventsListener demoListener = new DemoEventHandler();
      iTunes.addEventListener(demoListener);

      System.out.println("Enter for exit!");
      Scanner in = new Scanner(System.in);
      in.nextLine();

      iTunes.close();
    } catch (JitcaGeneralException e) {
      e.printStackTrace();
    }

  }
View Full Code Here

public class CurrentTrackDemo {

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

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

      iTunes.close();

    } catch (JitcaGeneralException e) {
      e.printStackTrace();
    }
View Full Code Here

public class CreatingPlaylistDemo {

  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.");
            newPlaylist.addTrack(track);
            i++;
          }
        }

        double sizeMB = newPlaylist.getSize() / 1000000;
        String duration = newPlaylist.getTime();
        String name = newPlaylist.getName();

        System.out.println("Playlist \"" + name
            + "\" created. \nSize of the playlist: " + sizeMB
            + "MB. \nDuration of playlist: " + duration);
      }

      iTunes.close();

    } catch (JitcaGeneralException e) {
      e.printStackTrace();
    }
View Full Code Here

public class EventControllerTest {

  @Test(expected=JitcaRuntimeException.class)
  public void NegativeEventControllerTest(){
    IJitcaCOMInterface comMock = EasyMock.createMock(IJitcaCOMInterface.class);
    IiTunes iTunes = new iTunesApp(comMock)// Mock should never be used by the API.
    TestEventListner testListener = new TestEventListner();
    iTunes.removeEventListener(testListener);
  }
View Full Code Here

TOP

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

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.