Changeset 19406 for lang/csharp
- Timestamp:
- 09/17/08 01:02:16 (2 months ago)
- Location:
- lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap
- Files:
-
- 1 added
- 5 modified
-
Application.cs (modified) (8 diffs)
-
Enums.cs (modified) (2 diffs)
-
Interfaces/IApplication.cs (added)
-
Sources.cs (modified) (2 diffs)
-
Utils.cs (modified) (2 diffs)
-
iTunesCOMWrap.csproj (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Application.cs
r19308 r19406 12 12 namespace Clovery.iTunesHelper.COMWrap 13 13 { 14 public class ITunesApp : IITFactory 14 /// <summary> 15 /// iTunes Application Main Class 16 /// </summary> 17 public class ITunesApp : IITunesApp 15 18 { 16 19 private readonly IITunesWrappedObjectFactory _objectFactory; 17 20 protected internal object _internal; 18 p ublic IIndexedCollection<IPlaylist, bool> CanSetShuffle = new CanSetShufflePlaylistCollection();19 p ublic IIndexedCollection<IPlaylist, bool> CanSetSongRepeat = new CanSetSongRepeatPlaylistCollection();21 private readonly IIndexedCollection<IPlaylist, bool> _canSetShuffle = new PlaylistCanSetShuffleCollection(); 22 private readonly IIndexedCollection<IPlaylist, bool> _canSetSongRepeat = new PlaylistCanSetSongRepeatCollection(); 20 23 21 24 internal ITunesApp(iTunes.iTunesApp _internal, bool useCache) … … 38 41 } 39 42 43 /// <summary> 44 /// construct iTunesApp. 45 /// </summary> 46 /// <param name="useCache">cache iTunes Object if true, otherwise not.</param> 40 47 public ITunesApp(bool useCache) 41 48 : this(new iTunes.iTunesAppClass(), useCache) … … 43 50 } 44 51 52 /// <summary> 53 /// construct iTunesApp with default options. 54 /// </summary> 55 /// <remarks>Cache is disabled.</remarks> 45 56 public ITunesApp() : this(false) 46 57 { … … 273 284 { 274 285 get { return this._objectFactory; } 286 } 287 288 public IIndexedCollection<IPlaylist, bool> CanSetShuffle 289 { 290 get { return this._canSetShuffle; } 291 } 292 293 public IIndexedCollection<IPlaylist, bool> CanSetSongRepeat 294 { 295 get { return this._canSetSongRepeat; } 275 296 } 276 297 … … 363 384 } 364 385 365 static private object _convertToITObjects(IITInternalObject track)366 {367 return track.__internalObject;368 }369 370 386 public event EventHandler<DatabaseChangedEventArgs> DatabaseChangedEvent; 371 387 public event EventHandler<TrackEventArgs> PlayerPlayEvent; … … 447 463 public IConvertOperationStatusWithEvents ConvertTrack(ITrack iTrackToConvert) 448 464 { 449 object real = _convertToITObjects(iTrackToConvert);465 object real = Utils.ConvertObjectToITObject(iTrackToConvert); 450 466 return this.factory.CreateConvertOperationStatus(this._asIiTunes.ConvertTrack2(ref real)); 451 467 } 452 468 453 public IConvertOperationStatusWithEvents ConvertTracks(ITrack[] iTracksToConvert) 454 { 455 object real = 456 iTracksToConvert.ToList().ConvertAll( 457 new Converter<ITrack, object>(_convertToITObjects)).ToArray(); 469 public IConvertOperationStatusWithEvents ConvertTracks(ITrackCollection iTracksToConvert) 470 { 471 object real = Utils.ConvertObjectToITObject(iTracksToConvert); 458 472 return this.factory.CreateConvertOperationStatus(this._asIiTunes.ConvertTracks2(ref real)); 459 473 } … … 557 571 namespace Internal 558 572 { 559 internal class CanSetShufflePlaylistCollection : IIndexedCollection<IPlaylist, bool>573 internal class PlaylistCanSetShuffleCollection : IIndexedCollection<IPlaylist, bool> 560 574 { 561 575 public bool this[IPlaylist Playlist] … … 565 579 } 566 580 567 internal class CanSetSongRepeatPlaylistCollection : IIndexedCollection<IPlaylist, bool>581 internal class PlaylistCanSetSongRepeatCollection : IIndexedCollection<IPlaylist, bool> 568 582 { 569 583 public bool this[IPlaylist Playlist] -
lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Enums.cs
r19308 r19406 527 527 /// <summary> 528 528 /// currently supported minimum iTunes type library version 529 /// </summary> 530 /// <remarks> 529 531 /// <list type="table"> 530 532 /// <listheader> … … 545 547 /// <item><term>1.11</term><description>iTunes 7.7</description></item> 546 548 /// </list> 547 /// </ summary>549 /// </remarks> 548 550 public enum SupportedVersion 549 551 { -
lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Sources.cs
r19308 r19406 61 61 IPlaylist playlist = this.Children[playlistName]; 62 62 if (playlist != null) 63 {64 63 return playlist; 65 }66 64 return this.CreatePlaylist(playlistName); 67 65 } … … 71 69 IPlaylist playlist = this.Children[folderName]; 72 70 if (playlist != null) 73 {74 71 return playlist; 75 }76 72 return this.CreateFolder(folderName); 77 73 } -
lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Utils.cs
r19308 r19406 1 1 // $Id$ 2 3 using Clovery.iTunesHelper.COMWrap.Interfaces; 2 4 3 5 namespace Clovery.iTunesHelper.COMWrap.Internal … … 17 19 return (long) high << 32 | (uint) low; 18 20 } 21 22 protected internal static object ConvertObjectToITObject(IITInternalObject obj) 23 { 24 return obj.__internalObject; 25 } 19 26 } 20 27 } -
lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/iTunesCOMWrap.csproj
r19308 r19406 54 54 <Compile Include="Enums.cs" /> 55 55 <Compile Include="EQPresets.cs" /> 56 <Compile Include="Interfaces\IApplication.cs" /> 56 57 <Compile Include="Interfaces\IEQPresets.cs" /> 57 58 <Compile Include="Interfaces\IEncoders.cs" />
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)