本文整理汇总了C#中FMOD.GUID类的典型用法代码示例。如果您正苦于以下问题:C# GUID类的具体用法?C# GUID怎么用?C# GUID使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GUID类属于FMOD命名空间,在下文中一共展示了GUID类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
示例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);
示例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;
}
示例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;
}
示例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);
}
示例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);
示例7: FMOD_EventSystem_GetEventByGUID
private static extern RESULT FMOD_EventSystem_GetEventByGUID(IntPtr eventsystem, ref GUID guid, EVENT_MODE mode, ref IntPtr _event);
示例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();
}
示例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);
}
}
示例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();
}
}
示例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;
}
示例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);
示例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);
}
示例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);
}
示例15: getRecordDriverInfo
public RESULT getRecordDriverInfo(int id, StringBuilder name, int namelen, ref GUID guid)
{
return FMOD_System_GetRecordDriverInfo(systemraw, id, name, namelen, ref guid);
}