public class Song extends Object implements Comparable<Song>
Modifier and Type | Field and Description |
---|---|
private String |
albumArtistName_ |
private File |
albumDirFile_ |
private char[] |
albumRefKEY_ |
private String |
artistDir_ |
private String |
artistName_ |
private char[] |
artistRefKEY_ |
private int |
cdNumber_ |
private String |
htmlLinkEnd_ |
private String |
htmlLinkStart_ |
private boolean |
lastFmLoved_ |
private int |
libraryIndex_
The optional absolute index for this Song in the users overall Library of songs.
|
private String |
name_ |
private int |
number_
The songs track number within its
Album . |
private char[] |
refKEY_
The 2 digit HEX char/byte Reference KEY for this Song .
|
private File |
songFile_ |
static String |
SYSTEM_FILE_SEPERATOR
A holder for this clients System File Separator.
|
static String |
SYSTEM_LINE_SEPERATOR
A holder for this clients System line termination separator.
|
private static String |
tunesSubPath_ |
Constructor and Description |
---|
Song(String songFileDirPath)
Minimal Constructor for Song.
|
Song(String songFileDirPath,
String htmlLinkStart,
String htmlLinkEnd)
Constructor for Song with specied html start/end.
|
Song(String songFileDirPath,
String htmlLinkStart,
String htmlLinkEnd,
char[] albumRefKEY)
Constructor for Song allowing fully defined metadata.
|
Modifier and Type | Method and Description |
---|---|
String |
albumName() |
String |
albumTitle()
The actual fully expanded, cleaned of underscores and explicits / usable Album Title.
|
String |
albumTitle(boolean removeSpaces)
The actual cleaned of underscores and explicits / usable Album Title.
|
String |
artistDir()
the artist dirname for this song.
|
String |
artistName()
the artist name for this song.
|
int |
compareTo(Song o)
Compares the Song Titles.
|
String |
getAlbumRefKeyString() |
char[] |
getArtistRefKEY()
Get Method for class field 'artistRefKEY_'.
|
String |
getArtistRefKeyString() |
int |
getCdNumber()
Get Method for class field 'cdNumber_'.
|
String |
getHtmlLinkEnd()
Get Method for class field 'htmlLinkEnd_'.
|
String |
getHtmlLinkStart()
Get Method for class field 'htmlLinkStart_'.
|
boolean |
getLastFmLoved()
Get Method for class field 'lastFmLoved_'.
|
int |
getLibraryIndex()
Get Method for class field
'libraryIndex_' . |
int |
getNumber()
Get Method for class field 'number_'.
|
String |
getRefKeyString() |
File |
getSongFile() |
String |
getSongFilePath() |
static String |
getTunesSubPath()
Get Method for class field 'tunesSubPath_'.
|
static String |
left(String value,
int numChars)
Gives you the leftmost number of chars in a string.
|
String |
name()
SongName part of the filename including extension with spaces in name .
|
String |
name(boolean removeSpaces)
SongName part of the filename including extension with or without thw spaces in name .
|
static String |
removeExplicit(String title)
Gets rid (removes) the word EXPLICIT from the title.
|
static String |
right(String value,
int numChars)
Gives you the rightmost number of chars in a string.
|
void |
setArtistRefKEY(char[] artistRefKEY)
Set Method for class field 'artistRefKEY_'.
|
void |
setCdNumber(int cdNumber)
Set Method for class field 'cdNumber_'.
|
void |
setHtmlLinkEnd(String htmlLinkEnd)
Set Method for class field 'htmlLinkEnd_'.
|
void |
setHtmlLinkStart(String htmlLinkStart)
Set Method for class field 'htmlLinkStart_'.
|
void |
setLastFmLoved()
Set this song as 'lastFmLoved_'.
|
void |
setLastFmLoved(boolean lastFmLoved)
Set Method for class field 'lastFmLoved_'.
|
void |
setLibraryIndex(int libraryIndex)
Set Method for class field
'libraryIndex_' . |
void |
setNumber(int number)
Set Method for class field 'number_'.
|
static void |
setTunesSubPath(String tunesSubPath)
Set Method for class field 'tunesSubPath_'.
|
String |
songTitle()
The actual fully expanded, cleaned of underscores and explicits / usable Song Title.
|
String |
songTitle(boolean removeSpaces)
The actual (optionally removed spaces), cleaned of underscores and explicits / usable Song Title.
|
String |
toJsonString(int songIndex)
Returns the song metadata as a JSON String.
|
String |
toString()
The Song Title.
|
String |
toString(boolean html) |
public static final String SYSTEM_FILE_SEPERATOR
public static final String SYSTEM_LINE_SEPERATOR
private String artistName_
private String albumArtistName_
private String artistDir_
private File albumDirFile_
private String htmlLinkStart_
private String htmlLinkEnd_
private int cdNumber_
private boolean lastFmLoved_
private static String tunesSubPath_
private int libraryIndex_
private char[] refKEY_
private char[] albumRefKEY_
private char[] artistRefKEY_
public Song(String songFileDirPath) throws Exception
songFileDirPath
- the full path to the songFile.Exception
- if the artist file dir does not exist of can't read as a dir.public Song(String songFileDirPath, String htmlLinkStart, String htmlLinkEnd) throws Exception
songFileDirPath
- the full path to the songFile.htmlLinkStart
- used in the creation of the html toString method.htmlLinkEnd
- used in the creation of the html toString method.Exception
- if the artist file dir does not exist of can't read as a dir.public Song(String songFileDirPath, String htmlLinkStart, String htmlLinkEnd, char[] albumRefKEY) throws Exception
songFileDirPath
- the full path to the songFile.htmlLinkStart
- used in the creation of the html toString method.htmlLinkEnd
- used in the creation of the html toString method.albumRefKEY
- see refKEY_
.Exception
- if the artist file dire does not exist of can't read as a dir.public String name(boolean removeSpaces)
public String getSongFilePath()
public File getSongFile()
public String songTitle()
public String songTitle(boolean removeSpaces)
public static void setTunesSubPath(String tunesSubPath)
tunesSubPath
- is the value to set this class field to.public static String getTunesSubPath()
public void setCdNumber(int cdNumber)
cdNumber
- is the value to set this class field to.public int getCdNumber()
public void setHtmlLinkStart(String htmlLinkStart)
htmlLinkStart
- is the value to set this class field to.public String getHtmlLinkStart()
public void setHtmlLinkEnd(String htmlLinkEnd)
htmlLinkEnd
- is the value to set this class field to.public String getHtmlLinkEnd()
public void setLastFmLoved()
public void setLastFmLoved(boolean lastFmLoved)
lastFmLoved
- is the value to set this class field to.public boolean getLastFmLoved()
public String albumTitle()
public String albumTitle(boolean removeSpaces)
public String artistDir()
public String artistName()
public void setNumber(int number)
number
- is the value to set this class field to.public int getNumber()
public void setLibraryIndex(int libraryIndex)
'libraryIndex_'
.libraryIndex
- is the value to set this class field to.public int getLibraryIndex()
'libraryIndex_'
.public static String removeExplicit(String title)
title
- is the string to parsepublic String getRefKeyString()
public void setArtistRefKEY(char[] artistRefKEY)
artistRefKEY
- is the value to set this class field to.public char[] getArtistRefKEY()
public String getAlbumRefKeyString()
public String getArtistRefKeyString()
public String toJsonString(int songIndex)
{ url : "https://red.webarts.bc.ca:9443/static/tunes/38Special/TheVeryBestOfTheA&lMYears(1977-1988)/38Special_13-Teacher,Teacher.ogg", file : "38Special_13-Teacher,Teacher.ogg", title : "Teacher, Teacher", number : "13" }
songIndex
- is the int to use as this songs overall library index number to use in its metadata tags.public static String right(String value, int numChars)
value
- is the string to pull result fromnumChars
- the number of chars to return from the right side of 'value'public static String left(String value, int numChars)
value
- is the string to pull result fromnumChars
- the number of chars to return from the left side of 'value'public int compareTo(Song o)
compareTo
in interface Comparable<Song>
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses