Table of callback functions used with StreamCreateFileUser.
Ejemplo n.º 1
0
        /// <summary>
        /// Release all resource.
        /// </summary>
        public void Dispose()
        {
            _fileCloseHandle.Free();
            _fileLengthHandle.Free();
            _fileReadHandle.Free();
            _fileSeekHandle.Free();

            _fileCloseHandler = null;
            _fileLengthHandler = null;
            _fileReadHandler = null;
            _fileSeekHandler = null;

            StreamHandlers = new FileHandlers();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Create a <see cref="BassStream"/> form a <see cref="Stream"/>.
        /// </summary>
        /// <param name="stream">Stream to wrap.</param>
        public BassStream(Stream stream)
        {
            _stream = stream;
            _streamPosition = _stream.Position;

            _fileCloseHandler = OnFileClose;
            _fileLengthHandler = OnFileLength;
            _fileReadHandler = OnFileRead;
            _fileSeekHandler = OnFileSeek;

            _fileCloseHandle = GCHandle.Alloc(_fileCloseHandler);
            _fileLengthHandle = GCHandle.Alloc(_fileLengthHandler);
            _fileReadHandle = GCHandle.Alloc(_fileReadHandler);
            _fileSeekHandle = GCHandle.Alloc(_fileSeekHandler);

            StreamHandlers = new FileHandlers
            {
                CloseHandler = _fileCloseHandler,
                LengthHandler = _fileLengthHandler,
                ReadHandler = _fileReadHandler,
                SeekHandler = _fileSeekHandler
            };
        }
Ejemplo n.º 3
0
 /// <summary>
 ///     Create a sample stream from an MP3, MP2, MP1, OGG, WAV, AIFF or plug-in supported file via user callback functions.
 /// </summary>
 /// <param name="handlers">The user defined file functions. </param>
 /// <param name="configs">Configure of <see cref="AudioFileStream" />.</param>
 /// <param name="systemType">File system to use.</param>
 /// <param name="user">User instance data to pass to the callback functions. </param>
 public AudioFileStream(FileHandlers handlers, StreamCreateFileUserConfig configs,
     StreamFileSystemType systemType, IntPtr user)
 {
     Handle =
         AudioStreamModule.StreamCreateFileUserFunction.CheckResult(
             AudioStreamModule.StreamCreateFileUserFunction.Delegate(systemType, configs,
                 ref handlers, user));
 }
Ejemplo n.º 4
0
 /// <summary>
 ///     Create a sample stream from a WMA file via user callback functions.
 /// </summary>
 /// <param name="handlers">The user defined file functions. </param>
 /// <param name="configs">Configure of <see cref="WmaStream" />.</param>
 /// <param name="systemType">File system to use.</param>
 /// <param name="user">User instance data to pass to the callback functions. </param>
 public WmaStream(FileHandlers handlers, WmaStreamCreateConfig configs,
     StreamFileSystemType systemType, IntPtr user)
 {
     Handle =
         WmaModule.WmaStreamCreateFileUserFunction.CheckResult(
             WmaModule.WmaStreamCreateFileUserFunction.Delegate(systemType, configs,
                 ref handlers, user));
 }