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


C++ IDirectSound_SetCooperativeLevel函数代码示例

本文整理汇总了C++中IDirectSound_SetCooperativeLevel函数的典型用法代码示例。如果您正苦于以下问题:C++ IDirectSound_SetCooperativeLevel函数的具体用法?C++ IDirectSound_SetCooperativeLevel怎么用?C++ IDirectSound_SetCooperativeLevel使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: DSoundOpenPlayback

static ALCboolean DSoundOpenPlayback(ALCdevice *device, const ALCchar *deviceName)
{
    DSoundData *pData = NULL;
    LPGUID guid = NULL;
    HRESULT hr;

    if(!DSoundLoad())
        return ALC_FALSE;

    if(!deviceName)
        deviceName = dsDevice;
    else if(strcmp(deviceName, dsDevice) != 0)
    {
        ALuint i;

        if(!DeviceList)
        {
            hr = pDirectSoundEnumerateA(DSoundEnumDevices, NULL);
            if(FAILED(hr))
                AL_PRINT("Error enumerating DirectSound devices (%#x)!\n", (unsigned int)hr);
        }

        for(i = 0; i < NumDevices; i++)
        {
            if(strcmp(deviceName, DeviceList[i].name) == 0)
            {
                if(i > 0)
                    guid = &DeviceList[i].guid;
                break;
            }
        }
        if(i == NumDevices)
            return ALC_FALSE;
    }

    //Initialise requested device
    pData = calloc(1, sizeof(DSoundData));
    if(!pData)
    {
        alcSetError(device, ALC_OUT_OF_MEMORY);
        return ALC_FALSE;
    }

    //DirectSound Init code
    hr = pDirectSoundCreate(guid, &pData->lpDS, NULL);
    if(SUCCEEDED(hr))
        hr = IDirectSound_SetCooperativeLevel(pData->lpDS, GetForegroundWindow(), DSSCL_PRIORITY);
    if(FAILED(hr))
    {
        if(pData->lpDS)
            IDirectSound_Release(pData->lpDS);
        free(pData);
        AL_PRINT("Device init failed: 0x%08lx\n", hr);
        return ALC_FALSE;
    }

    device->szDeviceName = strdup(deviceName);
    device->ExtraData = pData;
    return ALC_TRUE;
}
开发者ID:Genesis-3D,项目名称:Genesis-3D,代码行数:60,代码来源:dsound.c

示例2: gst_directsound_sink_open

static gboolean
gst_directsound_sink_open (GstAudioSink * asink)
{
  GstDirectSoundSink *dsoundsink;
  HRESULT hRes;

  dsoundsink = GST_DIRECTSOUND_SINK (asink);

  /* create and initialize a DirecSound object */
  if (FAILED (hRes = DirectSoundCreate (NULL, &dsoundsink->pDS, NULL))) {
    GST_ELEMENT_ERROR (dsoundsink, RESOURCE, OPEN_READ,
        ("gst_directsound_sink_open: DirectSoundCreate: %s",
            DXGetErrorString9 (hRes)), (NULL));
    return FALSE;
  }

  if (FAILED (hRes = IDirectSound_SetCooperativeLevel (dsoundsink->pDS,
              GetDesktopWindow (), DSSCL_PRIORITY))) {
    GST_ELEMENT_ERROR (dsoundsink, RESOURCE, OPEN_READ,
        ("gst_directsound_sink_open: IDirectSound_SetCooperativeLevel: %s",
            DXGetErrorString9 (hRes)), (NULL));
    return FALSE;
  }

  return TRUE;
}
开发者ID:BigBrother-International,项目名称:gst-plugins-good,代码行数:26,代码来源:gstdirectsoundsink.c

示例3: FreeSound

static void
FreeSound (void)
{
	if (pDSBuf) {
		IDirectSoundBuffer_Stop (pDSBuf);
		IDirectSound_Release (pDSBuf);
	}
// release primary buffer only if it's not also the mixing buffer we just released
	if (pDSPBuf && (pDSBuf != pDSPBuf)) {
		IDirectSound_Release (pDSPBuf);
	}

	if (pDS) {
		IDirectSound_SetCooperativeLevel (pDS, mainwindow, DSSCL_NORMAL);
		IDirectSound_Release (pDS);
	}
	pDS = NULL;
	pDSBuf = NULL;
	pDSPBuf = NULL;
	hWaveOut = 0;
	hData = 0;
	hWaveHdr = 0;
	lpData = NULL;
	lpWaveHdr = NULL;
}
开发者ID:EIREXE,项目名称:Quakeforge-gcw0,代码行数:25,代码来源:snd_dx.c

示例4: m1sdr_PlayStart

void m1sdr_PlayStart(void)
{
	waveLogStart();

	IDirectSound_SetCooperativeLevel(lpDS, GetForegroundWindow(), DSSCL_PRIORITY);
	
	IDirectSoundBuffer_SetCurrentPosition(lpSecB, 0);
	IDirectSoundBuffer_Play(lpSecB, 0, 0, DSBPLAY_LOOPING);
}
开发者ID:dreiss,项目名称:M1-Android,代码行数:9,代码来源:dsnd.cpp

示例5: DSoundOpenPlayback

static ALCboolean DSoundOpenPlayback(ALCdevice *device, const ALCchar *deviceName)
{
    DSoundData *pData = NULL;
    LPGUID guid = NULL;
    HRESULT hr;

    if(!deviceName)
        deviceName = dsDevice;
    else if(strcmp(deviceName, dsDevice) != 0)
    {
        ALuint i;
        for(i = 0;i < NumDevices;i++)
        {
            if(strcmp(deviceName, DeviceList[i].name) == 0)
            {
                guid = &DeviceList[i].guid;
                break;
            }
        }
        if(i == NumDevices)
            return ALC_FALSE;
    }

    DSoundLoad();
    if(ds_handle == NULL)
        return ALC_FALSE;

    //Initialise requested device

    pData = calloc(1, sizeof(DSoundData));
    if(!pData)
    {
        alcSetError(ALC_OUT_OF_MEMORY);
        DSoundUnload();
        return ALC_FALSE;
    }

    //DirectSound Init code
    hr = pDirectSoundCreate(guid, &pData->lpDS, NULL);
    if(SUCCEEDED(hr))
        hr = IDirectSound_SetCooperativeLevel(pData->lpDS, GetForegroundWindow(), DSSCL_PRIORITY);
    if(FAILED(hr))
    {
        if(pData->lpDS)
            IDirectSound_Release(pData->lpDS);
        free(pData);
        DSoundUnload();
        return ALC_FALSE;
    }

    device->szDeviceName = strdup(deviceName);
    device->ExtraData = pData;
    return ALC_TRUE;
}
开发者ID:SergeStinckwich,项目名称:openqwaq,代码行数:54,代码来源:dsound.c

示例6: FreeSound

/*
	FreeSound
*/
void
FreeSound (void)
{
	int         i;

	if (pDSBuf) {
		IDirectSoundBuffer_Stop (pDSBuf);
		IDirectSound_Release (pDSBuf);
	}
// only release primary buffer if it's not also the mixing buffer we just released
	if (pDSPBuf && (pDSBuf != pDSPBuf)) {
		IDirectSound_Release (pDSPBuf);
	}

	if (pDS) {
		IDirectSound_SetCooperativeLevel (pDS, mainwindow, DSSCL_NORMAL);
		IDirectSound_Release (pDS);
	}

	if (hWaveOut) {
		waveOutReset (hWaveOut);

		if (lpWaveHdr) {
			for (i = 0; i < WAV_BUFFERS; i++)
				waveOutUnprepareHeader (hWaveOut, lpWaveHdr + i,
										sizeof (WAVEHDR));
		}

		waveOutClose (hWaveOut);

		if (hWaveHdr) {
			GlobalUnlock (hWaveHdr);
			GlobalFree (hWaveHdr);
		}

		if (hData) {
			GlobalUnlock (hData);
			GlobalFree (hData);
		}

	}

	pDS = NULL;
	pDSBuf = NULL;
	pDSPBuf = NULL;
	hWaveOut = 0;
	hData = 0;
	hWaveHdr = 0;
	lpData = NULL;
	lpWaveHdr = NULL;
	dsound_init = false;
	wav_init = false;
}
开发者ID:luaman,项目名称:qforge-newtree,代码行数:56,代码来源:snd_win.c

示例7: SSInit

BOOL SSInit(HWND hWnd, int channels, unsigned flags)
{
	LPDIRECTSOUNDBUFFER lpPrimaryBuffer;
	LPDIRECTSOUND lpDS;
	DSBUFFERDESC dsbd;

	if (SSMixer.lpds) return TRUE;

//	Perform Direct Sound Initialization
	if (DirectSoundCreate(NULL, &lpDS, NULL) != DS_OK) 
		return FALSE;

	SSMixer.lpds = lpDS;

	if (IDirectSound_SetCooperativeLevel(lpDS, hWnd, DSSCL_NORMAL) != DS_OK) {
		SSDestroy();
		return FALSE;
	}

//	Start Mixer
	memset(&dsbd, 0, sizeof(DSBUFFERDESC));
	dsbd.dwSize = sizeof(DSBUFFERDESC);
	dsbd.dwFlags = DSBCAPS_PRIMARYBUFFER;
	if (IDirectSound_CreateSoundBuffer(SSMixer.lpds, &dsbd, &lpPrimaryBuffer, NULL) == DS_OK) {
		if (IDirectSoundBuffer_Play(lpPrimaryBuffer, 0, 0, DSBPLAY_LOOPING) != DS_OK) {
			IDirectSoundBuffer_Release(lpPrimaryBuffer);
			SSDestroy();
			return FALSE;
		}
		IDirectSoundBuffer_Release(lpPrimaryBuffer);
	}
	else {
		SSDestroy();
		return FALSE;
	}


//	Finish initializing SSMixer.
	SSMixer.ch_cur = 0;
	SSMixer.ch_list = (SSoundBuffer *)malloc(sizeof(SSoundBuffer)*channels);
	if (!SSMixer.ch_list) return FALSE;
	
	memset(SSMixer.ch_list, 0, sizeof(SSoundBuffer)*channels);
	
	SSMixer.ch_num = channels;

//	Determine Sound technology and volume caps
	waveOutGetVolume((HWAVEOUT)WAVE_MAPPER, (LPDWORD)&SSMixer.old_master_vol);
//	waveOutSetVolume((HWAVEOUT)WAVE_MAPPER, 0x40004000);
	return TRUE;
}
开发者ID:btb,项目名称:d2x,代码行数:51,代码来源:ds.c

示例8: pest_open

int pest_open( HWND win ){
	HMODULE lib;
	DIRECTSOUNDCREATE dsound_create;
	WAVEFORMATEX format;
	DSBUFFERDESC desc_primary, desc_secondary;

	lib = (HMODULE)LoadLibrary("dsound.dll");
	if(lib==NULL) return FALSE;

	dsound_create = (DIRECTSOUNDCREATE)GetProcAddress(lib, "DirectSoundCreate");
	if(dsound_create==NULL) return FALSE;
	FreeLibrary(lib);

	if( dsound_create( NULL, &dsound, NULL )!= DS_OK ) return FALSE;

	if( IDirectSound_SetCooperativeLevel( dsound, win, DSSCL_EXCLUSIVE | DSSCL_PRIORITY ) != DS_OK ) return FALSE;

	memset( &desc_primary, 0, sizeof(DSBUFFERDESC) );
	desc_primary.dwSize = sizeof(DSBUFFERDESC);
	desc_primary.dwFlags = DSBCAPS_PRIMARYBUFFER | DSBCAPS_STICKYFOCUS;
	
	if(IDirectSound_CreateSoundBuffer( dsound, &desc_primary, &primary, NULL )!=DS_OK) return FALSE;

	memset( &format, 0, sizeof(WAVEFORMATEX) );
	format.wFormatTag = WAVE_FORMAT_PCM;
	format.nChannels = 2;
	format.nSamplesPerSec = 44100;
	format.nAvgBytesPerSec = 44100 * 4;
	format.nBlockAlign = 4;
	format.wBitsPerSample = 16;

	if( IDirectSoundBuffer_SetFormat( primary, &format )!= DS_OK) return FALSE;

	memset( &desc_secondary, 0, sizeof(DSBUFFERDESC) );
	desc_secondary.dwSize = sizeof(DSBUFFERDESC);
	desc_secondary.dwFlags = DSBCAPS_GLOBALFOCUS | DSBCAPS_GETCURRENTPOSITION2;
	desc_secondary.lpwfxFormat = &format;
	desc_secondary.dwBufferBytes = 2*2*BUFFER_LEN;

	if(IDirectSound_CreateSoundBuffer( dsound, &desc_secondary, &secondary, NULL )!=DS_OK) return FALSE;

	InitializeCriticalSection(&critical);

	return TRUE;
}
开发者ID:imclab,项目名称:Open-World-Domination,代码行数:45,代码来源:dsound.c

示例9: DirectSoundInit

int DirectSoundInit()
{
   HRESULT hr;
   HWND hWnd;

	LoadDsound();	
   hr = pDirectSoundCreate(NULL, &lpDirectSound, NULL);
   if( hr != DS_OK ) 
	   return 0;
   hWnd = GetForegroundWindow();
   // establecer el nivel de cooperacion
   hr = IDirectSound_SetCooperativeLevel(lpDirectSound,hWnd, DSSCL_NORMAL );
   if( hr != DS_OK)
		return 0;
   return 1;

 
}
开发者ID:javisantana,项目名称:cubyshot,代码行数:18,代码来源:sound.c

示例10: DSInitialize

/*
 * DirectSoundを初期化する
 */
BOOL DSInitialize(HWND hWnd)
{
	HRESULT hRet;
	uintptr_t t;

	/* IDirectSoundのインスタンスを取得して初期化する */
	hRet = CoCreateInstance(&CLSID_DirectSound,
							NULL,
							CLSCTX_INPROC_SERVER,
							&IID_IDirectSound,
							(void **)&pDS);
	if(hRet != S_OK || pDS == NULL)
		return FALSE;

	/* COMオブジェクトを初期化する */
	IDirectSound_Initialize(pDS, NULL);

	/* 協調レベルを設定する */
	hRet = IDirectSound_SetCooperativeLevel(pDS, hWnd, DSSCL_PRIORITY);
	if(hRet != DS_OK)
		return FALSE;

	/* プライマリバッファのフォーマットを設定する */
	if(!CreatePrimaryBuffer())
		return FALSE;

	/* セカンダリバッファを作成する */
	if(!CreateSecondaryBuffers())
		return FALSE;

	/* イベントスレッドへの終了通知用のイベントを作成する */
	hQuitEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
	if(hQuitEvent == NULL)
		return FALSE;

	/* DirectSoundの再生位置通知を受け取るスレッドを開始する */
	t = _beginthread(EventThread, 0, NULL);
	if(t == (unsigned long)-1)
		return FALSE;

	hEventThread = (HANDLE)t;
	return TRUE;
}
开发者ID:ktabata,项目名称:suika2,代码行数:46,代码来源:dsound.c

示例11: digi_init

/* Initialise audio devices. */
int digi_init()
{
 HRESULT hr;
 
 if (!digi_initialised && g_hWnd){

	 memset(&waveformat, 0, sizeof(waveformat));
	 waveformat.wFormatTag=WAVE_FORMAT_PCM;
	 waveformat.wBitsPerSample=8;
	 waveformat.nChannels = 1;
	 waveformat.nSamplesPerSec = 11025;
	 waveformat.nBlockAlign =
                    waveformat.nChannels * (waveformat.wBitsPerSample/8);
	 waveformat.nAvgBytesPerSec =
                    waveformat.nSamplesPerSec * waveformat.nBlockAlign; 

	  if ((hr = DirectSoundCreate(NULL, &lpds, NULL)) != DS_OK)
	   return -1;

	  if ((hr = IDirectSound_SetCooperativeLevel(lpds, g_hWnd, DSSCL_PRIORITY)) //hWndMain
	       != DS_OK)
	   {
	    IDirectSound_Release(lpds);
	    return -1;
	   }
	
	 memset(&dsbd, 0, sizeof(dsbd));
	 dsbd.dwSize = sizeof(dsbd);
	 dsbd.dwFlags = (DSBCAPS_CTRLFREQUENCY|DSBCAPS_CTRLPAN|DSBCAPS_CTRLVOLUME) | DSBCAPS_GETCURRENTPOSITION2;
	 dsbd.dwBufferBytes = 8192;
	 dsbd.dwReserved=0;
	 dsbd.lpwfxFormat = &waveformat;

	 digi_initialised = 1;
}

	if (!digi_atexit_initialised){
		atexit(digi_close);
		digi_atexit_initialised=1;
	}
 return 0;
}
开发者ID:Ringdingcoder,项目名称:d1x,代码行数:43,代码来源:digi.c

示例12: dsound_open

static int dsound_open (dsound *s)
{
    HRESULT hr;
    HWND hwnd;

    hwnd = GetForegroundWindow ();
    hr = IDirectSound_SetCooperativeLevel (
        s->dsound,
        hwnd,
        DSSCL_PRIORITY
        );

    if (FAILED (hr)) {
        dsound_logerr (hr, "Could not set cooperative level for window %p\n",
                       hwnd);
        return -1;
    }

    return 0;
}
开发者ID:01org,项目名称:qemu-lite,代码行数:20,代码来源:dsoundaudio.c

示例13: setupSoundPlay

//open the dsound interface.
static BOOL setupSoundPlay(VOID)
{
	HWND		hwnd;
	HRESULT     hr;

	hwnd = frameGetWinHandle();

	hr =DirectSoundCreate(NULL, &lpDirectSound, NULL);							// create dsound object
	if (hr != DS_OK)
	{
		DBPRINTF(("NETPLAY Failed to create dsound interface.\n"));	
		return (FALSE);
	}

	hr =IDirectSound_SetCooperativeLevel(lpDirectSound, hwnd, DSSCL_PRIORITY);	// Set coop level
	if (hr != DS_OK)
	{
		DBPRINTF(("NETPLAY Failed to create playback buffer..\n"));	
		return (FALSE);
	}

	IDirectSound_Compact(lpDirectSound);										// compact things 
	return (TRUE);
}
开发者ID:pheonixstorm,项目名称:wzredemption,代码行数:25,代码来源:netaudio.c

示例14: DSoundOpenPlayback

static ALCenum DSoundOpenPlayback(ALCdevice *device, const ALCchar *deviceName)
{
    DSoundPlaybackData *data = NULL;
    LPGUID guid = NULL;
    HRESULT hr;

    if(!PlaybackDeviceList)
    {
        hr = DirectSoundEnumerateA(DSoundEnumPlaybackDevices, NULL);
        if(FAILED(hr))
            ERR("Error enumerating DirectSound devices (%#x)!\n", (unsigned int)hr);
    }

    if(!deviceName && NumPlaybackDevices > 0)
    {
        deviceName = PlaybackDeviceList[0].name;
        guid = &PlaybackDeviceList[0].guid;
    }
    else
    {
        ALuint i;

        for(i = 0;i < NumPlaybackDevices;i++)
        {
            if(strcmp(deviceName, PlaybackDeviceList[i].name) == 0)
            {
                guid = &PlaybackDeviceList[i].guid;
                break;
            }
        }
        if(i == NumPlaybackDevices)
            return ALC_INVALID_VALUE;
    }

    //Initialise requested device
    data = calloc(1, sizeof(DSoundPlaybackData));
    if(!data)
        return ALC_OUT_OF_MEMORY;

    hr = DS_OK;
    data->NotifyEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
    if(data->NotifyEvent == NULL)
        hr = E_FAIL;

    //DirectSound Init code
    if(SUCCEEDED(hr))
        hr = DirectSoundCreate(guid, &data->DS, NULL);
    if(SUCCEEDED(hr))
        hr = IDirectSound_SetCooperativeLevel(data->DS, GetForegroundWindow(), DSSCL_PRIORITY);
    if(FAILED(hr))
    {
        if(data->DS)
            IDirectSound_Release(data->DS);
        if(data->NotifyEvent)
            CloseHandle(data->NotifyEvent);
        free(data);
        ERR("Device init failed: 0x%08lx\n", hr);
        return ALC_INVALID_VALUE;
    }

    device->DeviceName = strdup(deviceName);
    device->ExtraData = data;
    return ALC_NO_ERROR;
}
开发者ID:WoodenHaptics,项目名称:woody-experimental,代码行数:64,代码来源:dsound.c

示例15: m1sdr_Init

INT16 m1sdr_Init(int sample_rate)
{
	DSBUFFERDESC	dsbuf;
	WAVEFORMATEX	format;

	if (!s32SoundEnable) return(0);

	nDSoundSamRate = sample_rate;

	samples = NULL;

	lpDS = NULL;
	lpPDSB = NULL;
	lpSecB = NULL;

	// Calculate the Seg Length and Loop length
	// (round to nearest sample)
	nDSoundSegLen=(nDSoundSamRate*10+(nDSoundFps>>1))/nDSoundFps;
	cbLoopLen=(nDSoundSegLen*nDSoundSegCount)<<2;

	// create an IDirectSound COM object

	if (DS_OK != DirectSoundCreate(NULL, &lpDS, NULL))
	{
    	printf("Unable to create DirectSound object!\n");
		return(0);
	}

	// set cooperative level where we need it

	if (DS_OK != IDirectSound_SetCooperativeLevel(lpDS, GetForegroundWindow(), DSSCL_PRIORITY))
	{
    	printf("Unable to set cooperative level!\n");
		return(0);
	}

	// now create a primary sound buffer
	memset(&format, 0, sizeof(format));
	format.wFormatTag = WAVE_FORMAT_PCM;
	format.nChannels = 2;
	format.wBitsPerSample = 16;
	format.nSamplesPerSec = nDSoundSamRate;
	format.nBlockAlign = 4;	// stereo 16-bit
	format.cbSize = 0;
  	format.nAvgBytesPerSec=format.nSamplesPerSec*format.nBlockAlign;

	memset(&dsbuf, 0, sizeof(dsbuf));
	dsbuf.dwSize = sizeof(DSBUFFERDESC);
	dsbuf.dwFlags = DSBCAPS_PRIMARYBUFFER;
	dsbuf.dwBufferBytes = 0;
	dsbuf.lpwfxFormat = NULL;

	if (DS_OK != IDirectSound_CreateSoundBuffer(lpDS, &dsbuf, &lpPDSB, NULL))
	{
    	printf("Unable to create primary buffer!");
		return(0);		
	}

	// and set it's format how we want
	
	if (DS_OK != IDirectSoundBuffer_SetFormat(lpPDSB, &format))		
	{
    	printf("Unable to set primary buffer format!\n");
		return(0);
	}

	// start the primary buffer playing now so we get
	// minimal lag when we trigger our secondary buffer

	IDirectSoundBuffer_Play(lpPDSB, 0, 0, DSBPLAY_LOOPING);

	// that's done, now let's create our secondary buffer

    memset(&dsbuf, 0, sizeof(DSBUFFERDESC));
    dsbuf.dwSize = sizeof(DSBUFFERDESC);
	// we'll take default controls for this one
    dsbuf.dwFlags = DSBCAPS_GLOBALFOCUS | DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_CTRLPOSITIONNOTIFY; 
    dsbuf.dwBufferBytes = cbLoopLen;
    dsbuf.lpwfxFormat = (LPWAVEFORMATEX)&format;
	
	if (DS_OK != IDirectSound_CreateSoundBuffer(lpDS, &dsbuf, &lpSecB, NULL))
	{
    	printf("Unable to create secondary buffer\n");
		return(0);
	}

	// ok, cool, we're ready to go!
	// blank out the entire sound buffer
	{
		LPVOID ptr; DWORD len;

		IDirectSoundBuffer_Lock(lpSecB, 0, 0, &ptr, &len, NULL, NULL, DSBLOCK_ENTIREBUFFER);
		ZeroMemory(ptr, len);
		IDirectSoundBuffer_Unlock(lpSecB, ptr, len, 0, 0);
	}

	// allocate and zero our local buffer
	samples = (INT16 *)malloc(nDSoundSegLen<<2);
	ZeroMemory(samples, nDSoundSegLen<<2);

//.........这里部分代码省略.........
开发者ID:dreiss,项目名称:M1-Android,代码行数:101,代码来源:dsnd.cpp


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