public MediaManager(METAboltInstance instance) : base() { this.Instance = instance; manager = this; if (MainProgram.CommandLine.DisableSound) { soundSystemAvailable = false; return; } endCallback = new FMOD.CHANNEL_CALLBACK(DispatchEndCallback); allBuffers = new Dictionary <UUID, BufferSound>(); // Start the background thread that does all the FMOD calls. soundThread = new Thread(new ThreadStart(CommandLoop)); soundThread.IsBackground = true; soundThread.Name = "SoundThread"; soundThread.Start(); // Start the background thread that updates listerner position. listenerThread = new Thread(new ThreadStart(ListenerUpdate)); listenerThread.IsBackground = true; listenerThread.Name = "ListenerThread"; listenerThread.Start(); Instance.ClientChanged += new EventHandler <ClientChangedEventArgs>(Instance_ClientChanged); // Wait for init to complete initDone.WaitOne(); initDone = null; }
public ChannelInfo(Channel channel, IMediaFile file, Action playNextFileAction) { this.Channel = channel; this.Channel.getSystemObject(out system).ERRCHECK(); this.File = file; this.playNextFileAction = playNextFileAction; this.channelEndCallback = new FMOD.CHANNEL_CALLBACK(ChannelEndCallback); this.Channel.setCallback(this.channelEndCallback).ERRCHECK(); this.Volume = 0f; }
public void CleanUp() { if (this.Channel != null) { this.Channel.setVolume(0f).ERRCHECK(RESULT.ERR_INVALID_HANDLE); this.Channel.setPaused(true).ERRCHECK(RESULT.ERR_INVALID_HANDLE); this.Channel.setCallback(null).ERRCHECK(RESULT.ERR_INVALID_HANDLE); this.Channel = null; } this.channelEndCallback = null; this.File.State = PlayerState.Stop; this.File = null; this.playNextFileAction = null; this.system = null; }
public MediaManager(RadegastInstance instance) : base() { this.Instance = instance; manager = this; if (MainProgram.CommandLine.DisableSound) { soundSystemAvailable = false; return; } endCallback = new FMOD.CHANNEL_CALLBACK(DispatchEndCallback); allBuffers = new Dictionary<UUID, BufferSound>(); // Start the background thread that does all the FMOD calls. soundThread = new Thread(new ThreadStart(CommandLoop)); soundThread.IsBackground = true; soundThread.Name = "SoundThread"; soundThread.Start(); // Start the background thread that updates listerner position. listenerThread = new Thread(new ThreadStart(ListenerUpdate)); listenerThread.IsBackground = true; listenerThread.Name = "ListenerThread"; listenerThread.Start(); Instance.ClientChanged += new EventHandler<ClientChangedEventArgs>(Instance_ClientChanged); // Wait for init to complete initDone.WaitOne(); initDone = null; }