Package se.despotify.client.protocol.command.media

Examples of se.despotify.client.protocol.command.media.LoadTracks


  public static Visitable browse(String URL, final Store store, final Connection connection) {
    return match(URL, new Visitor<Visitable>(){
      public Visitable track(URLtype type, String URI) {
        Track track = store.getTrack(SpotifyURI.toHex(URI));
        try {
          new LoadTracks(store, track).send(connection.getProtocol());
        } catch (DespotifyException e) {
          throw new RuntimeException(e);
        }
        return track;
      }
View Full Code Here


    assertNull(playlist.getTracks().get(4).getTrackNumber());
    assertNull(playlist.getTracks().get(4).getYear());

    // load all tracks

    new LoadTracks(store, playlist.getTracks()).send(connection.getProtocol());

    // assert tracks

//    for (int i = 0; i < playlist.getTracks().size(); i++) {
//      MediaTestCaseGenerator.createEqualsTest(playlist.getTracks().get(i), "playlist.getTracks().get(" + i + ")");
View Full Code Here

  public static Visitable browse(String URL, final Store store, final Connection connection) {
    return match(URL, new Visitor<Visitable>(){
      public Visitable track(URLtype type, String URI) {
        Track track = store.getTrack(SpotifyURI.toHex(URI));
        try {
          new LoadTracks(store, track).send(connection);
        } catch (DespotifyException e) {
          throw new RuntimeException(e);
        }
        return track;
      }
View Full Code Here

    assertNull(playlist.getTracks().get(4).getTrackNumber());
    assertNull(playlist.getTracks().get(4).getYear());

    // load all tracks

    manager.send(new LoadTracks(store, playlist.getTracks()));

    // assert tracks

//    for (int i = 0; i < playlist.getTracks().size(); i++) {
//      MediaTestCaseGenerator.createEqualsTest(playlist.getTracks().get(i), "playlist.getTracks().get(" + i + ")");
View Full Code Here

      if (track.getLoaded() == null) {
        tracksToLoad.add(track);
      }
    }
    if (tracksToLoad.size() > 0) {
      new LoadTracks(store, tracksToLoad).send(manager);
    }

    // sum up
    List<Double> distances = new ArrayList<Double>();
    for (Track track : new ArrayList<Track>(album.getTracks())) {
View Full Code Here

      return 1d;
    }

    // todo load both at once
    if (track.getLoaded() == null) {
      new LoadTracks(store, track).send(manager);
    }
    if (track1.getLoaded() == null) {
      new LoadTracks(store, track1).send(manager);
    }

    // todo if artist and title equals return 0.99d. i.e. same track in multiple albums.    

    double similarity = 0d;
View Full Code Here

  public static Visitable browse(String URL, final Store store, final ConnectionManager connectionManager) {
    return match(URL, new Visitor<Visitable>(){
      public Visitable track(URLtype type, String URI) {
        Track track = store.getTrack(SpotifyURI.toHex(URI));
        try {
          new LoadTracks(store, track).send(connectionManager);
        } catch (DespotifyException e) {
          throw new RuntimeException(e);
        }
        return track;
      }
View Full Code Here

      if (track.getLoaded() == null) {
        tracksToLoad.add(track);
      }
    }
    if (tracksToLoad.size() > 0) {
      manager.send(new LoadTracks(store, tracksToLoad));
    }

    // sum up
    List<Double> distances = new ArrayList<Double>();
    for (Track track : new ArrayList<Track>(album.getTracks())) {
View Full Code Here

      return 1d;
    }

    // todo load both at once
    if (track.getLoaded() == null) {
      manager.send(new LoadTracks(store, track));
    }
    if (track1.getLoaded() == null) {
      manager.send(new LoadTracks(store, track1));
    }

    // todo if artist and title equals return 0.99d. i.e. same track in multiple albums.    

    double similarity = 0d;
View Full Code Here

  public static Visitable browse(String URL, final Store store, final DespotifyManager connectionManager) {
    return match(URL, new Visitor<Visitable>(){
      public Visitable track(URLtype type, String URI) {
        Track track = store.getTrack(SpotifyURI.toHex(URI));
        try {
          new LoadTracks(store, track).send(connectionManager);
        } catch (DespotifyException e) {
          throw new RuntimeException(e);
        }
        return track;
      }
View Full Code Here

TOP

Related Classes of se.despotify.client.protocol.command.media.LoadTracks

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.