This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import sys | |
class FakeServerProtocol(asyncio.DatagramProtocol): | |
def __init__(self, target_addr, stc_delay, cts_delay, loop=None): | |
self.loop = loop | |
if self.loop is None: | |
self.loop = asyncio.get_event_loop() | |
self.transport = None | |
self.target_addr = target_addr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void OpenAlCloseDevice() | |
{ | |
StopAllSounds(); | |
IntPtr Context, Device; | |
Al.alDeleteBuffers(1, ref buffer); | |
Al.alDeleteSources(1, ref source); | |
Context = Alc.alcGetCurrentContext(); | |
Device = Alc.alcGetContextsDevice(Context); | |
Alc.alcMakeContextCurrent(IntPtr.Zero); | |
Alc.alcDestroyContext(Context); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static readonly string [] OpenAlGetDeviceList | |
{ | |
get | |
{ | |
string[] DeviceList; | |
if (Alc.alcIsExtensionPresent(IntPtr.Zero, "ALC_ENUMERATE_ALL_EXT") == Alc.ALC_TRUE) | |
{ | |
DeviceList = Alc.alcGetStringv(IntPtr.Zero, Alc.ALC_ALL_DEVICES_SPECIFIER); | |
if (Al.alGetError() != Al.AL_NO_ERROR) | |
throw new InvalidOperationException("Can't get OpenAL device list."); |