Changeset 19406

Show
Ignore:
Timestamp:
09/17/08 01:02:16 (4 months ago)
Author:
topia
Message:

fix Signature of ITunesApp.ConvertTracks?.
* Add more XML documentation comments.
* split ITunesApp interface as IITunesApp.
* This is ABI breakage, bump major version.

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

Legend:

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

    r19308 r19406  
    1212namespace Clovery.iTunesHelper.COMWrap 
    1313{ 
    14     public class ITunesApp : IITFactory 
     14    /// <summary> 
     15    /// iTunes Application Main Class 
     16    /// </summary> 
     17    public class ITunesApp : IITunesApp 
    1518    { 
    1619        private readonly IITunesWrappedObjectFactory _objectFactory; 
    1720        protected internal object _internal; 
    18         public IIndexedCollection<IPlaylist, bool> CanSetShuffle = new CanSetShufflePlaylistCollection(); 
    19         public IIndexedCollection<IPlaylist, bool> CanSetSongRepeat = new CanSetSongRepeatPlaylistCollection(); 
     21        private readonly IIndexedCollection<IPlaylist, bool> _canSetShuffle = new PlaylistCanSetShuffleCollection(); 
     22        private readonly IIndexedCollection<IPlaylist, bool> _canSetSongRepeat = new PlaylistCanSetSongRepeatCollection(); 
    2023 
    2124        internal ITunesApp(iTunes.iTunesApp _internal, bool useCache) 
     
    3841        } 
    3942 
     43        /// <summary> 
     44        /// construct iTunesApp. 
     45        /// </summary> 
     46        /// <param name="useCache">cache iTunes Object if true, otherwise not.</param> 
    4047        public ITunesApp(bool useCache) 
    4148            : this(new iTunes.iTunesAppClass(), useCache) 
     
    4350        } 
    4451 
     52        /// <summary> 
     53        /// construct iTunesApp with default options. 
     54        /// </summary> 
     55        /// <remarks>Cache is disabled.</remarks> 
    4556        public ITunesApp() : this(false) 
    4657        { 
     
    273284        { 
    274285            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; } 
    275296        } 
    276297 
     
    363384        } 
    364385 
    365         static private object _convertToITObjects(IITInternalObject track) 
    366         { 
    367             return track.__internalObject; 
    368         } 
    369  
    370386        public event EventHandler<DatabaseChangedEventArgs> DatabaseChangedEvent; 
    371387        public event EventHandler<TrackEventArgs> PlayerPlayEvent; 
     
    447463        public IConvertOperationStatusWithEvents ConvertTrack(ITrack iTrackToConvert) 
    448464        { 
    449             object real = _convertToITObjects(iTrackToConvert); 
     465            object real = Utils.ConvertObjectToITObject(iTrackToConvert); 
    450466            return this.factory.CreateConvertOperationStatus(this._asIiTunes.ConvertTrack2(ref real)); 
    451467        } 
    452468 
    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); 
    458472            return this.factory.CreateConvertOperationStatus(this._asIiTunes.ConvertTracks2(ref real)); 
    459473        } 
     
    557571    namespace Internal 
    558572    { 
    559         internal class CanSetShufflePlaylistCollection : IIndexedCollection<IPlaylist, bool> 
     573        internal class PlaylistCanSetShuffleCollection : IIndexedCollection<IPlaylist, bool> 
    560574        { 
    561575            public bool this[IPlaylist Playlist] 
     
    565579        } 
    566580 
    567         internal class CanSetSongRepeatPlaylistCollection : IIndexedCollection<IPlaylist, bool> 
     581        internal class PlaylistCanSetSongRepeatCollection : IIndexedCollection<IPlaylist, bool> 
    568582        { 
    569583            public bool this[IPlaylist Playlist] 
  • lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Enums.cs

    r19308 r19406  
    527527    /// <summary> 
    528528    /// currently supported minimum iTunes type library version 
     529    /// </summary> 
     530    /// <remarks> 
    529531    /// <list type="table"> 
    530532    ///     <listheader> 
     
    545547    ///     <item><term>1.11</term><description>iTunes 7.7</description></item> 
    546548    /// </list> 
    547     /// </summary> 
     549    /// </remarks> 
    548550    public enum SupportedVersion 
    549551    { 
  • lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Sources.cs

    r19308 r19406  
    6161            IPlaylist playlist = this.Children[playlistName]; 
    6262            if (playlist != null) 
    63             { 
    6463                return playlist; 
    65             } 
    6664            return this.CreatePlaylist(playlistName); 
    6765        } 
     
    7169            IPlaylist playlist = this.Children[folderName]; 
    7270            if (playlist != null) 
    73             { 
    7471                return playlist; 
    75             } 
    7672            return this.CreateFolder(folderName); 
    7773        } 
  • lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Utils.cs

    r19308 r19406  
    11// $Id$ 
     2 
     3using Clovery.iTunesHelper.COMWrap.Interfaces; 
    24 
    35namespace Clovery.iTunesHelper.COMWrap.Internal 
     
    1719            return (long) high << 32 | (uint) low; 
    1820        } 
     21 
     22        protected internal static object ConvertObjectToITObject(IITInternalObject obj) 
     23        { 
     24            return obj.__internalObject; 
     25        } 
    1926    } 
    2027} 
  • lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/iTunesCOMWrap.csproj

    r19308 r19406  
    5454    <Compile Include="Enums.cs" /> 
    5555    <Compile Include="EQPresets.cs" /> 
     56    <Compile Include="Interfaces\IApplication.cs" /> 
    5657    <Compile Include="Interfaces\IEQPresets.cs" /> 
    5758    <Compile Include="Interfaces\IEncoders.cs" />