当前位置: 首页>>代码示例>>C#>>正文


C# Library.addSong方法代码示例

本文整理汇总了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);
开发者ID:RuneHL,项目名称:MceController,代码行数:67,代码来源:musicCmd.cs


注:本文中的Library.addSong方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。