• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# FMOD.System类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中FMOD.System的典型用法代码示例。如果您正苦于以下问题:C# System类的具体用法?C# System怎么用?C# System使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



System类属于FMOD命名空间,在下文中一共展示了System类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: EqualizerBand

        private EqualizerBand(FMOD.System system, DSP dspParamEq, float centerValue, float gainValue, bool active)
        {
            this.fmodSystem = system;
            this.dspEQ = dspParamEq;

            if (centerValue >= 1000)
            {
                this.BandCaption = string.Format("{0}K", (centerValue / 1000));
            }
            else
            {
                this.BandCaption = centerValue.ToString(CultureInfo.InvariantCulture);
            }

            this.WhenAnyValue(x => x.Gain)
                .Subscribe(newGain => {
                    if (this.IsActive && this.dspEQ != null)
                    {
                        System.Diagnostics.Debug.WriteLine(">> Gain value: " + newGain);

                        this.dspEQ.setActive(false).ERRCHECK();
                        this.dspEQ.setParameterFloat((int)FMOD.DSP_PARAMEQ.GAIN, newGain).ERRCHECK();
                        this.dspEQ.setActive(true).ERRCHECK();
                        this.fmodSystem.update().ERRCHECK();
                    }
                });

            this.Gain = gainValue;
            this.IsActive = active;
        }
开发者ID:kaushik1605,项目名称:sample_DotNet,代码行数:30,代码来源:EqualizerBand.cs


示例2: Equalizer

 private Equalizer(FMOD.System system, SMPSettings settings) {
   this.smpSettings = settings;
   this.Name = "DefaultEqualizer";
   this.fmodSystem = system;
   this.Bands = new ObservableCollection<EqualizerBand>();
   this.isEnabled = settings.PlayerSettings.EqualizerSettings == null || settings.PlayerSettings.EqualizerSettings.IsEnabled;
 }
开发者ID:phaufe,项目名称:simple-music-player,代码行数:7,代码来源:Equalizer.cs


示例3: SoundManager

 internal SoundManager(FMOD.System system, bool hardware = true)
 {
     _log = Logging.LogManager.GetLogger(this);
     _log.Info("Initializing SoundManager...");
     _system = system;
     _sounds = new List<Sound>();
     _soundMode = hardware ? MODE.HARDWARE : MODE.SOFTWARE;
     _log.DebugFormat("Sound Mode == {0}", _soundMode);
     _log.Debug("SoundManager initialized!");
 }
开发者ID:Sharparam,项目名称:DiseasedToast,代码行数:10,代码来源:SoundManager.cs


示例4: Music

        public Music(FMOD.System system, string intropath, string looppath, float baseVol)
        {
            this.system = system;
            callback = new CHANNEL_CALLBACK(SyncCallback);

            baseVolume = baseVol;
            volume = 1;

            if (looppath != null) system.createSound(looppath, MODE.LOOP_NORMAL, ref loop);

            if (intropath != null)
            {
                system.createSound(intropath, MODE.DEFAULT, ref intro);
            }

            Playing = false;
        }
开发者ID:Tesserex,项目名称:C--MegaMan-Engine,代码行数:17,代码来源:Music.cs


示例5: SongManager

        internal SongManager(FMOD.System system, bool hardware = true)
        {
            _log = Logging.LogManager.GetLogger(this);
            _log.Info("Initializing SongManager...");
            _system = system;
            _songs = new List<Song>();

            // ReSharper disable BitwiseOperatorOnEnumWihtoutFlags
            if (hardware)
                _soundMode = MODE._2D | MODE.HARDWARE | MODE.CREATESTREAM;
            else
                _soundMode = MODE._2D | MODE.SOFTWARE | MODE.CREATESTREAM;
            // ReSharper restore BitwiseOperatorOnEnumWihtoutFlags

            _log.DebugFormat("Sound Mode == {0}", _soundMode);
            _log.Debug("SongManager initialized!");
        }
开发者ID:Sharparam,项目名称:DiseasedToast,代码行数:17,代码来源:SongManager.cs


示例6: DeckControl

        public DeckControl()
        {
            _mixerBackground = new Image();
            _mixerBackground.Height = 488;
            _mixerBackground.Width = 710;
            BitmapImage bmp = new BitmapImage();
            bmp.BeginInit();
            bmp.UriSource = new Uri("png/deck_background.png", UriKind.Relative);
            bmp.EndInit();
            _mixerBackground.Source = bmp;
            this.Children.Add(_mixerBackground);

            _recordController = new RecordController(RECORD_DIAMETER, RECORD_DIAMETER);
            _recordController.Margin = new Thickness(RECORD_MARGIN_LEFT, RECORD_MARGIN_TOP, 0, 0);
            _recordController.SetBackgroundImage(@"png/record.png");
            _recordController.Width = RECORD_DIAMETER;
            _recordController.Height = RECORD_DIAMETER;
            _recordController.TouchDown += new EventHandler<TouchEventArgs>(RecordTouchDown);
            _recordController.TouchUp += new EventHandler<TouchEventArgs>(RecordTouchUp);
            _recordController.TouchMove += new EventHandler<TouchEventArgs>(RecordTouchMove);
            _recordController.DragEnter += new System.Windows.DragEventHandler(RecordDragEnter);
            _recordController.DragLeave += new System.Windows.DragEventHandler(RecordDragLeave);
            _recordController.Drop += new System.Windows.DragEventHandler(RecordDrop);
            _recordController.AllowDrop = true;
            this.Children.Add(_recordController);

            _highPassKnob = new KnobControl(KNOB_DIAMETER, KNOB_DIAMETER);
            _highPassKnob.Margin = new Thickness(KNOB_MARGIN_LEFT, KNOB_MARGIN_TOP, 0, 0);
            _highPassKnob.SetBackgroundImage(@"png/dial_background.png");
            _highPassKnob.SetCenterImage(@"png/dial_knob.png");
            _highPassKnob.Width = KNOB_DIAMETER;
            _highPassKnob.Height = KNOB_DIAMETER;
            //_highPassKnob.TouchDown += new EventHandler<TouchEventArgs>(HPKnobTouchDown);
            //_highPassKnob.TouchUp += new EventHandler<TouchEventArgs>(HPKnobTouchUp);
            _highPassKnob.TouchMove += new EventHandler<TouchEventArgs>(HPKnobTouchMove);
            this.Children.Add(_highPassKnob);

            _lowPassKnob = new KnobControl(KNOB_DIAMETER, KNOB_DIAMETER);
            _lowPassKnob.Margin = new Thickness(KNOB_MARGIN_LEFT, KNOB_MARGIN_TOP + KNOB_DIAMETER * 1 + KNOB_PADDING * 1, 0, 0);
            _lowPassKnob.SetBackgroundImage(@"png/dial_background.png");
            _lowPassKnob.SetCenterImage(@"png/dial_knob.png");
            _lowPassKnob.Width = KNOB_DIAMETER;
            _lowPassKnob.Height = KNOB_DIAMETER;
            _lowPassKnob.TouchMove += new EventHandler<TouchEventArgs>(LPKnobTouchMove);
            this.Children.Add(_lowPassKnob);

            _reverbKnob = new KnobControl(KNOB_DIAMETER, KNOB_DIAMETER);
            _reverbKnob.Margin = new Thickness(KNOB_MARGIN_LEFT, KNOB_MARGIN_TOP + KNOB_DIAMETER * 2 + KNOB_PADDING * 2, 0, 0);
            _reverbKnob.SetBackgroundImage(@"png/dial_background.png");
            _reverbKnob.SetCenterImage(@"png/dial_knob.png");
            _reverbKnob.Width = KNOB_DIAMETER;
            _reverbKnob.Height = KNOB_DIAMETER;
            this.Children.Add(_reverbKnob);
            

            angle = 1;
            _recordMidPoint = new System.Windows.Point(_recordController.Width / 2 + _recordController.Margin.Left, _recordController.Height / 2 + _recordController.Margin.Top);
            rotate = new RotateTransform(1, _recordController.Width / 2, _recordController.Height / 2);
            transform = new TransformGroup();
            transform.Children.Add(rotate);

            dispatcherTimer = new DispatcherTimer();
            dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
            dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 1);
            dispatcherTimer.Start();

            system = new FMOD.System();
            FMOD.RESULT result = Factory.System_Create(ref system);
            system.init(8, INITFLAGS.NORMAL, (IntPtr)null);
            channel = new Channel(system);
            channel.Initialize(0);
            channel.SetHighPass(1.0f);
            _isPlaying = false;
        }
开发者ID:GunioRobot,项目名称:Project-Volcano,代码行数:74,代码来源:DeckControl.cs


示例7: System_Create

        public static RESULT System_Create(ref System system)
        {
            #if WIN64
            if (IntPtr.Size != 8)
            {
                /* Attempting to use 64-bit FMOD dll with 32-bit application.*/

                return RESULT.ERR_FILE_BAD;
            }
            #else
            if (IntPtr.Size != 4)
            {
                /* Attempting to use 32-bit FMOD dll with 64-bit application. A likely cause of this error
                 * is targetting platform 'Any CPU'. You cannot link to unmanaged dll with 'Any CPU'
                 * target.
                 *
                 * For 32-bit applications: set the platform to 'x86'.
                 *
                 * For 64-bit applications:
                 * 1. set the platform to x64
                 * 2. add the conditional complication symbol WIN64
                 * 3. download the win64 fmod release
                 * 4. copy the fmodex64.dll to the location of the .exe file for your application */

                return RESULT.ERR_FILE_BAD;
            }
            #endif

            RESULT result           = RESULT.OK;
            IntPtr      systemraw   = new IntPtr();
            System      systemnew   = null;

            // If you come to here with a DLLNotFound exception, make sure to copy "fmodex.dll" into
            // the game's runtime directory (along with config.xml)
            result = FMOD_System_Create(ref systemraw);
            if (result != RESULT.OK)
            {
                return result;
            }

            systemnew = new System();
            systemnew.setRaw(systemraw);
            system = systemnew;

            return result;
        }
开发者ID:huming2207,项目名称:ghgame,代码行数:46,代码来源:fmod.cs


示例8: System_Create

        public static RESULT System_Create(out System system)
        {
            system = null;

            RESULT result   = RESULT.OK;
            IntPtr rawPtr   = new IntPtr();

            result = FMOD_System_Create(out rawPtr);
            if (result != RESULT.OK)
            {
                return result;
            }

            system = new System(rawPtr);

            return result;
        }
开发者ID:Cocotus,项目名称:simple-music-player,代码行数:17,代码来源:fmod.cs


示例9: fmodSetup

        //This function is called by the loadSystem function. It sets up FMOD for the rest of
        //the program, like an "init" of sorts. Most of this code is boilerplate that is used in
        //every FMOD application.
        private FMOD.System fmodSetup()
        {
            FMOD.System t_system = new FMOD.System();
            FMOD.RESULT result = new FMOD.RESULT();
            uint version = 0;
            int numDrivers = 0;
            FMOD.SPEAKERMODE speakerMode = FMOD.SPEAKERMODE.STEREO;
            FMOD.CAPS caps = FMOD.CAPS.NONE;
            StringBuilder name = null;

            // Create FMOD interface object
            result = FMOD.Factory.System_Create(ref t_system);
            FMODErrorCheck(result);

            // Check version
            result = t_system.getVersion(ref version);
            FMODErrorCheck(result);

            if (version < FMOD.VERSION.number)
            {
                Console.WriteLine("Error! You are using an old version of FMOD " + version + ". This program requires " + FMOD.VERSION.number);
                return null;
            }

            //Check Sound Cards, if none, disable sound
            result = t_system.getNumDrivers(ref numDrivers);
            FMODErrorCheck(result);

            if (numDrivers == 0)
            {
                result = t_system.setOutput(FMOD.OUTPUTTYPE.NOSOUND);
                FMODErrorCheck(result);
            }
            // At least one sound card
            else
            {

                // Get the capabilities of the default (0) sound card
                result = t_system.getDriverCaps(0, ref caps, ref zero, ref speakerMode);
                FMODErrorCheck(result);

                // Set the speaker mode to match that in Control Panel
                result = t_system.setSpeakerMode(speakerMode);
                FMODErrorCheck(result);

                // Increase buffer size if user has Acceleration slider set to off
                if (FMOD.CAPS.HARDWARE_EMULATED.Equals(true))
                {
                    result = t_system.setDSPBufferSize(1024, 10);
                    FMODErrorCheck(result);
                }
                // Get name of driver
                FMOD.GUID temp = new FMOD.GUID();

                result = t_system.getDriverInfo(0, name, 256, ref temp);
                FMODErrorCheck(result);
            }
            System.IntPtr temp2 = new System.IntPtr();
            // Initialise FMOD
            result = t_system.init(100, FMOD.INITFLAGS.NORMAL, temp2);

            // If the selected speaker mode isn't supported by this sound card, switch it back to stereo
            if (result == FMOD.RESULT.ERR_OUTPUT_CREATEBUFFER)
            {
                result = t_system.setSpeakerMode(FMOD.SPEAKERMODE.STEREO);
                FMODErrorCheck(result);

                result = t_system.init(100, FMOD.INITFLAGS.NORMAL, temp2);
            }

            FMODErrorCheck(result);

            return t_system;
        }
开发者ID:SkuliSheepman,项目名称:BeatDetectorForGames,代码行数:77,代码来源:BeatDetector.cs


示例10: System_Create

        public static RESULT System_Create(ref System system)
        {
            RESULT result      = RESULT.OK;
            IntPtr      systemraw   = new IntPtr();
            System      systemnew   = null;

            result = FMOD_System_Create(ref systemraw);
            if (result != RESULT.OK)
            {
                return result;
            }

            systemnew = new System();
            systemnew.setRaw(systemraw);
            system = systemnew;

            return result;
        }
开发者ID:olbers,项目名称:sauip4,代码行数:18,代码来源:fmod.cs


示例11: Plugin

 public Plugin(uint handle, FMOD.System system)
 {
     Handle = handle;
     _system = system;
 }
开发者ID:HakanL,项目名称:SupersonicSound,代码行数:5,代码来源:Plugin.cs


示例12: CalculateAngle

        //Calculates the angle between two Points relative to the midpoint
        private double CalculateAngle(System.Windows.Point Mid, System.Windows.Point A, System.Windows.Point B)
        {
            double MidA = Math.Sqrt(Math.Pow(Mid.X - A.X, 2) + Math.Pow(Mid.Y - A.Y, 2));
            double AB = Math.Sqrt(Math.Pow(A.X - B.X, 2) + Math.Pow(A.Y - B.Y, 2));
            double MidB = Math.Sqrt(Math.Pow(Mid.X - B.X, 2) + Math.Pow(Mid.Y - B.Y, 2));
            Double angle = Math.Acos(((Math.Pow(AB, 2) - Math.Pow(MidA, 2) - Math.Pow(MidB, 2)) / (-2 * MidA * MidB)));

            double determinant = ((A.X - Mid.X) * (B.Y - Mid.Y)) - ((A.Y - Mid.Y) * (B.X - Mid.X));
            if (determinant < 0)
            {
                angle = -angle;
            }

            //check if memory got updated before the render
            if (Double.IsNaN(angle))
            {
                angle = 0;
            }
            return angle * (180 / Math.PI);
        }
开发者ID:GunioRobot,项目名称:Project-Volcano,代码行数:21,代码来源:DeckControl.cs


示例13: getSystemObject

        public RESULT getSystemObject(ref System system)
        {
            var result = RESULT.OK;
            var systemraw = new IntPtr();
            System systemnew = null;

            try
            {
                result = FMOD_Channel_GetSystemObject(channelraw, ref systemraw);
            }
            catch
            {
                result = RESULT.ERR_INVALID_PARAM;
            }
            if (result != RESULT.OK)
            {
                return result;
            }

            if (system == null)
            {
                systemnew = new System();
                systemnew.setRaw(systemraw);
                system = systemnew;
            }
            else
            {
                system.setRaw(systemraw);
            }

            return result;
        }
开发者ID:nathan-alden,项目名称:old-text-adventure,代码行数:32,代码来源:fmod.cs


示例14: ReverbPropertiesController

 internal ReverbPropertiesController(FMOD.System system)
 {
     _system = system;
 }
开发者ID:HakanL,项目名称:SupersonicSound,代码行数:4,代码来源:ReverbProperties.cs


示例15: CleanUp

 public void CleanUp()
 {
     this.DeInit(this.fmodSystem);
       this.Bands.Clear();
       this.fmodSystem = null;
       this.smpSettings = null;
 }
开发者ID:dotob,项目名称:simple-music-player,代码行数:7,代码来源:Equalizer.cs


示例16: Release

        public void Release()
        {
            if (this.dspEQ != null)
            {
                this.dspEQ.setActive(false).ERRCHECK();

                FMOD.ChannelGroup masterChannelGroup = null;
                this.fmodSystem.getMasterChannelGroup(out masterChannelGroup).ERRCHECK();

                masterChannelGroup.removeDSP(this.dspEQ).ERRCHECK();

                this.dspEQ.release().ERRCHECK();

                this.dspEQ = null;
                this.fmodSystem = null;
            }
            this.IsActive = false;
        }
开发者ID:kaushik1605,项目名称:sample_DotNet,代码行数:18,代码来源:EqualizerBand.cs


示例17: WavEffect

        public WavEffect(FMOD.System system, string path, bool loop, float baseVol)
        {
            this.system = system;
            callback = new CHANNEL_CALLBACK(SyncCallback);

            baseVolume = baseVol;
            volume = 1;

            system.createSound(path, MODE.SOFTWARE | (loop ? MODE.LOOP_NORMAL : MODE.LOOP_OFF), ref sound);
            channel = new Channel();
            playCount = 0;
        }
开发者ID:Tesserex,项目名称:C--MegaMan-Engine,代码行数:12,代码来源:SoundEffect.cs


示例18: loadSystem

 //Call this function to create the "System" object that the detector will use
 //throughout its lifetime. Should only be called once per instance.
 public void loadSystem()
 {
     system = fmodSetup();
 }
开发者ID:SkuliSheepman,项目名称:BeatDetectorForGames,代码行数:6,代码来源:BeatDetector.cs


示例19: getSystemObject

 public RESULT getSystemObject(out System system)
 {
     system = null;
     IntPtr raw;
     RESULT result = ChannelControl.FMOD5_ChannelGroup_GetSystemObject(this.rawPtr, out raw);
     system = new System(raw);
     return result;
 }
开发者ID:GameDiffs,项目名称:TheForest,代码行数:8,代码来源:ChannelControl.cs


示例20: clean

    private void clean(bool checkForHandles)
    {
        int nbEventSystemHandles = FmodEventSystemHandle.NbHandles;
        if (m_eventSystem != null &&
            (checkForHandles == false || nbEventSystemHandles <= 1)) {

            List<FmodEventAudioSource> tmpList = m_eventPoolManager.getAllActiveSources();
            foreach (FmodEventAudioSource src in tmpList) {
                if (src != null) {
                    src.Clean();
                }
            }
            if (m_musicSystem != null) {
                m_musicSystem.release();
                m_musicSystem = null;
            }
            if (_unloadAllFiles()) {
                ERRCHECK(m_eventSystem.unload());
            }
            if (m_eventSystem != null) {
                ERRCHECK(m_eventSystem.release());
                m_eventSystem = null;
            }

            if (m_system != null) {
                ERRCHECK(m_system.release());
                m_system = null;
            }

            m_eventSystemWasCleaned = true;
            m_eventSystemWasInit = false;
            WasCleaned = true;
            FmodEventSystem.m_FmodEventSystem = null;
        }
    }
开发者ID:Bourinours,项目名称:Projet_Son,代码行数:35,代码来源:FmodEventSystem.cs



注:本文中的FMOD.System类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# FMOD.TAG类代码示例发布时间:2022-05-24
下一篇:
C# FMOD.SoundGroup类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap