Changeset 19308 for lang/csharp
- Timestamp:
- 09/15/08 01:35:51 (2 months 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
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)