static void param_options(int argc,char *argv[]) { int i; for (i = 1; i < argc; i++) #if __MSDOS__ || MSDOS || WIN32 || __WIN32__ if (*argv[i] == '-' || *argv[i] == '/') SetOptions(argv[i]); #else if (*argv[i] == '-') SetOptions(argv[i]); #endif else strcpy(source_name, argv[i]); }
void QueuedCountry::AddOptions(MapOptions opt) { for (MapOptions file : {MapOptions::Map, MapOptions::CarRouting}) { if (HasOptions(opt, file) && !HasOptions(m_init, file)) { m_init = SetOptions(m_init, file); m_left = SetOptions(m_left, file); } } }
void COptionBytesDialog_L1::OnApply() { // TODO: Add your control notification handler code here UpdateData(TRUE); BYTE User = _tcstoul(m_User_Value, 0, 16) ; BYTE RDP = _tcstoul(m_RDP_Value, 0, 16) ; SHORT WRP01 = _tcstoul(m_WRP0_Value, 0, 16) ; BYTE WRP0 = WRP01; BYTE WRP1= WRP01>>8; SHORT WRP23 = _tcstoul(m_WRP2_Value, 0, 16) ; BYTE WRP2 = WRP23; BYTE WRP3= WRP23>>8; SHORT WRP45 = _tcstoul(m_WRP4_Value, 0, 16) ; BYTE WRP4 = WRP45; BYTE WRP5= WRP45>>8; SHORT WRP67 = _tcstoul(m_WRP6_Value, 0, 16) ; BYTE WRP6 = WRP67; BYTE WRP7= WRP67>>8; SHORT WRP89 = _tcstoul(m_WRP8_Value, 0, 16) ; BYTE WRP8 = WRP89; BYTE WRP9= WRP89>>8; SHORT WRP1011 = _tcstoul(m_WRP10_Value, 0, 16) ; BYTE WRP10 = WRP1011; BYTE WRP11= WRP1011>>8; UpdateData(FALSE); SetOptions(User, RDP, WRP0, WRP1 ,WRP2, WRP3 , WRP4, WRP5 , WRP6, WRP7 ,WRP8, WRP9 ,WRP10, WRP11 ); STDFU_Close(&m_phDevice); CDialog::OnOK(); }
Text::Text(std::string text, Font::ID font, int wrapping, SDL_Color color, unsigned char options) : Sprite() , text(text) , typewriterText(text) , font(Fonts->Get(font)) , color(color) , surface(nullptr) , options(0) , fadeInTimer(0) , fadeInSpeed(0.01f) , fadeOutTimer(0) , fadeOutSpeed(0.01f) , fadeOutDelay(2.f) , flashingTimer(0) , flashingSpeed(25/255.f) , typewriterTimer(0) , typewriterSpeed(0.15f) , wrapping(wrapping) { scaling = 1; srcRect = new SDL_Rect(); srcRect->x = 0; srcRect->y = 0; dstRect = new SDL_Rect(); dstRect->x = 0; dstRect->y = 0; SetOptions(options); isDirty = true; }
//____________________________________________________________ SocketStatus TTCPSocket::Open () { Close(); SOCKET ret = socket (AF_INET, SOCK_STREAM, 0); if (ret == INVALID_SOCKET) return WSAGetLastError (); fRef = ret; return SetOptions (); }
void CSymbolEngine::AddOptions( DWORD Options ) { DWORD CurOptions = GetOptions(); CurOptions |= Options; SetOptions( CurOptions ); }
NAMESPACE_UPP RegExp::RegExp(int options) { Clear(); SetOptions(options); }
// The init procedure is executed once when the REXLANG function block initializes. long init(void) { spi_bus_handle = OpenSPI(spi_dev); // open SPI device // SPI data modes: // SPI_MODE0 = 0, // CPOL = 0, CPHA = 0, Clock idle low, data is clocked in on rising edge, output data (change) on falling edge // SPI_MODE1 = 1, // CPOL = 0, CPHA = 1, Clock idle low, data is clocked in on falling edge, output data (change) on rising edge // SPI_MODE2 = 2, // CPOL = 1, CPHA = 0, Clock idle high, data is clocked in on falling edge, output data (change) on rising edge // SPI_MODE3 = 3, // CPOL = 1, CPHA = 1, Clock idle high, data is clocked in on rising, edge output data (change) on falling edge spi_bufTx[0] = 0; //SPI data mode (0-3 mode, | 4=CS_HIGH | 8=LSB_FIRST | 16=3WIRE | 32=LOOP | 64=NO_CS | 128=READY) spi_bufTx[1] = 8; //bits per word spi_bufTx[2] = 1000000; //clock frequency [Hz] SetOptions(spi_bus_handle, spi_bufTx); // Verification of SPI bus settings GetOptions(spi_bus_handle, spi_bufRx); Trace(0, spi_bufRx[0]); // SPI mode Trace(1, spi_bufRx[1]); // bits per word Trace(2, spi_bufRx[2]); // clock frequency // Addressing the device spi_opcode_write = 0x40; // ( 0 | 1 | 0 | 0 | A2 | A1 | A0 | R/W ), write=0 spi_opcode_read = 0x41; // ( 0 | 1 | 0 | 0 | A2 | A1 | A0 | R/W ), read=1 // !!!!!!!!!!!!! // By default, IOCON.BANK=0, therefore see Table 1-6 in the datasheet for register mapping // // Table 1-5, which confusingly appears sooner in the datasheet, displays register addresses // for IOCON.BANK=1, which are significantly different // !!!!!!!!!!!!! //Setting PORTA to output spi_bufTx[0] = spi_opcode_write; spi_bufTx[1] = 0x00; //register no. (IODIRA) spi_bufTx[2] = 0x00; //IODIRA data, bitmask, 0=output, 1=input spi_write_count = 3; spi_read_count = 0; spi_ret_fun = SPI(spi_bus_handle, 0, spi_bufTx, spi_write_count, spi_bufRx, spi_read_count); //Setting PORTB to input spi_bufTx[0] = spi_opcode_write; spi_bufTx[1] = 0x01; //register no. (IODIRB) spi_bufTx[2] = 0xFF; //IODIRB data, bitmask, 0=output, 1=input spi_write_count = 3; spi_read_count = 0; spi_ret_fun = SPI(spi_bus_handle, 0, spi_bufTx, spi_write_count, spi_bufRx, spi_read_count); //Enabling pull-up resistors on PORTB spi_bufTx[0] = spi_opcode_write; spi_bufTx[1] = 0x0D; //register no. (GPPUB) spi_bufTx[2] = 0xFF; //GPPUB data, bitmask, 0=no pull-up, 1=pull-up enabled spi_write_count = 3; spi_read_count = 0; spi_ret_fun = SPI(spi_bus_handle, 0, spi_bufTx, spi_write_count, spi_bufRx, spi_read_count); return 0; }
void Bert::Start(bool direction) { m_board.isDevicePresent(); m_isTesting = true; m_direction = direction; SetOptions(); StartRxBertTest(); StartTxBertTest(); m_bertErrors = 0; }
void CTreemap::DrawTreemap(CDC *pdc, CRect rc, Item *root, const Options *options) { RecurseCheckTree(root); if (options != NULL) SetOptions(options); if (rc.Width() <= 0 || rc.Height() <= 0) return; if (m_options.grid) { pdc->FillSolidRect(rc, m_options.gridColor); } else { // We shrink the rectangle here, too. // If we didn't do this, the layout of the treemap would // change, when grid is switched on and off. CPen pen(PS_SOLID, 1, GetSysColor(COLOR_3DSHADOW)); CSelectObject sopen(pdc, &pen); pdc->MoveTo(rc.right - 1, rc.top); pdc->LineTo(rc.right - 1, rc.bottom); pdc->MoveTo(rc.left, rc.bottom - 1); pdc->LineTo(rc.right, rc.bottom - 1); } rc.right--; rc.bottom--; if (rc.Width() <= 0 || rc.Height() <= 0) return; if (root->TmiGetSize() > 0) { double surface[4]; for (int i=0; i < 4; i++) surface[i]= 0; RecurseDrawGraph(pdc, root, rc, true, surface, m_options.height, 0); #ifdef STRONGDEBUG // slow, but finds bugs! #ifdef _DEBUG for (int x=rc.left; x < rc.right - m_options.grid; x++) for (int y=rc.top; y < rc.bottom - m_options.grid; y++) ASSERT(FindItemByPoint(root, CPoint(x, y)) != NULL); #endif #endif } else { pdc->FillSolidRect(rc, RGB(0,0,0)); } }
void FFMS_AudioSource::SetOutputFormat(const FFMS_ResampleOptions *opt) { if (!Cache.empty()) throw FFMS_Exception(FFMS_ERROR_RESAMPLING, FFMS_ERROR_USER, "Cannot change the output format after audio decoding has begun"); if (opt->SampleRate != AP.SampleRate) throw FFMS_Exception(FFMS_ERROR_RESAMPLING, FFMS_ERROR_UNSUPPORTED, "Sample rate changes are currently unsupported."); #ifndef WITH_AVRESAMPLE if (opt->SampleFormat != AP.SampleFormat || opt->SampleRate != AP.SampleRate || opt->ChannelLayout != AP.ChannelLayout) throw FFMS_Exception(FFMS_ERROR_RESAMPLING, FFMS_ERROR_UNSUPPORTED, "FFMS was not built with resampling enabled. The only supported conversion is interleaving planar audio."); #endif BytesPerSample = av_get_bytes_per_sample(static_cast<AVSampleFormat>(opt->SampleFormat)) * av_get_channel_layout_nb_channels(opt->ChannelLayout); NeedsResample = opt->SampleFormat != (int)CodecContext->sample_fmt || opt->SampleRate != AP.SampleRate || opt->ChannelLayout != AP.ChannelLayout || opt->ForceResample; #ifdef WITH_AVRESAMPLE if (!NeedsResample) return; std::auto_ptr<FFMS_ResampleOptions> oldOptions(ReadOptions(ResampleContext, resample_options)); SetOptions(opt, ResampleContext, resample_options); av_opt_set_int(ResampleContext, "in_sample_rate", AP.SampleRate, 0); av_opt_set_int(ResampleContext, "in_sample_fmt", CodecContext->sample_fmt, 0); av_opt_set_int(ResampleContext, "in_channel_layout", AP.ChannelLayout, 0); if (avresample_open(ResampleContext)) { SetOptions(oldOptions.get(), ResampleContext, resample_options); if (avresample_open(ResampleContext) < 0) throw FFMS_Exception(FFMS_ERROR_RESAMPLING, FFMS_ERROR_UNKNOWN, "Could not re-open old avresample context"); else throw FFMS_Exception(FFMS_ERROR_RESAMPLING, FFMS_ERROR_UNKNOWN, "Could not open avresample context"); } #endif }
void ImagemapDlg::OnCreate() { //Set up the controls from our ImagemapFilterOptions member variables SetOptions(ms_Options); //Set up our internal member variables SetMemberVariables(ms_Options); //And put the keyboard focus in the Map Name field SetKeyboardFocus(_R(IDC_IMAGEMAP_MAPNAME)); }
int main(int argc, char *argv[]) { int w,h; Rect gb; HNN=MakeHashTable(); HEL=MakeHashTable(); HLI=MakeHashTable(); HVC=MakeHashTable(); CM=MakeQueueTable(); SetOptions(argc,argv); ReadFiles(argc,argv); CheckNodes(HNN,HEL,HLI,HVC); if( OpCheck ) CheckMore(HNN,HEL,HLI); InitMinMax(&gb); GetNodeMinMax(HNN,&gb); GetNodeMinMax(HVC,&gb); SetMinMax(&gb); printf("Min/Max values : %f %f %f %f\n", gb.low.x,gb.low.y,gb.high.x,gb.high.y); printf("Center values : %f %f \n", (gb.low.x+gb.high.x)/2.,(gb.low.y+gb.high.y)/2.); GbAll = GbPlo = gb; QGraphInit(); QNewPen(PlotCol); SetColors(OpCol); QWindowMaxXY(&w,&h); ResizeWindow(w,h); ScaleFactor(HVC); MakeGridMenu(); /* MouseInit(); */ QInitEvent(); LoopForInput(); QGraphClose(); WriteFiles(); return 0; }
MoreForm :: MoreForm(UserInfo *data) : wFormWindow(D_MOREPOPUP, 3, 0, DlgModal) { AddField( new wEditField(FtString, 32, E_NAME, &data->name, NULL, FsRequired) ); AddField( new wEditField(FtString, 32, E_COMPANY, &data->company) ); AddField( new wEditField(FtString, 20, E_PHONE, &data->phone) ); ip = data; SetOptions(FmEnterExit); SetMessageWindow(T_MESSAGES); SetActionButtons(DID_CANCEL, DID_OK, DID_HELP); }
void xrSASH::LoopOA() { oaCommand Command; bool bExit = false; while (!bExit) { // It must be called on the oaCommand object sent to // oaGetNextCommand() before each call to oaGetNextCommand(). oaInitCommand(&Command); switch(oaGetNextCommand(&Command)) { /* No more commands, exit program */ case OA_CMD_EXIT: Msg("SASH:: Exit."); bExit = true; break; /* Run as normal */ case OA_CMD_RUN: //RunApp(); //Msg("SASH:: GetCurrentOptions."); bExit = true; break; /* Enumerate all in-game options */ case OA_CMD_GET_ALL_OPTIONS: GetAllOptions(); break; /* Return the option values currently set */ case OA_CMD_GET_CURRENT_OPTIONS: GetCurrentOptions(); break; /* Set all in-game options */ case OA_CMD_SET_OPTIONS: SetOptions(); break; /* Enumerate all known benchmarks */ case OA_CMD_GET_BENCHMARKS: GetBenchmarks(); break; /* Run benchmark */ case OA_CMD_RUN_BENCHMARK: RunBenchmark(Command.BenchmarkName); break; } } }
//创建消息 INT CSkinRichEdit::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (__super::OnCreate(lpCreateStruct)==-1) return -1; //初始化控件 SetEventMask(ENM_LINK); SetOptions(ECOOP_OR,ECO_NOHIDESEL); //获取接口 m_pIRichEditOle=GetIRichEditOle(); return 0; }
//控件绑定 VOID CSkinRichEdit::PreSubclassWindow() { __super::PreSubclassWindow(); //初始化控件 SetEventMask(ENM_LINK); SetOptions(ECOOP_OR,ECO_NOHIDESEL); //获取接口 m_pIRichEditOle=GetIRichEditOle(); return; }
void FFMS_AudioSource::SetOutputFormat(FFMS_ResampleOptions const& opt) { if (opt.SampleRate != AP.SampleRate) throw FFMS_Exception(FFMS_ERROR_RESAMPLING, FFMS_ERROR_UNSUPPORTED, "Sample rate changes are currently unsupported."); #ifndef FFMS_RESAMPLING_ENABLED if (opt.SampleFormat != AP.SampleFormat || opt.SampleRate != AP.SampleRate || opt.ChannelLayout != AP.ChannelLayout) throw FFMS_Exception(FFMS_ERROR_RESAMPLING, FFMS_ERROR_UNSUPPORTED, "FFMS was not built with resampling enabled. The only supported conversion is interleaving planar audio."); #endif #ifdef WITH_AVRESAMPLE if (opt.SampleFormat != AP.SampleFormat || opt.ChannelLayout != AP.ChannelLayout) throw FFMS_Exception(FFMS_ERROR_RESAMPLING, FFMS_ERROR_UNSUPPORTED, "FFMS was not built with FFMPEG resampling enabled."); #endif // Cache stores audio in the output format, so clear it and reopen the file Cache.clear(); PacketNumber = 0; ReopenFile(); FlushBuffers(CodecContext); BytesPerSample = av_get_bytes_per_sample(static_cast<AVSampleFormat>(opt.SampleFormat)) * av_get_channel_layout_nb_channels(opt.ChannelLayout); NeedsResample = opt.SampleFormat != (int)CodecContext->sample_fmt || opt.SampleRate != AP.SampleRate || opt.ChannelLayout != AP.ChannelLayout || opt.ForceResample; #ifdef FFMS_RESAMPLING_ENABLED if (!NeedsResample) return; FFResampleContext newContext; SetOptions(opt, newContext, resample_options); av_opt_set_int(newContext, "in_sample_rate", AP.SampleRate, 0); av_opt_set_int(newContext, "in_sample_fmt", CodecContext->sample_fmt, 0); av_opt_set_int(newContext, "in_channel_layout", AP.ChannelLayout, 0); av_opt_set_int(newContext, "out_sample_rate", opt.SampleRate, 0); #ifdef WITH_SWRESAMPLE av_opt_set_channel_layout(newContext, "out_channel_layout", opt.ChannelLayout, 0); av_opt_set_sample_fmt(newContext, "out_sample_fmt", (AVSampleFormat)opt.SampleFormat, 0); #endif if (ffms_open(newContext)) throw FFMS_Exception(FFMS_ERROR_RESAMPLING, FFMS_ERROR_UNKNOWN, "Could not open avresample context"); newContext.swap(ResampleContext); #endif }
RecConditionForm :: RecConditionForm() : wFormWindow(D_ADDCONDITION, 4, 0), argument(NULL, 80) { wRadioButtonField *fp = new wRadioButtonField(R_ERROR, 2, &type); AddField(fp); fp->SetFieldClickFn( FORMMETHOD(RecConditionForm, ProcTypeSelect) ); AddField( new wRadioButtonField(R_THREAD1, 3, &thread) ); AddField( new wComboField(FtString, 32, E_CONDITION, &condString, NULL, FsRequired) ); AddField( new wEditField(FtMLString, 80, E_ARG, &argument, NULL) ); SetOptions(FmEnterExit); SetActionButtons(B_CANCEL, B_OK, B_HELP); }
WordApplicationOptionsHelper::WordApplicationOptionsHelper(Word::_ApplicationPtr spWordApplication) : m_spWordApplication(spWordApplication), m_spOptions(0), m_bCanQuit(false) { if(m_spWordApplication == 0) { HRESULT hr = m_spWordApplication.CreateInstance("Word.Application"); if(FAILED(hr)) throw _com_error(hr); spWordApplication = m_spWordApplication; m_bCanQuit = true; } SetOptions(); }
LRESULT CScriptEditView::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& ) { LRESULT lRet = DefWindowProc( uMsg, wParam, lParam ); if( lRet != -1 ) { m_font = AtlGetDefaultGuiFont(); SetFont( m_font ); SetOptions( ECOOP_OR, ECO_SELECTIONBAR ); SetTabStopWidth(); SetEventMask( GetEventMask() | ENM_CHANGE ); SetModify( FALSE ); } return lRet; }
static int AmpOpen() { char *cp; cp = GetRouteName(GetFile("AmpDevice")); if ((cp == NULL) || (*cp == '.')) cp = DEFAULT_AMP_DEVICE; fprintf(stderr,"libamp:Opening:AmpDevice:%s",cp); if ((amp = open(cp,O_RDWR|O_SYNC|O_NDELAY,0)) > 0) { if (SetOptions(19200,8,"None","1",0,0) > 0) return amp; if (close(amp) != 0) perror("close"); } amp = 0; return amp; }
//控件绑定 VOID CRichEditMessage::PreSubclassWindow() { __super::PreSubclassWindow(); //设置滚动 m_SkinScrollBar.InitScroolBar(this); //设置颜色 SetBackgroundColor(FALSE,RGB(255,255,255)); //设置控件 SetEventMask(ENM_LINK); SetAutoURLDetect(FALSE); SetOptions(ECOOP_OR,ECO_AUTOWORDSELECTION); return; }
static PyObject * decodeFile(PyObject *self, PyObject *args) { char *pFileName; int option_iMaxBarcodesNumPerPage = -1; int option_llBarcodeFormat = -1; if (!PyArg_ParseTuple(args, "s", &pFileName)) { return NULL; } pBarcodeResultArray pResults = NULL; ReaderOptions option; SetOptions(&option, option_iMaxBarcodesNumPerPage, option_llBarcodeFormat); int ret = DBR_DecodeFile( pFileName, &option, &pResults ); if (ret == DBR_OK){ int count = pResults->iBarcodeCount; pBarcodeResult* ppBarcodes = pResults->ppBarcodes; pBarcodeResult tmp = NULL; PyObject* list = PyList_New(count); PyObject* result = NULL; for (int i = 0; i < count; i++) { tmp = ppBarcodes[i]; result = PyString_FromString(tmp->pBarcodeData); PyList_SetItem(list, i, Py_BuildValue("iN", (int)tmp->llFormat, result)); } // release memory DBR_FreeBarcodeResults(&pResults); return list; } return Py_None; }
WXCJob::WXCJob (const wxString& strOriginalLine, long lLine, const wxArrayString& arrOptions) : lLine_(lLine), pTimer_(NULL), strOriginalLine_(strOriginalLine), time_(strOriginalLine), bOption_nocatchup_(false), bOption_hide_(false) { // the command strCommand_ = time_.GetUnparsed(); strCommand_.Trim(true); strCommand_.Trim(false); // options SetOptions(arrOptions); }
void COptionBytesDialog_F2::OnApply() { // TODO: Add your control notification handler code here UpdateData(TRUE); BYTE User = _tcstoul(m_User_Value, 0, 16) ; BYTE RDP = _tcstoul(m_RDP_Value, 0, 16) ; SHORT WRP = _tcstoul(m_WRP_Value, 0, 16) ; BYTE WRP0 = WRP; BYTE WRP1= WRP>>8; UpdateData(FALSE); SetOptions(User, RDP, WRP0, WRP1 ); STDFU_Close(&m_phDevice); CDialog::OnOK(); }
void tcFxjFileImportSource::ShowSettingDialog(QWidget *pParent) { tcFxjFileImportSourceOption option; GetOptions(option); tcFxjFileImportSourceDialog dlg(pParent); if (! dlg.SetSettings(option)) { tcLogService::CreateLog(this, "Error when set dialog settings."); return; } if (dlg.exec() != QDialog::Accepted) { return; } if (! dlg.GetSettings(option)) { tcLogService::CreateLog(this, "Error when get dialog settings."); return; } SetOptions(option); }
boolean CConsole::Initialize (void) { CUSBKeyboardDevice *pKeyboard = (CUSBKeyboardDevice *) CDeviceNameService::Get ()->GetDevice ("ukbd1", FALSE); if (pKeyboard != 0) { assert (m_pOutputDevice == 0); m_pOutputDevice = CDeviceNameService::Get ()->GetDevice ("tty1", FALSE); if (m_pOutputDevice != 0) { assert (m_pInputDevice == 0); m_pInputDevice = new CKeyboardBuffer (pKeyboard); assert (m_pInputDevice != 0); } } if ( m_pInputDevice == 0 || m_pOutputDevice == 0) { if (m_pAlternateDevice == 0) { CLogger::Get ()->Write ("console", LogError, "Keyboard or screen is not available"); return FALSE; } m_pInputDevice = m_pAlternateDevice; m_pOutputDevice = m_pAlternateDevice; m_bAlternateDeviceUsed = TRUE; } assert (m_pLineDiscipline == 0); m_pLineDiscipline = new CLineDiscipline (m_pInputDevice, m_pOutputDevice); assert (m_pLineDiscipline != 0); SetOptions (m_nOptions); CDeviceNameService::Get ()->AddDevice ("console", this, FALSE); return TRUE; }
void CTreemap::DrawColorPreview(CDC *pdc, const CRect& rc, COLORREF color, const Options *options) { if (options != NULL) SetOptions(options); double surface[4]; for (int i=0; i < 4; i++) surface[i]= 0; AddRidge(rc, surface, m_options.height * m_options.scaleFactor); RenderRectangle(pdc, rc, surface, color); if (m_options.grid) { CPen pen(PS_SOLID, 1, m_options.gridColor); CSelectObject sopen(pdc, &pen); CSelectStockObject sobrush(pdc, NULL_BRUSH); pdc->Rectangle(rc); } }
void wxSheetValueProviderBase::Copy(const wxSheetValueProviderBase& other) { Clear(); const int numRows = other.GetNumberRows(); const int numCols = other.GetNumberCols(); SetOptions(other.GetOptions()); UpdateRows(0, numRows); UpdateCols(0, numCols); wxSheetCoords c; bool allow_empty = HasOption(wxSHEET_ValueProviderAllowEmpty); for (c.m_row = 0; c.m_row < numRows; c.m_row++) { for (c.m_col = 0; c.m_col < numCols; c.m_col++) { wxString val(other.GetValue(c)); if (allow_empty || !val.IsEmpty()) SetValue(c, val); } } }