本文整理汇总了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);
}