亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? system.cxx

?? 貢獻一個基于osip協議棧的用戶代理
?? CXX
字號:
#include "portaudiocpp/System.hxx"

#include <cstddef>
#include <cassert>

#include "portaudiocpp/HostApi.hxx"
#include "portaudiocpp/Device.hxx"
#include "portaudiocpp/Stream.hxx"
#include "portaudiocpp/Exception.hxx"
#include "portaudiocpp/SystemHostApiIterator.hxx"
#include "portaudiocpp/SystemDeviceIterator.hxx"

namespace portaudio
{
	// -----------------------------------------------------------------------------------

	// Static members:
	System *System::instance_ = NULL;
	int System::initCount_ = 0;
	HostApi **System::hostApis_ = NULL;
	Device **System::devices_ = NULL;
	Device *System::nullDevice_ = NULL;

	// -----------------------------------------------------------------------------------

	int System::version()
	{
		return Pa_GetVersion();
	}

	const char *System::versionText()
	{
		return Pa_GetVersionText();
	}

	void System::initialize()
	{
		++initCount_;

		if (initCount_ == 1)
		{
			// Create singleton:
			assert(instance_ == NULL);
			instance_ = new System();

			// Initialize the PortAudio system:
			{
				PaError err = Pa_Initialize();

				if (err != paNoError)
					throw PaException(err);
			}

			// Create and populate device array:
			{
				int numDevices = instance().deviceCount();

				devices_ = new Device*[numDevices];

				for (int i = 0; i < numDevices; ++i)
					devices_[i] = new Device(i);
			}

			// Create and populate host api array:
			{
				int numHostApis = instance().hostApiCount();

				hostApis_ = new HostApi*[numHostApis];

				for (int i = 0; i < numHostApis; ++i)
					hostApis_[i] = new HostApi(i);
			}
			
			// Create null device:
			nullDevice_ = new Device(paNoDevice);
		}
	}

	void System::terminate()
	{
		PaError err = paNoError;

		if (initCount_ == 1)
		{
			// Destroy null device:
			delete nullDevice_;

			// Destroy host api array:
			{
				if (hostApis_ != NULL)
				{
					int numHostApis = instance().hostApiCount();

					for (int i = 0; i < numHostApis; ++i)
						delete hostApis_[i];

					delete[] hostApis_;
					hostApis_ = NULL;
				}
			}

			// Destroy device array:
			{
				if (devices_ != NULL)
				{
					int numDevices = instance().deviceCount();

					for (int i = 0; i < numDevices; ++i)
						delete devices_[i];

					delete[] devices_;
					devices_ = NULL;
				}
			}

			// Terminate the PortAudio system:
			assert(instance_ != NULL);
			err = Pa_Terminate();

			// Destroy singleton:
			delete instance_;
			instance_ = NULL;
		}

		if (initCount_ > 0)
			--initCount_;

		if (err != paNoError)
			throw PaException(err);
	}


	System &System::instance()
	{
		assert(exists());

		return *instance_;
	}

	bool System::exists()
	{
		return (instance_ != NULL);
	}

	// -----------------------------------------------------------------------------------

	System::HostApiIterator System::hostApisBegin()
	{
		System::HostApiIterator tmp;
		tmp.ptr_ = &hostApis_[0]; // begin (first element)
		return tmp;
	}

	System::HostApiIterator System::hostApisEnd()
	{
		int count = hostApiCount();

		System::HostApiIterator tmp;
		tmp.ptr_ = &hostApis_[count]; // end (one past last element)
		return tmp;
	}

	HostApi &System::defaultHostApi()
	{
		PaHostApiIndex defaultHostApi = Pa_GetDefaultHostApi();

		if (defaultHostApi < 0)
			throw PaException(defaultHostApi);

		return *hostApis_[defaultHostApi];
	}

	HostApi &System::hostApiByTypeId(PaHostApiTypeId type)
	{
		PaHostApiIndex index = Pa_HostApiTypeIdToHostApiIndex(type);

		if (index < 0)
			throw PaException(index);

		return *hostApis_[index];
	}

	HostApi &System::hostApiByIndex(PaHostApiIndex index)
	{
		if (index < 0 || index >= hostApiCount())
			throw PaException(paInternalError);

		return *hostApis_[index];
	}

	int System::hostApiCount()
	{
		PaHostApiIndex count = Pa_GetHostApiCount();

		if (count < 0)
			throw PaException(count);

		return count;
	}

	// -----------------------------------------------------------------------------------

	System::DeviceIterator System::devicesBegin()
	{
		DeviceIterator tmp;
		tmp.ptr_ = &devices_[0];

		return tmp;
	}

	System::DeviceIterator System::devicesEnd()
	{
		int count = deviceCount();

		DeviceIterator tmp;
		tmp.ptr_ = &devices_[count];

		return tmp;
	}

	//////
	/// Returns the System's default input Device, or the null Device if none 
	/// was available.
	//////
	Device &System::defaultInputDevice()
	{
		PaDeviceIndex index = Pa_GetDefaultInputDevice();
		return deviceByIndex(index);
	}

	//////
	/// Returns the System's default output Device, or the null Device if none 
	/// was available.
	//////
	Device &System::defaultOutputDevice()
	{
		PaDeviceIndex index = Pa_GetDefaultOutputDevice();
		return deviceByIndex(index);
	}

	//////
	/// Returns the Device for the given index.
	/// Will throw a paInternalError equivalent PaException if the given index 
	/// is out of range.
	//////
	Device &System::deviceByIndex(PaDeviceIndex index)
	{
		if (index < -1 || index >= deviceCount())
		{
			throw PaException(paInternalError);
		}

		if (index == -1)
			return System::instance().nullDevice();

		return *devices_[index];
	}

	int System::deviceCount()
	{
		PaDeviceIndex count = Pa_GetDeviceCount();

		if (count < 0)
			throw PaException(count);

		return count;
	}

	Device &System::nullDevice()
	{
		return *nullDevice_;
	}

	// -----------------------------------------------------------------------------------

	void System::sleep(long msec)
	{
		Pa_Sleep(msec);
	}

	int System::sizeOfSample(PaSampleFormat format)
	{
		PaError err = Pa_GetSampleSize(format);
		if (err < 0)
		{
			throw PaException(err);
			return 0;
		}

		return err;
	}

	// -----------------------------------------------------------------------------------

	System::System()
	{
		// (left blank intentionally)
	}

	System::~System()
	{
		// (left blank intentionally)
	}

	// -----------------------------------------------------------------------------------

} // namespace portaudio

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕一区二区5566日韩| 国产一区二三区| 日本不卡视频在线观看| 懂色av中文一区二区三区| 欧日韩精品视频| 日本一区二区三区国色天香| 五月天亚洲婷婷| 91视频91自| 国产片一区二区三区| 日本不卡的三区四区五区| 色综合久久99| 欧美国产一区在线| 国模冰冰炮一区二区| 欧美日本国产视频| 一区二区三区 在线观看视频| 国产激情一区二区三区四区| 91精品国产综合久久久蜜臀粉嫩 | 黄一区二区三区| 欧美色倩网站大全免费| 亚洲欧美国产三级| 国产成人免费在线观看不卡| 欧美电影免费观看高清完整版在| 亚洲成人午夜影院| 色伊人久久综合中文字幕| 国产精品久久久久国产精品日日| 国产在线视频一区二区| 精品久久国产字幕高潮| 日韩经典中文字幕一区| 在线播放视频一区| 视频一区在线播放| 欧美乱妇23p| 日韩精品一区第一页| 欧美三级蜜桃2在线观看| 亚洲亚洲人成综合网络| 欧美性xxxxxx少妇| 亚洲国产精品视频| 欧美人xxxx| 久久99久久久欧美国产| 欧美哺乳videos| 激情欧美日韩一区二区| 久久久不卡网国产精品一区| 国产一区二三区| 欧美高清一级片在线观看| 国产91精品入口| 18涩涩午夜精品.www| 在线免费观看日韩欧美| 亚洲国产日日夜夜| 欧美一级一区二区| 韩国成人福利片在线播放| 国产亚洲精品精华液| 91在线视频免费91| 午夜精品福利视频网站| 欧美电影免费提供在线观看| 国产精品亚洲第一区在线暖暖韩国 | 久久99精品国产.久久久久| 精品国产1区二区| 成人午夜精品一区二区三区| 亚洲女同女同女同女同女同69| 欧美图区在线视频| 免费看日韩精品| 国产精品色婷婷久久58| 色婷婷久久久亚洲一区二区三区 | 日韩小视频在线观看专区| 久久99国产精品麻豆| 中文字幕欧美三区| 欧美日韩一区在线观看| 麻豆极品一区二区三区| 亚洲欧美在线视频| 欧美一区二区三区四区在线观看| 国产美女主播视频一区| 一级日本不卡的影视| 欧美v国产在线一区二区三区| 9色porny自拍视频一区二区| 奇米综合一区二区三区精品视频| 久久亚洲综合色一区二区三区| 99在线视频精品| 精品亚洲porn| 亚洲一区电影777| 国产午夜精品美女毛片视频| 欧美视频一区在线| 国产99久久久精品| 蜜臀av一区二区在线免费观看| 成人免费在线播放视频| 26uuu精品一区二区| 欧美日韩综合色| 成人国产在线观看| 老司机精品视频导航| 亚洲卡通欧美制服中文| 国产清纯在线一区二区www| 欧美日韩电影一区| 一本大道av伊人久久综合| 激情国产一区二区 | 欧美视频精品在线| 成人高清免费在线播放| 久久99热这里只有精品| 天天av天天翘天天综合网| 亚洲欧洲国产专区| 中文字幕免费不卡在线| 精品国产乱码久久久久久夜甘婷婷 | 91成人免费网站| 高清不卡在线观看av| 激情综合五月婷婷| 老司机精品视频导航| 五月激情综合色| 国产九色精品成人porny| 日韩一区欧美二区| 亚洲va国产va欧美va观看| 亚洲欧美日韩成人高清在线一区| 久久久久国产精品麻豆| 精品sm捆绑视频| 欧美刺激午夜性久久久久久久| 制服丝袜亚洲网站| 欧美夫妻性生活| 欧美区视频在线观看| 欧美日韩卡一卡二| 欧美三级电影一区| 欧美丰满一区二区免费视频| 欧美精品一二三| 这里只有精品电影| 91精品国产综合久久久久| 欧美一区日本一区韩国一区| 宅男在线国产精品| 日韩欧美一区中文| 欧美成人高清电影在线| 精品福利av导航| 久久精品亚洲乱码伦伦中文| 久久九九99视频| 中文字幕一区二区三中文字幕| 国产精品超碰97尤物18| 亚洲少妇中出一区| 一区二区日韩电影| 日韩av网站免费在线| 另类小说视频一区二区| 国产精品亚洲成人| 99久久久精品免费观看国产蜜| 91视频国产资源| 4438x成人网最大色成网站| 欧美成人精品福利| 中文av一区特黄| 亚洲自拍偷拍麻豆| 麻豆91小视频| 粉嫩aⅴ一区二区三区四区| 99精品在线免费| 欧美日韩高清一区| 国产欧美日韩精品a在线观看| 亚洲色图视频网站| 日韩av电影天堂| 国产iv一区二区三区| 欧美色中文字幕| 26uuu精品一区二区在线观看| 中文字幕一区三区| 日本不卡一区二区三区高清视频| 国产成人亚洲精品狼色在线| 色婷婷av一区二区三区软件| 日韩欧美一卡二卡| 亚洲婷婷在线视频| 麻豆精品精品国产自在97香蕉| 国产成人精品三级麻豆| 欧美性猛片xxxx免费看久爱| 精品久久久久久久久久久久久久久| 国产精品国产三级国产普通话蜜臀 | 日本sm残虐另类| 波多野结衣精品在线| 91精品国产综合久久久久久久 | 91美女在线看| 日韩久久免费av| 亚洲图片欧美一区| 国产精品资源站在线| 欧美剧在线免费观看网站 | 国产精品中文有码| 欧美色图免费看| 中文幕一区二区三区久久蜜桃| 婷婷久久综合九色国产成人 | 在线看国产一区| 欧美精彩视频一区二区三区| 偷窥少妇高潮呻吟av久久免费| 成人午夜碰碰视频| 日韩欧美国产一区二区在线播放| 亚洲裸体xxx| 福利一区二区在线| 精品国产91久久久久久久妲己| 午夜在线电影亚洲一区| 91小视频在线| 中日韩av电影| 国产69精品久久久久毛片| 午夜精品久久一牛影视| voyeur盗摄精品| 国产色产综合色产在线视频| 精品一区二区三区不卡| 欧美一区二区三区视频免费播放| 一区二区三区在线视频观看 | 国产视频一区二区在线| 美腿丝袜在线亚洲一区| 3d动漫精品啪啪一区二区竹菊 | 日本美女视频一区二区| 欧美性极品少妇| 午夜精品123| 欧美日韩高清影院| 首页国产欧美久久| 欧美麻豆精品久久久久久|