Beispiel #1
0
        public System(int maxChannels = 1024, InitFlags flags = InitFlags.LiveUpdate, LowLevelInitFlags lowLevelFlags = LowLevelInitFlags.Normal, AdvancedInitializationSettings advancedSettings = default(AdvancedInitializationSettings), Action<IPreInitilizeLowLevelSystem> preInit = null)
        {
            //Load native dependencies
            Native.Load();

            //Create studio system
            FMOD.Studio.System.create(out _system).Check();

            //Create low level system
            FMOD.System lowLevel;
            _system.getLowLevelSystem(out lowLevel).Check();
            LowLevelSystem = new LowLevelSystem(lowLevel);

            if (preInit != null)
                preInit(LowLevelSystem);

            //Set advanced settings
            LowLevelSystem.SetAdvancedSettings(advancedSettings);

            //Initialize
            _system.initialize(maxChannels, (INITFLAGS)flags, (FMOD.INITFLAGS)lowLevelFlags, IntPtr.Zero).Check();
        }
        public void SetAdvancedSettings(AdvancedInitializationSettings advancedInitializationSettings)
        {
            var init = advancedInitializationSettings.ToFmod();

            _system.setAdvancedSettings(ref init).Check();
        }
        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();
        }