int DIA_getLameSettings(ADM_audioEncoderDescriptor *descriptor) { int ret=0; char string[400]; uint32_t mmode,ppreset; #define SZT(x) sizeof(x)/sizeof(diaMenuEntry ) #define PX(x) &(lameParam->x) LAME_encoderParam *lameParam; ADM_assert(sizeof(LAME_encoderParam)==descriptor->paramSize); lameParam=(LAME_encoderParam*)descriptor->param; mmode=lameParam->mode; ppreset=lameParam->preset; diaMenuEntry channelMode[]={ {ADM_STEREO, QT_TR_NOOP("Stereo"),NULL}, {ADM_JSTEREO, QT_TR_NOOP("Joint stereo"),NULL}, {ADM_MONO, QT_TR_NOOP("Mono"),NULL}}; diaElemMenu menuMode(&mmode, QT_TR_NOOP("C_hannel mode:"), SZT(channelMode),channelMode); diaMenuEntry encodingMode[]={ {ADM_LAME_PRESET_CBR, QT_TR_NOOP("CBR"),NULL}, {ADM_LAME_PRESET_ABR, QT_TR_NOOP("ABR"),NULL}, #if 0 {ADM_LAME_PRESET_EXTREME, QT_TR_NOOP("Extreme"),NULL} #endif }; diaElemMenu Mode(&ppreset, QT_TR_NOOP("Bit_rate mode:"), SZT(encodingMode),encodingMode); #define BITRATE(x) {x,QT_TR_NOOP(#x)} diaMenuEntry bitrateM[]={ BITRATE(56), BITRATE(64), BITRATE(80), BITRATE(96), BITRATE(112), BITRATE(128), BITRATE(160), BITRATE(192), BITRATE(224) }; diaElemMenu bitrate(&(descriptor->bitrate), QT_TR_NOOP("_Bitrate:"), SZT(bitrateM),bitrateM); diaElemUInteger quality(PX(quality),QT_TR_NOOP("_Quality:"),0,9); diaElemToggle reservoir(PX(disableReservoir),QT_TR_NOOP("_Disable reservoir:")); diaElem *elems[]={&menuMode,&Mode,&quality,&bitrate,&reservoir}; if( diaFactoryRun(QT_TR_NOOP("LAME Configuration"),5,elems)) { lameParam->mode=(ADM_mode)mmode; lameParam->preset=(ADM_LAME_PRESET)ppreset; return 1; } return 0; }
bool nvEncConfigure(void) { diaMenuEntry mePreset[]={ {NV_PRESET_HP,QT_TRANSLATE_NOOP("nvenc", "Low Quality")}, {NV_PRESET_HQ,QT_TRANSLATE_NOOP("nvenc", "High Quality")}, {NV_PRESET_BD,QT_TRANSLATE_NOOP("nvenc", "BluRay")}, {NV_PRESET_LL,QT_TRANSLATE_NOOP("nvenc", "Low Latency")}, {NV_PRESET_LLHP,QT_TRANSLATE_NOOP("nvenc","Low Latency (LQ)")}, {NV_PRESET_LLHQ,QT_TRANSLATE_NOOP("nvenc","Low Latency (HQ)")} }; nvencconf *conf=&NvEncSettings; #define PX(x) &(conf->x) diaElemMenu qzPreset(PX(preset),QT_TRANSLATE_NOOP("nvenc","Preset:"),6,mePreset); diaElemUInteger bitrate(PX(bitrate),QT_TRANSLATE_NOOP("nvenc","Bitrate (kbps):"),1,50000); diaElemUInteger maxBitrate(PX(max_bitrate),QT_TRANSLATE_NOOP("nvenc","Max Bitrate (kbps):"),1,50000); /* First Tab : encoding mode */ diaElem *diamode[]={&qzPreset,&bitrate,&maxBitrate}; if( diaFactoryRun(QT_TRANSLATE_NOOP("nvenc","Nvidia H264 Encoder configuration"),3,diamode)) { return true; } return false; }
bool ffVAEncHevcConfigure(void) { ffvaHEVC_encoder *conf=&VaEncHevcSettings; #define PX(x) &(conf->x) diaElemUInteger gopSize(PX(gopsize),QT_TRANSLATE_NOOP("ffVAEncHEVC","GOP Size:"),1,250); diaElemUInteger maxBframes(PX(bframes),QT_TRANSLATE_NOOP("ffVAEncHEVC","Maximum Consecutive B-Frames:"),0,4); diaElemUInteger bitrate(PX(bitrate), QT_TRANSLATE_NOOP("ffVAEncHEVC","Bitrate (kbps):"),1,50000); diaElemUInteger maxBitrate(PX(max_bitrate), QT_TRANSLATE_NOOP("ffVAEncHEVC","Max Bitrate (kbps):"),1,50000); diaElemFrame rateControl(QT_TRANSLATE_NOOP("ffVAEncHEVC","Rate Control")); diaElemFrame frameControl(QT_TRANSLATE_NOOP("ffVAEncHEVC","Frame Control")); rateControl.swallow(&bitrate); rateControl.swallow(&maxBitrate); frameControl.swallow(&gopSize); frameControl.swallow(&maxBframes); diaElem *diamode[] = {&rateControl,&frameControl}; if( diaFactoryRun(QT_TRANSLATE_NOOP("ffVAEncHEVC","FFmpeg VA-API HEVC Encoder Configuration"),2,diamode)) { return true; } return false; }
void PX(split_cart_procmesh_for_3dto2d_remap_q1)( const INT *n, MPI_Comm comm_cart_3d, MPI_Comm *comm_1d ) { int p0, p1, q0=0, q1=0; int ndims, coords_3d[3]; int dim_1d, period_1d, reorder=0; int color, key; MPI_Comm comm; if( !PX(is_cart_procmesh)(comm_cart_3d) ) return; MPI_Cartdim_get(comm_cart_3d, &ndims); if(ndims != 3) return; PX(get_mpi_cart_coords)(comm_cart_3d, ndims, coords_3d); PX(get_procmesh_dims_2d)(n, comm_cart_3d, &p0, &p1, &q0, &q1); /* split into p0*p1*q0 comms of size q1 */ color = coords_3d[0]*p1*q0 + coords_3d[1]*q0 + coords_3d[2]/q1; key = coords_3d[2]%q1; // key = coords_3d[2]/q0; /* TODO: delete this line after several tests */ MPI_Comm_split(comm_cart_3d, color, key, &comm); dim_1d = q1; period_1d = 1; MPI_Cart_create(comm, ndims=1, &dim_1d, &period_1d, reorder, comm_1d); MPI_Comm_free(&comm); }
uint8_t DGbob::configure(AVDMGenericVideoStream *in) { _in=in; #define PX(x) &(_param->x) diaMenuEntry menuField[2]={{0,QT_TR_NOOP("Top"),NULL}, {1,QT_TR_NOOP("Bottom"),NULL} }; diaMenuEntry menuMode[3]={{0,QT_TR_NOOP("Keep nb of frames and fps"),NULL}, {1,QT_TR_NOOP("Double nb of frames and fps"),NULL}, {2,QT_TR_NOOP("Double nb of frames (slow motion)"),NULL} }; diaElemMenu menu1(PX(order),QT_TR_NOOP("_Field order:"), 2,menuField); diaElemMenu menu2(PX(mode),QT_TR_NOOP("_Mode:"), 3,menuMode); diaElemUInteger threshold(PX(thresh),QT_TR_NOOP("_Threshold:"),0,255); diaElemToggle extra(PX(ap),QT_TR_NOOP("_Extra"),QT_TR_NOOP("Extra check, avoid using it")); diaElem *elems[4]={&menu1,&menu2,&threshold ,&extra}; if(diaFactoryRun(QT_TR_NOOP("DGBob"),4,elems)) { update(); return 1; } return 0; }
/** \fn DIA_animated \brief Dialog to set params for the animated filter */ uint8_t DIA_animated(ANIMATED_PARAM *param,uint32_t w, uint32_t h,uint32_t n) { uint8_t r=0; #define PX(x) &(param->x) diaElemFile jpeg(0,(char **)PX(backgroundImg),QT_TR_NOOP("_Background Image:"), NULL, QT_TR_NOOP("Select background image")); diaElemToggle isNtsc(PX(isNTSC),QT_TR_NOOP("_NTSC (default is PAL):")); diaElemUInteger vignetteW(PX(vignetteW),QT_TR_NOOP("Vignette _Width:"),16,w/3); diaElemUInteger vignetteH(PX(vignetteH),QT_TR_NOOP("Vignette _Height:"),16,h/2); diaElemUInteger *timecode[MAX_VIGNETTE]; diaElemFrame timecodes(QT_TR_NOOP("Vignette frame number")); for(int i=0;i<MAX_VIGNETTE;i++) { timecode[i]=new diaElemUInteger(&(param->timecode[i]),QT_TR_NOOP("Timecode:"),0,n); timecodes.swallow(timecode[i]); } diaElem *elems[5]={&jpeg,&isNtsc,&vignetteW,&vignetteH,&timecodes}; if( diaFactoryRun(QT_TR_NOOP("Animated Menu"),5,elems)) { r=1; } for(int i=0;i<MAX_VIGNETTE;i++) { delete timecode[i]; } return r; }
uint8_t ADMVideoMPD3Dlow::configure(AVDMGenericVideoStream *instream) { _in=instream; ELEM_TYPE_FLOAT fluma,fchroma,ftemporal; #define PX(x) &x #define OOP(x,y) f##x=(ELEM_TYPE_FLOAT )_param->y; OOP(luma,param1); OOP(chroma,param2); OOP(temporal,param3); diaElemFloat luma(PX(fluma),QT_TR_NOOP("_Spatial luma strength:"),0.,100.); diaElemFloat chroma(PX(fchroma),QT_TR_NOOP("S_patial chroma strength:"),0.,100.); diaElemFloat temporal(PX(ftemporal),QT_TR_NOOP("_Temporal strength:"),0.,100.); diaElem *elems[3]={&luma,&chroma,&temporal}; if( diaFactoryRun(QT_TR_NOOP("MPlayer denoise3d"),3,elems)) { #undef OOP #define OOP(x,y) _param->y=(double) f##x OOP(luma,param1); OOP(chroma,param2); OOP(temporal,param3); setup(); return 1; } return 0; }
SuggestionWidget(wxWindow *parent) : wxPanel(parent, wxID_ANY) { m_appIsRTL = (wxTheApp->GetLayoutDirection() == wxLayout_RightToLeft); m_icon = new wxStaticBitmap(this, wxID_ANY, wxNullBitmap); m_text = new AutoWrappingText(this, "TEXT"); m_info = new InfoStaticText(this); auto top = new wxBoxSizer(wxHORIZONTAL); auto right = new wxBoxSizer(wxVERTICAL); top->AddSpacer(PX(2)); top->Add(m_icon, wxSizerFlags().Top().PXBorder(wxTOP|wxBOTTOM)); top->Add(right, wxSizerFlags(1).Expand().PXBorder(wxLEFT)); right->Add(m_text, wxSizerFlags().Expand().Border(wxTOP, PX(4))); right->Add(m_info, wxSizerFlags().Expand().Border(wxTOP|wxBOTTOM, PX(2))); SetSizerAndFit(top); // setup mouse hover highlighting: m_bg = parent->GetBackgroundColour(); m_bgHighlight = m_bg.ChangeLightness(160); wxWindow* parts [] = { this, m_icon, m_text, m_info }; for (auto w : parts) { w->Bind(wxEVT_MOTION, &SuggestionWidget::OnMouseMove, this); w->Bind(wxEVT_LEAVE_WINDOW, &SuggestionWidget::OnMouseMove, this); w->Bind(wxEVT_LEFT_UP, &SuggestionWidget::OnMouseClick, this); } }
void OnPaint(wxPaintEvent&) { wxPaintDC dc(this); auto w = dc.GetSize().x; dc.GradientFillLinear(wxRect(0,0,PX(15),PX(1)), m_sides, m_center); dc.GradientFillLinear(wxRect(PX(15),0,w,PX(1)), m_center, m_sides); }
static INT num_used_procs( INT N, int p ) { INT blk = PX(global_block_size)(N, PFFT_DEFAULT_BLOCK, p); return PX(num_blocks)(N, blk); }
/** \fn configure */ bool lavDeint::configure( void) { #define PX(x) &(param.x) diaMenuEntry menuField[6]={{PP_BM_NONE, QT_TRANSLATE_NOOP("lavdeint","None"),NULL}, {PP_BM_LINEAR_BLEND, QT_TRANSLATE_NOOP("lavdeint","Linear blend"),NULL}, {PP_BM_LINEAR_INTER, QT_TRANSLATE_NOOP("lavdeint","Linear interpolate"),NULL}, {PP_BM_CUBIC_INTER, QT_TRANSLATE_NOOP("lavdeint","Cubic interpolate"),NULL}, {PP_BM_MEDIAN_INTER, QT_TRANSLATE_NOOP("lavdeint","Median interpolate"),NULL}, {PP_BM_FFMPEG_DEINT, QT_TRANSLATE_NOOP("lavdeint","FFmpeg deint"),NULL}, }; diaElemMenu menu1(PX(deintType),QT_TRANSLATE_NOOP("lavdeint","_Deinterlacing:"), 6,menuField); diaElemToggle autolevel(PX(autoLevel),QT_TRANSLATE_NOOP("lavdeint","_Autolevel")); diaElem *elems[2]={&menu1,&autolevel}; if(diaFactoryRun(QT_TRANSLATE_NOOP("lavdeint","libavcodec deinterlacer"),2,elems)) { setup(); return true; } return false; }
void PX(split_cart_procmesh_3dto2d_p1q1)( const INT *n, MPI_Comm comm_cart_3d, MPI_Comm *comm_1d ) { int p0, p1, q0=0, q1=0; int ndims, coords_3d[3]; int dim_1d, period_1d, reorder=0; int color, key; MPI_Comm comm; if( !PX(is_cart_procmesh)(comm_cart_3d) ) return; MPI_Cartdim_get(comm_cart_3d, &ndims); if(ndims != 3) return; PX(get_mpi_cart_coords)(comm_cart_3d, ndims, coords_3d); PX(get_procmesh_dims_2d)(n, comm_cart_3d, &p0, &p1, &q0, &q1); /* split into p0*q0 comms of size p1*q1 */ color = coords_3d[0]*q0 + coords_3d[2]/q1; key = coords_3d[1]*q1 + coords_3d[2]%q1; MPI_Comm_split(comm_cart_3d, color, key, &comm); dim_1d = p1*q1; period_1d = 1; MPI_Cart_create(comm, ndims=1, &dim_1d, &period_1d, reorder, comm_1d); MPI_Comm_free(&comm); }
//************************************************************* uint8_t ADMVideoLavPPDeint::configure(AVDMGenericVideoStream *in) { #define PX(x) &(_param->x) _in=in; diaMenuEntry menuField[6]={{PP_BM_NONE, QT_TR_NOOP("None"),NULL}, {PP_BM_LINEAR_BLEND, QT_TR_NOOP("Linear blend"),NULL}, {PP_BM_LINEAR_INTER, QT_TR_NOOP("Linear interpolate"),NULL}, {PP_BM_CUBIC_INTER, QT_TR_NOOP("Cubic interpolate"),NULL}, {PP_BM_MEDIAN_INTER, QT_TR_NOOP("Median interpolate"),NULL}, {PP_BM_FFMPEG_DEINT, QT_TR_NOOP("FFmpeg deint"),NULL}, }; diaElemMenu menu1(PX(deintType),QT_TR_NOOP("_Deinterlacing:"), 6,menuField); diaElemToggle autolevel(PX(autolevel),QT_TR_NOOP("_Autolevel")); diaElem *elems[2]={&menu1,&autolevel}; if(diaFactoryRun(QT_TR_NOOP("libavcodec deinterlacer"),2,elems)) { setup(); return 1; } return 0; }
void PX(local_block_size_and_offset)(INT global_array_size, INT global_block_size, int which_block, INT *local_block_size, INT *local_block_start) { /* Block index runs from blockStart <= index < blockEnd */ *local_block_start = PX(local_block_offset)(global_array_size, global_block_size, which_block); *local_block_size = PX(local_block_size)(global_array_size, global_block_size, which_block); }
PX(plan) PX(plan_dft_c2r_3d_f03)(const INT * Nos, C * in, R * out, MPI_Fint f_comm_cart, int sign, unsigned pfft_flags) { MPI_Comm comm_cart; comm_cart = MPI_Comm_f2c(f_comm_cart); PX(plan) ret = PX(plan_dft_c2r_3d)(Nos, in, out, comm_cart, sign, pfft_flags); return ret; }
ManagerFrame::ManagerFrame() : wxFrame(NULL, -1, _("Poedit - Catalogs manager"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE, "manager") { #if defined(__WXGTK__) wxIconBundle appicons; appicons.AddIcon(wxArtProvider::GetIcon("poedit", wxART_FRAME_ICON, wxSize(16,16))); appicons.AddIcon(wxArtProvider::GetIcon("poedit", wxART_FRAME_ICON, wxSize(32,32))); appicons.AddIcon(wxArtProvider::GetIcon("poedit", wxART_FRAME_ICON, wxSize(48,48))); SetIcons(appicons); #elif defined(__WXMSW__) SetIcons(wxIconBundle(wxStandardPaths::Get().GetResourcesDir() + "\\Resources\\Poedit.ico")); #endif ms_instance = this; auto tb = wxXmlResource::Get()->LoadToolBar(this, "manager_toolbar"); (void)tb; #ifdef __WXMSW__ // De-uglify the toolbar a bit on Windows 10: if (IsWindows10OrGreater()) { const wxUxThemeEngine* theme = wxUxThemeEngine::GetIfActive(); if (theme) { wxUxThemeHandle hTheme(tb, L"ExplorerMenu::Toolbar"); tb->SetBackgroundColour(wxRGBToColour(theme->GetThemeSysColor(hTheme, COLOR_WINDOW))); } } #endif wxPanel *panel = wxXmlResource::Get()->LoadPanel(this, "manager_panel"); m_listPrj = XRCCTRL(*panel, "prj_list", wxListBox); m_listCat = XRCCTRL(*panel, "prj_files", wxListCtrl); m_splitter = XRCCTRL(*panel, "manager_splitter", wxSplitterWindow); wxImageList *list = new wxImageList(PX(16), PX(16)); list->Add(wxArtProvider::GetBitmap("poedit-status-cat-no")); list->Add(wxArtProvider::GetBitmap("poedit-status-cat-mid")); list->Add(wxArtProvider::GetBitmap("poedit-status-cat-ok")); m_listCat->AssignImageList(list, wxIMAGE_LIST_SMALL); m_curPrj = -1; int last = (int)wxConfig::Get()->Read("manager_last_selected", (long)0); // FIXME: do this in background (here and elsewhere) UpdateListPrj(last); if (m_listPrj->GetCount() > 0) UpdateListCat(last); RestoreWindowState(this, wxSize(PX(400), PX(300))); m_splitter->SetSashPosition((int)wxConfig::Get()->Read("manager_splitter", PX(200))); }
bool avsfilter::configure(void) { DEBUG_PRINTF("avsfilter : before dialog init\n"); print_objects(); #define PX(x) &(param.x) diaElemFile wine_app(0,(char**)PX(wine_app), QT_TR_NOOP("_wine app file:"), NULL, QT_TR_NOOP("Select wine filename[wine/cedega/etc.]")); diaElemFile loaderfile(0,(char**)PX(avs_loader), QT_TR_NOOP("_loader file:"), NULL, QT_TR_NOOP("Select loader filename[avsload.exe]")); diaElemFile avsfile(0,(char**)PX(avs_script), QT_TR_NOOP("_avs file:"), NULL, QT_TR_NOOP("Select avs filename[*.avs]")); diaElemUInteger pipe_timeout(PX(pipe_timeout),QT_TR_NOOP("_pipe timeout:"),1,30); diaElem *elems[4]={&wine_app, &loaderfile, &avsfile, &pipe_timeout}; if( diaFactoryRun(QT_TR_NOOP("AvsFilter config"), 4, elems)) { bool res = false; DEBUG_PRINTF("avsfilter : configure before SetParameters\n"); // if script/loader names are exist, then taste config if (param.avs_loader && strlen((const char*)param.avs_loader) && param.avs_script && strlen((const char*)param.avs_script) && param.wine_app && strlen((const char*)param.wine_app)) { struct stat st; if (stat((char*)param.avs_script, &st) != 0) { DEBUG_PRINTF_RED("avsfilter : cannot stat script file\n"); return 0; } param.script_mtime = st.st_mtime; // store timestamp param.script_ctime = st.st_ctime; print_objects(); res = SetParameters(¶m); if (res) avsfilter_config_jserialize(prefs_name, ¶m); DEBUG_PRINTF("avsfilter : configure before save prefs [%s][%s]\n", param.avs_script, param.avs_loader); // if setparameters are ok and (therefore) avs_script and avs_loader exist // we store this parameters in filter preferences DEBUG_PRINTF("avsfilter : after save prefs info : frameIncrement %lu totalDuration %llu\n", info.frameIncrement, info.totalDuration); DEBUG_PRINTF("avsfilter : configure exit ok\n"); return res; } } return 0; }
uint8_t ADMVideoKernelDeint::configure( AVDMGenericVideoStream *instream) { _in=instream; #define PX(x) &_param->x if(DIA_kerneldeint(PX(order), PX(threshold), PX(sharp), PX(twoway), PX(map))) return 1; return 0; }
INT PX(local_block_size_shifted)( INT global_array_size, INT global_block_size, int shift, MPI_Comm comm_cart_1d ) { int num_procs, coord; MPI_Comm_size(comm_cart_1d, &num_procs); PX(get_mpi_cart_coord_1d)(comm_cart_1d, &coord); return PX(local_block_size)(global_array_size, global_block_size, PX(pos_mod)(coord+shift, num_procs)); }
OldMsgidSidebarBlock(Sidebar *parent) /// TRANSLATORS: "Previous" as in used in the past, now replaced with newer. : SidebarBlock(parent, _("Previous source text:")) { m_innerSizer->AddSpacer(PX(2)); m_innerSizer->Add(new ExplanationLabel(parent, _("The old source text (before it changed during an update) that the fuzzy translation corresponds to.")), wxSizerFlags().Expand()); m_innerSizer->AddSpacer(PX(5)); m_text = new SelectableAutoWrappingText(parent, ""); m_innerSizer->Add(m_text, wxSizerFlags().Expand()); }
int PX(get_mpi_cart_dims)(MPI_Comm comm_cart, int maxdims, int *dims) { int ret; int *periods = PX(malloc_int)(maxdims); int *coords = PX(malloc_int)(maxdims); ret = MPI_Cart_get(comm_cart, maxdims, dims, periods, coords); free(periods); free(coords); return ret; }
static void get_local_start_3d( const INT *n, const INT *blks, const MPI_Comm *comms, INT *local_start ) { int coord; for(int t=0; t<3; t++){ PX(get_mpi_cart_coord_1d)(comms[t], &coord); local_start[t] = PX(local_block_offset)(n[t], blks[t], coord); } }
bool SnakeLayer::init() { maximumLength = 100; itemsPicked = 0; score = 0; bonus = 0; direction = Point::ZERO; speed = 180; LayerColor* lc = LayerColor::create(Color4B(0, 0, 0, 210), PX(1.0f), PY(0.8f)); lc->setPosition(CP(0.5f, 0.5f)); lc->setAnchorPoint(Point(0.5f, 0.5f)); lc->ignoreAnchorPointForPosition(false); addChild(lc); bounds = lc->getBoundingBox(); LayerColor* scorebg = LayerColor::create(Color4B::BLACK, PX(1.0f), PY(0.1f)); scorebg->setPosition(Point::ZERO); addChild(scorebg); addChild(lineGroup = Node::create()); addChild(bonusGroup = Node::create()); addChild(itemGroup = Node::create()); LineNode* line = LineNode::create(CP(0.5f, 0.5f), CP(0.5f, 0.5f)); lineGroup->addChild(line); schedule(schedule_selector(SnakeLayer::considerSpawningBonus), 5.0f); scheduleUpdate(); lblScore = Label::createWithTTF(LS("ScoreColon") + " 0", NORMAL_TTF, 42.0f); lblScore->setColor(Color3B::WHITE); lblScore->setPosition(CP(0.5f, 0.05f)); //lblScore->enableGlow(Color4B::BLACK); //lblScore->enableShadow(Color4B::BLACK, Size::ZERO, 4); addChild(lblScore); string instruction = LS("SNAKE_INSTRUCTIONS"); lblInstruction = Label::createWithTTF(instruction, NORMAL_TTF, 48.0f); lblInstruction->setPosition(CP(0.5f, 0.5f)); lblInstruction->setHorizontalAlignment(TextHAlignment::CENTER); lblInstruction->setColor(Color3B::WHITE); lblInstruction->enableGlow(Color4B::RED); lblInstruction->runAction(RepeatForever::create( Sequence::createWithTwoActions(ScaleTo::create(1.0f, 1.1f), ScaleTo::create(1.0f, 1.0f)))); addChild(lblInstruction); instructionVisible = true; return true; }
void re_basics() { double euro_cent; PX(my::euro_parser("1,89", euro_cent)); PX(euro_cent); PX(my::euro_parser("123,89", euro_cent)); PX(euro_cent); PX(my::euro_parser("1234567,89", euro_cent)); PX(euro_cent); PX(my::euro_parser("1.234.567,89", euro_cent)); PX(euro_cent); }
uint8_t DIA_getPartial(PARTIAL_CONFIG *param,AVDMGenericVideoStream *son,AVDMGenericVideoStream *previous) { #define PX(x) &(param->x) void *params[2]={son,previous}; uint32_t fmax=previous->getInfo()->nb_frames; if(fmax) fmax--; diaElemUInteger start(PX(_start),QT_TR_NOOP("Partial Start Frame:"),0,fmax); diaElemUInteger end(PX(_end),QT_TR_NOOP("Partial End Frame:"),0,fmax); diaElemButton button(QT_TR_NOOP("Configure child"), partialCb,params); diaElem *tabs[]={&start,&end,&button}; return diaFactoryRun(QT_TR_NOOP("Partial Video Filter"),3,tabs); }
void create_win(t_screen *screen) { PX(screen->mlx = mlx_init()); PX(screen->win = mlx_new_window(screen->mlx, screen->width, screen->height, "Raytracer")); PX(screen->img.img = mlx_new_image(screen->mlx, screen->width, screen->height)); PX(screen->img.data = mlx_get_data_addr(screen->img.img, &screen->img.bpp, &screen->img.sizeline, &screen->img.endian)); screen->img.x_size = screen->width; screen->img.y_size = screen->height; }
/* wrappers for fftw init and cleanup */ void PX(init) (void){ #ifdef _OPENMP X(init_threads)(); PX(plan_with_nthreads)(omp_get_max_threads()); #endif XM(init)(); }
WXMainToolbar(wxFrame *parent) { m_tb = wxXmlResource::Get()->LoadToolBar(parent, "toolbar"); m_idUpdate = XRCID("toolbar_update"); #ifdef __WXGTK3__ gtk_style_context_add_class(gtk_widget_get_style_context(GTK_WIDGET(Toolbar())), GTK_STYLE_CLASS_PRIMARY_TOOLBAR); SetIcon(0 , "document-open-symbolic"); SetIcon(1 , "document-save-symbolic"); SetIcon(3 , "poedit-validate-symbolic"); SetIcon(4 , "poedit-update-symbolic"); SetIcon(6 , "sidebar-symbolic"); #endif #ifdef __WXMSW__ // De-uglify the toolbar a bit on Windows 10: if (IsWindows10OrGreater()) { if (wxUxThemeIsActive()) { wxUxThemeHandle hTheme(m_tb, L"ExplorerMenu::Toolbar"); m_tb->SetBackgroundColour(wxRGBToColour(::GetThemeSysColor(hTheme, COLOR_WINDOW))); } unsigned padding = PX(4); ::SendMessage((HWND) m_tb->GetHWND(), TB_SETPADDING, 0, MAKELPARAM(padding, padding)); } m_tb->SetDoubleBuffered(true); #endif }
/* calculate block sizes from physical array size * for the 'rnk_pm' distributed dimensions */ static void decompose( const INT *pn, const INT *block, int rnk_pm, const MPI_Comm *comms_pm, INT *local_n, INT *local_start ) { int *coords_pm = PX(malloc_int)(rnk_pm); PX(get_coords)(rnk_pm, comms_pm, coords_pm); PX(decompose)(pn, block, rnk_pm, coords_pm, local_n, local_start); free(coords_pm); }
int init_thread(t_screen *screen, t_scene *scene) { int num; int x; num = -1; scene->thread = PX(malloc(sizeof(*(scene->thread)) * (screen->img.thread_num))); x = 0; is_in_neg_object(NULL, NULL, scene->objet); while (++num < screen->img.thread_num) { scene->thread[num].sx = x; x = (num * screen->img.x_size) / (screen->img.thread_num - 1); scene->thread[num].ex = x; scene->thread[num].screen = screen; scene->thread[num].scene = scene; scene->thread[num].quit = 0; scene->thread[num].calc_new = 0; scene->thread[num].num = num; X(pipe(scene->thread[num].pipein)); X(pipe(scene->thread[num].pipeout)); pthread_create(&scene->thread[num].thread, NULL, thread_loop, &scene->thread[num]); } return (num); }