/// <summary>Create a stream from Url.</summary> public static int CreateStream(string Url, int Offset, BassFlags Flags, DownloadProcedure Procedure, IntPtr User = default(IntPtr)) { var h = BASS_HLS_StreamCreateURL(Url, Offset, Flags | BassFlags.Unicode, Procedure, User); if (h != 0) { ChannelReferences.Add(h, 0, Procedure); } return(h); }
/// <summary> /// Creates a sample stream from an audio CD track, using a CDA file on the CD, optionally providing a callback function to receive sub-channel data and/or C2 error info. /// </summary> /// <param name="File">The CDA filename... for example, "D:\Track01.cda".</param> /// <param name="Flags">A combination of <see cref="BassFlags"/>.</param> /// <param name="Procedure">A callback function to receive sub-channel data and C2 error info... <see langword="null" /> = no callback. If a callback function is provided, sub-channel data and C2 error info will be delivered to it rather than being inserted amongst the sample data.</param> /// <param name="User">User instance data to pass to the callback function.</param> /// <returns>If successful, the new stream's handle is returned, else 0 is returned. Use <see cref="Bass.LastError" /> to get the error code.</returns> /// <remarks> /// This function is identical to <see cref="CreateStream(string,BassFlags)" />, but with the additional option of providing a callback function to receive sub-channel data and C2 error info. /// </remarks> /// <exception cref="Errors.Init"><see cref="Bass.Init" /> has not been successfully called.</exception> /// <exception cref="Errors.Already">A stream using this drive already exists.</exception> /// <exception cref="Errors.FileOpen">The file could not be opened.</exception> /// <exception cref="Errors.FileFormat">The file was not recognised as a CDA file.</exception> /// <exception cref="Errors.Parameter">The <see cref="BassFlags.CDSubChannel"/> and <see cref="BassFlags.CdC2Errors"/> flags cannot be used without the <see cref="BassFlags.Decode"/> flag or with the <see cref="BassFlags.Float"/> flag, unless a <see cref="CDDataProcedure" /> is provided.</exception> /// <exception cref="Errors.NoCD">There's no CD in the drive.</exception> /// <exception cref="Errors.NotAudioTrack">The track is not an audio track.</exception> /// <exception cref="Errors.NotAvailable">Reading sub-channel data and/or C2 error info is not supported by the drive, or a read offset is in effect, in which case a <see cref="CDDataProcedure" /> must be provided to receive sub-channel data or C2 error info.</exception> /// <exception cref="Errors.SampleFormat">The sample format is not supported by the device/drivers. If using the <see cref="BassFlags.Float"/> flag, it could be that floating-point channels are not supported (ie. no WDM drivers).</exception> /// <exception cref="Errors.Speaker">The device/drivers do not support the requested speaker(s), or you're attempting to assign a stereo stream to a mono speaker.</exception> /// <exception cref="Errors.Memory">There is insufficient memory.</exception> /// <exception cref="Errors.Unknown">Some other mystery problem!</exception> public static int CreateStream(string File, BassFlags Flags, CDDataProcedure Procedure, IntPtr User = default(IntPtr)) { var h = BASS_CD_StreamCreateFileEx(File, Flags | BassFlags.Unicode, Procedure, User); if (h != 0) { ChannelReferences.Add(h, 0, Procedure); } return(h); }
/// <summary>Create a stream using User File Procedures.</summary> public static int CreateStream(StreamSystem System, BassFlags Flags, FileProcedures Procedures, IntPtr User = default(IntPtr)) { var h = BASS_ZXTUNE_StreamCreateFileUser(System, Flags, Procedures, User); if (h != 0) { ChannelReferences.Add(h, 0, Procedures); } return(h); }
/// <summary> /// Creates a sample stream from an audio CD track, optionally providing a callback function to receive sub-channel data and/or C2 error info. /// </summary> /// <param name="Drive">The drive... 0 = the first drive.</param> /// <param name="Track">The track... 0 = the first track, <see cref="TrackPregap"/> = 1st track pregap (not all drives support reading of the 1st track pregap).</param> /// <param name="Flags">A combination of <see cref="BassFlags"/>.</param> /// <param name="Procedure">A callback function to receive sub-channel data and C2 error info... <see langword="null" /> = no callback. If a callback function is provided, sub-channel data and C2 error info will be delivered to it rather than being inserted amongst the sample data.</param> /// <param name="User">User instance data to pass to the callback function.</param> /// <returns>If successful, the new stream's handle is returned, else 0 is returned. Use <see cref="Bass.LastError" /> to get the error code.</returns> /// <remarks> /// This function is identical to <see cref="CreateStream(int,int,BassFlags)" />, but with the additional option of providing a callback function to receive sub-channel data and C2 error info. /// </remarks> /// <exception cref="Errors.Init"><see cref="Bass.Init" /> has not been successfully called.</exception> /// <exception cref="Errors.Device"><paramref name="Drive" /> is invalid.</exception> /// <exception cref="Errors.Already">A stream using this drive already exists.</exception> /// <exception cref="Errors.Parameter">The <see cref="BassFlags.CDSubChannel"/> and <see cref="BassFlags.CdC2Errors"/> flags cannot be used without the <see cref="BassFlags.Decode"/> flag or with the <see cref="BassFlags.Float"/> flag, unless a <see cref="CDDataProcedure" /> is provided.</exception> /// <exception cref="Errors.NoCD">There's no CD in the drive.</exception> /// <exception cref="Errors.CDTrack"><paramref name="Track" /> is invalid.</exception> /// <exception cref="Errors.NotAudioTrack">The track is not an audio track.</exception> /// <exception cref="Errors.NotAvailable">Reading sub-channel data and/or C2 error info is not supported by the drive, or a read offset is in effect, in which case a , in which case a <see cref="CDDataProcedure" /> must be provided to receive sub-channel data or C2 error info.</exception> /// <exception cref="Errors.SampleFormat">The sample format is not supported by the device/drivers. If using the <see cref="BassFlags.Float"/> flag, it could be that floating-point channels are not supported (ie. no WDM drivers).</exception> /// <exception cref="Errors.Speaker">The device/drivers do not support the requested speaker(s), or you're attempting to assign a stereo stream to a mono speaker.</exception> /// <exception cref="Errors.Memory">There is insufficient memory.</exception> /// <exception cref="Errors.Unknown">Some other mystery problem!</exception> public static int CreateStream(int Drive, int Track, BassFlags Flags, CDDataProcedure Procedure, IntPtr User = default(IntPtr)) { var h = BASS_CD_StreamCreateEx(Drive, Track, Flags, Procedure, User); if (h != 0) { ChannelReferences.Add(h, 0, Procedure); } return(h); }