コード例 #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));
        }
コード例 #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));
        }
コード例 #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));
        }
コード例 #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));
        }
コード例 #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));
        }
コード例 #6
0
ファイル: SoundSystem.cs プロジェクト: hainam2101/FmodSharp
        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));
        }
コード例 #7
0
ファイル: SoundSystem.cs プロジェクト: hainam2101/FmodSharp
        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));
        }
コード例 #8
0
ファイル: SoundSystem.cs プロジェクト: hainam2101/FmodSharp
        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));
        }
コード例 #9
0
        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();
        }
コード例 #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.");
            }
        }
コード例 #11
0
ファイル: SoundSystem.cs プロジェクト: hainam2101/FmodSharp
        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.");
            }
        }
コード例 #12
0
ファイル: SoundSystem.cs プロジェクト: hainam2101/FmodSharp
        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.");
            }
        }
コード例 #13
0
 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);
 }
コード例 #14
0
ファイル: Dsp.cs プロジェクト: hainam2101/FmodSharp
 public void Reset()
 {
     Error.Code ReturnCode = Reset_External(this.DangerousGetHandle());
     Error.Errors.ThrowError(ReturnCode);
 }
コード例 #15
0
 public void UnlockDSP()
 {
     Error.Code ReturnCode = UnlockDSP(this.DangerousGetHandle());
     Error.Errors.ThrowError(ReturnCode);
 }
コード例 #16
0
ファイル: SoundSystem.cs プロジェクト: hainam2101/FmodSharp
 public void Init(int Maxchannels, InitFlags Flags, IntPtr Extradriverdata)
 {
     Error.Code ReturnCode = Init(this.handle, Maxchannels, Flags, Extradriverdata);
     Error.Errors.ThrowError(ReturnCode);
 }
コード例 #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);
 }
コード例 #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);
 }
コード例 #19
0
 public void Stop()
 {
     Error.Code ReturnCode = Stop(this.DangerousGetHandle());
     Error.Errors.ThrowError(ReturnCode);
 }