|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.dc.freedb.Freedb
Constructor Summary | |
Freedb(java.lang.String server,
ImportAudioCDDialog ui)
|
Method Summary | |
AudioCD |
convertToDcObject(FreedbQueryResult result)
Converts a query result (not detailed) to a Data Crow Object |
AudioCD |
convertToDcObject(FreedbReadResult result)
Converts a read result (detailed) to a Data Crow Object |
java.lang.String[] |
getAvailableServers()
|
java.lang.String[] |
getCategories()
public FreedbQueryResult[] queryKeywords(String search) throws Exception { String answer = searchFreedb(search); StringTokenizer st = new StringTokenizer(answer, "\n"); LinkedList list = new LinkedList(); String[] infos = new String[4]; int counter = 0; ui.initProgressBar(st.countTokens()); while (st.hasMoreTokens()) { ui.updateProgressBar(counter); String line = st.nextToken(); if (bigMatch(line, infos)) { // We have a line that has an artist/album list.add(new FreedbQueryResult(infos[0]+" "+infos[1]+" "+infos[2])); if (smallMatch(infos[3], infos)) { // Do we have a number 2 of the same album/artist ? list.add(new FreedbQueryResult(infos[0]+" "+infos[1]+" "+infos[2])); } } else if(smallMatch(line, infos)) { // We have a line that is number 3,4 of the previous artist/album list.add(new FreedbQueryResult(infos[0]+" "+infos[1]+" "+infos[2])); } counter++; } FreedbQueryResult[] results = new FreedbQueryResult[list.size()]; Iterator it = list.iterator(); int i = 0; while (it.hasNext()) { results[i] = (FreedbQueryResult) it.next(); i++; } return results; } |
AudioCD[] |
query(java.lang.String id)
Queries the freedb server for the full id: Client command: -> cddb query discid ntrks off1 off2 ... |
AudioCD[] |
queryDiscId(java.lang.String discID)
|
FreedbReadResult |
read(FreedbQueryResult query)
|
FreedbReadResult |
read(java.lang.String genre,
java.lang.String id)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Freedb(java.lang.String server, ImportAudioCDDialog ui)
Method Detail |
public AudioCD[] queryDiscId(java.lang.String discID) throws java.lang.Exception
java.lang.Exception
public java.lang.String[] getCategories() throws java.lang.Exception
java.lang.Exception
public java.lang.String[] getAvailableServers() throws java.lang.Exception
java.lang.Exception
public AudioCD[] query(java.lang.String id) throws java.lang.Exception
id
- full disc id
java.lang.Exception
public FreedbReadResult read(java.lang.String genre, java.lang.String id) throws java.lang.Exception
java.lang.Exception
public FreedbReadResult read(FreedbQueryResult query) throws java.lang.Exception
java.lang.Exception
public AudioCD convertToDcObject(FreedbQueryResult result)
result
- query resultpublic AudioCD convertToDcObject(FreedbReadResult result)
result
- read result
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |