本文整理汇总了C++中SetConfig函数的典型用法代码示例。如果您正苦于以下问题:C++ SetConfig函数的具体用法?C++ SetConfig怎么用?C++ SetConfig使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetConfig函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GameConfigKeys
void GameConfigKeys (unsigned int key, bool special, bool release, int x, int y) {
if (release) return;
switch (key) {
case SDLK_q: Winsys.Quit (); break;
case 27: Winsys.SetMode (g_game.prev_mode); break;
case SDLK_TAB: if (curr_focus < 7) curr_focus++; else curr_focus = 0; break;
case 13:
switch (curr_focus) {
case 6: Winsys.SetMode (g_game.prev_mode); break;
case 7: SetConfig (); break;
default: SetConfig (); break;
} break;
case 276:
switch (curr_focus) {
case 0: ToggleFullscreen (); break;
case 1: ChangeRes (-1); break;
case 2: ChangeMusVol (-1); break;
case 3: ChangeSoundVol (-1); break;
case 4: ChangeDetail (-1); break;
case 5: ChangeLanguage (-1); break;
} break;
case 275:
switch (curr_focus) {
case 0: ToggleFullscreen (); break;
case 1: ChangeRes (1); break;
case 2: ChangeMusVol (1); break;
case 3: ChangeSoundVol (1); break;
case 4: ChangeDetail (1); break;
case 5: ChangeLanguage (1); break;
} break;
case 273: if (curr_focus > 0) curr_focus--; break;
case 274: if (curr_focus < 7) curr_focus++; break;
}
}
示例2: SetConfig
void PlayerDriver::setLooping( int isLooping )
{
m_bIsLooping = isLooping;
if (m_bIsLooping)
{
SetConfig("FinishMode", FINISH_RESTART_TO_PREFETCH);
SetConfig("LoopingInCurrentTrack", TRUE);
}
}
示例3: SetConfig
void CommManager::DisconnectedNotify()
{
#ifdef _DEBUG
SetConfig(1000 * 30, 1000 * 30);
#else
SetConfig(1000 * 60 * 30, g_ConfigInfo.nTryConnectIntervalM * 60 * 1000);
#endif
::InterlockedExchange(&m_bConnected, FALSE);
debugLog(_T("DISCONNECTED"));
}
示例4: SetConfig
// Return false if the serial configuration is not valid for the host.
bool
CeCosTestSerialFilter::VerifyConfig(CeCosSerial &pSer, ser_cfg_t* new_cfg)
{
ser_cfg_t old_cfg;
bool rc;
// Try changing to the new config, recording the result. Then restore
// the original config.
rc = SetConfig(pSer, new_cfg, &old_cfg);
SetConfig(pSer, &old_cfg, NULL);
return rc;
}
示例5: SetConfig
void plDynamicTextMap::Create( uint32_t width, uint32_t height, bool hasAlpha, uint32_t extraWidth, uint32_t extraHeight )
{
SetConfig( hasAlpha ? kARGB32Config : kRGB32Config );
fVisWidth = (uint16_t)width;
fVisHeight = (uint16_t)height;
fHasAlpha = hasAlpha;
for( fWidth = 1; fWidth < width + extraWidth; fWidth <<= 1 );
for( fHeight = 1; fHeight < height + extraHeight; fHeight <<= 1 );
// instead of allocating the fImage here, we'll wait for the first draw operation to be called (in IIsValid)
fHasCreateBeenCalled = true;
fRowBytes = fWidth << 2;
fNumLevels = 1;
fFlags |= plMipmap::kDontThrowAwayImage | plMipmap::kAutoGenMipmap;
fCompressionType = plMipmap::kUncompressed;
fUncompressedInfo.fType = plMipmap::UncompressedInfo::kRGB8888;
// Destroy the old texture ref, if we have one. This should force the
// pipeline to recreate one more suitable for our use
SetDeviceRef( nil );
// Some init color
SetFont( "Arial", 12 );
hsColorRGBA color;
color.Set( 0,0,1,1);
SetTextColor( color );
SetCurrLevel( 0 );
plProfile_Inc(DynaTexts);
}
示例6: KeyGUI
void CGameConfig::Keyb (unsigned int key, bool special, bool release, int x, int y) {
if (release) return;
if (key != SDLK_UP && key != SDLK_DOWN)
KeyGUI(key, 0, release);
switch (key) {
case SDLK_q:
State::manager.RequestQuit();
break;
case SDLK_ESCAPE:
State::manager.RequestEnterState (*State::manager.PreviousState());
break;
case SDLK_RETURN:
if (textbuttons[0]->focussed())
State::manager.RequestEnterState (*State::manager.PreviousState());
else if (textbuttons[1]->focussed())
SetConfig ();
break;
case SDLK_UP:
DecreaseFocus();
break;
case SDLK_DOWN:
IncreaseFocus();
break;
}
}
示例7: Lock
bool OMXClock::Stop(bool lock)
{
if (!GetComponent())
return false;
if (lock)
Lock();
OMX_ERRORTYPE omxErr = OMX_ErrorNone;
OMX_TIME_CONFIG_CLOCKSTATETYPE clock;
OMX_INIT_STRUCTURE(clock);
clock.eState = OMX_TIME_ClockStateStopped;
clock.nOffset = ToOMXTime(-1000LL * OMX_PRE_ROLL);
omxErr = SetConfig(OMX_IndexConfigTimeClockState, &clock);
if (omxErr != OMX_ErrorNone)
{
if (lock)
Unlock();
return false;
}
m_eState = clock.eState;
m_lastMediaTime = 0.0f;
if (lock)
Unlock();
return true;
}
示例8: SetConfig
bool
FlarmDevice::SetRange(unsigned range, OperationEnvironment &env)
{
NarrowString<32> buffer;
buffer.Format("%d", range);
return SetConfig("RANGE", buffer, env);
}
示例9: ConvertMarkersToTempoDialog
/******************************************************************************
* Dialogs *
******************************************************************************/
void ConvertMarkersToTempoDialog (COMMAND_T* = NULL)
{
static HWND hwnd = CreateDialog(g_hInst, MAKEINTRESOURCE(IDD_BR_MARKERS_TO_TEMPO), g_hwndParent, ConvertMarkersToTempoProc);
if (g_convertMarkersToTempoDialog)
{
KillTimer(hwnd, 1);
ShowWindow(hwnd, SW_HIDE);
g_convertMarkersToTempoDialog = false;
}
else
{
// Detect timebase
bool cancel = false;
int timebase; GetConfig("itemtimelock", timebase);
if (timebase)
{
int answer = MessageBox(g_hwndParent, __LOCALIZE("Project timebase is not set to time. Do you want to set it now?","sws_DLG_166"), __LOCALIZE("SWS - Warning","sws_mbox"), MB_YESNOCANCEL);
if (answer == 6)
SetConfig("itemtimelock", 0);
if (answer == 2)
cancel = true;
}
if (!cancel)
{
SetTimer(hwnd, 1, 100, NULL);
ShowWindow(hwnd, SW_SHOW);
SetFocus(hwnd);
g_convertMarkersToTempoDialog = true;
}
}
RefreshToolbar(SWSGetCommandID(ConvertMarkersToTempoDialog));
}
示例10: SetConfig
void CapstoneTokenizer::UpdateConfig()
{
SetConfig(ConfigBool("Disassembler", "Uppercase"),
ConfigBool("Disassembler", "TabbedMnemonic"),
ConfigBool("Disassembler", "ArgumentSpaces"),
ConfigBool("Disassembler", "MemorySpaces"));
}
示例11: scfInit
void scfInit(BYTE delay) {
BYTE i;
//If delay = 0, return!
if (delay == 0) return;
//Clear Screen
serPutRomString(AnsiEscClearScreen);
/*
* Wait a couple of seconds for user input.
* - If something is detected, start config.
* - If nothing detected, start main program.
*/
serPutRomString(PressKeyForConfig);
for (i = delay; i > 0; --i) //Delay for 50mS x 60 = 3 sec
{
if ((i % 8) == 0) serPutByte('.');
if (serIsGetReady())
{
SetConfig();
break;
}
DelayMs(50);
}
serPutByte('\r');
serPutByte('\n');
}
示例12: switch
/**
Process synchronous 'control' requests
*/
TInt DZeroCopyLoopbackChannel::DoControl(TInt aFunction, TAny* a1, TAny* a2)
{
(void)a2; // a2 not used in this example
TInt r;
switch (aFunction)
{
case RZeroCopyLoopbackDriver::EGetConfig:
r = GetConfig((TDes8*)a1);
break;
case RZeroCopyLoopbackDriver::ESetConfig:
r = SetConfig((const TDesC8*)a1);
break;
case RZeroCopyLoopbackDriver::ELoadPond:
r = LoadPond((TPondTransferBuf*)a1);
break;
case RZeroCopyLoopbackDriver::EUnloadPond:
r = UnloadPond();
break;
default:
r = KErrNotSupported;
break;
}
return r;
}
示例13: SetConfig
bool
FlarmDevice::SetRange(unsigned range)
{
StaticString<32> buffer;
buffer.Format(_T("%d"), range);
return SetConfig("RANGE", buffer);
}
示例14: switch
TInt DExampleChannel::DoControl(TInt aFunction,TAny* a1,TAny* /*a2*/)
{
TInt r = KErrNone;
switch (aFunction)
{
case RPagingExample::ESetRealtimeState:
iDynamicDfcQ->SetRealtimeState(a1 ? ERealtimeStateOn : ERealtimeStateWarn);
break;
case RPagingExample::EGetConfig:
r = Kern::ThreadRawWrite(iClient, a1, (TAny*)&iConfig, sizeof(TConfigData), iClient);
break;
case RPagingExample::ESetConfig:
{
TConfigData newConfig;
r = Kern::ThreadRawRead(iClient, a1, &newConfig, sizeof(TConfigData));
if (r == KErrNone)
SetConfig(newConfig);
}
break;
default:
r = KErrNotSupported;
}
return r;
}
示例15: SetConfig
NPT_Result HttpConnector::start()
{
if (m_started) {
return NPT_ERROR_INVALID_STATE;
}
NPT_Result nr;
Config cfg;
cfg.m_ListenAddress = m_ifAddr;
cfg.m_ListenPort = 0;
cfg.m_IoTimeout = NPT_HTTP_SERVER_DEFAULT_IO_TIMEOUT;
cfg.m_ConnectionTimeout = NPT_HTTP_SERVER_DEFAULT_CONNECTION_TIMEOUT;
nr = SetConfig(cfg);
if (NPT_FAILED(nr)) {
return nr;
}
m_abortFlag = false;
nr = NPT_Thread::Start();
if (NPT_FAILED(nr)) {
return nr;
}
m_started = true;
return NPT_SUCCESS;
}