Esempio n. 1
0
bool SpecialPush::_makeDynamicSql(uint32_t pid,uint32_t pageIndex)
{
    char sql[2048]={0};
    int weight = pid%5+1;
    snprintf(sql,2048,"insert into info_dynamic  values(%d,%d,%d)",pid,pageIndex,weight);
    /*
    mc 里面存入 uptW_pid -- weight
    */
    char mcKey[1024]={0};
    char mcVal[1024]={0};
    snprintf(mcKey,1024,"uptW_%d",pid);
    snprintf(mcVal,1024,"%d",weight);
    if(setMc(_mcIns,mcKey,mcVal)!=true)
    {
        mylogF("spec set uptW into memcache fail !!!");
        return false;
    }

    bool ret =  doUpdateSql(_sqlIns,sql);
    return ret;
}
Esempio n. 2
0
void PrefGeneral::setData(Preferences * pref) {
	setMplayerPath( pref->mplayer_bin );

	setUseScreenshots( pref->use_screenshot );
	setScreenshotDir( pref->screenshot_directory );

	QString vo = pref->vo;
	if (vo.isEmpty()) {
#ifdef Q_OS_WIN
		vo = "direct3d,";
#else
		vo = "xv,";
#endif
	}
	setVO( vo );

	QString ao = pref->ao;
	setAO( ao );

	setRememberSettings( !pref->dont_remember_media_settings );
	setRememberTimePos( !pref->dont_remember_time_pos );
	setFileSettingsMethod( pref->file_settings_method );
	setAudioLang( pref->audio_lang );
	setSubtitleLang( pref->subtitle_lang );
	setAudioTrack( pref->initial_audio_track );
	setSubtitleTrack( pref->initial_subtitle_track );
	setCloseOnFinish( pref->close_on_finish );
	setPauseWhenHidden( pref->pause_when_hidden );

	setEq2( pref->use_soft_video_eq );
	setUseAudioEqualizer( pref->use_audio_equalizer );
	setGlobalVolume( pref->global_volume );
	setSoftVol( pref->use_soft_vol );
	setAc3DTSPassthrough( pref->use_hwac3 );
	setInitialVolNorm( pref->initial_volnorm );
	setAmplification( pref->softvol_max );
	setInitialPostprocessing( pref->initial_postprocessing );
	setInitialDeinterlace( pref->initial_deinterlace );
	setInitialZoom( pref->initial_zoom_factor );
	setDirectRendering( pref->use_direct_rendering );
	setDoubleBuffer( pref->use_double_buffer );
	setUseSlices( pref->use_slices );
	setStartInFullscreen( pref->start_in_fullscreen );
	setBlackbordersOnFullscreen( pref->add_blackborders_on_fullscreen );
	setAutoq( pref->autoq );

#ifdef Q_OS_WIN
	setAvoidScreensaver( pref->avoid_screensaver );
	setTurnScreensaverOff( pref->turn_screensaver_off );
#else
	setDisableScreensaver( pref->disable_screensaver );
#endif

#ifndef Q_OS_WIN
	vdpau = pref->vdpau;
#endif

	setAudioChannels( pref->initial_audio_channels );
	setScaleTempoFilter( pref->use_scaletempo );

	setAutoSyncActivated( pref->autosync );
	setAutoSyncFactor( pref->autosync_factor );

	setMcActivated( pref->use_mc );
	setMc( pref->mc_value );
}