本文整理汇总了C++中FindDevice函数的典型用法代码示例。如果您正苦于以下问题:C++ FindDevice函数的具体用法?C++ FindDevice怎么用?C++ FindDevice使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FindDevice函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ChangeInterface
bool ChangeInterface(char * filepath, bool silent)
{
int device = -1;
if(!FindDevice(filepath, &device))
return false;
return ChangeInterface(device, silent);
}
开发者ID:askotx,项目名称:vba-wii,代码行数:9,代码来源:fileop.cpp
示例2: ctr_drives_chdrive
int ctr_drives_chdrive(const char *drive)
{
//Check that the drive requested is in the devoptab table
int index = FindDevice(drive);
if (index == -1) return -1;
setDefaultDevice(index);
return 0;
}
开发者ID:gemarcano,项目名称:libctr9,代码行数:9,代码来源:ctr_drives.c
示例3: ChangeInterface
bool ChangeInterface(char * filepath, int retryCount )
{
int device = -1;
if(!FindDevice(filepath, &device))
return false;
return ChangeInterface(device, retryCount );
}
开发者ID:raz0red,项目名称:wii-mednafen,代码行数:9,代码来源:fileop.cpp
示例4: CDXLOG
//////////////////////////////////////////////////////////////////////////////////
// CRMEngine CreateWindowed - creates a windowed application
//////////////////////////////////////////////////////////////////////////////////
HRESULT CRMEngine::CreateWindowed(CDXScreen* pScreen, void *hWnd,
int Width, int Height)
{
GUID d3dGUID;
CDXLOG("START: CRMEngine::CreateWindowed");
CDXLOG("Release our m_RMDevice and Clipper object if we have one");
// first release everything that has been allocated
RELEASE(m_RMDevice);
RELEASE(m_lpDDClipper);
CDXLOG("Save the Screen object and do a CreateWindow");
// create the CDXScreen object
m_Screen = pScreen;
if(FAILED(m_Screen->CreateWindowed(hWnd, Width, Height))) {
CDXLOG("CreateWindow failed");
return D3DRMERR_NOTDONEYET;
}
CDXLOG("Create a Clipper object");
// create the dd clipper object
if(FAILED(DirectDrawCreateClipper(0, &m_lpDDClipper, NULL))) {
CDXLOG("Clipper creation failed");
return D3DRMERR_NOTDONEYET;
}
CDXLOG("Set the hWnd of the clipper to the main window");
// set the clipper objects hWnd
if(FAILED(m_lpDDClipper->SetHWnd(0, (HWND)hWnd))) {
RELEASE(m_lpDDClipper);
return D3DRMERR_NOTDONEYET;
}
CDXLOG("Do a CreateDeviceFromClipper to setup the 3DRM clipper");
// create the d3d device
if(FAILED(m_Direct3DRM->CreateDeviceFromClipper(m_lpDDClipper,
FindDevice(m_Screen->GetBPP(), &d3dGUID), Width, Height, &m_RMDevice))) {
return D3DRMERR_NOTDONEYET;
}
CDXLOG("Call SetDefaults");
// start our engine with default values based on color depth
SetDefaults();
CDXLOG("END: CRMEngine::CreateWindowed");
return D3DRM_OK;
}
开发者ID:hyuntaeng,项目名称:CDX,代码行数:58,代码来源:engine.cpp
示例5: OpenProfilesFolder
int OpenProfilesFolder()
{
sprintf(browser.dir, "%s/profiles/", appPath);
int device = 0;
FindDevice(browser.dir, &device);
CleanupPath(browser.dir);
ResetBrowser(); // reset browser
return ParseDirectory();
}
开发者ID:ifish12,项目名称:WiiTweet,代码行数:11,代码来源:profilebrowser.cpp
示例6: FindDevice
void Fl_Canvas::DeleteSelection (void) {
if (! m_HaveSelection) return;
// show some warning here
for (unsigned int i=0; i<m_Selection.m_DeviceIds.size(); i++) {
int ID = m_Selection.m_DeviceIds[i];
Fl_DeviceGUI* o = FindDevice(ID);
if (o) Fl_DeviceGUI::Kill(o);
}
m_HaveSelection = false;
m_Selection.Clear();
redraw();
}
开发者ID:original-male,项目名称:spiralsynthmodular,代码行数:12,代码来源:Fl_Canvas.C
示例7: while
bool C1WireByOWFS::FindDevice(const std::string inDir, const std::string sID, /*out*/_t1WireDevice& device) const
{
bool found = false;
DIR *d=opendir(inDir.c_str());
if (d != NULL)
{
struct dirent *de=NULL;
// Loop while not NULL or not found
while((de=readdir(d)) && !found)
{
// Check dir
if (!IsValidDir(de))
continue;
// Get the device from it's dirname
GetDevice(inDir, de->d_name, device);
// Check if it's the device we are looking for
if (device.devid.compare(0,sID.length(),sID)==0)
{
found=true;
continue;
}
// Else, try to scan hubs (recursively)
if (device.family==microlan_coupler)
{
// Search in "main" and "aux" dir
found=FindDevice(inDir + "/" + de->d_name + HUB_MAIN_SUB_PATH, sID, device);
if(!found)
found=FindDevice(inDir + "/" + de->d_name + HUB_AUX_SUB_PATH, sID, device);
}
}
}
closedir(d);
return found;
}
开发者ID:G3ronim0,项目名称:domoticz,代码行数:38,代码来源:1WireByOWFS.cpp
示例8: FindDevice
KSGDeviceNode* KSGDeviceManager::NewDevice(
int did,
KSGDeviceNode* parent,
const std::string& phyid,
KSGDevice* devtype)
{
KSGDeviceNode* ret = FindDevice(did);
if(ret)
throw DeviceIdAlreadyExists();
ret = _pool.construct(did,parent,devtype);
ret->SetPhyId(phyid);
SaveDevice(ret);
return ret;
}
开发者ID:nykma,项目名称:ykt4sungard,代码行数:14,代码来源:device.cpp
示例9: MakeX
static int MakeX(int help)
{
char *token, *server;
int dpi, device, defDPI;
if (help) {
p_stderr("gist: display command syntax:\n ");
p_stderr("display host:server.screen [dpi]\n");
p_stderr(" Connects to the specified X server.\n");
p_stderr(" Subsequent draw commands will write to server,\n");
p_stderr(" unless the draw to list is modified (see draw).\n");
p_stderr(" If specified, 40<=dpi<=200 (default 100).\n");
return 0;
}
token= strtok(0, " \t\n");
if (!token) {
p_stderr("gist: (SYNTAX) cgmoutput name missing in cgm command\n");
return 0;
}
server= token;
token= strtok(0, " \t\n");
if (token) {
char *suffix;
dpi= (int)strtol(token, &suffix, 0);
if (*suffix) {
p_stderr("gist: (SYNTAX) dpi unintelligble in display command\n");
return 0;
}
if (dpi<40 && dpi>200) {
p_stderr(
"gist: (SYNTAX) dpi not between 40 and 200 in display command\n");
return 0;
}
if (CheckEOL("display")) return 0;
} else {
dpi= 100;
}
device= FindDevice();
if (device>=8) return 0;
defDPI= defaultDPI;
defaultDPI= dpi;
CreateX(device, server);
defaultDPI= defDPI;
return 0;
}
开发者ID:mbentz80,项目名称:jzigbeercp,代码行数:49,代码来源:browser.c
示例10: MOZ_ASSERT
// nsIDNSServiceResolveListener
NS_IMETHODIMP
MulticastDNSDeviceProvider::OnServiceResolved(nsIDNSServiceInfo* aServiceInfo)
{
MOZ_ASSERT(NS_IsMainThread());
if (NS_WARN_IF(!aServiceInfo)) {
return NS_ERROR_INVALID_ARG;
}
nsresult rv;
nsAutoCString serviceName;
if (NS_WARN_IF(NS_FAILED(rv = aServiceInfo->GetServiceName(serviceName)))) {
return rv;
}
LOG_I("OnServiceResolved: %s", serviceName.get());
nsAutoCString host;
if (NS_WARN_IF(NS_FAILED(rv = aServiceInfo->GetHost(host)))) {
return rv;
}
uint16_t port;
if (NS_WARN_IF(NS_FAILED(rv = aServiceInfo->GetPort(&port)))) {
return rv;
}
nsAutoCString serviceType;
if (NS_WARN_IF(NS_FAILED(rv = aServiceInfo->GetServiceType(serviceType)))) {
return rv;
}
uint32_t index;
if (FindDevice(host, index)) {
return UpdateDevice(index,
serviceName,
serviceType,
host,
port);
} else {
return AddDevice(serviceName,
serviceType,
host,
port);
}
return NS_OK;
}
开发者ID:Jar-win,项目名称:Waterfox,代码行数:50,代码来源:MulticastDNSDeviceProvider.cpp
示例11: emuShutdown
bool emuShutdown(const CComBSTR& deviceIdentifier)
{
CComPtr<IDeviceEmulatorManagerVMID> pDevice = NULL;
BOOL bFound = FindDevice(deviceIdentifier, &pDevice);
if (bFound && pDevice){
HRESULT hr = pDevice->Shutdown(FALSE);
if (!SUCCEEDED(hr)) {
wprintf(L"Error: Operation Shutdown failed. Hr=0x%x\n", hr);
return false;
}
return true;
}
return false;
}
开发者ID:Aerodynamic,项目名称:rhodes,代码行数:15,代码来源:detool.cpp
示例12: IsWidcommDevice
bool
IsWidcommDevice(const TCHAR *name)
{
TCHAR key[64];
if (!FindDevice(name, key, 64))
return false;
RegistryKey registry(HKEY_LOCAL_MACHINE, key, true);
if (registry.error())
return false;
TCHAR dll[64];
return registry.get_value(_T("Dll"), dll, 64) &&
_tcscmp(dll, _T("btcedrivers.dll"));
}
开发者ID:aharrison24,项目名称:XCSoar,代码行数:15,代码来源:Widcomm.cpp
示例13: FindDevice
KSGDeviceNode* KSGDeviceManager::NewDevice(
int did,
int parentId,
const std::string& phyid,
NormalDeviceType devtype)
{
KSGDeviceNode* ret = FindDevice(did);
if(ret)
throw DeviceIdAlreadyExists();
KSGDevice* dev = FindDeviceType(devtype);
ret = _pool.construct<int,int,KSGDevice*>(did,parentId,dev);
ret->SetPhyId(phyid);
SaveDevice(ret);
return ret;
}
开发者ID:nykma,项目名称:ykt4sungard,代码行数:15,代码来源:device.cpp
示例14: ClearIncompleteWire
void Fl_Canvas::ClearConnections(Fl_DeviceGUI* Device)
{
bool removedall=false;
//make sure we don't leave a dangling incomplete wire this will cause errors/seg-faults
if (UserMakingConnection() && Device && ((Device->GetID() == m_IncompleteWire.OutputID) ||
(Device->GetID() == m_IncompleteWire.InputID)))
{
ClearIncompleteWire();
}
while (!removedall)
{
removedall=true;
for (vector<CanvasWire>::iterator i=m_WireVec.begin();
i!=m_WireVec.end(); i++)
{
if (i->OutputID==Device->GetID() ||
i->InputID==Device->GetID())
{
// Turn off both ports
FindDevice(i->OutputID)->RemoveConnection(i->OutputPort+FindDevice(i->OutputID)->GetInfo()->NumInputs);
FindDevice(i->InputID)->RemoveConnection(i->InputPort);
// send the unconnect callback
cb_Unconnect(this,(void*)&(*i));
m_Graph.RemoveConnection(i->OutputID,i->InputID);
m_WireVec.erase(i);
removedall=false;
break;
}
}
}
}
开发者ID:original-male,项目名称:spiralsynthmodular,代码行数:36,代码来源:Fl_Canvas.C
示例15: DownloadUpdate
bool DownloadUpdate()
{
bool result = false;
if(updateURL[0] == 0 || appPath[0] == 0 || !ChangeInterface(appPath, NOTSILENT))
{
ErrorPrompt("Update failed!");
updateFound = false; // updating is finished (successful or not!)
return false;
}
// stop checking if devices were removed/inserted
// since we're saving a file
HaltDeviceThread();
int device;
FindDevice(appPath, &device);
char updateFile[50];
sprintf(updateFile, "%s%s Update.zip", pathPrefix[device], APPNAME);
FILE * hfile = fopen (updateFile, "wb");
if (hfile)
{
if(http_request(updateURL, hfile, NULL, (1024*1024*10), NOTSILENT) > 0)
{
fclose (hfile);
result = unzipArchive(updateFile, (char *)pathPrefix[device]);
}
else
{
fclose (hfile);
}
remove(updateFile); // delete update file
}
// go back to checking if devices were inserted/removed
ResumeDeviceThread();
if(result)
InfoPrompt("Update successful!");
else
ErrorPrompt("Update failed!");
updateFound = false; // updating is finished (successful or not!)
return result;
}
开发者ID:CJB100,项目名称:fceugc,代码行数:48,代码来源:networkop.cpp
示例16: Selection
inline void Fl_Canvas::cb_OnDrag_i (Fl_Widget* widget, int xoffset, int yoffset) {
if ((widget) && (widget->parent())) {
int moved_device_id = ((Fl_DeviceGUI*)(widget->parent()))->GetID();
if (m_HaveSelection) {
if (m_Selection.m_DeviceIds.size() <= 0)
m_HaveSelection = false;
for (unsigned int i=0; i<m_Selection.m_DeviceIds.size(); i++) {
int ID = Selection().m_DeviceIds[i];
Fl_Widget *o = FindDevice(ID);
if ((o) && (m_Selection.m_DeviceIds[i] != moved_device_id)) {
o->position (o->x() + xoffset, o->y() + yoffset);
}
}
}
}
return;
}
开发者ID:original-male,项目名称:spiralsynthmodular,代码行数:17,代码来源:Fl_Canvas.C
示例17: switch
void C1WireByOWFS::SetLightState(const std::string& sId,int unit,bool value)
{
_t1WireDevice device;
if (!FindDevice(sId, device))
return;
switch(device.family)
{
case Addresable_Switch:
{
writeData(device,"PIO",value?"yes":"no");
break;
}
case dual_addressable_switch_plus_1k_memory:
case Temperature_IO:
case dual_channel_addressable_switch:
{
if (unit<0 || unit>1)
return;
writeData(device,std::string("PIO.").append(1,'A'+unit),value?"yes":"no");
break;
}
case _8_channel_addressable_switch:
{
if (unit<0 || unit>7)
return;
writeData(device,std::string("PIO.").append(1,'0'+unit),value?"yes":"no");
break;
}
case _4k_EEPROM_with_PIO:
{
if (unit<0 || unit>1)
return;
writeData(device,std::string("PIO.").append(1,'0'+unit),value?"yes":"no");
break;
}
case microlan_coupler:
{
// 1 = Unconditionally off (non-conducting), 2 = Unconditionally on (conducting)
writeData(device,"control",value?"2":"1");
break;
}
default:
return;
}
}
开发者ID:G3ronim0,项目名称:domoticz,代码行数:46,代码来源:1WireByOWFS.cpp
示例18: fatMount
bool fatMount (const char* name, const DISC_INTERFACE* interface, sec_t startSector, uint32_t cacheSize, uint32_t SectorsPerPage) {
PARTITION* partition;
devoptab_t* devops;
char* nameCopy;
if(!name || strlen(name) > 8 || !interface)
return false;
if(!interface->startup())
return false;
if(!interface->isInserted())
return false;
char devname[10];
strcpy(devname, name);
strcat(devname, ":");
if(FindDevice(devname) >= 0)
return true;
devops = _FAT_mem_allocate (sizeof(devoptab_t) + strlen(name) + 1);
if (!devops) {
return false;
}
// Use the space allocated at the end of the devoptab struct for storing the name
nameCopy = (char*)(devops+1);
// Initialize the file system
partition = _FAT_partition_constructor (interface, cacheSize, SectorsPerPage, startSector);
if (!partition) {
_FAT_mem_free (devops);
return false;
}
// Add an entry for this device to the devoptab table
memcpy (devops, &dotab_fat, sizeof(dotab_fat));
strcpy (nameCopy, name);
devops->name = nameCopy;
devops->deviceData = partition;
AddDevice (devops);
return true;
}
开发者ID:AdmiralCurtiss,项目名称:swiss-gc,代码行数:44,代码来源:libfat.c
示例19: Draw
static int Draw(int help)
{
int i, n;
char *token;
if (help) {
p_stderr("gist: draw command syntax:\n draw [page list]\n");
p_stderr(
" Copy the page(s) (default current page) from the current CGM input\n");
p_stderr(" to all display output devices.\n");
p_stderr(" By default, these are all X windows.\n");
p_stderr(" Use alternate syntax:\n draw to [device#1 ...]\n");
p_stderr(" to specify a particular list of devices to be used\n");
p_stderr(" by the draw command. Without any device numbers,\n");
p_stderr(" draw to restores the default list of devices.\n");
p_stderr(" (Use the info command to describe current device numbers.)\n");
p_stderr(" Page list syntax: group1 [group2 ...]\n");
p_stderr(" Page group syntax: n - just page n\n");
p_stderr(" m-n - pages n thru m\n");
p_stderr(" m-n-s - pages n thru m, step s\n");
return 0;
}
token= strtok(0, " \t\n");
if (token && strcmp(token, "to")==0) {
DrawSend(1, token);
return 0;
}
n= 0;
for (i=0 ; i<8 ; i++) {
if (!outDraw[i]) GpDeactivate(outEngines[i]);
if (outDraw[i] && !GpActivate(outEngines[i])) n++;
}
if (!n && (i= FindDevice())<8) {
if (!CreateX(i, 0) && !GpActivate(outEngines[i])) n++;
}
if (n) DrawSend(0, token);
else Warning("no devices active for draw command", "");
return 0;
}
开发者ID:mbentz80,项目名称:jzigbeercp,代码行数:43,代码来源:browser.c
示例20: BrowserLoadFile
/****************************************************************************
* BrowserLoadFile
*
* Loads the selected ROM
***************************************************************************/
int BrowserLoadFile()
{
int loaded = 0;
int device;
if(!FindDevice(browser.dir, &device))
return 0;
// check that this is a valid ROM
if(!IsValidROM())
goto done;
// store the filename (w/o ext) - used for sram/freeze naming
StripExt(Memory.ROMFilename, browserList[browser.selIndex].filename);
snprintf(GCSettings.LastFileLoaded, MAXPATHLEN, "%s", browserList[browser.selIndex].filename);
strncpy(Memory.ROMFilePath, browser.dir, PATH_MAX);
SNESROMSize = 0;
S9xDeleteCheats();
Memory.LoadROM("ROM");
if (SNESROMSize == 0)
{
ErrorPrompt("Error loading game!");
}
else if(bsxBiosLoadFailed) {
ErrorPrompt("BS-X BIOS file not found!");
}
else
{
// load SRAM or snapshot
if (GCSettings.AutoLoad == 1)
LoadSRAMAuto(SILENT);
else if (GCSettings.AutoLoad == 2)
LoadSnapshotAuto(SILENT);
ResetBrowser();
loaded = 1;
}
done:
CancelAction();
return loaded;
}
开发者ID:dborth,项目名称:snes9xgx,代码行数:48,代码来源:filebrowser.cpp
注:本文中的FindDevice函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论