当前位置: 首页>>代码示例>>C#>>正文


C# System.init方法代码示例

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


在下文中一共展示了System.init方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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

示例2: 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

示例3: Main

 static void Main(string[] args)
 {
     //Console.SetBufferSize(80, 500);
     Console.WriteLine("--- SpectralCoding League of Legends FMOD Sound Back Extractor ---");
     Console.WriteLine();
     ParseArgs(args);
     FMOD.RESULT FModResult;					// Set our variable we will keep updating with the FMOD Results
     if ((!Directory.Exists(TargetDir)) && ExtractFSB) {		// Create the target directory if it doesn't exist
         Console.WriteLine("Creating target directory: " + TargetDir + @"\");
         Directory.CreateDirectory(TargetDir);
     }
     FMOD.System FModSys = new FMOD.System();				// Initialize and create a FMOD "System" so
     FModResult = FMOD.Factory.System_Create(ref FModSys);	// we can interface with the FSBs
     // Initialize the FMod System with default flags
     FModResult = FModSys.init(16, FMOD.INITFLAGS.NORMAL, IntPtr.Zero);
     foreach (string CurFSB in FSBList) {	// For each file we're going to list or extract
         if (FModSys == null) {
             // Something went wrong, probably didn't have the proper DLL or something.
             Console.WriteLine("Unable to initialize the FMOD System. Did you copy the fmodex.dll into the same folder as LoLFSBExtract.exe?");
             Environment.Exit(1);
         } else {
             if (FModResult != FMOD.RESULT.OK) {
                 // If something went wrong, print the error.
                 Console.WriteLine("ERR FModSys.init(): " + FMOD.Error.String(FModResult));
             } else {
                 // Otherwise, dump the sound bank!
                 Console.WriteLine();
                 FModResult = DumpSoundBank(FModSys, CurFSB);
                 if (FModResult != FMOD.RESULT.OK) {
                     Console.WriteLine("ERR DumpSoundBank: " + FMOD.Error.String(FModResult));
                 }
             }
         }
     }
     Console.WriteLine();
     Console.WriteLine("Finished!");
     //Console.ReadLine();
     Environment.Exit(0);
 }
开发者ID:SpectralCoding,项目名称:lol-fsb-extract,代码行数:39,代码来源:Program.cs


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