Ejemplo n.º 1
0
        public static void Free()
        {
            if (!IsInitialized)
            {
                return;
            }

            if (Info != null)
            {
                var flags =
                    AsioChannelResetFlags.Enable |
                    AsioChannelResetFlags.Join |
                    AsioChannelResetFlags.Format |
                    AsioChannelResetFlags.Rate;
                Logger.Write(typeof(BassAsioDevice), LogLevel.Debug, "Resetting BASS ASIO channel attributes.");
                for (var channel = 0; channel < Info.Outputs; channel++)
                {
                    BassAsio.ChannelReset(false, channel, flags);
                }
            }

            Logger.Write(typeof(BassAsioDevice), LogLevel.Debug, "Releasing BASS ASIO.");
            BassAsio.Free();
            BassAsioHandler.Free();
            IsInitialized = false;
        }
Ejemplo n.º 2
0
 internal override void Close()
 {
     Bass.ChannelStop(MixerStream);
     BassAsio.Stop();
     BassAsio.ChannelReset(false, 0,
                           AsioChannelResetFlags.Enable | AsioChannelResetFlags.Join);
     //BassAsio.CurrentDevice = AsioDevNum;
     BassAsio.Free();
     FreeDevice(0);
     Cfg.AsioProcs.Remove(dAsioProc);
 }
Ejemplo n.º 3
0
 public override void Resume()
 {
     if (!this.IsPaused)
     {
         return;
     }
     Logger.Write(this, LogLevel.Debug, "Resuming ASIO.");
     try
     {
         BassAsioUtils.OK(BassAsio.ChannelReset(false, BassAsioDevice.PRIMARY_CHANNEL, AsioChannelResetFlags.Pause));
     }
     catch (Exception e)
     {
         this.OnError(e);
         throw;
     }
 }
Ejemplo n.º 4
0
 protected virtual bool ResetASIO()
 {
     try
     {
         var flags =
             AsioChannelResetFlags.Enable |
             AsioChannelResetFlags.Join |
             AsioChannelResetFlags.Format |
             AsioChannelResetFlags.Rate;
         Logger.Write(this, LogLevel.Debug, "Resetting channel attributes.");
         for (var channel = 0; channel < this.Channels; channel++)
         {
             BassAsioUtils.OK(BassAsio.ChannelReset(false, channel, flags));
         }
     }
     catch (Exception e)
     {
         //Nothing can be done.
         Logger.Write(this, LogLevel.Warn, "Failed to reset channel attributes: {0}", e.Message);
     }
     return(true);
 }