Changeset 19308
- Timestamp:
- 09/15/08 01:35:51 (5 years ago)
- Location:
- lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap
- Files:
-
- 1 added
- 23 modified
-
Application.cs (modified) (2 diffs)
-
Artworks.cs (modified) (3 diffs)
-
Base.cs (modified) (7 diffs)
-
EQPresets.cs (modified) (1 diff)
-
Encoders.cs (modified) (1 diff)
-
Enums.cs (modified) (2 diffs)
-
Factory.cs (modified) (2 diffs)
-
Interfaces/IArtwork.cs (modified) (2 diffs)
-
Interfaces/IBase.cs (modified) (3 diffs)
-
Interfaces/IEQPresets.cs (modified) (1 diff)
-
Interfaces/IEncoders.cs (modified) (1 diff)
-
Interfaces/IPlaylists.cs (modified) (4 diffs)
-
Interfaces/ISources.cs (modified) (2 diffs)
-
Interfaces/ITracks.cs (modified) (3 diffs)
-
Interfaces/IVisuals.cs (modified) (1 diff)
-
Interfaces/IWindows.cs (modified) (1 diff)
-
Playlists.cs (modified) (6 diffs)
-
Properties/AssemblyInfo.cs (modified) (2 diffs)
-
Sources.cs (modified) (5 diffs)
-
Tracks.cs (modified) (8 diffs)
-
Utils.cs (added)
-
Visuals.cs (modified) (1 diff)
-
Windows.cs (modified) (1 diff)
-
iTunesCOMWrap.csproj (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Application.cs
r11205 r19308 6 6 using System.Runtime.InteropServices; 7 7 using Clovery.iTunesHelper.COMWrap.Interfaces; 8 using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 9 using Clovery.iTunesHelper.COMWrap.Internal; 8 10 using iTunes = iTunesLib; 9 11 … … 553 555 } 554 556 555 internal class CanSetShufflePlaylistCollection : IIndexedCollection<IPlaylist, bool>557 namespace Internal 556 558 { 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 } 569 574 } 570 575 -
lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Artworks.cs
r11205 r19308 5 5 using System.Linq; 6 6 using Clovery.iTunesHelper.COMWrap.Interfaces; 7 using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 8 using Clovery.iTunesHelper.COMWrap.Internal; 7 9 using iTunes = iTunesLib; 8 10 … … 15 17 } 16 18 17 protected internal iTunes.IITArtwork _ _asIITArtwork19 protected internal iTunes.IITArtwork _asIITArtwork 18 20 { 19 21 get { return (iTunes.IITArtwork) this._internal; } … … 22 24 public void Delete() 23 25 { 24 this._ _asIITArtwork.Delete();26 this._asIITArtwork.Delete(); 25 27 } 26 28 27 29 public ArtworkFormat Format 28 30 { 29 get { return (ArtworkFormat) this._ _asIITArtwork.Format; }31 get { return (ArtworkFormat) this._asIITArtwork.Format; } 30 32 } 31 33 32 34 public bool IsDownloadedArtwork 33 35 { 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; } 35 43 } 36 44 37 45 public void SaveArtworkToFile(string filePath) 38 46 { 39 this._ _asIITArtwork.SaveArtworkToFile(filePath);47 this._asIITArtwork.SaveArtworkToFile(filePath); 40 48 } 41 49 42 50 public void SetArtworkFromFile(string filePath) 43 51 { 44 this._ _asIITArtwork.SetArtworkFromFile(filePath);52 this._asIITArtwork.SetArtworkFromFile(filePath); 45 53 } 46 54 } -
lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Base.cs
r11205 r19308 5 5 using System.Linq; 6 6 using Clovery.iTunesHelper.COMWrap.Interfaces; 7 using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 8 using Clovery.iTunesHelper.COMWrap.Internal; 7 9 8 10 namespace Clovery.iTunesHelper.COMWrap … … 69 71 protected internal readonly int _TrackDatabaseID; 70 72 protected internal readonly int _trackID; 73 protected internal readonly long? _persistentID; 71 74 protected internal string _name; 72 75 … … 75 78 _internal.GetITObjectIDs(out this._sourceID, out this._playlistID, out this._trackID, 76 79 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 } 77 85 this._name = _internal.Name; 78 86 } 79 87 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) 81 93 { 82 94 this._sourceID = sourceID; … … 84 96 this._trackID = trackID; 85 97 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 { 86 107 } 87 108 … … 105 126 public void GetITObjectIDs(out int sourceID, out int playlistID, out int trackID, out int databaseID) 106 127 { 107 //this._asIITObject.GetITObjectIDs(out sourceID, out playlistID, out trackID, out databaseID);108 128 sourceID = this.sourceID; 109 129 playlistID = this.playlistID; … … 160 180 } 161 181 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 162 194 ///<summary> 163 195 ///Indicates whether the current object is equal to another object of the same type. … … 231 263 } 232 264 233 internal class ParentStringIndexerReferrer<TCollection, TItem> : IIndexedCollection<string, TItem> 234 where TCollection : IIndexedCollection<string, TItem> 265 namespace Internal 235 266 { 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 } 374 410 } 375 411 } -
lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/EQPresets.cs
r11205 r19308 4 4 using System.Linq; 5 5 using Clovery.iTunesHelper.COMWrap.Interfaces; 6 using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 7 using Clovery.iTunesHelper.COMWrap.Internal; 6 8 using iTunes = iTunesLib; 7 9 -
lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Encoders.cs
r11205 r19308 4 4 using System.Linq; 5 5 using Clovery.iTunesHelper.COMWrap.Interfaces; 6 using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 7 using Clovery.iTunesHelper.COMWrap.Internal; 6 8 using iTunes = iTunesLib; 7 9 -
lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Enums.cs
r11205 r19308 542 542 /// <item><term>1.8</term><description>iTunes 7.0</description></item> 543 543 /// <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> 545 546 /// </list> 546 547 /// </summary> … … 555 556 /// iTunes type library minor version 556 557 /// </summary> 557 MinorVersion = 1 0558 MinorVersion = 11 558 559 } 559 560 -
lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Factory.cs
r11205 r19308 4 4 using System.Collections.Generic; 5 5 using System.Linq; 6 using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 6 7 using iTunesLib; 7 8 … … 41 42 public IITObject CreateAbstractObject(int sourceID, int playlistID, int trackID, int TrackDatabaseID) 42 43 { 43 return new ITObject(sourceID, playlistID, trackID, TrackDatabaseID, this.app);44 return new ITObject(sourceID, playlistID, trackID, TrackDatabaseID, null, this.app); 44 45 } 45 46 -
lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Interfaces/IArtwork.cs
r11205 r19308 1 1 // $Id$ 2 using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 3 2 4 namespace Clovery.iTunesHelper.COMWrap.Interfaces 3 5 { … … 24 26 /// </summary> 25 27 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; } 26 36 27 37 /// <summary> -
lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Interfaces/IBase.cs
r11205 r19308 2 2 using System; 3 3 using System.Collections.Generic; 4 using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 4 5 using iTunes = iTunesLib; 5 6 … … 99 100 /// </remarks> 100 101 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; } 101 111 102 112 /// <summary> … … 136 146 } 137 147 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 145 149 { 146 150 /// <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 } 382 394 } 383 395 } -
lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Interfaces/IEQPresets.cs
r11205 r19308 1 1 // $Id$ 2 using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 2 3 using iTunes = iTunesLib; 3 4 -
lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Interfaces/IEncoders.cs
r11205 r19308 1 1 // $Id$ 2 using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 2 3 using iTunes = iTunesLib; 3 4 -
lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Interfaces/IPlaylists.cs
r11205 r19308 1 1 // $Id$ 2 2 using System.Collections.Generic; 3 3 using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 4 4 using iTunes = iTunesLib; 5 5 namespace Clovery.iTunesHelper.COMWrap.Interfaces … … 16 16 ITrackCollection Tracks { get; } 17 17 List<ITrack> SameTracks(ITrack track); 18 List<ITrack> SameTracks(IItemTrack track); 18 19 List<ITrack> SameTracks(int trackDatabaseID, string name); 19 20 List<ITrack> SameTracks(int trackDatabaseID); … … 77 78 { 78 79 List<IPlaylist> this[string Name, int? maxCounts] { get; } 80 81 IIndexedCollection<long, IPlaylist> ItemByPersistentID { get; } 79 82 } 80 83 … … 88 91 IIndexedCollection<string, IPlaylist> ItemByName { get; } 89 92 } 93 90 94 } -
lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Interfaces/ISources.cs
r11205 r19308 1 1 // $Id$ 2 using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 3 2 4 namespace Clovery.iTunesHelper.COMWrap.Interfaces 3 5 { … … 73 75 } 74 76 75 public interface ISourceCollection : INamedCollection<ISource> { } 77 public interface ISourceCollection : INamedCollection<ISource> 78 { 79 IIndexedCollection<long, ISource> ItemByPersistentID { get; } 80 } 76 81 } -
lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Interfaces/ITracks.cs
r18990 r19308 1 1 // $Id$ 2 2 using System; 3 using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 3 4 using iTunes = iTunesLib; 4 5 … … 242 243 243 244 /// <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> 244 260 /// Update the podcast feed for this track. 245 261 /// </summary> … … 446 462 /// </summary> 447 463 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; } 448 469 } 449 470 } -
lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Interfaces/IVisuals.cs
r11205 r19308 1 1 // $Id$ 2 using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 2 3 using iTunes = iTunesLib; 3 4 -
lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Interfaces/IWindows.cs
r11205 r19308 1 1 // $Id$ 2 2 using Clovery.iTunesHelper.COMWrap; 3 using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 3 4 4 5 namespace Clovery.iTunesHelper.COMWrap.Interfaces -
lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Playlists.cs
r11205 r19308 5 5 using System.Linq; 6 6 using Clovery.iTunesHelper.COMWrap.Interfaces; 7 using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 8 using Clovery.iTunesHelper.COMWrap.Internal; 7 9 using iTunes = iTunesLib; 8 10 … … 48 50 } 49 51 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 50 61 public List<ITrack> SameTracks(int trackDatabaseId, string name) 51 62 { … … 322 333 { 323 334 private readonly IIndexedCollection<string, IPlaylist> _itemByName; 335 private readonly IIndexedCollection<long, IPlaylist> _itemByPersistentID; 324 336 325 337 protected internal PlaylistCollection(iTunes.IITPlaylistCollection _internal, ITunesApp _app) … … 327 339 { 328 340 this._itemByName = new ParentStringIndexerReferrer<PlaylistCollection, IPlaylist>(this); 341 this._itemByPersistentID = new PlaylistPersistentIDIndex(this); 329 342 } 330 343 … … 370 383 } 371 384 385 public IIndexedCollection<long, IPlaylist> ItemByPersistentID 386 { 387 get { return this._itemByPersistentID; } 388 } 389 372 390 public IPlaylist CreateItem(iTunes.IITPlaylist item) 373 391 { … … 383 401 } 384 402 385 internal class ChildPlaylistCollection : IChildPlaylistCollection403 namespace Internal 386 404 { 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 } 470 512 } 471 513 } 514 472 515 } -
lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Properties/AssemblyInfo.cs
r11205 r19308 11 11 [assembly: AssemblyDescription("")] 12 12 [assembly: AssemblyConfiguration("")] 13 [assembly: AssemblyCompany(" Microsoft")]13 [assembly: AssemblyCompany("CodeRepos")] 14 14 [assembly: AssemblyProduct("iTunesCOMWrap")] 15 15 [assembly: AssemblyCopyright("Copyright © Topia 2008")] … … 38 38 // [assembly: AssemblyVersion("1.0.*")] 39 39 40 [assembly: AssemblyVersion("1.0. 0.0")]41 [assembly: AssemblyFileVersion("1.0. 0.0")]40 [assembly: AssemblyVersion("1.0.*")] 41 [assembly: AssemblyFileVersion("1.0.*")] 42 42 [assembly: InternalsVisibleTo("iTunesCOMWrapTests")] -
lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Sources.cs
r11205 r19308 5 5 using System.Linq; 6 6 using Clovery.iTunesHelper.COMWrap.Interfaces; 7 using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 8 using Clovery.iTunesHelper.COMWrap.Internal; 7 9 using iTunes = iTunesLib; 8 10 … … 114 116 { 115 117 private readonly IIndexedCollection<string, ISource> _itemByName; 118 private readonly IIndexedCollection<long, ISource> _itemByPersistentID; 116 119 117 120 protected internal SourceCollection(iTunes.IITSourceCollection _internal, ITunesApp _app) … … 119 122 { 120 123 this._itemByName = new ParentStringIndexerReferrer<SourceCollection, ISource>(this); 124 this._itemByPersistentID = new SourcePersistentIDIndex(this); 121 125 } 122 126 123 127 protected internal iTunesLib.IITSourceCollection _asIITSourceCollection 124 128 { 125 get { return (iTunesLib.IITSourceCollection) this._internal; }129 get { return (iTunesLib.IITSourceCollection)this._internal; } 126 130 } 127 131 … … 146 150 } 147 151 152 public IIndexedCollection<long, ISource> ItemByPersistentID 153 { 154 get { return this._itemByPersistentID; } 155 } 156 148 157 public ISource CreateItem(iTunesLib.IITSource item) 149 158 { … … 158 167 } 159 168 } 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 160 195 } -
lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Tracks.cs
r18990 r19308 5 5 using System.Linq; 6 6 using Clovery.iTunesHelper.COMWrap.Interfaces; 7 using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 8 using Clovery.iTunesHelper.COMWrap.Internal; 7 9 using iTunes = iTunesLib; 8 10 … … 236 238 private readonly IIndexedCollection<string, ITrack> _itemByName; 237 239 private readonly IIndexedCollection<int, ITrack> _itemByPlayOrder; 240 private readonly IIndexedCollection<long, ITrack> _itemByPersistentID; 238 241 239 242 public TrackCollection(iTunes.IITTrackCollection _internal, ITunesApp _app) … … 242 245 this._itemByName = new ParentStringIndexerReferrer<TrackCollection, ITrack>(this); 243 246 this._itemByPlayOrder = new TrackPlayOrderIndex(this); 247 this._itemByPersistentID = new TrackPersistentIDIndex(this); 244 248 } 245 249 … … 277 281 { 278 282 get { return this._itemByPlayOrder; } 283 } 284 285 public IIndexedCollection<long, ITrack> ItemByPersistentID 286 { 287 get { return this._itemByPersistentID; } 279 288 } 280 289 … … 287 296 } 288 297 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 get301 {302 TrackCollection collection = this._parent;303 return collection.CreateItem(collection._asIITTrackCollection.get_ItemByPlayOrder(Index));304 }305 }306 }307 308 298 internal class FileOrCDTrack : Track, IFileOrCDTrack 309 299 { … … 394 384 get 395 385 { 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); 399 388 } 400 389 } … … 504 493 { 505 494 get { return this._asIITFileOrCDTrack.Location; } 495 } 496 497 public IPlaylistCollection Playlists 498 { 499 get { return this.factory.CreatePlaylistCollection(this._asIITFileOrCDTrack.Playlists); } 506 500 } 507 501 } … … 577 571 get { return (RatingKind) this._asIITURLTrack.ratingKind; } 578 572 } 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 579 622 } 580 623 } -
lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Visuals.cs
r11205 r19308 4 4 using System.Linq; 5 5 using Clovery.iTunesHelper.COMWrap.Interfaces; 6 using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 7 using Clovery.iTunesHelper.COMWrap.Internal; 6 8 using iTunes = iTunesLib; 7 9 -
lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Windows.cs
r11205 r19308 5 5 using System.Linq; 6 6 using Clovery.iTunesHelper.COMWrap.Interfaces; 7 using Clovery.iTunesHelper.COMWrap.Interfaces.Internal; 8 using Clovery.iTunesHelper.COMWrap.Internal; 7 9 using iTunes = iTunesLib; 8 10 -
lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/iTunesCOMWrap.csproj
r11205 r19308 4 4 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> 5 5 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> 6 <ProductVersion>9.0. 21022</ProductVersion>6 <ProductVersion>9.0.30729</ProductVersion> 7 7 <SchemaVersion>2.0</SchemaVersion> 8 8 <ProjectGuid>{C2C2BB60-561C-4A96-8CAE-1777755BC369}</ProjectGuid> … … 71 71 <Compile Include="Sources.cs" /> 72 72 <Compile Include="Tracks.cs" /> 73 <Compile Include="Utils.cs" /> 73 74 <Compile Include="Visuals.cs" /> 74 75 <Compile Include="Windows.cs" /> 76 </ItemGroup> 77 <ItemGroup> 78 <Content Include="TODO.txt" /> 75 79 </ItemGroup> 76 80 <ItemGroup> … … 78 82 <Guid>{9E93C96F-CF0D-43F6-8BA8-B807A3370712}</Guid> 79 83 <VersionMajor>1</VersionMajor> 80 <VersionMinor>1 0</VersionMinor>84 <VersionMinor>11</VersionMinor> 81 85 <Lcid>0</Lcid> 82 86 <WrapperTool>tlbimp</WrapperTool> 83 87 <Isolated>False</Isolated> 84 88 </COMReference> 85 </ItemGroup>86 <ItemGroup>87 <Content Include="TODO.txt" />88 89 </ItemGroup> 89 90 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)