Package com.jitcaforwin.basic

Examples of com.jitcaforwin.basic.iTunesApp


   *
   * @throws JitcaException
   *             if an error occurs.
   */
  public JitcaiTunesController(boolean lazy){
    this.iTunes = new iTunesApp();
    this.library = new UserLibraryImpl(lazy, this.iTunes);
    this.trackController = new TrackControllerImpl(iTunes, this.library,
        this.library.getTrackFactory());
    this.playlistController = new PlaylistControllerImpl(iTunes,
        this.library.getPlaylistFactory());
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 (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

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

TOP

Related Classes of com.jitcaforwin.basic.iTunesApp

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.