public LowLevelSystem(int maxChannels = 1024, LowLevelInitFlags flags = LowLevelInitFlags.Normal, AdvancedInitializationSettings advancedSettings = default(AdvancedInitializationSettings), Action <IPreInitilizeLowLevelSystem> preInit = null)
        {
            //Load native dependencies
            Native.Load();

            _listenerCollection = new ListenerCollection(this);
            _disposed           = false;

            _reverbController = new ReverbPropertiesController(_system);

            //Create low level system and mark it for disposal management
            Factory.System_Create(out _system).Check();
            _managedSystem = true;

            if (preInit != null)
            {
                preInit(this);
            }

            //Set advanced settings
            SetAdvancedSettings(advancedSettings);

            //Initialize
            _system.init(maxChannels, EquivalentEnum <LowLevelInitFlags, INITFLAGS> .Cast(flags), IntPtr.Zero).Check();
        }
Beispiel #2
0
        public DspConnection?AddInput(DSP target, DspConnectionType dspConnectionType = DspConnectionType.Standard)
        {
            DSPConnection connection;

            if (!FmodDsp.addInput(target.FmodDsp, out connection, EquivalentEnum <DspConnectionType, DSPCONNECTION_TYPE> .Cast(dspConnectionType)).Check(Suppressions()))
            {
                return(null);
            }

            return(new DspConnection(connection));
        }
Beispiel #3
0
        public LoopPoints?GetLoopPoints(TimeUnit startUnit, TimeUnit endUnit)
        {
            uint startv;
            uint endv;

            if (!FmodChannel.getLoopPoints(out startv, EquivalentEnum <TimeUnit, TIMEUNIT> .Cast(startUnit), out endv, EquivalentEnum <TimeUnit, TIMEUNIT> .Cast(endUnit)).Check(Suppressions()))
            {
                return(null);
            }

            return(new LoopPoints(startv, endv));
        }
Beispiel #4
0
        public OutputChannelFormat?GetOutputChannelFormat(ChannelMask inmask, int inchannels, SpeakerMode inspeakermode)
        {
            CHANNELMASK mask;
            SPEAKERMODE mode;
            int         c;

            if (!FmodDsp.getOutputChannelFormat(EquivalentEnum <ChannelMask, CHANNELMASK> .Cast(inmask), inchannels, EquivalentEnum <SpeakerMode, SPEAKERMODE> .Cast(inspeakermode), out mask, out c, out mode).Check(Suppressions()))
            {
                return(null);
            }

            return(new OutputChannelFormat(
                       EquivalentEnum <CHANNELMASK, ChannelMask> .Cast(mask),
                       c,
                       EquivalentEnum <SPEAKERMODE, SpeakerMode> .Cast(mode)
                       ));
        }
Beispiel #5
0
        public FormatInfo?GetFormat()
        {
            SOUND_TYPE   t;
            SOUND_FORMAT f;
            int          channels, bits;

            if (!_fmodSound.getFormat(out t, out f, out channels, out bits).Check(Suppressions()))
            {
                return(null);
            }

            return(new FormatInfo(
                       EquivalentEnum <SOUND_TYPE, SoundType> .Cast(t),
                       EquivalentEnum <SOUND_FORMAT, SoundFormat> .Cast(f),
                       channels, bits
                       ));
        }
Beispiel #6
0
        public ChannelFormat?GetChannelFormat()
        {
            CHANNELMASK mask;
            SPEAKERMODE sourceMode;
            int         nc;

            if (!FmodDsp.getChannelFormat(out mask, out nc, out sourceMode).Check(Suppressions()))
            {
                return(null);
            }
            else
            {
                return(new ChannelFormat(
                           EquivalentEnum <CHANNELMASK, ChannelMask> .Cast(mask),
                           nc,
                           EquivalentEnum <SPEAKERMODE, SpeakerMode> .Cast(sourceMode)
                           ));
            }
        }
Beispiel #7
0
        public OpenStateInfo?GetOpenState()
        {
            OPENSTATE oState;
            uint      percentBuffered;
            bool      starving;
            bool      diskBusy;

            if (!_fmodSound.getOpenState(out oState, out percentBuffered, out starving, out diskBusy).Check(Suppressions()))
            {
                return(null);
            }

            return(new OpenStateInfo(
                       EquivalentEnum <OPENSTATE, OpenState> .Cast(oState),
                       percentBuffered,
                       starving,
                       diskBusy
                       ));
        }
Beispiel #8
0
 public void SetChannelFormat(ChannelMask channelMask, int numChannels, SpeakerMode sourceSpeakerMode)
 {
     FmodDsp.setChannelFormat(EquivalentEnum <ChannelMask, CHANNELMASK> .Cast(channelMask), numChannels, EquivalentEnum <SpeakerMode, SPEAKERMODE> .Cast(sourceSpeakerMode)).Check(Suppressions());
 }
Beispiel #9
0
 public void SetLoopPoints(uint start, TimeUnit startUnit, uint end, TimeUnit endUnit)
 {
     FmodChannel.setLoopPoints(start, EquivalentEnum <TimeUnit, TIMEUNIT> .Cast(startUnit), end, EquivalentEnum <TimeUnit, TIMEUNIT> .Cast(endUnit)).Check(Suppressions());
 }
Beispiel #10
0
        public uint?GetPosition(TimeUnit unit)
        {
            uint pos;

            return(FmodChannel.getPosition(out pos, EquivalentEnum <TimeUnit, TIMEUNIT> .Cast(unit)).CheckBox(pos, Suppressions()));
        }
Beispiel #11
0
 public bool SetLoopPoints(LoopPoint point, TimeUnit startUnit, TimeUnit endUnit)
 {
     return(_fmodSound.setLoopPoints(point.Start, EquivalentEnum <TimeUnit, TIMEUNIT> .Cast(startUnit), point.End, EquivalentEnum <TimeUnit, TIMEUNIT> .Cast(endUnit)).Check(Suppressions()));
 }