本文整理汇总了C#中FMOD.System类的典型用法代码示例。如果您正苦于以下问题:C# System类的具体用法?C# System怎么用?C# System使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
System类属于FMOD命名空间,在下文中一共展示了System类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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!");
}
示例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;
}
示例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!");
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例11: Plugin
public Plugin(uint handle, FMOD.System system)
{
Handle = handle;
_system = system;
}
示例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);
}
示例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;
}
示例14: ReverbPropertiesController
internal ReverbPropertiesController(FMOD.System system)
{
_system = system;
}
示例15: CleanUp
public void CleanUp()
{
this.DeInit(this.fmodSystem);
this.Bands.Clear();
this.fmodSystem = null;
this.smpSettings = null;
}