public override RequestInitializationResult Initialize() { AudioRequestInitializationResult result = new AudioRequestInitializationResult(); if (!Spotify.IsLoggedIn) { result.CanProceed = false; return result; } try { var track = new Track(Context.Data[0]); _trackPtr = track.TrackPtr; } catch { throw new MediaNotFoundException("Track not found."); } result.InputProperties = new AudioStreamProperties(MediaFormats.LPCM); result.CanProceed = true; result.IsConversion = this.Context.Format != MediaFormats.LPCM; result.SupportsSeeking = false; return result; }
public override RequestInitializationResult Initialize() { try { IntPtr trackPtr = (IntPtr)Convert.ToInt32(this.Context.Data[0]); new Track(trackPtr); } catch { throw new MediaNotFoundException("Track not found."); } AudioRequestInitializationResult result = new AudioRequestInitializationResult(); result.InputProperties = new AudioStreamProperties(MediaFormats.LPCM); result.CanProceed = true; result.IsConversion = this.Context.Format != MediaFormats.LPCM; result.SupportsSeeking = false; return result; }