Package com.jitcaforwin.extended.api

Examples of com.jitcaforwin.extended.api.IJitcaITunesController


public class TestClass {

  public static void main(String args[]) {

    IJitcaITunesController iTunes = new JitcaiTunesController(true);

    try {
      // LogPrinter printer =
      // iTunes.getLibrary().analyzeTrackInfo().getPrinter();
      // LogPrinter printer = ((FileOrCDTrack)
      // iTunes.getTrackController().currentTrack()).analyzeTrackInfo().getPrinter();
      // LogPrinter printer =
      // printer.setOutputStream(System.out);
      // printer.printOnlyErrors();

      for (Genre genre : PlaylistUtilities.getNonId3BasicGenres(iTunes.getLibrary().getPlaylist())) {
        System.out.println(genre.getName());
      }

    } catch (Exception e) {
      e.printStackTrace();
    }

    iTunes.close();

  }
View Full Code Here


import com.jitcaforwin.trackinfoanalyzer.printout.LogPrinter;
public class TestClass {

  public static void main(String args[]){

    IJitcaITunesController iTunes = new JitcaiTunesController(true);

    try {


      //LogPrinter printer = iTunes.getLibrary().analyzeTrackInfo().getPrinter();
      LogPrinter printer = ((FileOrCDTrack) iTunes.getTrackController().currentTrack()).analyzeTrackInfo().getPrinter();
      printer.setOutputStream(System.out);
      printer.print();

    } catch (IOException e) {
      e.printStackTrace();
    }
   

    iTunes.close();

  }
View Full Code Here

import com.jitcaforwin.extended.api.IJitcaITunesController;
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

public class PlaylistCreateDemo {

  public static void main(String args[]){
    try {
      IJitcaITunesController iTunes = new JitcaiTunesController(true);
     
      UserLibrary library = iTunes.getLibrary();
     
      PlaylistFolder folder = library.createPlaylistFolder("Demo_Folder");
     
      UserPlaylist playlist = folder.createPlaylist("Demo_Playlist");
     
      playlist.addTrack(iTunes.getPlayerController().currentTrack());

      iTunes.close();

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

import com.jitcaforwin.main.exceptions.JitcaException;

public class CurrentTrackDemo {
  public static void main(String args[]) {
    try {
      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();

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

  public static void main(String args[]){
    try {
      //BasicConfigurator.configure();
     
      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() + ")");
      }
     
      iTunes.close();
     
    } catch (JitcaException e) {
      e.printStackTrace();
    }
  }
View Full Code Here

public class CDDemo {

  public static void main(String[] args) {
    try {
      IJitcaITunesController iTunes = new JitcaiTunesController(true);
     
      CD cd = iTunes.getCD();
     
      if (cd == null)
      {
        if (iTunes.getCDs() != null){
          System.out.println("More than one CD is available!");
        } else {
          System.out.println("No CD available!");
        }
      } else {
        System.out.println("Start playing: " + cd.getTitle());
        cd.play();
      }
     
      iTunes.close();

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

public class TracksLastPlayedDemo {
 
  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() + ")");
      }
     
      iTunes.close();
     
    } catch (JitcaException e) {
      e.printStackTrace();
    }
  }
View Full Code Here

import com.jitcaforwin.id3.ID3Tag;
import com.jitcaforwin.id3.exceptions.ID3TagException;

public class ID3Tags {
  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 {
      if (track.isFileOrCDTrack()) {
        System.out.println("Content of the ID3Tags for the currently placyed track:");
        try {
          ID3Tag id3 = ((FileOrCDTrack) track).getID3Tag();
          System.out.println("Song Title: " + id3.getSongTitle());
          System.out.println("Artist Name: " + id3.getArtistName());
          System.out.println("Album Name: " + id3.getAlbumTitle());
          System.out.println("Genre: " + id3.getGenreAsString());
        } catch (ID3TagException e) {
          e.printStackTrace();
        }

      } else {
        System.out.println("Currently played track does not have an ID3Tag!");
      }

    }

    iTunes.close();
  }
View Full Code Here

import com.jitcaforwin.extended.collections.TrackCollection;

public class TracksOfArtistDemo {

  public static void main(String args[]) {
    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() + ")");
    }

    iTunes.close();
  }
View Full Code Here

TOP

Related Classes of com.jitcaforwin.extended.api.IJitcaITunesController

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.