Android Open Source - pi-android-player Song






From Project

Back to project page pi-android-player.

License

The source code is released under:

Apache License

If you think the Android project pi-android-player listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package edu.ptit.xbmc.model;
/*  ww  w.  j av a2  s  .c  o m*/
import java.io.Serializable;

public class Song implements Serializable {
  /**
   * 
   */
  private static final long serialVersionUID = -6722683265243705995L;
  String name;
  String[] artist;
  String album;
  String thumbnail;
  int duration, songid, albumid, track;

  public int getTrack() {
    return track;
  }

  public void setTrack(int track) {
    this.track = track;
  }

  public int getAlbumid() {
    return albumid;
  }

  public void setAlbumid(int albumid) {
    this.albumid = albumid;
  }

  public Song() {
    duration = 0;
  }

  public String toString() {
    return name;
  }

  public String getName() {
    return name;
  }

  public String formatDuration() {
    String ret = "";
    ret += (duration / 60) + ":";
    ret += duration % 60;
    return ret;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String[] getArtist() {
    return artist;
  }

  public void setArtist(String[] artist) {
    this.artist = artist;
  }

  public String getAlbum() {
    return album;
  }

  public void setAlbum(String album) {
    this.album = album;
  }

  public String getThumbnail() {
    return thumbnail;
  }

  public void setThumbnail(String thumbnail) {
    this.thumbnail = thumbnail;
  }

  public int getDuration() {
    return duration;
  }

  public String getFormatedDuration() {
    String ret = "";
    ret += (duration / 60);
    ret += ":";
    int du = duration % 60;
    if (du < 10)
      ret += "0";
    ret += du;
    return ret;

  }

  public void setDuration(int duration) {
    this.duration = duration;
  }

  public int getSongid() {
    return songid;
  }

  public void setSongid(int songid) {
    this.songid = songid;
  }

  public String getFormatedArtist() {
    // String first = artist == null? "unknown":artist[0];
    // return first;
    String ret = "";
    if (artist == null || artist.length == 0 || artist[0] == "")
      return "Unknown";
    for (int i = 0; i < artist.length - 1; i++) {
      ret += artist[i] + " ft. ";
    }
    ret += artist[artist.length - 1];
    return ret;
  }

}




Java Source Code List

.FragmentAlbum.java
.FragmentArtist.java
.MyTabListener.java
.TabListenerForAlbum.java
edu.ptit.xbmc.activities.MainActivity.java
edu.ptit.xbmc.adapter.AllAlbumAdapter.java
edu.ptit.xbmc.adapter.AllArtistAdapter.java
edu.ptit.xbmc.adapter.AllSongAdapter2.java
edu.ptit.xbmc.adapter.ImageAdapter.java
edu.ptit.xbmc.fragments.FragmentAlbumDetail.java
edu.ptit.xbmc.fragments.FragmentAlbumList.java
edu.ptit.xbmc.fragments.FragmentAllSong.java
edu.ptit.xbmc.fragments.FragmentArtistDetail.java
edu.ptit.xbmc.fragments.FragmentArtistList.java
edu.ptit.xbmc.fragments.FragmentDirectRemote.java
edu.ptit.xbmc.fragments.FragmentNowPlaying.java
edu.ptit.xbmc.fragments.FragmentSettings.java
edu.ptit.xbmc.model.Album.java
edu.ptit.xbmc.model.Artist.java
edu.ptit.xbmc.model.Settings.java
edu.ptit.xbmc.model.Song.java
edu.ptit.xbmc.sp.Constants.java
edu.ptit.xbmc.sp.SPUtils.java
edu.ptit.xbmc.tablistener.TabListenerForArtist.java
edu.ptit.xbmc.tools.PiConnector.java
edu.ptit.xbmc.tools.Utils.java