本文整理汇总了C#中Library.addSong方法的典型用法代码示例。如果您正苦于以下问题:C# Library.addSong方法的具体用法?C# Library.addSong怎么用?C# Library.addSong使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Library
的用法示例。
在下文中一共展示了Library.addSong方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
//.........这里部分代码省略.........
opResult = serializeObject(opResult, metadata, cache_fn, cache_ver);
}
else
{
opResult.StatusCode = OpStatusCode.BadRequest;
opResult.StatusText = "No albums found!";
}
}
return opResult;
case LIST_SONGS:
IWMPStringCollection songs;
if (has_query)
{
songs = collection.getStringCollectionByQuery("Title", query, "Audio", "Title", true);
}
else
{
songs = collection.getAttributeStringCollection("Title", "Audio");
}
if (songs != null && songs.count > 0)
{
for (int k = 0; k < songs.count; k++)
{
IWMPPlaylist playlist = collection.getByName(songs.Item(k));
if (playlist != null && playlist.count > 0)
{
if (create_playlist_name != null)
{
add_to_playlist(opResult, has_query, playlist, create_playlist_name);
opResult.StatusCode = OpStatusCode.Ok;
}
else
{
metadata.addSongs(playlist);
}
}
}
if (create_playlist_name == null)
{
metadata.trimToSize();
opResult = serializeObject(opResult, metadata, cache_fn, cache_ver);
}
}
else
{
opResult.StatusCode = OpStatusCode.BadRequest;
opResult.StatusText = "No songs found!";
}
return opResult;
case LIST_PLAYLISTS:
result_count = 0;
playlists = getAllUserPlaylists(playlistCollection);
result_count = metadata.addPlaylists(playlistCollection, playlists);
metadata.trimToSize();
opResult.ResultCount = result_count;
opResult.ContentText = JsonConvert.SerializeObject(metadata, Formatting.Indented);
return opResult;
case LIST_RECENT:
if (param.Contains("count:"))
{
string scount = param.Substring(param.IndexOf("count:") + "count:".Length);
if (scount.IndexOf(" ") >= 0) scount = scount.Substring(0, scount.IndexOf(" "));
int count = Convert.ToInt32(scount);
list_recent(opResult, template, count);
}
else list_recent(opResult, template);