Exemplo n.º 1
0
 public BassStream(IBassStreamProvider provider, int channelHandle, long length, IEnumerable <IBassStreamAdvice> advice, BassFlags flags) : this()
 {
     this.Provider      = provider;
     this.ChannelHandle = channelHandle;
     this.Length        = length;
     this.Advice        = advice;
     this.Flags         = flags;
 }
Exemplo n.º 2
0
 /// <summary>Create a stream from file.</summary>
 public static int CreateStream(string File, long Offset = 0, long Length = 0, BassFlags Flags = BassFlags.Default)
 {
     return(BASS_MPC_StreamCreateFile(false, File, Offset, Length, Flags | BassFlags.Unicode));
 }
Exemplo n.º 3
0
 /// <summary>Create a stream from Memory (byte[]).</summary>
 public static int CreateStream(byte[] Memory, long Offset, long Length, BassFlags Flags)
 {
     return(GCPin.CreateStreamHelper(Pointer => CreateStream(Pointer, Offset, Length, Flags), Memory));
 }
Exemplo n.º 4
0
 static extern IntPtr BASS_WMA_GetTags(string File, BassFlags Flags = BassFlags.Unicode);
Exemplo n.º 5
0
 static extern int BASS_OFR_StreamCreateURL(string Url, int Offset, BassFlags Flags, DownloadProcedure Procedure, IntPtr User);
Exemplo n.º 6
0
 public static extern int ReverseCreate(int Channel, float DecodingBlockLength, BassFlags Flags);
Exemplo n.º 7
0
 /// <summary>
 /// Streams a WMA file authenticating using given <paramref name="UserName"/> and <paramref name="Password"/>.
 /// </summary>
 public static int CreateStream(string File, BassFlags Flags, string UserName, string Password)
 {
     return(BASS_WMA_StreamCreateFileAuth(false, File, 0, 0, Flags | BassFlags.Unicode, UserName, Password));
 }
Exemplo n.º 8
0
 public static extern int CreateStream(int Drive, int Track, BassFlags Flags);
Exemplo n.º 9
0
 static extern int BASS_CD_StreamCreateEx(int Drive, int Track, BassFlags Flags, CDDataProcedure proc, IntPtr user);
Exemplo n.º 10
0
 static extern int BASS_RecordStart(int freq, int chans, BassFlags flags, RecordProcedure proc, IntPtr User);
Exemplo n.º 11
0
        public override bool Wrap(IBassStreamProvider provider, int channelHandle, IEnumerable <IBassStreamAdvice> advice, BassFlags flags, out IBassStream stream)
        {
            var offset = default(long);
            var length = default(long);

            if (this.Offset != TimeSpan.Zero)
            {
                offset = Bass.ChannelSeconds2Bytes(channelHandle, this.Offset.TotalSeconds);
            }
            if (this.Length != TimeSpan.Zero)
            {
                length = Bass.ChannelSeconds2Bytes(channelHandle, this.Length.TotalSeconds);
            }
            if (offset != 0 || length != 0)
            {
                if (length == 0)
                {
                    length = Bass.ChannelGetLength(channelHandle, PositionFlags.Bytes) - offset;
                }
                stream = new BassStream(
                    provider,
                    BassSubstream.CreateStream(channelHandle, offset, length, flags),
                    length,
                    advice,
                    flags
                    );
                return(true);
            }
            stream = null;
            return(false);
        }
Exemplo n.º 12
0
 /// <summary>
 /// Starts recording.
 /// </summary>
 /// <param name="Frequency">The sample rate to record at.</param>
 /// <param name="Channels">The number of channels... 1 = mono, 2 = stereo.</param>
 /// <param name="Flags">Any combination of <see cref="BassFlags.Byte"/>, <see cref="BassFlags.Float"/> and <see cref="BassFlags.RecordPause"/>.</param>
 /// <param name="Period">
 /// Set the period (in milliseconds) between calls to the callback function (<see cref="RecordProcedure" />).
 /// The minimum period is 5ms, the maximum the maximum is half the <see cref="RecordingBufferLength"/> setting.
 /// If the period specified is outside this range, it is automatically capped. The default is 100ms.
 /// </param>
 /// <param name="Procedure">The user defined function to receive the recorded sample data... can be <see langword="null" /> if you do not wish to use a callback.</param>
 /// <param name="User">User instance data to pass to the callback function.</param>
 /// <returns>If successful, the new recording's handle is returned, else <see langword="false" /> is returned. Use <see cref="LastError"/> to get the error code.</returns>
 /// <exception cref="Errors.Init"><see cref="RecordInit" /> has not been successfully called.</exception>
 /// <exception cref="Errors.Busy">
 /// The device is busy.
 /// An existing recording must be stopped before starting another one.
 /// Multiple simultaneous recordings can be made from the same device on Windows XP and Vista, but generally not on older Windows.
 /// </exception>
 /// <exception cref="Errors.NotAvailable">
 /// The recording device is not available.
 /// Another application may already be recording with it, or it could be a half-duplex device and is currently being used for playback.
 /// </exception>
 /// <exception cref="Errors.SampleFormat">
 /// The specified format is not supported.
 /// If using the <see cref="BassFlags.Float"/> flag, it could be that floating-point recording is not supported.
 /// </exception>
 /// <exception cref="Errors.Memory">There is insufficient memory.</exception>
 /// <exception cref="Errors.Unknown">Some other mystery problem!</exception>
 public static int RecordStart(int Frequency, int Channels, BassFlags Flags, int Period, RecordProcedure Procedure, IntPtr User = default(IntPtr))
 {
     return(RecordStart(Frequency, Channels, (BassFlags)BitHelper.MakeLong((short)Flags, (short)Period), Procedure, User));
 }
Exemplo n.º 13
0
 static extern int BASS_ZIPSTREAM_StreamCreateFile(bool mem, string file, int index, long offset, long length, BassFlags flags);
Exemplo n.º 14
0
 [DllImport(DllName, EntryPoint = "BASS_WINAMP_StreamCreate")]         // Winamp only supports ASCII filenames.
 public static extern int CreateStream(string FileName, BassFlags Flags);
Exemplo n.º 15
0
 public static extern bool BPMBeatDecodeGet(int Channel, double StartSec, double EndSec, BassFlags Flags, BPMBeatProcedure Procedure, IntPtr User = default(IntPtr));
Exemplo n.º 16
0
 static extern int BASS_CD_StreamCreateFile(string File, BassFlags Flags);
Exemplo n.º 17
0
 public static extern int TempoCreate(int Channel, BassFlags Flags);
Exemplo n.º 18
0
 /// <summary>
 /// Creates a sample stream from an audio CD track, using a CDA file on the CD.
 /// </summary>
 /// <param name="File">The CDA filename... for example, "D:\Track01.cda".</param>
 /// <param name="Flags">A combination of <see cref="BassFlags"/>.</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>
 /// <para>
 /// Only one stream can exist at a time per CD drive.
 /// If a stream using the drive already exists, this function will fail, unless the <see cref="FreeOld"/> config option is enabled.
 /// Note that <see cref="StreamSetTrack" /> can be used to change track without creating a new stream.
 /// </para>
 /// <para>
 /// The sample format of a CD audio stream is always 44100hz stereo 16-bit, unless the <see cref="BassFlags.Float"/> flag is used, in which case it's converted to 32-bit.
 /// When reading sub-channel data, the sample rate will be 45900hz, taking the additional sub-channel data into account.
 /// </para>
 /// <para>
 /// When reading sub-channel data, BASSCD will automatically de-interleave the data if the drive can't.
 /// You can check whether the drive can de-interleave the data itself (or even read sub-channel data at all) in the the <see cref="CDInfo.ReadWriteFlags"/> member.
 /// </para>
 /// <para>
 /// When using the <see cref="BassFlags.Decode"/> flag, it's not possible to play the stream, but seeking is still possible.
 /// Because the decoded sample data is not outputted, "decoding channels" can still be used when there is no output device (using the <see cref="Bass.NoSoundDevice"/> device with <see cref="Bass.Init" />).
 /// </para>
 /// </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. See <see cref="CreateStream(string,BassFlags,CDDataProcedure,IntPtr)" />.</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 case of the latter, see <see cref="CreateStream(string,BassFlags,CDDataProcedure,IntPtr)" />.</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)
 {
     return(BASS_CD_StreamCreateFile(File, Flags | BassFlags.Unicode));
 }
Exemplo n.º 19
0
 static extern int BASS_WMA_StreamCreateFileAuth(bool mem, string file, long offset, long length, BassFlags flags, string user, string pass);
Exemplo n.º 20
0
 static extern int BASS_CD_StreamCreateFileEx(string File, BassFlags Flags, CDDataProcedure proc, IntPtr user = default(IntPtr));
Exemplo n.º 21
0
 /// <summary>
 /// Streams a WMA file from Memory (<see cref="IntPtr"/>) authenticating using given <paramref name="UserName"/> and <paramref name="Password"/>.
 /// </summary>
 public static int CreateStream(IntPtr Memory, long Length, BassFlags Flags, string UserName, string Password)
 {
     return(BASS_WMA_StreamCreateFileAuth(true, Memory, 0, Length, Flags | BassFlags.Unicode, UserName, Password));
 }
Exemplo n.º 22
0
 /// <summary>
 /// Creates a new BASS stream based on any VST instrument plugin (VSTi).
 /// </summary>
 /// <param name="Frequency">The sample rate of the VSTi output (e.g. 44100).</param>
 /// <param name="Channels">The number of channels... 1 = mono, 2 = stereo, 4 = quadraphonic, 6 = 5.1, 8 = 7.1.</param>
 /// <param name="DllFile">The fully qualified path and file name to the VSTi plugin (a DLL file name).</param>
 /// <param name="Flags">A combination of <see cref="BassFlags"/>.</param>
 /// <returns>If successful, the new vst handle is returned, else 0 is returned. Use <see cref="Bass.LastError" /> to get the error code.</returns>
 /// <remarks>
 /// On success, the function returns the new vstHandle that must be given to the other functions.
 /// The returned VST handle can also be given to the typical Bass.Channel* functions.
 /// Use <see cref="ChannelFree" /> to delete and free a VST instrument channel.
 /// </remarks>
 public static int ChannelCreate(int Frequency, int Channels, string DllFile, BassFlags Flags)
 {
     return(BASS_VST_ChannelCreate(Frequency, Channels, DllFile, Flags | BassFlags.Unicode));
 }
Exemplo n.º 23
0
 static extern int BASS_OFR_StreamCreateFile(bool mem, string file, long offset, long length, BassFlags flags);
Exemplo n.º 24
0
 static extern int BASS_VST_ChannelCreate(int Frequency, int Channels, string DllFile, BassFlags Flags);
Exemplo n.º 25
0
 static extern int BASS_MPC_StreamCreateFile(bool mem, IntPtr file, long offset, long length, BassFlags flags);
Exemplo n.º 26
0
 public static extern float BPMDecodeGet(int Channel, double StartSec, double EndSec, int MinMaxBPM, BassFlags Flags, BPMProgressProcedure Procedure, IntPtr User = default(IntPtr));
Exemplo n.º 27
0
 /// <summary>Create a stream from Memory (IntPtr).</summary>
 public static int CreateStream(IntPtr Memory, long Offset, long Length, BassFlags Flags = BassFlags.Default)
 {
     return(BASS_MPC_StreamCreateFile(true, new IntPtr(Memory.ToInt64() + Offset), 0, Length, Flags));
 }
Exemplo n.º 28
0
 public static extern bool BPMCallbackSet(int Handle, BPMProcedure Procedure, double Period, int MinMaxBPM, BassFlags Flags, IntPtr User = default(IntPtr));
Exemplo n.º 29
0
 static extern int BASS_MPC_StreamCreateFileUser(StreamSystem system, BassFlags flags, [In, Out] FileProcedures procs, IntPtr user);
Exemplo n.º 30
0
 /// <summary>
 /// Streams a WMA file from Memory (byte[]) authenticating using given <paramref name="UserName"/> and <paramref name="Password"/>.
 /// </summary>
 public static int CreateStream(byte[] Memory, long Length, BassFlags Flags, string UserName, string Password)
 {
     return(GCPin.CreateStreamHelper(Pointer => CreateStream(Pointer, Length, Flags, UserName, Password), Memory));
 }