Esempio n. 1
0
        public Dsp.Dsp CreateDspByType(Dsp.Type type)
        {
            IntPtr DspHandle = IntPtr.Zero;

            Error.Code ReturnCode = CreateDspByType(this.DangerousGetHandle(), type, ref DspHandle);
            Error.Errors.ThrowError(ReturnCode);

            return(new Dsp.Dsp(DspHandle));
        }
Esempio n. 2
0
        public Dsp.Connection AddDsp(Dsp.Dsp dsp)
        {
            IntPtr ConnectionHandle = IntPtr.Zero;

            Error.Code ReturnCode = AddDSP(this.DangerousGetHandle(), dsp.DangerousGetHandle(), ref ConnectionHandle);
            Error.Errors.ThrowError(ReturnCode);

            return(new Dsp.Connection(ConnectionHandle));
        }
Esempio n. 3
0
        public Channel.Channel PlayDsp(Dsp.Dsp dsp, bool paused)
        {
            IntPtr ChannelHandle = IntPtr.Zero;

            Error.Code ReturnCode = PlayDsp(this.DangerousGetHandle(), Channel.Index.Free, dsp.DangerousGetHandle(), paused, ref ChannelHandle);
            Error.Errors.ThrowError(ReturnCode);

            return(new Channel.Channel(ChannelHandle));
        }
Esempio n. 4
0
        public Reverb.Reverb CreateReverb()
        {
            IntPtr ReverbHandle = IntPtr.Zero;

            Error.Code ReturnCode = CreateReverb(this.DangerousGetHandle(), ref ReverbHandle);
            Error.Errors.ThrowError(ReturnCode);

            return(new Reverb.Reverb(ReverbHandle));
        }
Esempio n. 5
0
        public Dsp.Dsp CreateDSP(ref Dsp.Description description)
        {
            IntPtr DspHandle = IntPtr.Zero;

            Error.Code ReturnCode = CreateDSP(this.DangerousGetHandle(), ref description, ref DspHandle);
            Error.Errors.ThrowError(ReturnCode);

            return(new Dsp.Dsp(DspHandle));
        }
Esempio n. 6
0
        public Sound.Sound CreateStream(byte[] data, Mode mode, Sound.Info exinfo)
        {
            IntPtr SoundHandle = IntPtr.Zero;

            Error.Code ReturnCode = CreateStream(this.DangerousGetHandle(), data, mode, ref exinfo, ref SoundHandle);
            Error.Errors.ThrowError(ReturnCode);

            return(new Sound.Sound(SoundHandle));
        }
Esempio n. 7
0
        public Channel.Channel PlaySound(Sound.Sound snd, bool paused)
        {
            IntPtr ChannelHandle = IntPtr.Zero;

            Error.Code ReturnCode = PlaySound(this.DangerousGetHandle(), Channel.Index.Free, snd.DangerousGetHandle(), paused, ref ChannelHandle);
            Error.Errors.ThrowError(ReturnCode);

            return(new Channel.Channel(ChannelHandle));
        }
Esempio n. 8
0
        public Sound.Sound CreateStream(string path, Mode mode)
        {
            IntPtr SoundHandle = IntPtr.Zero;

            Error.Code ReturnCode = CreateStream(this.DangerousGetHandle(), path, mode, 0, ref SoundHandle);
            Error.Errors.ThrowError(ReturnCode);

            return(new Sound.Sound(SoundHandle));
        }
        private void GetRecordDriverInfo(int Id, out string Name, out Guid DriverGuid)
        {
            System.Text.StringBuilder str = new System.Text.StringBuilder(255);

            Error.Code ReturnCode = GetRecordDriverInfo(this.DangerousGetHandle(), Id, str, str.Capacity, out DriverGuid);
            Error.Errors.ThrowError(ReturnCode);

            Name = str.ToString();
        }
Esempio n. 10
0
        public void PlayDsp(Dsp.Dsp dsp, bool paused, Channel.Channel chn)
        {
            IntPtr channel = chn.DangerousGetHandle();

            Error.Code ReturnCode = PlayDsp(this.DangerousGetHandle(), Channel.Index.Reuse, dsp.DangerousGetHandle(), paused, ref channel);
            Error.Errors.ThrowError(ReturnCode);

            //This can't really happend.
            //Check just in case...
            if (chn.DangerousGetHandle() != channel)
            {
                throw new Exception("Channel handle got changed by Fmod.");
            }
        }
Esempio n. 11
0
        public SoundSystem() : base()
        {
            IntPtr SoundSystemHandle = IntPtr.Zero;

            Error.Code ReturnCode = Create(ref SoundSystemHandle);
            Error.Errors.ThrowError(ReturnCode);

            this.SetHandle(SoundSystemHandle);

            if (this.Version < Fmod_Version)
            {
                Release(this.handle);
                this.SetHandleAsInvalid();
                throw new NotSupportedException("The current version of Fmod isnt supported.");
            }
        }
Esempio n. 12
0
        private void PlaySound(Sound.Sound snd, bool paused, Channel.Channel chn)
        {
            //FIXME The handle is changed most of the time on some system.
            //Only use the other metods to be safe.

            IntPtr channel = chn.DangerousGetHandle();

            Error.Code ReturnCode = PlaySound(this.DangerousGetHandle(), Channel.Index.Reuse, snd.DangerousGetHandle(), paused, ref channel);
            Error.Errors.ThrowError(ReturnCode);

            //This can't really happend.
            //Check just in case...
            if (chn.DangerousGetHandle() == channel)
            {
                throw new Exception("Channel handle got changed by Fmod.");
            }
        }
 private void GetRecordDriverCapabilities(int id, out Capabilities caps, out int minfrequency, out int maxfrequency)
 {
     Error.Code ReturnCode = GetRecordDriverCaps(this.DangerousGetHandle(), id, out caps, out minfrequency, out maxfrequency);
     Error.Errors.ThrowError(ReturnCode);
 }
Esempio n. 14
0
 public void Reset()
 {
     Error.Code ReturnCode = Reset_External(this.DangerousGetHandle());
     Error.Errors.ThrowError(ReturnCode);
 }
Esempio n. 15
0
 public void UnlockDSP()
 {
     Error.Code ReturnCode = UnlockDSP(this.DangerousGetHandle());
     Error.Errors.ThrowError(ReturnCode);
 }
Esempio n. 16
0
 public void Init(int Maxchannels, InitFlags Flags, IntPtr Extradriverdata)
 {
     Error.Code ReturnCode = Init(this.handle, Maxchannels, Flags, Extradriverdata);
     Error.Errors.ThrowError(ReturnCode);
 }
Esempio n. 17
0
 private void GetOutputDriverCapabilities(int Id, out Capabilities caps, out int minfrequency, out int maxfrequency, out SpeakerMode controlpanelspeakermode)
 {
     Error.Code ReturnCode = GetDriverCaps(this.DangerousGetHandle(), Id, out caps, out minfrequency, out maxfrequency, out controlpanelspeakermode);
     Error.Errors.ThrowError(ReturnCode);
 }
Esempio n. 18
0
 public static void GetStats(ref int currentalloced, ref int maxalloced, bool blocking)
 {
     Error.Code ReturnCode = GetStats_External(ref currentalloced, ref maxalloced, blocking);
     Error.Errors.ThrowError(ReturnCode);
 }
Esempio n. 19
0
 public void Stop()
 {
     Error.Code ReturnCode = Stop(this.DangerousGetHandle());
     Error.Errors.ThrowError(ReturnCode);
 }