本文整理汇总了C#中FMOD.GUID类的典型用法代码示例。如果您正苦于以下问题:C# GUID类的具体用法?C# GUID怎么用?C# GUID使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GUID类属于FMOD命名空间,在下文中一共展示了GUID类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: FMOD_System_GetRecordDriverInfo
private static extern RESULT FMOD_System_GetRecordDriverInfo (IntPtr system, int id, IntPtr name, int namelen, out GUID guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels);
开发者ID:Cocotus,项目名称:simple-music-player,代码行数:1,代码来源:fmod.cs
示例2: FMOD_System_GetRecordDriverInfoW
private static extern RESULT FMOD_System_GetRecordDriverInfoW(IntPtr system, int id, [MarshalAs(UnmanagedType.LPWStr)]StringBuilder name, int namelen, ref GUID guid);
开发者ID:IndiegameGarden,项目名称:TTMusicEngine,代码行数:1,代码来源:fmod.cs
示例3: getRecordDriverInfo
public RESULT getRecordDriverInfo(int id, StringBuilder name, int namelen, out GUID guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels)
{
IntPtr stringMem = Marshal.AllocHGlobal(name.Capacity);
RESULT result = FMOD_System_GetRecordDriverInfo(rawPtr, id, stringMem, namelen, out guid, out systemrate, out speakermode, out speakermodechannels);
StringMarshalHelper.NativeToBuilder(name, stringMem);
Marshal.FreeHGlobal(stringMem);
return result;
}
开发者ID:Cocotus,项目名称:simple-music-player,代码行数:11,代码来源:fmod.cs
示例4: 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
示例5: getRecordDriverInfo
public RESULT getRecordDriverInfo(int id, [MarshalAs(UnmanagedType.LPWStr)]StringBuilder name, int namelen, ref GUID guid)
{
//use multibyte version
return FMOD_System_GetRecordDriverInfoW(systemraw, id, name, namelen, ref guid);
}
开发者ID:IndiegameGarden,项目名称:TTMusicEngine,代码行数:5,代码来源:fmod.cs
示例6: FMOD5_System_GetRecordDriverInfo
private static extern RESULT FMOD5_System_GetRecordDriverInfo (IntPtr system, int id, StringBuilder name, [MarshalAs(UnmanagedType.LPWStr)]StringBuilder nameW, int namelen, out GUID guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels);
开发者ID:Backman,项目名称:Hellbound,代码行数:1,代码来源:fmod.cs
示例7: FMOD_EventSystem_GetEventByGUID
private static extern RESULT FMOD_EventSystem_GetEventByGUID(IntPtr eventsystem, ref GUID guid, EVENT_MODE mode, ref IntPtr _event);
开发者ID:Guitaroz,项目名称:Arcade-Space-Shooter,代码行数:1,代码来源:fmod_event.cs
示例8: CreateDeviceList
private static void CreateDeviceList()
{
if(m_deviceList.Count > 0) return;
// Create a bare system object to get the driver count
FMODSystem system = null;
RESULT result = Factory.System_Create(ref system);
if (result == RESULT.ERR_FILE_BAD)
MessageBox.Show("Error creating audio device: 32/64 bit incompatibility.");
int driverCount = 0;
system.getNumDrivers(ref driverCount);
if(driverCount > 0) {
// There are audio devices available
// Create device list
system.getNumDrivers(ref driverCount);
StringBuilder sb = new StringBuilder(256);
int i;
for(i = 0; i < driverCount; i++) {
GUID GUID = new GUID();
system.getDriverInfo(i, sb, sb.Capacity, ref GUID);
m_deviceList.Add(sb.ToString());
}
}
system.release();
}
开发者ID:komby,项目名称:vixen,代码行数:29,代码来源:fmod_wrapper.cs
示例9: InitFMOD
/// <summary>
/// Initialize the FMOD sound system.
/// </summary>
private void InitFMOD()
{
try
{
FMODExec(FMOD.Factory.System_Create(ref system));
uint version = 0;
FMODExec(system.getVersion(ref version));
if (version < FMOD.VERSION.number)
throw new MediaException("You are using an old version of FMOD " +
version.ToString("X") +
". This program requires " +
FMOD.VERSION.number.ToString("X") + ".");
// Assume no special hardware capabilities except 5.1 surround sound.
FMOD.CAPS caps = FMOD.CAPS.NONE;
FMOD.SPEAKERMODE speakermode = FMOD.SPEAKERMODE._5POINT1;
// Fancy param checking on Linux can cause init to fail
try
{
// Get the capabilities of the driver.
int minfrequency = 0, maxfrequency = 0;
FMODExec(system.getDriverCaps(0, ref caps,
ref minfrequency,
ref maxfrequency,
ref speakermode));
// Set FMOD speaker mode to what the driver supports.
FMODExec(system.setSpeakerMode(speakermode));
}
catch {}
// Forcing the ALSA sound system on Linux seems to avoid a CPU loop
// LK - this causes fails on OSX and many linux distros
//if (System.Environment.OSVersion.Platform == PlatformID.Unix)
// FMODExec(system.setOutput(FMOD.OUTPUTTYPE.ALSA));
// The user has the 'Acceleration' slider set to off, which
// is really bad for latency. At 48khz, the latency between
// issuing an fmod command and hearing it will now be about 213ms.
if ((caps & FMOD.CAPS.HARDWARE_EMULATED) == FMOD.CAPS.HARDWARE_EMULATED)
{
FMODExec(system.setDSPBufferSize(1024, 10));
}
try
{
StringBuilder name = new StringBuilder(128);
// Get driver information so we can check for a wierd one.
FMOD.GUID guid = new FMOD.GUID();
FMODExec(system.getDriverInfo(0, name, 128, ref guid));
// Sigmatel sound devices crackle for some reason if the format is pcm 16bit.
// pcm floating point output seems to solve it.
if (name.ToString().IndexOf("SigmaTel") != -1)
{
FMODExec(system.setSoftwareFormat(
48000,
FMOD.SOUND_FORMAT.PCMFLOAT,
0, 0,
FMOD.DSP_RESAMPLER.LINEAR)
);
}
}
catch {}
// Try to initialize with all those settings, and Max 32 channels.
FMOD.RESULT result = system.init(32, FMOD.INITFLAG.NORMAL, (IntPtr)null);
if (result == FMOD.RESULT.ERR_OUTPUT_CREATEBUFFER)
{
// Can not handle surround sound - back to Stereo.
FMODExec(system.setSpeakerMode(FMOD.SPEAKERMODE.STEREO));
// And init again.
FMODExec(system.init(
32,
FMOD.INITFLAG.NORMAL,
(IntPtr)null)
);
}
// Set real-world effect scales.
FMODExec(system.set3DSettings(
1.0f, // Doppler scale
1.0f, // Distance scale is meters
1.0f) // Rolloff factor
);
soundSystemAvailable = true;
Logger.Log("Initialized FMOD Ex", Helpers.LogLevel.Debug);
}
catch (Exception ex)
{
Logger.Log("Failed to initialize the sound system: ", Helpers.LogLevel.Warning, ex);
}
}
开发者ID:mixixi,项目名称:radegast,代码行数:99,代码来源:MediaManager.cs
示例10: CreateDeviceList
private static void CreateDeviceList()
{
if (m_deviceList.Count <= 0)
{
System system = null;
Factory.System_Create(ref system);
int numdrivers = 0;
system.getNumDrivers(ref numdrivers);
if (numdrivers > 0)
{
system.getNumDrivers(ref numdrivers);
StringBuilder name = new StringBuilder(0x100);
for (int i = 0; i < numdrivers; i++)
{
GUID guid = new GUID();
system.getDriverInfo(i, name, name.Capacity, ref guid);
m_deviceList.Add(name.ToString());
}
}
system.release();
}
}
开发者ID:jmcadams,项目名称:vplus,代码行数:22,代码来源:fmodType.cs
示例11: GetEvent
public FMOD.Studio.EventInstance GetEvent(string path)
{
FMOD.Studio.EventInstance instance = null;
if (string.IsNullOrEmpty(path))
{
FMOD.Studio.UnityUtil.LogError("Empty event path!");
return null;
}
if (eventDescriptions.ContainsKey(path))
{
ERRCHECK(eventDescriptions[path].createInstance(out instance));
}
else
{
FMOD.GUID id = new FMOD.GUID();
if (path.StartsWith("{"))
{
ERRCHECK(FMOD.Studio.Util.ParseID(path, out id));
}
else if (path.StartsWith("event:"))
{
ERRCHECK(system.lookupID(path, out id));
}
else
{
FMOD.Studio.UnityUtil.LogError("Expected event path to start with 'event:/'");
}
FMOD.Studio.EventDescription desc = null;
ERRCHECK(system.getEvent(id, FMOD.Studio.LOADING_MODE.BEGIN_NOW, out desc));
if (desc != null && desc.isValid())
{
eventDescriptions.Add(path, desc);
ERRCHECK(desc.createInstance(out instance));
}
}
if (instance == null)
{
FMOD.Studio.UnityUtil.Log("GetEvent FAILED: \"path\"");
}
return instance;
}
开发者ID:Backman,项目名称:Hellbound,代码行数:48,代码来源:FMOD_StudioSystem.cs
示例12:
private static extern RESULT FMOD_System_GetDriverInfo (IntPtr system, int id, StringBuilder name, [MarshalAs(UnmanagedType.LPWStr)]StringBuilder namew, int namelen, ref GUID guid, ref int systemrate, ref SPEAKERMODE speakermode, ref int speakermodechannels);
开发者ID:whztt07,项目名称:GameEngine,代码行数:1,代码来源:fmod.cs
示例13: FMOD_System_GetDriverInfo
public RESULT getDriverInfo (int id, StringBuilder name, [MarshalAs(UnmanagedType.LPWStr)]StringBuilder namew, int namelen, ref GUID guid, ref int systemrate, ref SPEAKERMODE speakermode, ref int speakermodechannels)
{
return FMOD_System_GetDriverInfo(systemraw, id, name, namew, namelen, ref guid, ref systemrate, ref speakermode, ref speakermodechannels);
}
开发者ID:whztt07,项目名称:GameEngine,代码行数:4,代码来源:fmod.cs
示例14: getRecordDriverInfo
public RESULT getRecordDriverInfo(int id, StringBuilder name, int namelen, out GUID guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels)
{
return FMOD_System_GetRecordDriverInfo(rawPtr, id, name, null, namelen, out guid, out systemrate, out speakermode, out speakermodechannels);
}
开发者ID:NuXareon,项目名称:Tower_Defense,代码行数:4,代码来源:fmod.cs
示例15: getRecordDriverInfo
public RESULT getRecordDriverInfo(int id, StringBuilder name, int namelen, ref GUID guid)
{
return FMOD_System_GetRecordDriverInfo(systemraw, id, name, namelen, ref guid);
}
开发者ID:huming2207,项目名称:ghgame,代码行数:4,代码来源:fmod.cs
示例16: getEventByGUID
public RESULT getEventByGUID(ref GUID guid, EVENT_MODE mode, ref Event _event)
{
RESULT result = RESULT.OK;
IntPtr eventraw = new IntPtr();
Event eventnew = null;
try
{
result = FMOD_EventSystem_GetEventByGUID(eventsystemraw, ref guid, mode, ref eventraw);
}
catch
{
result = RESULT.ERR_INVALID_PARAM;
}
if (result != RESULT.OK)
{
return result;
}
if (_event == null)
{
eventnew = new Event();
eventnew.setRaw(eventraw);
_event = eventnew;
}
else
{
_event.setRaw(eventraw);
}
return result;
}
开发者ID:Guitaroz,项目名称:Arcade-Space-Shooter,代码行数:32,代码来源:fmod_event.cs
示例17: FMOD_System_GetRecordDriverInfo
private static extern RESULT FMOD_System_GetRecordDriverInfo(IntPtr system, int id, StringBuilder name, int namelen, ref GUID guid);
开发者ID:huming2207,项目名称:ghgame,代码行数:1,代码来源:fmod.cs
示例18: Initialize
public void Initialize(FMOD.Event e, FmodEventGroup eventGroup, int indexInGroup, FmodEventAsset asset)
{
#if UNITY_EDITOR
FMOD.EVENT_INFO info = new FMOD.EVENT_INFO();
FMOD.GUID guid = new FMOD.GUID();
FMOD.EventParameter param = null;
FMOD.RESULT result = FMOD.RESULT.OK;
FmodEventParameter toAdd = null;
IntPtr name = new IntPtr(0);
int numParameters = 0;
int index = 0;
Initialize(eventGroup, indexInGroup, asset);
int size = System.Runtime.InteropServices.Marshal.SizeOf(typeof(FMOD.GUID));
info.guid = System.Runtime.InteropServices.Marshal.AllocHGlobal(size);
result = e.getInfo(ref index, ref name, ref info);
ERRCHECK(result);
m_name = System.Runtime.InteropServices.Marshal.PtrToStringAnsi(name);
this.name = m_name;
guid = (FMOD.GUID)System.Runtime.InteropServices.Marshal.PtrToStructure(info.guid, typeof(FMOD.GUID));
m_guidString = "{" + String.Format("{0:x8}-{1:x4}-{2:x4}-{3:x2}{4:x2}-{5:x2}{6:x2}{7:x2}{8:x2}{9:x2}{10:x2}",
guid.Data1, guid.Data2, guid.Data3,
guid.Data4[0], guid.Data4[1],
guid.Data4[2], guid.Data4[3], guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]
) + "}";
int mode = 0;
IntPtr modePtr = System.Runtime.InteropServices.Marshal.AllocHGlobal(sizeof(int));
e.getPropertyByIndex((int)FMOD.EVENTPROPERTY.MODE, modePtr, false);
mode = System.Runtime.InteropServices.Marshal.ReadInt32(modePtr);
System.Runtime.InteropServices.Marshal.FreeHGlobal(modePtr);
m_sourceType = (SourceType)mode;
if (m_sourceType == SourceType.SOURCE_3D) {
IntPtr range;
float[] tmp = new float[1];
int[] tmpInt = new int[1];
range = System.Runtime.InteropServices.Marshal.AllocHGlobal(sizeof(int));
result = e.getPropertyByIndex((int)FMOD.EVENTPROPERTY._3D_ROLLOFF, range, false);
ERRCHECK(result);
System.Runtime.InteropServices.Marshal.Copy(range, tmpInt, 0, 1);
if (tmpInt[0] == (int)FMOD.MODE._3D_CUSTOMROLLOFF) {
m_rolloffType = RolloffType.CUSTOM;
} else if (tmpInt[0] == (int)FMOD.MODE._3D_INVERSEROLLOFF) {
m_rolloffType = RolloffType.INVERSE;
} else if (tmpInt[0] == (int)FMOD.MODE._3D_LINEARROLLOFF) {
m_rolloffType = RolloffType.LINEAR;
} else if (tmpInt[0] == (int)FMOD.MODE._3D_LINEARSQUAREROLLOFF) {
m_rolloffType = RolloffType.LINEARSQUARE;
} else if (tmpInt[0] == (int)FMOD.MODE._3D_LOGROLLOFF) {
m_rolloffType = RolloffType.LOGARITHMIC;
}
System.Runtime.InteropServices.Marshal.FreeHGlobal(range);
range = System.Runtime.InteropServices.Marshal.AllocHGlobal(sizeof(float));
result = e.getPropertyByIndex((int)FMOD.EVENTPROPERTY._3D_MINDISTANCE, range, false);
ERRCHECK(result);
System.Runtime.InteropServices.Marshal.Copy(range, tmp, 0, 1);
m_minRange = tmp[0];
System.Runtime.InteropServices.Marshal.FreeHGlobal(range);
range = System.Runtime.InteropServices.Marshal.AllocHGlobal(sizeof(float));
result = e.getPropertyByIndex((int)FMOD.EVENTPROPERTY._3D_MAXDISTANCE, range, false);
ERRCHECK(result);
System.Runtime.InteropServices.Marshal.Copy(range, tmp, 0, 1);
m_maxRange = tmp[0];
System.Runtime.InteropServices.Marshal.FreeHGlobal(range);
}
e.getNumParameters(ref numParameters);
for (int k = 0; k < numParameters; k++) {
e.getParameterByIndex(k, ref param);
toAdd = FmodEventParameter.CreateInstance("FmodEventParameter") as FmodEventParameter;
toAdd.Initialize(param, this);
m_parameters.Add(toAdd);
}
m_wasLoaded = true;
#endif
}
开发者ID:Bourinours,项目名称:Projet_Son,代码行数:79,代码来源:FmodEvent.cs
注:本文中的FMOD.GUID类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论