예제 #1
0
파일: audiostream.cpp 프로젝트: Wayt/Skypy
int AudioStream::deviceIndex(QString const& name)
{
    int count = deviceCount();
    for (int i = 0; i < count; ++i)
        if (deviceName(i) == name)
            return i;
    return -1;
}
예제 #2
0
		Freenect() : m_stop(false) {
			if(freenect_init(&m_ctx, NULL) < 0) throw std::runtime_error("Cannot initialize freenect library");
			// We claim both the motor and camera devices, since this class exposes both.
			// It does not support audio, so we do not claim it.
			freenect_select_subdevices(m_ctx, static_cast<freenect_device_flags>(FREENECT_DEVICE_MOTOR | FREENECT_DEVICE_CAMERA));
			
			if (deviceCount() < 1)
				m_stop = true;
			
			if(pthread_create(&m_thread, NULL, pthread_callback, (void*)this) != 0) throw std::runtime_error("Cannot initialize freenect thread");
		}
예제 #3
0
	DeviceVector ATIGPUDevice::createDevices(unsigned int flags)
	{
		DeviceVector devices;

		if(deviceCount() == 0) return devices;

		try {
			// Multiple devices is not supported yet
			devices.push_back(new ATIGPUDevice());
		} catch (hydrazine::Exception he) {
			// Swallow the exception and return empty device vector
			report(he.what());
		}

		return devices;
	}