Changeset 19308

Show
Ignore:
Timestamp:
09/15/08 01:35:51 (5 years ago)
Author:
topia
Message:

update supported iTunesLib version to 1.11 (iTunes 7.7).
* support PersistentID and Playlists property.
* support ITArtwork.Description property.

Location:
lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap
Files:
1 added
23 modified

Legend:

Unmodified
Added
Removed
  • lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Application.cs

    r11205 r19308  
    66using System.Runtime.InteropServices; 
    77using Clovery.iTunesHelper.COMWrap.Interfaces; 
     8using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 
     9using Clovery.iTunesHelper.COMWrap.Internal; 
    810using iTunes = iTunesLib; 
    911 
     
    553555    } 
    554556 
    555     internal class CanSetShufflePlaylistCollection : IIndexedCollection<IPlaylist, bool> 
     557    namespace Internal 
    556558    { 
    557         public bool this[IPlaylist Playlist] 
    558         { 
    559             get { return Playlist.CanSetShuffle; } 
    560         } 
    561     } 
    562  
    563     internal class CanSetSongRepeatPlaylistCollection : IIndexedCollection<IPlaylist, bool> 
    564     { 
    565         public bool this[IPlaylist Playlist] 
    566         { 
    567             get { return Playlist.CanSetSongRepeat; } 
    568         } 
     559        internal class CanSetShufflePlaylistCollection : IIndexedCollection<IPlaylist, bool> 
     560        { 
     561            public bool this[IPlaylist Playlist] 
     562            { 
     563                get { return Playlist.CanSetShuffle; } 
     564            } 
     565        } 
     566 
     567        internal class CanSetSongRepeatPlaylistCollection : IIndexedCollection<IPlaylist, bool> 
     568        { 
     569            public bool this[IPlaylist Playlist] 
     570            { 
     571                get { return Playlist.CanSetSongRepeat; } 
     572            } 
     573        }         
    569574    } 
    570575 
  • lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Artworks.cs

    r11205 r19308  
    55using System.Linq; 
    66using Clovery.iTunesHelper.COMWrap.Interfaces; 
     7using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 
     8using Clovery.iTunesHelper.COMWrap.Internal; 
    79using iTunes = iTunesLib; 
    810 
     
    1517        } 
    1618 
    17         protected internal iTunes.IITArtwork __asIITArtwork 
     19        protected internal iTunes.IITArtwork _asIITArtwork 
    1820        { 
    1921            get { return (iTunes.IITArtwork) this._internal; } 
     
    2224        public void Delete() 
    2325        { 
    24             this.__asIITArtwork.Delete(); 
     26            this._asIITArtwork.Delete(); 
    2527        } 
    2628 
    2729        public ArtworkFormat Format 
    2830        { 
    29             get { return (ArtworkFormat) this.__asIITArtwork.Format; } 
     31            get { return (ArtworkFormat) this._asIITArtwork.Format; } 
    3032        } 
    3133 
    3234        public bool IsDownloadedArtwork 
    3335        { 
    34             get { return this.__asIITArtwork.IsDownloadedArtwork; } 
     36            get { return this._asIITArtwork.IsDownloadedArtwork; } 
     37        } 
     38 
     39        public string Description 
     40        { 
     41            get { return this._asIITArtwork.Description; } 
     42            set { this._asIITArtwork.Description = value; } 
    3543        } 
    3644 
    3745        public void SaveArtworkToFile(string filePath) 
    3846        { 
    39             this.__asIITArtwork.SaveArtworkToFile(filePath); 
     47            this._asIITArtwork.SaveArtworkToFile(filePath); 
    4048        } 
    4149 
    4250        public void SetArtworkFromFile(string filePath) 
    4351        { 
    44             this.__asIITArtwork.SetArtworkFromFile(filePath); 
     52            this._asIITArtwork.SetArtworkFromFile(filePath); 
    4553        } 
    4654    } 
  • lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Base.cs

    r11205 r19308  
    55using System.Linq; 
    66using Clovery.iTunesHelper.COMWrap.Interfaces; 
     7using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 
     8using Clovery.iTunesHelper.COMWrap.Internal; 
    79 
    810namespace Clovery.iTunesHelper.COMWrap 
     
    6971        protected internal readonly int _TrackDatabaseID; 
    7072        protected internal readonly int _trackID; 
     73        protected internal readonly long? _persistentID; 
    7174        protected internal string _name; 
    7275 
     
    7578            _internal.GetITObjectIDs(out this._sourceID, out this._playlistID, out this._trackID, 
    7679                                     out this._TrackDatabaseID); 
     80            { 
     81                int high, low; 
     82                this._app._asIiTunes.GetITObjectPersistentIDs(ref this._internal, out high, out low); 
     83                this._persistentID = Utils.JoinInt32ToInt64(high, low); 
     84            } 
    7785            this._name = _internal.Name; 
    7886        } 
    7987 
    80         protected internal ITObject(int sourceID, int playlistID, int trackID, int TrackDatabaseID, ITunesApp app) : base(app) 
     88        /// <summary> 
     89        /// Create Abstract ITObject. 
     90        /// </summary> 
     91        protected internal ITObject(int sourceID, int playlistID, int trackID, int TrackDatabaseID, long? PersistentID, ITunesApp app) 
     92            : base(app) 
    8193        { 
    8294            this._sourceID = sourceID; 
     
    8496            this._trackID = trackID; 
    8597            this._TrackDatabaseID = TrackDatabaseID; 
     98            this._persistentID = PersistentID; 
     99        } 
     100 
     101        /// <summary> 
     102        /// Create Abstract ITObject. 
     103        /// </summary> 
     104        protected internal ITObject(int sourceID, int playlistID, int trackID, int TrackDatabaseID, ITunesApp app) 
     105            : this(sourceID, playlistID, trackID, TrackDatabaseID, null, app) 
     106        { 
    86107        } 
    87108 
     
    105126        public void GetITObjectIDs(out int sourceID, out int playlistID, out int trackID, out int databaseID) 
    106127        { 
    107             //this._asIITObject.GetITObjectIDs(out sourceID, out playlistID, out trackID, out databaseID); 
    108128            sourceID = this.sourceID; 
    109129            playlistID = this.playlistID; 
     
    160180        } 
    161181 
     182        public long PersistentID 
     183        { 
     184            get 
     185            { 
     186                if (this._persistentID.HasValue) 
     187                { 
     188                    return this._persistentID.Value; 
     189                } 
     190                throw new InvalidOperationException("This object is abstract."); 
     191            } 
     192        } 
     193 
    162194        ///<summary> 
    163195        ///Indicates whether the current object is equal to another object of the same type. 
     
    231263    } 
    232264 
    233     internal class ParentStringIndexerReferrer<TCollection, TItem> : IIndexedCollection<string, TItem> 
    234         where TCollection : IIndexedCollection<string, TItem> 
     265    namespace Internal 
    235266    { 
    236         protected internal readonly TCollection _parent; 
    237  
    238         internal ParentStringIndexerReferrer(TCollection _parent) 
    239         { 
    240             this._parent = _parent; 
    241         } 
    242  
    243         public TItem this[string Name] 
    244         { 
    245             get { return this._parent[Name]; } 
    246         } 
    247     } 
    248  
    249     internal abstract class ITBaseCollection<TItem> : ITFactory, IITBaseCollection<TItem> 
    250         where TItem : class 
    251     { 
    252         protected ITBaseCollection(object _internal, ITunesApp app) : base(_internal, app) 
    253         { 
    254         } 
    255  
    256         public abstract int Count { get; } 
    257  
    258         ///<summary> 
    259         ///Returns an enumerator that iterates through the collection. 
    260         ///</summary> 
    261         /// 
    262         ///<returns> 
    263         ///A <see cref="T:System.Collections.Generic.IEnumerator`1"></see> that can be used to iterate through the collection. 
    264         ///</returns> 
    265         ///<filterpriority>1</filterpriority> 
    266         public IEnumerator<TItem> GetEnumerator() 
    267         { 
    268             return this._GetEnumerator(); 
    269         } 
    270  
    271         ///<summary> 
    272         ///Returns an enumerator that iterates through a collection. 
    273         ///</summary> 
    274         /// 
    275         ///<returns> 
    276         ///An <see cref="T:System.Collections.IEnumerator"></see> object that can be used to iterate through the collection. 
    277         ///</returns> 
    278         ///<filterpriority>2</filterpriority> 
    279         IEnumerator IEnumerable.GetEnumerator() 
    280         { 
    281             return this._GetEnumerator(); 
    282         } 
    283  
    284         protected internal abstract IEnumerator<TItem> _GetEnumerator(); 
    285     } 
    286  
    287     internal class ITBaseEnumerator<TITunesItem, TItem, TBaseCollection> : IEnumerator<TItem> 
    288         where TBaseCollection : IITBaseCollection<TItem>, ItemCreatableCollection<TITunesItem, TItem> 
    289         where TItem : class 
    290     { 
    291         protected internal readonly TBaseCollection _collection; 
    292         protected internal readonly IEnumerator _internal; 
    293         protected TItem _current; 
    294  
    295         internal ITBaseEnumerator(IEnumerator internalEnumerator, TBaseCollection baseCollection) 
    296         { 
    297             this._internal = internalEnumerator; 
    298             this._collection = baseCollection; 
    299         } 
    300  
    301         ///<summary> 
    302         ///Advances the enumerator to the next element of the collection. 
    303         ///</summary> 
    304         /// 
    305         ///<returns> 
    306         ///true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. 
    307         ///</returns> 
    308         /// 
    309         ///<exception cref="T:System.InvalidOperationException">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority> 
    310         public bool MoveNext() 
    311         { 
    312             this._current = null; 
    313             return this._internal.MoveNext(); 
    314         } 
    315  
    316         ///<summary> 
    317         ///Sets the enumerator to its initial position, which is before the first element in the collection. 
    318         ///</summary> 
    319         /// 
    320         ///<exception cref="T:System.InvalidOperationException">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority> 
    321         public void Reset() 
    322         { 
    323             this._internal.Reset(); 
    324         } 
    325  
    326         ///<summary> 
    327         ///Gets the current element in the collection. 
    328         ///</summary> 
    329         /// 
    330         ///<returns> 
    331         ///The current element in the collection. 
    332         ///</returns> 
    333         /// 
    334         ///<exception cref="T:System.InvalidOperationException">The enumerator is positioned before the first element of the collection or after the last element. </exception><filterpriority>2</filterpriority> 
    335         object IEnumerator.Current 
    336         { 
    337             get { return this.GetCurrent(); } 
    338         } 
    339  
    340         ///<summary> 
    341         ///Gets the element in the collection at the current position of the enumerator. 
    342         ///</summary> 
    343         /// 
    344         ///<returns> 
    345         ///The element in the collection at the current position of the enumerator. 
    346         ///</returns> 
    347         /// 
    348         TItem IEnumerator<TItem>.Current 
    349         { 
    350             get { return this.GetCurrent(); } 
    351         } 
    352  
    353         ///<summary> 
    354         ///Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. 
    355         ///</summary> 
    356         ///<filterpriority>2</filterpriority> 
    357         public void Dispose() 
    358         { 
    359         } 
    360  
    361         protected TItem GetCurrent() 
    362         { 
    363             if (this._current == null) 
    364             { 
    365                 this._current = this._GetCurrent(); 
    366             } 
    367  
    368             return this._current; 
    369         } 
    370  
    371         protected TItem _GetCurrent() 
    372         { 
    373             return this._collection.CreateItem((TITunesItem) this._internal.Current); 
     267        internal class ParentStringIndexerReferrer<TCollection, TItem> : IIndexedCollection<string, TItem> 
     268            where TCollection : IIndexedCollection<string, TItem> 
     269        { 
     270            protected internal readonly TCollection _parent; 
     271 
     272            internal ParentStringIndexerReferrer(TCollection _parent) 
     273            { 
     274                this._parent = _parent; 
     275            } 
     276 
     277            public TItem this[string Name] 
     278            { 
     279                get { return this._parent[Name]; } 
     280            } 
     281        } 
     282 
     283        internal abstract class ITBaseCollection<TItem> : ITFactory, IITBaseCollection<TItem> 
     284            where TItem : class 
     285        { 
     286            protected ITBaseCollection(object _internal, ITunesApp app) 
     287                : base(_internal, app) 
     288            { 
     289            } 
     290 
     291            public abstract int Count { get; } 
     292 
     293            ///<summary> 
     294            ///Returns an enumerator that iterates through the collection. 
     295            ///</summary> 
     296            /// 
     297            ///<returns> 
     298            ///A <see cref="T:System.Collections.Generic.IEnumerator`1"></see> that can be used to iterate through the collection. 
     299            ///</returns> 
     300            ///<filterpriority>1</filterpriority> 
     301            public IEnumerator<TItem> GetEnumerator() 
     302            { 
     303                return this._GetEnumerator(); 
     304            } 
     305 
     306            ///<summary> 
     307            ///Returns an enumerator that iterates through a collection. 
     308            ///</summary> 
     309            /// 
     310            ///<returns> 
     311            ///An <see cref="T:System.Collections.IEnumerator"></see> object that can be used to iterate through the collection. 
     312            ///</returns> 
     313            ///<filterpriority>2</filterpriority> 
     314            IEnumerator IEnumerable.GetEnumerator() 
     315            { 
     316                return this._GetEnumerator(); 
     317            } 
     318 
     319            protected internal abstract IEnumerator<TItem> _GetEnumerator(); 
     320        } 
     321 
     322        internal class ITBaseEnumerator<TITunesItem, TItem, TBaseCollection> : IEnumerator<TItem> 
     323            where TBaseCollection : IITBaseCollection<TItem>, ItemCreatableCollection<TITunesItem, TItem> 
     324            where TItem : class 
     325        { 
     326            protected internal readonly TBaseCollection _collection; 
     327            protected internal readonly IEnumerator _internal; 
     328            protected TItem _current; 
     329 
     330            internal ITBaseEnumerator(IEnumerator internalEnumerator, TBaseCollection baseCollection) 
     331            { 
     332                this._internal = internalEnumerator; 
     333                this._collection = baseCollection; 
     334            } 
     335 
     336            ///<summary> 
     337            ///Advances the enumerator to the next element of the collection. 
     338            ///</summary> 
     339            /// 
     340            ///<returns> 
     341            ///true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. 
     342            ///</returns> 
     343            /// 
     344            ///<exception cref="T:System.InvalidOperationException">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority> 
     345            public bool MoveNext() 
     346            { 
     347                this._current = null; 
     348                return this._internal.MoveNext(); 
     349            } 
     350 
     351            ///<summary> 
     352            ///Sets the enumerator to its initial position, which is before the first element in the collection. 
     353            ///</summary> 
     354            /// 
     355            ///<exception cref="T:System.InvalidOperationException">The collection was modified after the enumerator was created. </exception><filterpriority>2</filterpriority> 
     356            public void Reset() 
     357            { 
     358                this._internal.Reset(); 
     359            } 
     360 
     361            ///<summary> 
     362            ///Gets the current element in the collection. 
     363            ///</summary> 
     364            /// 
     365            ///<returns> 
     366            ///The current element in the collection. 
     367            ///</returns> 
     368            /// 
     369            ///<exception cref="T:System.InvalidOperationException">The enumerator is positioned before the first element of the collection or after the last element. </exception><filterpriority>2</filterpriority> 
     370            object IEnumerator.Current 
     371            { 
     372                get { return this.GetCurrent(); } 
     373            } 
     374 
     375            ///<summary> 
     376            ///Gets the element in the collection at the current position of the enumerator. 
     377            ///</summary> 
     378            /// 
     379            ///<returns> 
     380            ///The element in the collection at the current position of the enumerator. 
     381            ///</returns> 
     382            /// 
     383            TItem IEnumerator<TItem>.Current 
     384            { 
     385                get { return this.GetCurrent(); } 
     386            } 
     387 
     388            ///<summary> 
     389            ///Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. 
     390            ///</summary> 
     391            ///<filterpriority>2</filterpriority> 
     392            public void Dispose() 
     393            { 
     394            } 
     395 
     396            protected TItem GetCurrent() 
     397            { 
     398                if (this._current == null) 
     399                { 
     400                    this._current = this._GetCurrent(); 
     401                } 
     402 
     403                return this._current; 
     404            } 
     405 
     406            protected TItem _GetCurrent() 
     407            { 
     408                return this._collection.CreateItem((TITunesItem)this._internal.Current); 
     409            } 
    374410        } 
    375411    } 
  • lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/EQPresets.cs

    r11205 r19308  
    44using System.Linq; 
    55using Clovery.iTunesHelper.COMWrap.Interfaces; 
     6using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 
     7using Clovery.iTunesHelper.COMWrap.Internal; 
    68using iTunes = iTunesLib; 
    79 
  • lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Encoders.cs

    r11205 r19308  
    44using System.Linq; 
    55using Clovery.iTunesHelper.COMWrap.Interfaces; 
     6using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 
     7using Clovery.iTunesHelper.COMWrap.Internal; 
    68using iTunes = iTunesLib; 
    79 
  • lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Enums.cs

    r11205 r19308  
    542542    ///     <item><term>1.8</term><description>iTunes 7.0</description></item> 
    543543    ///     <item><term>1.9</term><description>iTunes 7.1</description></item> 
    544     ///     <item><term>1.10</term><description>iTunes 7.2?</description></item> 
     544    ///     <item><term>1.10</term><description>iTunes 7.4</description></item> 
     545    ///     <item><term>1.11</term><description>iTunes 7.7</description></item> 
    545546    /// </list> 
    546547    /// </summary> 
     
    555556        /// iTunes type library minor version 
    556557        /// </summary> 
    557         MinorVersion = 10 
     558        MinorVersion = 11 
    558559    } 
    559560 
  • lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Factory.cs

    r11205 r19308  
    44using System.Collections.Generic; 
    55using System.Linq; 
     6using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 
    67using iTunesLib; 
    78 
     
    4142        public IITObject CreateAbstractObject(int sourceID, int playlistID, int trackID, int TrackDatabaseID) 
    4243        { 
    43             return new ITObject(sourceID, playlistID, trackID, TrackDatabaseID, this.app); 
     44            return new ITObject(sourceID, playlistID, trackID, TrackDatabaseID, null, this.app); 
    4445        } 
    4546 
  • lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Interfaces/IArtwork.cs

    r11205 r19308  
    11// $Id$ 
     2using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 
     3 
    24namespace Clovery.iTunesHelper.COMWrap.Interfaces 
    35{ 
     
    2426        /// </summary> 
    2527        bool IsDownloadedArtwork { get; } 
     28 
     29        /// <summary> 
     30        /// get/set the description for the artwork. 
     31        /// </summary> 
     32        /// <remarks> 
     33        /// Artwork descriptions are only supported in files that use ID3 tags (i.e. MP3 files).  
     34        /// </remarks> 
     35        string Description { get; set; } 
    2636 
    2737        /// <summary> 
  • lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Interfaces/IBase.cs

    r11205 r19308  
    22using System; 
    33using System.Collections.Generic; 
     4using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 
    45using iTunes = iTunesLib; 
    56 
     
    99100        /// </remarks> 
    100101        int TrackDatabaseID { get; } 
     102 
     103        /// <summary> 
     104        /// Get the persistent ID. 
     105        /// </summary> 
     106        /// <remarks> 
     107        /// <para>64-bit persistent which can be used to identify 
     108        /// the IITObject across multiple invocations of iTunes.</para> 
     109        /// </remarks> 
     110        long PersistentID { get; } 
    101111 
    102112        /// <summary> 
     
    136146    } 
    137147 
    138  
    139     /// <summary> 
    140     /// Interface of a index enabled collection. 
    141     /// </summary> 
    142     /// <typeparam name="TIndex">Index type</typeparam> 
    143     /// <typeparam name="TItem">Item type</typeparam> 
    144     public interface IIndexedCollection<TIndex, TItem> 
     148    namespace Internal 
    145149    { 
    146150        /// <summary> 
    147         /// collection indexer of specified type. 
    148         /// </summary> 
    149         /// <param name="Index"><typeparamref name="TIndex"/>'s index of <typeparamref name="TItem"/> to retrive.</param> 
    150         /// <returns>Returns an <typeparamref name="TItem"/> object corresponding to the specified index.</returns> 
    151         TItem this[TIndex Index] { get; } 
    152     } 
    153  
    154     /// <summary> 
    155     /// Base interface of iTunes collections. 
    156     /// </summary> 
    157     /// <typeparam name="TItem">Wrapped item type</typeparam> 
    158     public interface IITBaseCollection<TItem> : IEnumerable<TItem>, IITFactory 
    159     { 
    160         /// <summary> 
    161         /// Get count of items. 
    162         /// </summary> 
    163         int Count { get; } 
    164     } 
    165  
    166     /// <summary> 
    167     /// interface of iTunes item creatable collections. 
    168     /// </summary> 
    169     /// <typeparam name="TITunesItem">Native iTunes item type</typeparam> 
    170     /// <typeparam name="TItem">Wrapped item type</typeparam> 
    171     internal interface ItemCreatableCollection<TITunesItem, TItem> 
    172     { 
    173         /// <summary> 
    174         /// Create item from Native iTunes item. 
    175         /// </summary> 
    176         /// <param name="item">Native iTunes item of <typeparamref name="TITunesItem"/>'s object.</param> 
    177         /// <returns>Wrapped item of <typeparamref name="TItem"/>'s object.</returns> 
    178         TItem CreateItem(TITunesItem item); 
    179     } 
    180  
    181     /// <summary> 
    182     /// interface of iTunes named collections. 
    183     /// </summary> 
    184     /// <typeparam name="TItem">Wrapped item type</typeparam> 
    185     public interface INamedCollection<TItem> : 
    186         IITBaseCollection<TItem>, IIndexedCollection<string, TItem>, IIndexedCollection<int, TItem> 
    187     { 
    188         /// <summary> 
    189         /// Returns an ItemByName indexer collection. 
    190         /// </summary> 
    191         IIndexedCollection<string, TItem> ItemByName { get; } 
    192     } 
    193  
    194     /// <summary> 
    195     /// object factory of wrapped iTunes object. 
    196     /// </summary> 
    197     public interface IITunesWrappedObjectFactory 
    198     { 
    199         IITObject GetCachedIITObject(int sourceID, int playlistID, int trackID, int TrackDatabaseID); 
    200         IITObject GetCachedIITObject(iTunesLib.IITObject _internal); 
    201         void PurgeObjectCache(); 
    202  
    203         TResult GetCacheOrAbstractObject<TResult>(int sourceID, int playlistID, int trackID, int TrackDatabaseID) 
    204             where TResult : class, IITObject; 
    205  
    206         /// <summary> 
    207         /// Returns an abstract iTunes object corresponding to the specified IDs. 
    208         /// </summary> 
    209         /// <remarks> 
    210         /// The object may be a source, playlist, or track. 
    211         /// </remarks> 
    212         /// <param name="sourceID">The ID that identifies the source. Valid for a source, playlist, or track.</param> 
    213         /// <param name="playlistID">The ID that identifies the playlist. Valid for a playlist or track. 
    214         /// Must be zero for a source.</param> 
    215         /// <param name="trackID">The ID that identifies the track within the playlist. Valid for a track. 
    216         /// Must be zero for a source or playlist.</param> 
    217         /// <param name="TrackDatabaseID">The ID that identifies the track, independent of its playlist. 
    218         /// Valid for a track. Must be zero for a source or playlist.</param> 
    219         /// <returns>Returns an <see cref="ITObject"/> object corresponding to the specified IDs.</returns> 
    220         IITObject CreateAbstractObject(int sourceID, int playlistID, int trackID, int TrackDatabaseID); 
    221  
    222         /// <summary> 
    223         /// Returns a wrapped object implements iTunes object corresponding to a native. 
    224         /// </summary> 
    225         /// <param name="_internal">internal <see cref="iTunes.IITObject" /> object.</param> 
    226         /// <returns>Returns a wrapped object implements <see cref="ITObject"/>.</returns> 
    227         IITObject CreateObject(iTunes.IITObject _internal); 
    228  
    229         /// <summary> 
    230         /// Returns a wrapped object implements playlist object corresponding to a native playlist. 
    231         /// </summary> 
    232         /// <param name="_internal">internal <see cref="iTunes.IITPlaylist"/> object.</param> 
    233         /// <returns>Returns a wrapped object implements <see cref="IPlaylist"/>.</returns> 
    234         IPlaylist CreatePlaylist(iTunes.IITPlaylist _internal); 
    235  
    236         /// <summary> 
    237         /// Returns a wrapped object implements library playlist object corresponding to a native library playlist. 
    238         /// </summary> 
    239         /// <param name="_internal">internal <see cref="iTunes.IITLibraryPlaylist"/> object.</param> 
    240         /// <returns>Returns a wrapped object implements <see cref="ILibraryPlaylist"/>.</returns> 
    241         ILibraryPlaylist CreateLibraryPlaylist(iTunes.IITLibraryPlaylist _internal); 
    242  
    243         /// <summary> 
    244         /// Returns a wrapped object implements user playlist object corresponding to a native user playlist. 
    245         /// </summary> 
    246         /// <param name="_internal">internal <see cref="iTunes.IITUserPlaylist"/> object.</param> 
    247         /// <returns>Returns a wrapped object implements <see cref="IUserPlaylist"/>.</returns> 
    248         IUserPlaylist CreateUserPlaylist(iTunes.IITUserPlaylist _internal); 
    249  
    250         /// <summary> 
    251         /// Returns a wrapped object implements playlist collection object correspoding to a native playlist collection. 
    252         /// </summary> 
    253         /// <param name="_internal">internal <see cref="iTunes.IITPlaylistCollection"/> object.</param> 
    254         /// <returns>Returns a wrapped object implements <see cref="IPlaylistCollection"/>.</returns> 
    255         IPlaylistCollection CreatePlaylistCollection(iTunes.IITPlaylistCollection _internal); 
    256  
    257         /// <summary> 
    258         /// Returns a wrapped object implements source object corresponding to a native source. 
    259         /// </summary> 
    260         /// <param name="_internal">internal <see cref="iTunes.IITSource"/> object.</param> 
    261         /// <returns>Returns a wrapped object implements <see cref="ISource"/>.</returns> 
    262         ISource CreateSource(iTunes.IITSource _internal); 
    263  
    264         /// <summary> 
    265         /// Returns a wrapped object implements source collection object corresponding to a native source collection. 
    266         /// </summary> 
    267         /// <param name="_internal">internal <see cref="iTunes.IITSourceCollection"/> object.</param> 
    268         /// <returns>Returns a wrapped object implements <see cref="ISourceCollection"/>.</returns> 
    269         ISourceCollection CreateSourceCollection(iTunes.IITSourceCollection _internal); 
    270  
    271         /// <summary> 
    272         /// Returns a wrapped object implements track object corresponding to a native track. 
    273         /// </summary> 
    274         /// <param name="_internal">internal <see cref="iTunes.IITTrack"/> object.</param> 
    275         /// <returns>Returns a wrapped object implements <see cref="ITrack"/>.</returns> 
    276         ITrack CreateTrack(iTunes.IITTrack _internal); 
    277  
    278         /// <summary> 
    279         /// Returns a wrapped object implements url track object corresponding to a native url track. 
    280         /// </summary> 
    281         /// <param name="_internal">internal <see cref="iTunes.IITURLTrack"/> object.</param> 
    282         /// <returns>Returns a wrapped object implements <see cref="IURLTrack"/>.</returns> 
    283         IURLTrack CreateURLTrack(iTunes.IITURLTrack _internal); 
    284  
    285         /// <summary> 
    286         /// Returns a wrapped object implements track collection object corresponding to a native track collection. 
    287         /// </summary> 
    288         /// <param name="_internal">internal <see cref="iTunes.IITTrackCollection"/> object.</param> 
    289         /// <returns>Returns a wrapped object implements <see cref="ITrackCollection"/>.</returns> 
    290         ITrackCollection CreateTrackCollection(iTunes.IITTrackCollection _internal); 
    291  
    292         /// <summary> 
    293         /// Returns a wrapped object implements window object corresponding to a native window. 
    294         /// </summary> 
    295         /// <param name="_internal">internal <see cref="iTunes.IITWindow"/> object.</param> 
    296         /// <returns>Returns a wrapped object implements <see cref="IWindow"/>.</returns> 
    297         IWindow CreateWindow(iTunes.IITWindow _internal); 
    298  
    299         /// <summary> 
    300         /// Returns a wrapped object implements browser window object corresponding to a native browser window. 
    301         /// </summary> 
    302         /// <param name="_internal">internal <see cref="iTunes.IITBrowserWindow"/> object.</param> 
    303         /// <returns>Returns a wrapped object implements <see cref="IBrowserWindow"/>.</returns> 
    304         IBrowserWindow CreateBrowserWindow(iTunes.IITBrowserWindow _internal); 
    305  
    306         /// <summary> 
    307         /// Returns a wrapped object implements window collection object corresponding to a native window collection. 
    308         /// </summary> 
    309         /// <param name="_internal">internal <see cref="iTunes.IITWindowCollection"/> object.</param> 
    310         /// <returns>Returns a wrapped object implements <see cref="IWindowCollection"/>.</returns> 
    311         IWindowCollection CreateWindowCollection(iTunes.IITWindowCollection _internal); 
    312  
    313         /// <summary> 
    314         /// Returns a wrapped object implements artwork object corresponding to a native artwork. 
    315         /// </summary> 
    316         /// <param name="_internal">internal <see cref="iTunes.IITArtwork"/> object.</param> 
    317         /// <returns>Returns a wrapped object implements <see cref="IArtwork"/>.</returns> 
    318         IArtwork CreateArtwork(iTunes.IITArtwork _internal); 
    319  
    320         /// <summary> 
    321         /// Returns a wrapped object implements artwork collection object corresponding to a native artwork collection. 
    322         /// </summary> 
    323         /// <param name="_internal">internal <see cref="iTunes.IITArtworkCollection"/> object.</param> 
    324         /// <returns>Returns a wrapped object implements <see cref="IArtworkCollection"/>.</returns> 
    325         IArtworkCollection CreateArtworkCollection(iTunes.IITArtworkCollection _internal); 
    326  
    327         /// <summary> 
    328         /// Returns a wrapped object implements encoder object corresponding to a native encoder. 
    329         /// </summary> 
    330         /// <param name="_internal">internal <see cref="iTunes.IITEncoder"/> object.</param> 
    331         /// <returns>Returns a wrapped object implements <see cref="IEncoder"/>.</returns> 
    332         IEncoder CreateEncoder(iTunes.IITEncoder _internal); 
    333  
    334         /// <summary> 
    335         /// Returns a encoder collection object corresponding to a native encoder collection object. 
    336         /// </summary> 
    337         /// <param name="_internal">internal <see cref="iTunes.IITEncoderCollection"/> object.</param> 
    338         /// <returns>Returns a wrapped object implements <see cref="IEncoderCollection"/>.</returns> 
    339         IEncoderCollection CreateEncoderCollection(iTunes.IITEncoderCollection _internal); 
    340  
    341         /// <summary> 
    342         /// Returns a equalizer preset object corresponding to a native equalizer preset object. 
    343         /// </summary> 
    344         /// <param name="_internal">internal <see cref="iTunes.IITEQPreset"/> object.</param> 
    345         /// <returns>Returns a wrapped object implements <see cref="IEQPreset"/>.</returns> 
    346         IEQPreset CreateEQPreset(iTunes.IITEQPreset _internal); 
    347  
    348         /// <summary> 
    349         /// Returns a equalizer preset collection object corresponding to a native equalizer preset collection object. 
    350         /// </summary> 
    351         /// <param name="_internal">internal <see cref="iTunes.IITEQPresetCollection"/> object.</param> 
    352         /// <returns>Returns a wrapped object implements <see cref="IEQPresetCollection"/>.</returns> 
    353         IEQPresetCollection CreateEQPresetCollection(iTunes.IITEQPresetCollection _internal); 
    354  
    355         /// <summary> 
    356         /// Returns a visual object corresponding to a native visual object. 
    357         /// </summary> 
    358         /// <param name="_internal">internal <see cref="iTunes.IITVisual"/> object.</param> 
    359         /// <returns>Returns a wrapped object implements <see cref="IVisual"/>.</returns> 
    360         IVisual CreateVisual(iTunes.IITVisual _internal); 
    361  
    362         /// <summary> 
    363         /// Returns a visual collection object corresponding to a native visual collection object. 
    364         /// </summary> 
    365         /// <param name="_internal">internal <see cref="iTunes.IITVisualCollection"/> object.</param> 
    366         /// <returns>Returns a wrapped object implements <see cref="IVisualCollection"/>.</returns> 
    367         IVisualCollection CreateVisualCollection(iTunes.IITVisualCollection _internal); 
    368  
    369         /// <summary> 
    370         /// Returns a operation status object corresponding to a native operation status object. 
    371         /// </summary> 
    372         /// <param name="_internal">internal <see cref="iTunes.IITOperationStatus"/> object.</param> 
    373         /// <returns>Returns a wrapped object implements <see cref="IOperationStatus"/>.</returns> 
    374         IOperationStatus CreateOperationStatus(iTunes.IITOperationStatus _internal); 
    375  
    376         /// <summary> 
    377         /// Returns a convert operation status object corresponding to a native convert operation status object. 
    378         /// </summary> 
    379         /// <param name="_internal">internal <see cref="iTunes.iTunesConvertOperationStatus"/> object.</param> 
    380         /// <returns>Returns a wrapped object implements <see cref="IConvertOperationStatusWithEvents"/>.</returns> 
    381         IConvertOperationStatusWithEvents CreateConvertOperationStatus(iTunes.iTunesConvertOperationStatus _internal); 
     151        /// Interface of a index enabled collection. 
     152        /// </summary> 
     153        /// <typeparam name="TIndex">Index type</typeparam> 
     154        /// <typeparam name="TItem">Item type</typeparam> 
     155        public interface IIndexedCollection<TIndex, TItem> 
     156        { 
     157            /// <summary> 
     158            /// collection indexer of specified type. 
     159            /// </summary> 
     160            /// <param name="Index"><typeparamref name="TIndex"/>'s index of <typeparamref name="TItem"/> to retrive.</param> 
     161            /// <returns>Returns an <typeparamref name="TItem"/> object corresponding to the specified index.</returns> 
     162            TItem this[TIndex Index] { get; } 
     163        } 
     164 
     165        /// <summary> 
     166        /// Base interface of iTunes collections. 
     167        /// </summary> 
     168        /// <typeparam name="TItem">Wrapped item type</typeparam> 
     169        public interface IITBaseCollection<TItem> : IEnumerable<TItem>, IITFactory 
     170        { 
     171            /// <summary> 
     172            /// Get count of items. 
     173            /// </summary> 
     174            int Count { get; } 
     175        } 
     176 
     177        /// <summary> 
     178        /// interface of iTunes item creatable collections. 
     179        /// </summary> 
     180        /// <typeparam name="TITunesItem">Native iTunes item type</typeparam> 
     181        /// <typeparam name="TItem">Wrapped item type</typeparam> 
     182        internal interface ItemCreatableCollection<TITunesItem, TItem> 
     183        { 
     184            /// <summary> 
     185            /// Create item from Native iTunes item. 
     186            /// </summary> 
     187            /// <param name="item">Native iTunes item of <typeparamref name="TITunesItem"/>'s object.</param> 
     188            /// <returns>Wrapped item of <typeparamref name="TItem"/>'s object.</returns> 
     189            TItem CreateItem(TITunesItem item); 
     190        } 
     191 
     192        /// <summary> 
     193        /// interface of iTunes named collections. 
     194        /// </summary> 
     195        /// <typeparam name="TItem">Wrapped item type</typeparam> 
     196        public interface INamedCollection<TItem> : 
     197            IITBaseCollection<TItem>, IIndexedCollection<string, TItem>, IIndexedCollection<int, TItem> 
     198        { 
     199            /// <summary> 
     200            /// Returns an ItemByName indexer collection. 
     201            /// </summary> 
     202            IIndexedCollection<string, TItem> ItemByName { get; } 
     203        } 
     204 
     205        /// <summary> 
     206        /// object factory of wrapped iTunes object. 
     207        /// </summary> 
     208        public interface IITunesWrappedObjectFactory 
     209        { 
     210            IITObject GetCachedIITObject(int sourceID, int playlistID, int trackID, int TrackDatabaseID); 
     211            IITObject GetCachedIITObject(iTunesLib.IITObject _internal); 
     212            void PurgeObjectCache(); 
     213 
     214            TResult GetCacheOrAbstractObject<TResult>(int sourceID, int playlistID, int trackID, int TrackDatabaseID) 
     215                where TResult : class, IITObject; 
     216 
     217            /// <summary> 
     218            /// Returns an abstract iTunes object corresponding to the specified IDs. 
     219            /// </summary> 
     220            /// <remarks> 
     221            /// The object may be a source, playlist, or track. 
     222            /// </remarks> 
     223            /// <param name="sourceID">The ID that identifies the source. Valid for a source, playlist, or track.</param> 
     224            /// <param name="playlistID">The ID that identifies the playlist. Valid for a playlist or track. 
     225            /// Must be zero for a source.</param> 
     226            /// <param name="trackID">The ID that identifies the track within the playlist. Valid for a track. 
     227            /// Must be zero for a source or playlist.</param> 
     228            /// <param name="TrackDatabaseID">The ID that identifies the track, independent of its playlist. 
     229            /// Valid for a track. Must be zero for a source or playlist.</param> 
     230            /// <returns>Returns an <see cref="ITObject"/> object corresponding to the specified IDs.</returns> 
     231            IITObject CreateAbstractObject(int sourceID, int playlistID, int trackID, int TrackDatabaseID); 
     232 
     233            /// <summary> 
     234            /// Returns a wrapped object implements iTunes object corresponding to a native. 
     235            /// </summary> 
     236            /// <param name="_internal">internal <see cref="iTunes.IITObject" /> object.</param> 
     237            /// <returns>Returns a wrapped object implements <see cref="ITObject"/>.</returns> 
     238            IITObject CreateObject(iTunes.IITObject _internal); 
     239 
     240            /// <summary> 
     241            /// Returns a wrapped object implements playlist object corresponding to a native playlist. 
     242            /// </summary> 
     243            /// <param name="_internal">internal <see cref="iTunes.IITPlaylist"/> object.</param> 
     244            /// <returns>Returns a wrapped object implements <see cref="IPlaylist"/>.</returns> 
     245            IPlaylist CreatePlaylist(iTunes.IITPlaylist _internal); 
     246 
     247            /// <summary> 
     248            /// Returns a wrapped object implements library playlist object corresponding to a native library playlist. 
     249            /// </summary> 
     250            /// <param name="_internal">internal <see cref="iTunes.IITLibraryPlaylist"/> object.</param> 
     251            /// <returns>Returns a wrapped object implements <see cref="ILibraryPlaylist"/>.</returns> 
     252            ILibraryPlaylist CreateLibraryPlaylist(iTunes.IITLibraryPlaylist _internal); 
     253 
     254            /// <summary> 
     255            /// Returns a wrapped object implements user playlist object corresponding to a native user playlist. 
     256            /// </summary> 
     257            /// <param name="_internal">internal <see cref="iTunes.IITUserPlaylist"/> object.</param> 
     258            /// <returns>Returns a wrapped object implements <see cref="IUserPlaylist"/>.</returns> 
     259            IUserPlaylist CreateUserPlaylist(iTunes.IITUserPlaylist _internal); 
     260 
     261            /// <summary> 
     262            /// Returns a wrapped object implements playlist collection object correspoding to a native playlist collection. 
     263            /// </summary> 
     264            /// <param name="_internal">internal <see cref="iTunes.IITPlaylistCollection"/> object.</param> 
     265            /// <returns>Returns a wrapped object implements <see cref="IPlaylistCollection"/>.</returns> 
     266            IPlaylistCollection CreatePlaylistCollection(iTunes.IITPlaylistCollection _internal); 
     267 
     268            /// <summary> 
     269            /// Returns a wrapped object implements source object corresponding to a native source. 
     270            /// </summary> 
     271            /// <param name="_internal">internal <see cref="iTunes.IITSource"/> object.</param> 
     272            /// <returns>Returns a wrapped object implements <see cref="ISource"/>.</returns> 
     273            ISource CreateSource(iTunes.IITSource _internal); 
     274 
     275            /// <summary> 
     276            /// Returns a wrapped object implements source collection object corresponding to a native source collection. 
     277            /// </summary> 
     278            /// <param name="_internal">internal <see cref="iTunes.IITSourceCollection"/> object.</param> 
     279            /// <returns>Returns a wrapped object implements <see cref="ISourceCollection"/>.</returns> 
     280            ISourceCollection CreateSourceCollection(iTunes.IITSourceCollection _internal); 
     281 
     282            /// <summary> 
     283            /// Returns a wrapped object implements track object corresponding to a native track. 
     284            /// </summary> 
     285            /// <param name="_internal">internal <see cref="iTunes.IITTrack"/> object.</param> 
     286            /// <returns>Returns a wrapped object implements <see cref="ITrack"/>.</returns> 
     287            ITrack CreateTrack(iTunes.IITTrack _internal); 
     288 
     289            /// <summary> 
     290            /// Returns a wrapped object implements url track object corresponding to a native url track. 
     291            /// </summary> 
     292            /// <param name="_internal">internal <see cref="iTunes.IITURLTrack"/> object.</param> 
     293            /// <returns>Returns a wrapped object implements <see cref="IURLTrack"/>.</returns> 
     294            IURLTrack CreateURLTrack(iTunes.IITURLTrack _internal); 
     295 
     296            /// <summary> 
     297            /// Returns a wrapped object implements track collection object corresponding to a native track collection. 
     298            /// </summary> 
     299            /// <param name="_internal">internal <see cref="iTunes.IITTrackCollection"/> object.</param> 
     300            /// <returns>Returns a wrapped object implements <see cref="ITrackCollection"/>.</returns> 
     301            ITrackCollection CreateTrackCollection(iTunes.IITTrackCollection _internal); 
     302 
     303            /// <summary> 
     304            /// Returns a wrapped object implements window object corresponding to a native window. 
     305            /// </summary> 
     306            /// <param name="_internal">internal <see cref="iTunes.IITWindow"/> object.</param> 
     307            /// <returns>Returns a wrapped object implements <see cref="IWindow"/>.</returns> 
     308            IWindow CreateWindow(iTunes.IITWindow _internal); 
     309 
     310            /// <summary> 
     311            /// Returns a wrapped object implements browser window object corresponding to a native browser window. 
     312            /// </summary> 
     313            /// <param name="_internal">internal <see cref="iTunes.IITBrowserWindow"/> object.</param> 
     314            /// <returns>Returns a wrapped object implements <see cref="IBrowserWindow"/>.</returns> 
     315            IBrowserWindow CreateBrowserWindow(iTunes.IITBrowserWindow _internal); 
     316 
     317            /// <summary> 
     318            /// Returns a wrapped object implements window collection object corresponding to a native window collection. 
     319            /// </summary> 
     320            /// <param name="_internal">internal <see cref="iTunes.IITWindowCollection"/> object.</param> 
     321            /// <returns>Returns a wrapped object implements <see cref="IWindowCollection"/>.</returns> 
     322            IWindowCollection CreateWindowCollection(iTunes.IITWindowCollection _internal); 
     323 
     324            /// <summary> 
     325            /// Returns a wrapped object implements artwork object corresponding to a native artwork. 
     326            /// </summary> 
     327            /// <param name="_internal">internal <see cref="iTunes.IITArtwork"/> object.</param> 
     328            /// <returns>Returns a wrapped object implements <see cref="IArtwork"/>.</returns> 
     329            IArtwork CreateArtwork(iTunes.IITArtwork _internal); 
     330 
     331            /// <summary> 
     332            /// Returns a wrapped object implements artwork collection object corresponding to a native artwork collection. 
     333            /// </summary> 
     334            /// <param name="_internal">internal <see cref="iTunes.IITArtworkCollection"/> object.</param> 
     335            /// <returns>Returns a wrapped object implements <see cref="IArtworkCollection"/>.</returns> 
     336            IArtworkCollection CreateArtworkCollection(iTunes.IITArtworkCollection _internal); 
     337 
     338            /// <summary> 
     339            /// Returns a wrapped object implements encoder object corresponding to a native encoder. 
     340            /// </summary> 
     341            /// <param name="_internal">internal <see cref="iTunes.IITEncoder"/> object.</param> 
     342            /// <returns>Returns a wrapped object implements <see cref="IEncoder"/>.</returns> 
     343            IEncoder CreateEncoder(iTunes.IITEncoder _internal); 
     344 
     345            /// <summary> 
     346            /// Returns a encoder collection object corresponding to a native encoder collection object. 
     347            /// </summary> 
     348            /// <param name="_internal">internal <see cref="iTunes.IITEncoderCollection"/> object.</param> 
     349            /// <returns>Returns a wrapped object implements <see cref="IEncoderCollection"/>.</returns> 
     350            IEncoderCollection CreateEncoderCollection(iTunes.IITEncoderCollection _internal); 
     351 
     352            /// <summary> 
     353            /// Returns a equalizer preset object corresponding to a native equalizer preset object. 
     354            /// </summary> 
     355            /// <param name="_internal">internal <see cref="iTunes.IITEQPreset"/> object.</param> 
     356            /// <returns>Returns a wrapped object implements <see cref="IEQPreset"/>.</returns> 
     357            IEQPreset CreateEQPreset(iTunes.IITEQPreset _internal); 
     358 
     359            /// <summary> 
     360            /// Returns a equalizer preset collection object corresponding to a native equalizer preset collection object. 
     361            /// </summary> 
     362            /// <param name="_internal">internal <see cref="iTunes.IITEQPresetCollection"/> object.</param> 
     363            /// <returns>Returns a wrapped object implements <see cref="IEQPresetCollection"/>.</returns> 
     364            IEQPresetCollection CreateEQPresetCollection(iTunes.IITEQPresetCollection _internal); 
     365 
     366            /// <summary> 
     367            /// Returns a visual object corresponding to a native visual object. 
     368            /// </summary> 
     369            /// <param name="_internal">internal <see cref="iTunes.IITVisual"/> object.</param> 
     370            /// <returns>Returns a wrapped object implements <see cref="IVisual"/>.</returns> 
     371            IVisual CreateVisual(iTunes.IITVisual _internal); 
     372 
     373            /// <summary> 
     374            /// Returns a visual collection object corresponding to a native visual collection object. 
     375            /// </summary> 
     376            /// <param name="_internal">internal <see cref="iTunes.IITVisualCollection"/> object.</param> 
     377            /// <returns>Returns a wrapped object implements <see cref="IVisualCollection"/>.</returns> 
     378            IVisualCollection CreateVisualCollection(iTunes.IITVisualCollection _internal); 
     379 
     380            /// <summary> 
     381            /// Returns a operation status object corresponding to a native operation status object. 
     382            /// </summary> 
     383            /// <param name="_internal">internal <see cref="iTunes.IITOperationStatus"/> object.</param> 
     384            /// <returns>Returns a wrapped object implements <see cref="IOperationStatus"/>.</returns> 
     385            IOperationStatus CreateOperationStatus(iTunes.IITOperationStatus _internal); 
     386 
     387            /// <summary> 
     388            /// Returns a convert operation status object corresponding to a native convert operation status object. 
     389            /// </summary> 
     390            /// <param name="_internal">internal <see cref="iTunes.iTunesConvertOperationStatus"/> object.</param> 
     391            /// <returns>Returns a wrapped object implements <see cref="IConvertOperationStatusWithEvents"/>.</returns> 
     392            IConvertOperationStatusWithEvents CreateConvertOperationStatus(iTunes.iTunesConvertOperationStatus _internal); 
     393        } 
    382394    } 
    383395} 
  • lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Interfaces/IEQPresets.cs

    r11205 r19308  
    11// $Id$ 
     2using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 
    23using iTunes = iTunesLib; 
    34 
  • lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Interfaces/IEncoders.cs

    r11205 r19308  
    11// $Id$ 
     2using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 
    23using iTunes = iTunesLib; 
    34 
  • lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Interfaces/IPlaylists.cs

    r11205 r19308  
    11// $Id$ 
    22using System.Collections.Generic; 
    3  
     3using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 
    44using iTunes = iTunesLib; 
    55namespace Clovery.iTunesHelper.COMWrap.Interfaces 
     
    1616        ITrackCollection Tracks { get; } 
    1717        List<ITrack> SameTracks(ITrack track); 
     18        List<ITrack> SameTracks(IItemTrack track); 
    1819        List<ITrack> SameTracks(int trackDatabaseID, string name); 
    1920        List<ITrack> SameTracks(int trackDatabaseID); 
     
    7778    { 
    7879        List<IPlaylist> this[string Name, int? maxCounts] { get; } 
     80 
     81        IIndexedCollection<long, IPlaylist> ItemByPersistentID { get; } 
    7982    } 
    8083 
     
    8891        IIndexedCollection<string, IPlaylist> ItemByName { get; } 
    8992    } 
     93 
    9094} 
  • lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Interfaces/ISources.cs

    r11205 r19308  
    11// $Id$ 
     2using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 
     3 
    24namespace Clovery.iTunesHelper.COMWrap.Interfaces 
    35{ 
     
    7375    } 
    7476 
    75     public interface ISourceCollection : INamedCollection<ISource> { } 
     77    public interface ISourceCollection : INamedCollection<ISource> 
     78    { 
     79        IIndexedCollection<long, ISource> ItemByPersistentID { get; } 
     80    } 
    7681} 
  • lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Interfaces/ITracks.cs

    r18990 r19308  
    11// $Id$ 
    22using System; 
     3using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 
    34using iTunes = iTunesLib; 
    45 
     
    242243 
    243244        /// <summary> 
     245        /// Get a collection of playlists that contain the song that this track represents. 
     246        /// </summary> 
     247        /// <remarks> 
     248        /// <para> 
     249        /// This is the same collection of playlists that are shown in the "Show in Playlist" contextual menu for a track,  
     250        /// plus the specific playlist that contains this track. 
     251        /// </para> 
     252        /// <para> 
     253        /// A track represents a song in a single playlist, 
     254        /// use <seealso cref="ITrack.Playlist" /> to get the specific playlist that contains this track. 
     255        /// </para> 
     256        /// </remarks> 
     257        IPlaylistCollection Playlists { get; } 
     258 
     259        /// <summary> 
    244260        /// Update the podcast feed for this track. 
    245261        /// </summary> 
     
    446462        /// </summary> 
    447463        IIndexedCollection<int, ITrack> ItemByPlayOrder { get; } 
     464 
     465        /// <summary> 
     466        /// Returns an ITrack object with the specified persistent ID. 
     467        /// </summary> 
     468        IIndexedCollection<long, ITrack> ItemByPersistentID { get; } 
    448469    } 
    449470} 
  • lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Interfaces/IVisuals.cs

    r11205 r19308  
    11// $Id$ 
     2using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 
    23using iTunes = iTunesLib; 
    34 
  • lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Interfaces/IWindows.cs

    r11205 r19308  
    11// $Id$ 
    22using Clovery.iTunesHelper.COMWrap; 
     3using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 
    34 
    45namespace Clovery.iTunesHelper.COMWrap.Interfaces 
  • lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Playlists.cs

    r11205 r19308  
    55using System.Linq; 
    66using Clovery.iTunesHelper.COMWrap.Interfaces; 
     7using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 
     8using Clovery.iTunesHelper.COMWrap.Internal; 
    79using iTunes = iTunesLib; 
    810 
     
    4850        } 
    4951 
     52        public List<ITrack> SameTracks(IItemTrack track) 
     53        { 
     54            // fall quickly 
     55            var playlistCollection = track.Playlists; 
     56            if (playlistCollection == null || !playlistCollection.Contains(this)) 
     57                return new List<ITrack>(); 
     58            return this.SameTracks((ITrack) track); 
     59        } 
     60 
    5061        public List<ITrack> SameTracks(int trackDatabaseId, string name) 
    5162        { 
     
    322333    { 
    323334        private readonly IIndexedCollection<string, IPlaylist> _itemByName; 
     335        private readonly IIndexedCollection<long, IPlaylist> _itemByPersistentID; 
    324336 
    325337        protected internal PlaylistCollection(iTunes.IITPlaylistCollection _internal, ITunesApp _app) 
     
    327339        { 
    328340            this._itemByName = new ParentStringIndexerReferrer<PlaylistCollection, IPlaylist>(this); 
     341            this._itemByPersistentID = new PlaylistPersistentIDIndex(this); 
    329342        } 
    330343 
     
    370383        } 
    371384 
     385        public IIndexedCollection<long, IPlaylist> ItemByPersistentID 
     386        { 
     387            get { return this._itemByPersistentID; } 
     388        } 
     389 
    372390        public IPlaylist CreateItem(iTunes.IITPlaylist item) 
    373391        { 
     
    383401    } 
    384402 
    385     internal class ChildPlaylistCollection : IChildPlaylistCollection 
     403    namespace Internal 
    386404    { 
    387         private readonly IIndexedCollection<string, IPlaylist> _itemByName; 
    388         private readonly List<IPlaylist> list; 
    389  
    390         public ChildPlaylistCollection(IPlaylist parent, ISource source) 
    391         { 
    392             this.list = new List<IPlaylist>(); 
    393             IUserPlaylist userPlaylist; 
    394             foreach (IPlaylist playlist in source.Playlists) 
    395             { 
    396                 userPlaylist = playlist as IUserPlaylist; 
    397                 if (userPlaylist == null) 
    398                     continue; 
    399                 if (!userPlaylist.Parent.Equals(parent)) 
    400                     continue; 
    401                 this.list.Add(userPlaylist); 
    402             } 
    403             this._itemByName = new ParentStringIndexerReferrer<ChildPlaylistCollection, IPlaylist>(this); 
    404         } 
    405  
    406         public int Count 
    407         { 
    408             get { return this.list.Count; } 
    409         } 
    410  
    411         public IPlaylist this[int Index] 
    412         { 
    413             get { return this.list[Index]; } 
    414         } 
    415  
    416         public IPlaylist this[string Name] 
    417         { 
    418             get 
    419             { 
    420                 List<IPlaylist> playlists = this[Name, 1]; 
    421                 return playlists.Count == 0 ? null : playlists[0]; 
    422             } 
    423         } 
    424  
    425         public List<IPlaylist> this[string Name, int? maxCounts] 
    426         { 
    427             get 
    428             { 
    429                 List<IPlaylist> playlists = new List<IPlaylist>(); 
    430                 foreach (IPlaylist playlist in this) 
    431                     if (playlist.Name == Name) 
    432                     { 
    433                         playlists.Add(playlist); 
    434                         if (maxCounts != null && --maxCounts == 0) 
    435                             return playlists; 
    436                     } 
    437                 return playlists; 
    438             } 
    439         } 
    440  
    441         public IIndexedCollection<string, IPlaylist> ItemByName 
    442         { 
    443             get { return this._itemByName; } 
    444         } 
    445  
    446         ///<summary> 
    447         ///Returns an enumerator that iterates through the collection. 
    448         ///</summary> 
    449         /// 
    450         ///<returns> 
    451         ///A <see cref="T:System.Collections.Generic.IEnumerator`1"/> that can be used to iterate through the collection. 
    452         ///</returns> 
    453         ///<filterpriority>1</filterpriority> 
    454         IEnumerator<IPlaylist> IEnumerable<IPlaylist>.GetEnumerator() 
    455         { 
    456             return list.GetEnumerator(); 
    457         } 
    458  
    459         ///<summary> 
    460         ///Returns an enumerator that iterates through a collection. 
    461         ///</summary> 
    462         /// 
    463         ///<returns> 
    464         ///An <see cref="T:System.Collections.IEnumerator"/> object that can be used to iterate through the collection. 
    465         ///</returns> 
    466         ///<filterpriority>2</filterpriority> 
    467         public IEnumerator GetEnumerator() 
    468         { 
    469             return ((IEnumerable<IPlaylist>)this).GetEnumerator(); 
     405        internal class PlaylistPersistentIDIndex : IIndexedCollection<long, IPlaylist> 
     406        { 
     407            protected internal readonly PlaylistCollection _parent; 
     408 
     409            internal PlaylistPersistentIDIndex(PlaylistCollection _parent) 
     410            { 
     411                this._parent = _parent; 
     412            } 
     413 
     414            public IPlaylist this[long PersistentID] 
     415            { 
     416                get 
     417                { 
     418                    PlaylistCollection collection = this._parent; 
     419                    int highID, lowID; 
     420                    Utils.SplitInt64ToInt32(PersistentID, out highID, out lowID); 
     421                    return collection.CreateItem(collection._asIITPlaylistCollection.get_ItemByPersistentID(highID, lowID)); 
     422                } 
     423            } 
     424        } 
     425 
     426        internal class ChildPlaylistCollection : IChildPlaylistCollection 
     427        { 
     428            private readonly IIndexedCollection<string, IPlaylist> _itemByName; 
     429            private readonly List<IPlaylist> list; 
     430 
     431            public ChildPlaylistCollection(IPlaylist parent, ISource source) 
     432            { 
     433                this.list = new List<IPlaylist>(); 
     434                IUserPlaylist userPlaylist; 
     435                foreach (IPlaylist playlist in source.Playlists) 
     436                { 
     437                    userPlaylist = playlist as IUserPlaylist; 
     438                    if (userPlaylist == null) 
     439                        continue; 
     440                    if (!userPlaylist.Parent.Equals(parent)) 
     441                        continue; 
     442                    this.list.Add(userPlaylist); 
     443                } 
     444                this._itemByName = new ParentStringIndexerReferrer<ChildPlaylistCollection, IPlaylist>(this); 
     445            } 
     446 
     447            public int Count 
     448            { 
     449                get { return this.list.Count; } 
     450            } 
     451 
     452            public IPlaylist this[int Index] 
     453            { 
     454                get { return this.list[Index]; } 
     455            } 
     456 
     457            public IPlaylist this[string Name] 
     458            { 
     459                get 
     460                { 
     461                    List<IPlaylist> playlists = this[Name, 1]; 
     462                    return playlists.Count == 0 ? null : playlists[0]; 
     463                } 
     464            } 
     465 
     466            public List<IPlaylist> this[string Name, int? maxCounts] 
     467            { 
     468                get 
     469                { 
     470                    List<IPlaylist> playlists = new List<IPlaylist>(); 
     471                    foreach (IPlaylist playlist in this) 
     472                        if (playlist.Name == Name) 
     473                        { 
     474                            playlists.Add(playlist); 
     475                            if (maxCounts != null && --maxCounts == 0) 
     476                                return playlists; 
     477                        } 
     478                    return playlists; 
     479                } 
     480            } 
     481 
     482            public IIndexedCollection<string, IPlaylist> ItemByName 
     483            { 
     484                get { return this._itemByName; } 
     485            } 
     486 
     487            ///<summary> 
     488            ///Returns an enumerator that iterates through the collection. 
     489            ///</summary> 
     490            /// 
     491            ///<returns> 
     492            ///A <see cref="T:System.Collections.Generic.IEnumerator`1"/> that can be used to iterate through the collection. 
     493            ///</returns> 
     494            ///<filterpriority>1</filterpriority> 
     495            IEnumerator<IPlaylist> IEnumerable<IPlaylist>.GetEnumerator() 
     496            { 
     497                return this.list.GetEnumerator(); 
     498            } 
     499 
     500            ///<summary> 
     501            ///Returns an enumerator that iterates through a collection. 
     502            ///</summary> 
     503            /// 
     504            ///<returns> 
     505            ///An <see cref="T:System.Collections.IEnumerator"/> object that can be used to iterate through the collection. 
     506            ///</returns> 
     507            ///<filterpriority>2</filterpriority> 
     508            public IEnumerator GetEnumerator() 
     509            { 
     510                return ((IEnumerable<IPlaylist>)this).GetEnumerator(); 
     511            } 
    470512        } 
    471513    } 
     514 
    472515} 
  • lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Properties/AssemblyInfo.cs

    r11205 r19308  
    1111[assembly: AssemblyDescription("")] 
    1212[assembly: AssemblyConfiguration("")] 
    13 [assembly: AssemblyCompany("Microsoft")] 
     13[assembly: AssemblyCompany("CodeRepos")] 
    1414[assembly: AssemblyProduct("iTunesCOMWrap")] 
    1515[assembly: AssemblyCopyright("Copyright © Topia 2008")] 
     
    3838// [assembly: AssemblyVersion("1.0.*")] 
    3939 
    40 [assembly: AssemblyVersion("1.0.0.0")] 
    41 [assembly: AssemblyFileVersion("1.0.0.0")] 
     40[assembly: AssemblyVersion("1.0.*")] 
     41[assembly: AssemblyFileVersion("1.0.*")] 
    4242[assembly: InternalsVisibleTo("iTunesCOMWrapTests")] 
  • lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Sources.cs

    r11205 r19308  
    55using System.Linq; 
    66using Clovery.iTunesHelper.COMWrap.Interfaces; 
     7using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 
     8using Clovery.iTunesHelper.COMWrap.Internal; 
    79using iTunes = iTunesLib; 
    810 
     
    114116    { 
    115117        private readonly IIndexedCollection<string, ISource> _itemByName; 
     118        private readonly IIndexedCollection<long, ISource> _itemByPersistentID; 
    116119 
    117120        protected internal SourceCollection(iTunes.IITSourceCollection _internal, ITunesApp _app) 
     
    119122        { 
    120123            this._itemByName = new ParentStringIndexerReferrer<SourceCollection, ISource>(this); 
     124            this._itemByPersistentID = new SourcePersistentIDIndex(this); 
    121125        } 
    122126 
    123127        protected internal iTunesLib.IITSourceCollection _asIITSourceCollection 
    124128        { 
    125             get { return (iTunesLib.IITSourceCollection) this._internal; } 
     129            get { return (iTunesLib.IITSourceCollection)this._internal; } 
    126130        } 
    127131 
     
    146150        } 
    147151 
     152        public IIndexedCollection<long, ISource> ItemByPersistentID 
     153        { 
     154            get { return this._itemByPersistentID; } 
     155        } 
     156 
    148157        public ISource CreateItem(iTunesLib.IITSource item) 
    149158        { 
     
    158167        } 
    159168    } 
     169 
     170    namespace Internal 
     171    { 
     172 
     173        internal class SourcePersistentIDIndex : IIndexedCollection<long, ISource> 
     174        { 
     175            protected internal readonly SourceCollection _parent; 
     176 
     177            internal SourcePersistentIDIndex(SourceCollection _parent) 
     178            { 
     179                this._parent = _parent; 
     180            } 
     181 
     182            public ISource this[long PersistentID] 
     183            { 
     184                get 
     185                { 
     186                    SourceCollection collection = this._parent; 
     187                    int highID, lowID; 
     188                    Utils.SplitInt64ToInt32(PersistentID, out highID, out lowID); 
     189                    return collection.CreateItem(collection._asIITSourceCollection.get_ItemByPersistentID(highID, lowID)); 
     190                } 
     191            } 
     192        } 
     193    } 
     194 
    160195} 
  • lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Tracks.cs

    r18990 r19308  
    55using System.Linq; 
    66using Clovery.iTunesHelper.COMWrap.Interfaces; 
     7using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 
     8using Clovery.iTunesHelper.COMWrap.Internal; 
    79using iTunes = iTunesLib; 
    810 
     
    236238        private readonly IIndexedCollection<string, ITrack> _itemByName; 
    237239        private readonly IIndexedCollection<int, ITrack> _itemByPlayOrder; 
     240        private readonly IIndexedCollection<long, ITrack> _itemByPersistentID; 
    238241 
    239242        public TrackCollection(iTunes.IITTrackCollection _internal, ITunesApp _app) 
     
    242245            this._itemByName = new ParentStringIndexerReferrer<TrackCollection, ITrack>(this); 
    243246            this._itemByPlayOrder = new TrackPlayOrderIndex(this); 
     247            this._itemByPersistentID = new TrackPersistentIDIndex(this); 
    244248        } 
    245249 
     
    277281        { 
    278282            get { return this._itemByPlayOrder; } 
     283        } 
     284 
     285        public IIndexedCollection<long, ITrack> ItemByPersistentID 
     286        { 
     287            get { return this._itemByPersistentID; } 
    279288        } 
    280289 
     
    287296    } 
    288297 
    289     internal class TrackPlayOrderIndex : IIndexedCollection<int, ITrack> 
    290     { 
    291         protected internal readonly TrackCollection _parent; 
    292  
    293         internal TrackPlayOrderIndex(TrackCollection _parent) 
    294         { 
    295             this._parent = _parent; 
    296         } 
    297  
    298         public ITrack this[int Index] 
    299         { 
    300             get 
    301             { 
    302                 TrackCollection collection = this._parent; 
    303                 return collection.CreateItem(collection._asIITTrackCollection.get_ItemByPlayOrder(Index)); 
    304             } 
    305         } 
    306     } 
    307  
    308298    internal class FileOrCDTrack : Track, IFileOrCDTrack 
    309299    { 
     
    394384            get 
    395385            { 
    396                 Int64 high = this._asIITFileOrCDTrack.Size64High; 
    397                 UInt32 low = (UInt32) this._asIITFileOrCDTrack.Size64Low; 
    398                 return high << 32 | low; 
     386                return Utils.JoinInt32ToInt64(this._asIITFileOrCDTrack.Size64High, 
     387                                                       this._asIITFileOrCDTrack.Size64Low); 
    399388            } 
    400389        } 
     
    504493        { 
    505494            get { return this._asIITFileOrCDTrack.Location; } 
     495        } 
     496 
     497        public IPlaylistCollection Playlists 
     498        { 
     499            get { return this.factory.CreatePlaylistCollection(this._asIITFileOrCDTrack.Playlists); } 
    506500        } 
    507501    } 
     
    577571            get { return (RatingKind) this._asIITURLTrack.ratingKind; } 
    578572        } 
     573 
     574        public IPlaylistCollection Playlists 
     575        { 
     576            get { return this.factory.CreatePlaylistCollection(this._asIITURLTrack.Playlists); } 
     577        } 
     578    } 
     579 
     580    namespace Internal 
     581    { 
     582        internal class TrackPlayOrderIndex : IIndexedCollection<int, ITrack> 
     583        { 
     584            protected internal readonly TrackCollection _parent; 
     585 
     586            internal TrackPlayOrderIndex(TrackCollection _parent) 
     587            { 
     588                this._parent = _parent; 
     589            } 
     590 
     591            public ITrack this[int Index] 
     592            { 
     593                get 
     594                { 
     595                    TrackCollection collection = this._parent; 
     596                    return collection.CreateItem(collection._asIITTrackCollection.get_ItemByPlayOrder(Index)); 
     597                } 
     598            } 
     599        } 
     600 
     601        internal class TrackPersistentIDIndex : IIndexedCollection<long, ITrack> 
     602        { 
     603            protected internal readonly TrackCollection _parent; 
     604 
     605            internal TrackPersistentIDIndex(TrackCollection _parent) 
     606            { 
     607                this._parent = _parent; 
     608            } 
     609 
     610            public ITrack this[long PersistentID] 
     611            { 
     612                get 
     613                { 
     614                    TrackCollection collection = this._parent; 
     615                    int highID, lowID; 
     616                    Utils.SplitInt64ToInt32(PersistentID, out highID, out lowID); 
     617                    return collection.CreateItem(collection._asIITTrackCollection.get_ItemByPersistentID(highID, lowID)); 
     618                } 
     619            } 
     620        } 
     621 
    579622    } 
    580623} 
  • lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Visuals.cs

    r11205 r19308  
    44using System.Linq; 
    55using Clovery.iTunesHelper.COMWrap.Interfaces; 
     6using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 
     7using Clovery.iTunesHelper.COMWrap.Internal; 
    68using iTunes = iTunesLib; 
    79 
  • lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Windows.cs

    r11205 r19308  
    55using System.Linq; 
    66using Clovery.iTunesHelper.COMWrap.Interfaces; 
     7using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 
     8using Clovery.iTunesHelper.COMWrap.Internal; 
    79using iTunes = iTunesLib; 
    810 
  • lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/iTunesCOMWrap.csproj

    r11205 r19308  
    44    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> 
    55    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> 
    6     <ProductVersion>9.0.21022</ProductVersion> 
     6    <ProductVersion>9.0.30729</ProductVersion> 
    77    <SchemaVersion>2.0</SchemaVersion> 
    88    <ProjectGuid>{C2C2BB60-561C-4A96-8CAE-1777755BC369}</ProjectGuid> 
     
    7171    <Compile Include="Sources.cs" /> 
    7272    <Compile Include="Tracks.cs" /> 
     73    <Compile Include="Utils.cs" /> 
    7374    <Compile Include="Visuals.cs" /> 
    7475    <Compile Include="Windows.cs" /> 
     76  </ItemGroup> 
     77  <ItemGroup> 
     78    <Content Include="TODO.txt" /> 
    7579  </ItemGroup> 
    7680  <ItemGroup> 
     
    7882      <Guid>{9E93C96F-CF0D-43F6-8BA8-B807A3370712}</Guid> 
    7983      <VersionMajor>1</VersionMajor> 
    80       <VersionMinor>10</VersionMinor> 
     84      <VersionMinor>11</VersionMinor> 
    8185      <Lcid>0</Lcid> 
    8286      <WrapperTool>tlbimp</WrapperTool> 
    8387      <Isolated>False</Isolated> 
    8488    </COMReference> 
    85   </ItemGroup> 
    86   <ItemGroup> 
    87     <Content Include="TODO.txt" /> 
    8889  </ItemGroup> 
    8990  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />