本文整理汇总了C++中GetDeviceName函数的典型用法代码示例。如果您正苦于以下问题:C++ GetDeviceName函数的具体用法?C++ GetDeviceName怎么用?C++ GetDeviceName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetDeviceName函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:Karlan88,项目名称:xray,代码行数:30,代码来源:OpenALDeviceList.cpp
示例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);
}
开发者ID:spankminister,项目名称:dolphin,代码行数:29,代码来源:FileIO.cpp
示例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
}
开发者ID:ErwanLegrand,项目名称:freebt,代码行数:60,代码来源:BTTestDlg.cpp
示例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;
}
开发者ID:Asmodean-,项目名称:Ishiiruka,代码行数:26,代码来源:WII_IPC_HLE_WiiSpeak.cpp
示例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);
}
开发者ID:Tinob,项目名称:Ishiiruka,代码行数:25,代码来源:Top.cpp
示例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);
}
开发者ID:Tinob,项目名称:Ishiiruka,代码行数:32,代码来源:Top.cpp
示例7: GetDeviceNames
PStringArray PVideoOutputDevice_EKIGA::GetDeviceNames() const
{
PStringArray devlist;
devlist.AppendString(GetDeviceName());
return devlist;
}
开发者ID:GNOME,项目名称:ekiga,代码行数:7,代码来源:opal-videooutput.cpp
示例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;
}
开发者ID:neilogd,项目名称:DOOM-3-BFG,代码行数:64,代码来源:win_glimp.cpp
示例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);
}
开发者ID:spankminister,项目名称:dolphin,代码行数:45,代码来源:STM.cpp
示例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;
}
开发者ID:PhilColbert,项目名称:LK8000,代码行数:9,代码来源:devCProbe.cpp
示例11: GetDeviceName
tbool CDeviceManagerWaveIO::GetDeviceName_OutputsOnly(tint iIndex, tchar* pszName)
{
if (!DeviceMayHaveOutput(iIndex)) {
*pszName = '\0';
return false;
}
return GetDeviceName(iIndex, pszName);
} // GetDeviceName_OutputsOnly
开发者ID:grimtraveller,项目名称:koblo_software,代码行数:9,代码来源:CDeviceManagerWaveIO.cpp
示例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));
}
开发者ID:Tinob,项目名称:Ishiiruka,代码行数:9,代码来源:Top.cpp
示例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));
}
开发者ID:Tinob,项目名称:Ishiiruka,代码行数:10,代码来源:Top.cpp
示例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);
}
开发者ID:apatriciu,项目名称:ParODE,代码行数:11,代码来源:ParODEmodule.c
示例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());
}
}
开发者ID:ramabhadrarao,项目名称:OBS,代码行数:11,代码来源:MMDeviceAudioSource.cpp
示例16: INFO_LOG
void USBHost::DispatchHooks(const DeviceChangeHooks& hooks)
{
for (const auto& hook : hooks)
{
INFO_LOG(IOS_USB, "%s - %s device: %04x:%04x", GetDeviceName().c_str(),
hook.second == ChangeEvent::Inserted ? "New" : "Removed", hook.first->GetVid(),
hook.first->GetPid());
OnDeviceChange(hook.second, hook.first);
}
if (!hooks.empty())
OnDeviceChangeEnd();
}
开发者ID:Anti-Ultimate,项目名称:dolphin,代码行数:12,代码来源:Host.cpp
示例17: WARN_LOG
IPCCommandResult CWII_IPC_HLE_Device_usb_oh0::IOCtl(u32 CommandAddress)
{
u32 Command = Memory::Read_U32(CommandAddress + 0x0c);
u32 BufferIn = Memory::Read_U32(CommandAddress + 0x10);
u32 BufferInSize = Memory::Read_U32(CommandAddress + 0x14);
u32 BufferOut = Memory::Read_U32(CommandAddress + 0x18);
u32 BufferOutSize = Memory::Read_U32(CommandAddress + 0x1c);
WARN_LOG(OSHLE, "%s - IOCtl:%x", GetDeviceName().c_str(), Command);
WARN_LOG(OSHLE, "%x:%x %x:%x", BufferIn, BufferInSize, BufferOut, BufferOutSize);
return IOCtlV(CommandAddress);
}
开发者ID:Asmodean-,项目名称:Ishiiruka,代码行数:13,代码来源:WII_IPC_HLE_WiiSpeak.cpp
示例18: INFO_LOG
IPCCommandResult CWII_IPC_HLE_Device_net_ssl::IOCtl(u32 _CommandAddress)
{
u32 BufferIn = Memory::Read_U32(_CommandAddress + 0x10);
u32 BufferInSize = Memory::Read_U32(_CommandAddress + 0x14);
u32 BufferOut = Memory::Read_U32(_CommandAddress + 0x18);
u32 BufferOutSize = Memory::Read_U32(_CommandAddress + 0x1C);
u32 Command = Memory::Read_U32(_CommandAddress + 0x0C);
INFO_LOG(WII_IPC_SSL, "%s unknown %i "
"(BufferIn: (%08x, %i), BufferOut: (%08x, %i)",
GetDeviceName().c_str(), Command,
BufferIn, BufferInSize, BufferOut, BufferOutSize);
Memory::Write_U32(0, _CommandAddress + 0x4);
return IPC_DEFAULT_REPLY;
}
开发者ID:Buddybenj,项目名称:dolphin,代码行数:15,代码来源:WII_IPC_HLE_Device_net_ssl.cpp
示例19: CloseDevice
bool
BL_CDEngine::OpenDevice(int8 aIndex)
{
// If a device is already opened, then close it first.
CloseDevice();
// Open the device for reading.
mCurrentDevice = open(GetDeviceName(aIndex), O_RDONLY);
// Error?
if(mCurrentDevice < 0) {
return FALSE;
}
return TRUE;
}
开发者ID:HaikuArchives,项目名称:BeFAR,代码行数:15,代码来源:BL_CDEngine.cpp
示例20: AfxGetApp
void CBCGPRibbonBackstagePagePrint::OnPrinterProperties()
{
CWaitCursor wait;
CWinApp* pApp = AfxGetApp();
if (pApp == NULL)
{
ASSERT(FALSE);
return;
}
int nSelection = GetPrinterSelection ();
if (nSelection < 0)
{
ASSERT(FALSE);
return;
}
PRINTDLG* dlgPrint = GetPrintDlg();
ASSERT(dlgPrint != NULL);
if (dlgPrint->hDevMode == NULL)
{
ASSERT(FALSE);
return;
}
CString strDeviceName (GetDeviceName ());
HANDLE hPrinter = OpenPrinterByName(strDeviceName);
if (hPrinter == NULL)
{
ASSERT(FALSE);
return;
}
UpdatePrinterProperties (TRUE);
LPDEVMODE lpDevMode = (LPDEVMODE)::GlobalLock (dlgPrint->hDevMode);
BOOL bRes = ::DocumentProperties(GetParent()->GetSafeHwnd (), hPrinter, (LPTSTR)(LPCTSTR)strDeviceName, lpDevMode, lpDevMode, DM_IN_PROMPT | DM_IN_BUFFER | DM_OUT_BUFFER) == IDOK;
::GlobalUnlock (dlgPrint->hDevMode);
::ClosePrinter (hPrinter);
if (bRes)
{
UpdatePrinterProperties(FALSE, TRUE);
}
}
开发者ID:cugxiangzhenwei,项目名称:WorkPlatForm,代码行数:48,代码来源:BCGPRibbonBackstagePagePrint.cpp
注:本文中的GetDeviceName函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论