本文整理匯總了Java中net.sourceforge.subsonic.ajax.LyricsInfo類的典型用法代碼示例。如果您正苦於以下問題:Java LyricsInfo類的具體用法?Java LyricsInfo怎麽用?Java LyricsInfo使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
LyricsInfo類屬於net.sourceforge.subsonic.ajax包,在下文中一共展示了LyricsInfo類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getLyrics
import net.sourceforge.subsonic.ajax.LyricsInfo; //導入依賴的package包/類
@SuppressWarnings("UnusedDeclaration")
public void getLyrics(HttpServletRequest request, HttpServletResponse response) throws Exception {
request = wrapRequest(request);
String artist = request.getParameter("artist");
String title = request.getParameter("title");
LyricsInfo lyrics = lyricsService.getLyrics(artist, title);
Lyrics result = new Lyrics();
result.setArtist(lyrics.getArtist());
result.setTitle(lyrics.getTitle());
result.setContent(lyrics.getLyrics());
Response res = createResponse();
res.setLyrics(result);
jaxbWriter.writeResponse(request, response, res);
}
示例2: getLyrics
import net.sourceforge.subsonic.ajax.LyricsInfo; //導入依賴的package包/類
public void getLyrics(HttpServletRequest request, HttpServletResponse response) throws Exception {
request = wrapRequest(request);
String artist = request.getParameter("artist");
String title = request.getParameter("title");
String id = request.getParameter("id");
LyricsInfo lyrics = new LyricsInfo();
if (id != null) {
lyrics = lyricsService.getLyrics(id, artist, title);
} else {
lyrics = lyricsService.getLyrics(artist, title);
}
XMLBuilder builder = createXMLBuilder(request, response, true);
AttributeSet attributes = new AttributeSet();
attributes.add("artist", lyrics.getArtist());
attributes.add("title", lyrics.getTitle());
builder.add("lyrics", attributes, lyrics.getLyrics(), true);
builder.endAll();
response.getWriter().print(builder);
}