本文整理汇总了C++中GetDeviceName函数的典型用法代码示例。如果您正苦于以下问题:C++ GetDeviceName函数的具体用法?C++ GetDeviceName怎么用?C++ GetDeviceName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetDeviceName函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: R_ASSERT
void ALDeviceList::SelectBestDevice()
{
m_defaultDeviceIndex = -1;
int best_majorVersion = -1;
int best_minorVersion = -1;
int majorVersion, minorVersion;
for (int i = 0; i < GetNumDevices(); i++)
{
if( m_defaultDeviceName!=GetDeviceName(i) )continue;
GetDeviceVersion (i, &majorVersion, &minorVersion);
if( (majorVersion>best_majorVersion) ||
(majorVersion==best_majorVersion && minorVersion>best_minorVersion) )
{
best_majorVersion = majorVersion;
best_minorVersion = minorVersion;
m_defaultDeviceIndex = i;
}
}
if(m_defaultDeviceIndex==-1)
{ // not selected
R_ASSERT(GetNumDevices()!=0);
m_defaultDeviceIndex = 0; //first
};
if(GetNumDevices()==0)
Msg("SOUND: OpenAL: SelectBestDevice: list empty");
else
Msg("SOUND: OpenAL: SelectBestDevice is %s %d.%d",GetDeviceName(m_defaultDeviceIndex).c_str(),best_majorVersion,best_minorVersion);
}
示例2: DEBUG_LOG
IPCCommandResult FileIO::IOCtl(const IOCtlRequest& request)
{
DEBUG_LOG(IOS_FILEIO, "FileIO: IOCtl (Device=%s)", m_name.c_str());
s32 return_value = IPC_SUCCESS;
switch (request.request)
{
case ISFS_IOCTL_GETFILESTATS:
{
if (m_file->IsOpen())
{
DEBUG_LOG(IOS_FILEIO, "File: %s, Length: %" PRIu64 ", Pos: %i", m_name.c_str(),
m_file->GetSize(), m_SeekPos);
Memory::Write_U32(static_cast<u32>(m_file->GetSize()), request.buffer_out);
Memory::Write_U32(m_SeekPos, request.buffer_out + 4);
}
else
{
return_value = FS_ENOENT;
}
}
break;
default:
request.Log(GetDeviceName(), LogTypes::IOS_FILEIO, LogTypes::LERROR);
}
return GetDefaultReply(return_value);
}
示例3: SetIcon
BOOL CBTTestDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
CFont *font=new CFont;
font->CreateFont(
14, // nHeight
0, // nWidth
0, // nEscapement
0, // nOrientation
0, // nWeight
FALSE, // bItalic
FALSE, // bUnderline
FALSE, // cStrikeOut
DEFAULT_CHARSET, // nCharSet
OUT_DEFAULT_PRECIS, // nOutPrecision
CLIP_DEFAULT_PRECIS, // nClipPrecision
DEFAULT_QUALITY, // nQuality
FF_DONTCARE, // nPitchAndFamily
"Courier New"); // lpszFacename
m_lbHCI.SetFont(font);
fbtLogSetFile("bttest.log");
fbtLogSetLevel(255);
UINT i=0;
CString szString;
while (i<255 && !IsAttached())
{
szString.Format("\\\\.\\FbtUsb%02d", i++);
CHciRoundTrip::Attach(szString);
}
if (!IsAttached())
{
MessageBox(_T("No Bluetooth hardware detected!"));
exit(0);
}
// Retrieve the HW driver device name
fbtLog(fbtLog_Notice, _T("CBTTestDlg::OnInitDialog: Connected to device %s"), szString);
char szDeviceName[80]={0};
if (GetDeviceName(szDeviceName, 80)>0)
m_stDevice.SetWindowText(szDeviceName);
// Let the dialog finish creating itself and displaying the window
// When its done, it will process its message queue on catch WM_USER+1
PostMessage(WM_USER+1, 0, 0);
return TRUE; // return TRUE unless you set the focus to a control
}
示例4: GetNoReply
IPCCommandResult CWII_IPC_HLE_Device_usb_oh0_46d_a03::IOCtl(u32 CommandAddress)
{
IPCCommandResult SendReply = GetNoReply();
SIOCtlVBuffer CommandBuffer(CommandAddress);
switch (CommandBuffer.Parameter)
{
case USBV0_IOCTL_DEVREMOVALHOOK:
// Reply is sent when device is removed
//SendReply = true;
break;
default:
WARN_LOG(OSHLE, "%s - IOCtl:", GetDeviceName().c_str());
WARN_LOG(OSHLE, " Parameter: 0x%x", CommandBuffer.Parameter);
WARN_LOG(OSHLE, " NumberIn: 0x%08x", CommandBuffer.NumberInBuffer);
WARN_LOG(OSHLE, " NumberOut: 0x%08x", CommandBuffer.NumberPayloadBuffer);
WARN_LOG(OSHLE, " BufferVector: 0x%08x", CommandBuffer.BufferVector);
DumpAsync(CommandBuffer.BufferVector, CommandBuffer.NumberInBuffer, CommandBuffer.NumberPayloadBuffer);
break;
}
Memory::Write_U32(0, CommandAddress + 4);
return SendReply;
}
示例5: HandleGetSockNameRequest
IPCCommandResult NetIPTop::HandleGetSockNameRequest(const IOCtlRequest& request)
{
u32 fd = Memory::Read_U32(request.buffer_in);
request.Log(GetDeviceName(), LogTypes::IOS_WC24);
sockaddr sa;
socklen_t sa_len = sizeof(sa);
int ret = getsockname(WiiSockMan::GetInstance().GetHostSocket(fd), &sa, &sa_len);
if (request.buffer_out_size < 2 + sizeof(sa.sa_data))
WARN_LOG(IOS_NET, "IOCTL_SO_GETSOCKNAME output buffer is too small. Truncating");
if (request.buffer_out_size > 0)
Memory::Write_U8(request.buffer_out_size, request.buffer_out);
if (request.buffer_out_size > 1)
Memory::Write_U8(sa.sa_family & 0xFF, request.buffer_out + 1);
if (request.buffer_out_size > 2)
{
Memory::CopyToEmu(request.buffer_out + 2, &sa.sa_data,
std::min<size_t>(sizeof(sa.sa_data), request.buffer_out_size - 2));
}
return GetDefaultReply(ret);
}
示例6: HandleGetSockOptRequest
IPCCommandResult NetIPTop::HandleGetSockOptRequest(const IOCtlRequest& request)
{
u32 fd = Memory::Read_U32(request.buffer_out);
u32 level = Memory::Read_U32(request.buffer_out + 4);
u32 optname = Memory::Read_U32(request.buffer_out + 8);
request.Log(GetDeviceName(), LogTypes::IOS_WC24);
// Do the level/optname translation
int nat_level = MapWiiSockOptLevelToNative(level);
int nat_optname = MapWiiSockOptNameToNative(optname);
u8 optval[20];
u32 optlen = 4;
int ret = getsockopt(WiiSockMan::GetInstance().GetHostSocket(fd), nat_level, nat_optname,
(char*)&optval, (socklen_t*)&optlen);
const s32 return_value = WiiSockMan::GetNetErrorCode(ret, "SO_GETSOCKOPT", false);
Memory::Write_U32(optlen, request.buffer_out + 0xC);
Memory::CopyToEmu(request.buffer_out + 0x10, optval, optlen);
if (optname == SO_ERROR)
{
s32 last_error = WiiSockMan::GetInstance().GetLastNetError();
Memory::Write_U32(sizeof(s32), request.buffer_out + 0xC);
Memory::Write_U32(last_error, request.buffer_out + 0x10);
}
return GetDefaultReply(return_value);
}
示例7: GetDeviceNames
PStringArray PVideoOutputDevice_EKIGA::GetDeviceNames() const
{
PStringArray devlist;
devlist.AppendString(GetDeviceName());
return devlist;
}
示例8: GetDisplayCoordinates
/*
========================
GetDisplayCoordinates
========================
*/
static bool GetDisplayCoordinates( const int deviceNum, int & x, int & y, int & width, int & height, int & displayHz ) {
idStr deviceName = GetDeviceName( deviceNum );
if ( deviceName.Length() == 0 ) {
return false;
}
DISPLAY_DEVICE device = {};
device.cb = sizeof( device );
if ( !EnumDisplayDevices(
0, // lpDevice
deviceNum,
&device,
0 /* dwFlags */ ) ) {
return false;
}
DISPLAY_DEVICE monitor;
monitor.cb = sizeof( monitor );
if ( !EnumDisplayDevices(
deviceName.c_str(),
0,
&monitor,
0 /* dwFlags */ ) ) {
return false;
}
DEVMODE devmode;
devmode.dmSize = sizeof( devmode );
if ( !EnumDisplaySettings( deviceName.c_str(),ENUM_CURRENT_SETTINGS, &devmode ) ) {
return false;
}
common->Printf( "display device: %i\n", deviceNum );
common->Printf( " DeviceName : %s\n", device.DeviceName );
common->Printf( " DeviceString: %s\n", device.DeviceString );
common->Printf( " StateFlags : 0x%x\n", device.StateFlags );
common->Printf( " DeviceID : %s\n", device.DeviceID );
common->Printf( " DeviceKey : %s\n", device.DeviceKey );
common->Printf( " DeviceName : %s\n", monitor.DeviceName );
common->Printf( " DeviceString: %s\n", monitor.DeviceString );
common->Printf( " StateFlags : 0x%x\n", monitor.StateFlags );
common->Printf( " DeviceID : %s\n", monitor.DeviceID );
common->Printf( " DeviceKey : %s\n", monitor.DeviceKey );
common->Printf( " dmPosition.x : %i\n", devmode.dmPosition.x );
common->Printf( " dmPosition.y : %i\n", devmode.dmPosition.y );
common->Printf( " dmBitsPerPel : %i\n", devmode.dmBitsPerPel );
common->Printf( " dmPelsWidth : %i\n", devmode.dmPelsWidth );
common->Printf( " dmPelsHeight : %i\n", devmode.dmPelsHeight );
common->Printf( " dmDisplayFlags : 0x%x\n", devmode.dmDisplayFlags );
common->Printf( " dmDisplayFrequency: %i\n", devmode.dmDisplayFrequency );
x = devmode.dmPosition.x;
y = devmode.dmPosition.y;
width = devmode.dmPelsWidth;
height = devmode.dmPelsHeight;
displayHz = devmode.dmDisplayFrequency;
return true;
}
示例9: switch
IPCCommandResult STMImmediate::IOCtl(const IOCtlRequest& request)
{
s32 return_value = IPC_SUCCESS;
switch (request.request)
{
case IOCTL_STM_IDLE:
case IOCTL_STM_SHUTDOWN:
NOTICE_LOG(IOS_STM, "IOCTL_STM_IDLE or IOCTL_STM_SHUTDOWN received, shutting down");
Core::QueueHostJob(&Core::Stop, false);
break;
case IOCTL_STM_RELEASE_EH:
if (!s_event_hook_request)
{
return_value = IPC_ENOENT;
break;
}
Memory::Write_U32(0, s_event_hook_request->buffer_out);
EnqueueReply(*s_event_hook_request, IPC_SUCCESS);
s_event_hook_request.reset();
break;
case IOCTL_STM_HOTRESET:
INFO_LOG(IOS_STM, "%s - IOCtl:", GetDeviceName().c_str());
INFO_LOG(IOS_STM, " IOCTL_STM_HOTRESET");
break;
case IOCTL_STM_VIDIMMING: // (Input: 20 bytes, Output: 20 bytes)
INFO_LOG(IOS_STM, "%s - IOCtl:", GetDeviceName().c_str());
INFO_LOG(IOS_STM, " IOCTL_STM_VIDIMMING");
// Memory::Write_U32(1, buffer_out);
// return_value = 1;
break;
case IOCTL_STM_LEDMODE: // (Input: 20 bytes, Output: 20 bytes)
INFO_LOG(IOS_STM, "%s - IOCtl:", GetDeviceName().c_str());
INFO_LOG(IOS_STM, " IOCTL_STM_LEDMODE");
break;
default:
request.DumpUnknown(GetDeviceName(), LogTypes::IOS_STM);
}
return GetDefaultReply(return_value);
}
示例10: GetDeviceName
BOOL CDevCProbe::SetDeviceName( PDeviceDescriptor_t d, const std::tstring& strName ){
if (d && d->Com && strName.size() <= 15) {
d->Com->WriteString(TEXT("$PCPILOT,C,SET,"));
d->Com->WriteString(strName.c_str());
d->Com->WriteString(TEXT("\r\n"));
return GetDeviceName(d);
}
return FALSE;
}
示例11: GetDeviceName
tbool CDeviceManagerWaveIO::GetDeviceName_OutputsOnly(tint iIndex, tchar* pszName)
{
if (!DeviceMayHaveOutput(iIndex)) {
*pszName = '\0';
return false;
}
return GetDeviceName(iIndex, pszName);
} // GetDeviceName_OutputsOnly
示例12: listen
IPCCommandResult NetIPTop::HandleListenRequest(const IOCtlRequest& request)
{
u32 fd = Memory::Read_U32(request.buffer_in);
u32 BACKLOG = Memory::Read_U32(request.buffer_in + 0x04);
u32 ret = listen(WiiSockMan::GetInstance().GetHostSocket(fd), BACKLOG);
request.Log(GetDeviceName(), LogTypes::IOS_WC24);
return GetDefaultReply(WiiSockMan::GetNetErrorCode(ret, "SO_LISTEN", false));
}
示例13: HandleShutdownRequest
IPCCommandResult NetIPTop::HandleShutdownRequest(const IOCtlRequest& request)
{
request.Log(GetDeviceName(), LogTypes::IOS_WC24);
u32 fd = Memory::Read_U32(request.buffer_in);
u32 how = Memory::Read_U32(request.buffer_in + 4);
int ret = shutdown(WiiSockMan::GetInstance().GetHostSocket(fd), how);
return GetDefaultReply(WiiSockMan::GetNetErrorCode(ret, "SO_SHUTDOWN", false));
}
示例14: ParODE_GetDeviceName
// void GetDeviceName( int *DeviceId, char strDeviceName[], int nErr[]);
static PyObject*
ParODE_GetDeviceName(PyObject *self, PyObject *args){
int deviceID;
if(!PyArg_ParseTuple(args, "i", &deviceID))
return NULL;
char deviceName[128];
int nErr = 0;
GetDeviceName(&deviceID, deviceName, &nErr);
return Py_BuildValue("s i", deviceName, nErr);
}
示例15: Log
void MMDeviceAudioSource::StartCapture()
{
if(mmClient) {
mmClient->Start();
UINT64 freq;
mmClock->GetFrequency(&freq);
Log(TEXT("frequency for device '%s' is %llu, samples per sec is %u"), GetDeviceName(), freq, this->GetSamplesPerSec());
}
}