當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。