Exemple #1
0
        public override void Initialize()
        {
            _browseComplete = new Spotify.AlbumBrowseCompleteCallback(OnBrowseCompleteCallback);
            _tracks         = new DelegateArray <ITrack>(GetNumberOfTracks, GetTrackAtIndex);
            _copyrights     = new DelegateArray <string>(GetNumberOfCopyrights, GetCopyrightAtIndex);

            if (_userData != null)
            {
                _userDataHandle = GCHandle.Alloc(_userData);
            }

            lock (Spotify.Mutex)
            {
                Handle = Spotify.sp_albumbrowse_create(
                    Session.GetHandle(),
                    _albumToBrowse.GetHandle(),
                    _browseComplete,
                    _userDataHandle.IsAllocated ? GCHandle.ToIntPtr(_userDataHandle) : IntPtr.Zero);
            }
        }