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


C# Album.addTracks方法代码示例

本文整理汇总了C#中Album.addTracks方法的典型用法代码示例。如果您正苦于以下问题:C# Album.addTracks方法的具体用法?C# Album.addTracks怎么用?C# Album.addTracks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Album的用法示例。


在下文中一共展示了Album.addTracks方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Execute


//.........这里部分代码省略.........
                        {
                            mediaPlaylist = getPlaylistFromExactQuery(query_text, query_type, collection);
                        }
                        else if (has_query)
                        {
                            string type = getSortAttributeFromQueryType(query_type);
                            mediaPlaylist = collection.getPlaylistByQuery(query, "Audio", type, true);
                        }

                        if (mediaPlaylist != null)
                        {
                            //Create playlist from query if supplied with playlist name
                            if (create_playlist_name != null)
                            {
                                add_to_playlist(opResult, has_query, mediaPlaylist, create_playlist_name);
                                return opResult;
                            }
                            else if (query_indexes.Count > 0)
                            {
                                for (int j = 0; j < query_indexes.Count; j++)
                                {
                                    media_item = mediaPlaylist.get_Item((Int16)query_indexes[j]);
                                    if (media_item != null)
                                    {
                                        metadata.addSong(media_item);
                                    }
                                }
                            }
                            else
                            {
                                if (query_type.Equals("Album"))
                                {
                                    Album album = new Album(query_text, m_stats_only);
                                    album.addTracks(mediaPlaylist);
                                    metadata.addAlbum(album);
                                }
                                else
                                {
                                    metadata.addSongs(mediaPlaylist);
                                }
                            }
                        }
                        else
                        {
                            if (logger != null)
                            {
                                logger.Write("Creating library metadata object");
                            }
                            //No query supplied so entire detailed library requested
                            //Parse all albums and return, no value album will be added as songs
                            IWMPStringCollection album_collection = collection.getAttributeStringCollection("WM/AlbumTitle", "Audio");
                            if (album_collection.count > 0)
                            {
                                result_count = 0;
                                for (int j = 0; j < album_collection.count; j++)
                                {
                                    if (album_collection.Item(j) != null)
                                    {
                                        //The collection seems to represent the abcense of an album as an "" string value
                                        IWMPPlaylist album_playlist = collection.getByAlbum(album_collection.Item(j));
                                        if (album_playlist != null)
                                        {
                                            if (!album_collection.Item(j).Equals(""))
                                            {
                                                Album album = new Album(album_collection.Item(j), m_stats_only);
                                                result_count += album.addTracks(album_playlist);
开发者ID:RuneHL,项目名称:MceController,代码行数:67,代码来源:musicCmd.cs


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