• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setDelay函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中setDelay函数的典型用法代码示例。如果您正苦于以下问题:C++ setDelay函数的具体用法?C++ setDelay怎么用?C++ setDelay使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了setDelay函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: switch

void Scene1000::Action1::signal() {
	Scene1000 *scene = (Scene1000 *)_globals->_sceneManager._scene;

	switch (_actionIndex++) {
	case 0:
		_globals->_player.disableControl();
		setDelay(10);
		break;
	case 1:
		scene->_object4.postInit();
		scene->_object4.setVisage(1001);
		scene->_object4._frame = 1;
		scene->_object4.setStrip2(5);
		scene->_object4.changeZoom(100);
		scene->_object4.animate(ANIM_MODE_2, NULL);
		scene->_object4.setPosition(Common::Point(403, 163));
		setDelay(90);
		break;
	case 2: {
		SceneItem::display(0, 0);
		scene->_object4.remove();
		scene->_object1.changeZoom(-1);
		NpcMover *mover = new NpcMover();
		Common::Point pt(180, 100);
		scene->_object1.addMover(mover, &pt, this);
		break;
	}
	case 3:
		_globals->_sceneManager.changeScene(1400);
		break;
	}

}
开发者ID:TomFrost,项目名称:scummvm,代码行数:33,代码来源:ringworld_scenes2.cpp


示例2: handle2id

int AkmSensor::setEnable(int32_t handle, int enabled)
{
	int id = handle2id(handle);
	int err = 0;
	char buffer[2];

	switch (id) {
	case Accelerometer:
		strcpy(&input_sysfs_path[input_sysfs_path_len], "enable_acc");
		break;
	case MagneticField:
		strcpy(&input_sysfs_path[input_sysfs_path_len], "enable_mag");
		break;
	case Orientation:
		strcpy(&input_sysfs_path[input_sysfs_path_len], "enable_ori");
		break;
	default:
		ALOGE("AkmSensor: unknown handle (%d)", handle);
		return -EINVAL;
	}

	buffer[0] = '\0';
	buffer[1] = '\0';

	if (mEnabled[id] <= 0) {
		if(enabled) buffer[0] = '1';
	} else if (mEnabled[id] == 1) {
		if(!enabled) buffer[0] = '0';
	}

    if (buffer[0] != '\0') {
		err = write_sys_attribute(input_sysfs_path, buffer, 1);
		if (err != 0) {
			return err;
		}
		ALOGD("AkmSensor: set %s to %s",
			&input_sysfs_path[input_sysfs_path_len], buffer);

		/* for AKMD specification */
		if (buffer[0] == '1') {
			setDelay(handle, AKMD_DEFAULT_INTERVAL);
		} else {
			setDelay(handle, -1);
		}
    }

	if (enabled) {
		(mEnabled[id])++;
		if (mEnabled[id] > 32767) mEnabled[id] = 32767;
	} else {
		(mEnabled[id])--;
		if (mEnabled[id] < 0) mEnabled[id] = 0;
	}
	ALOGD("AkmSensor: mEnabled[%d] = %d", id, mEnabled[id]);

    return err;
}
开发者ID:IllusionRom-deprecated,项目名称:android_platform_hardware_akm,代码行数:57,代码来源:AkmSensor.cpp


示例3: undrawArrow

void Board::getHint() {
  int x1, y1, x2, y2;
  History h[4];

  if(getHint_I(x1, y1, x2, y2, h)) {
    undrawArrow();
    for(int i = 0; i < 4; i++)
      history[i] = h[i];

    int old_delay = getDelay();
    setDelay(1000);
    drawArrow(x1, y1, x2, y2);
    setDelay(old_delay);
  }
}
开发者ID:kthxbyte,项目名称:KDE1-Linaro,代码行数:15,代码来源:board.cpp


示例4: open

int Kxtf9Sensor::enable(int32_t handle, int en)
{
    int err = 0;

    int newState = en ? 1 : 0;

    // don't set enable state if it's already valid
    if(mEnabled == newState) {
        return err;
    }

    // ok we need to set our enabled state
    int fd = open(KXTF9_ENABLE_FILE, O_WRONLY);
    if(fd >= 0) {
        char buffer[20];
        int bytes = sprintf(buffer, "%d\n", newState);
        err = write(fd, buffer, bytes);
        err = err < 0 ? -errno : 0;
    } else {
        err = -errno;
    }

    LOGE_IF(err < 0, "Error setting enable of kxtf9 accelerometer (%s)", strerror(-err));

    if (!err) {
        mEnabled = newState;
        setDelay(0, 100000000); // 100ms by default for faster re-orienting
    }

    return err;
}
开发者ID:Krylon360,项目名称:android_device_bn_encore,代码行数:31,代码来源:Kxtf9.cpp


示例5: open_device

int SensorKXTF9::enable(int32_t handle, int en)
{
    int err = 0;
    int newState = en ? 1 : 0;

    if(mEnabled == (unsigned)newState)
        return err;

    if (!mEnabled)
        open_device();

    err = ioctl(dev_fd, KXTF9_IOCTL_SET_ENABLE, &newState);
    err = err < 0 ? -errno : 0;
    LOGE_IF(err, "SensorKXTF9: KXTF9_IOCTL_SET_ENABLE failed (%s)", strerror(-err));

    if (!err)
    {
        mEnabled = newState;
        err = setDelay(handle, KXTF9_DEFAULT_DELAY);
    }

    if (!mEnabled)
        close_device();

    return err;
}
开发者ID:binodnepal,项目名称:android_device_motorola_umts_jordan,代码行数:26,代码来源:SensorKXTF9.cpp


示例6: switch

void SpeakerPOR::SpeakerAction1::signal(){
	switch (_actionIndex++) {
	case 0:
		setDelay(_globals->_randomSource.getRandomNumber(60) + 60);
		break;
	case 1:
		static_cast<SceneObject *>(_owner)->animate(ANIM_MODE_5, this, NULL);
		break;
	case 2:
		setDelay(_globals->_randomSource.getRandomNumber(10));
		_actionIndex = 0;
		break;
	default:
		break;
	}
}
开发者ID:TomFrost,项目名称:scummvm,代码行数:16,代码来源:ringworld_logic.cpp


示例7: setSaveDir

// set default values
void Config::setDefaultSettings()
{
    setSaveDir(getDirNameDefault());
    setSaveFileName(DEF_SAVE_NAME);
    setSaveFormat(DEF_SAVE_FORMAT);
    setDefDelay(DEF_DELAY);
    setImageQuality(DEF_IMG_QUALITY);
    setDateTimeInFilename(DEF_DATETIME_FILENAME);
    setDateTimeTpl(DEF_DATETIME_TPL);
    setAutoCopyFilenameOnSaving(DEF_FILENAME_TO_CLB);
    setAutoSave(DEF_AUTO_SAVE);
    setAutoSaveFirst(DEF_AUTO_SAVE_FIRST);
    setTrayMessages(DEF_TRAY_MESS_TYPE);
    setIncludeCursor(DEF_INCLUDE_CURSOR);
    setZoomAroundMouse(DEF_ZOOM_AROUND_MOUSE);
    setCloseInTray(DEF_CLOSE_IN_TRAY);
    setTimeTrayMess(DEF_TIME_TRAY_MESS);
    setAllowMultipleInstance(DEF_ALLOW_COPIES);
    // TODO - make set windows size without hardcode values
    // setRestoredWndSize(DEF_WND_WIDTH, DEF_WND_HEIGHT);
    setShowTrayIcon(DEF_SHOW_TRAY);
    setEnableExtView(DEF_ENABLE_EXT_VIEWER);

    _shortcuts->setDefaultSettings();

    setNoDecoration(DEF_X11_NODECOR);
    setDelay(DEF_DELAY);

    quint8 countModules = Core::instance()->modules()->count();
    for (int i = 0; i < countModules; ++i)
        Core::instance()->modules()->getModule(i)->defaultSettings();
}
开发者ID:siduction-upstream,项目名称:screengrab,代码行数:33,代码来源:config.cpp


示例8: QWidget

Board::Board(QWidget *parent) : QWidget(parent) {
  trying = FALSE;
  _solvable_flag = TRUE;

  // randomze
  setShuffle(DEFAULTSHUFFLE);
  clock_t t;
  struct tms dummy;
  t = times(&dummy); 
  srandom((int)t);

  starttime = time((time_t *)0);

  for(int i = 0; i < 45; i++)
    pm_tile[i] = 0;

  setDelay(DEFAULTDELAY);
  _redo.setAutoDelete(TRUE);
  _undo.setAutoDelete(TRUE);

  loadTiles(1);
  field = 0;
  QPixmap bg((PICDIR + "/kshisen_bgnd.xpm").data());
  setBackgroundPixmap(bg);
  connect(this, SIGNAL(fieldClicked(int, int)),
	  this, SLOT(marked(int, int)));
  connect(this, SIGNAL(madeMove(int, int, int, int)),
	  this, SLOT(slotMadeMove(int, int, int, int)));  

  setShuffle(0);
  setSize(18, 8);

  highlighted_tile = -1;
}
开发者ID:kthxbyte,项目名称:KDE1-Linaro,代码行数:34,代码来源:board.cpp


示例9: setDelay

bool CircuitElement::updateState(GameScripting* m_script, Map* map, INodeDefManager* ndef) {
	MapNode node = map->getNodeNoEx(m_pos);
	// Map not yet loaded
	if(!node) {
		dstream << "Circuit simulator: Waiting for map blocks loading..." << std::endl;
		return false;
	}
	const ContentFeatures& node_features = ndef->get(node);
	// Update delay (may be not synchronized)
	u32 delay = node_features.circuit_element_delay;
	if(delay != m_states_queue.size()) {
		setDelay(delay);
	}
	m_states_queue.push_back(m_next_input_state);
	m_next_input_state = m_states_queue.front();
	m_states_queue.pop_front();
	m_current_output_state = node_features.circuit_element_func[m_next_input_state];
	if(m_next_input_state && !m_current_input_state && node_features.has_on_activate) {
		m_script->node_on_activate(m_pos, node);
	}
	if(!m_next_input_state && m_current_input_state && node_features.has_on_deactivate) {
		m_script->node_on_deactivate(m_pos, node);
	}
	m_prev_input_state = m_current_input_state;
	m_current_input_state = m_next_input_state;
	m_next_input_state = 0;
	return true;
}
开发者ID:gourytch,项目名称:freeminer,代码行数:28,代码来源:circuit_element.cpp


示例10: initQuickSwap

void initQuickSwap(void){
		
	quickSwapMode = eeprom_read_byte((uint8_t *)EEPROM_QUICK_SWAP); 
	if(quickSwapMode == 0xFF) quickSwapMode = 0;
		
	quickSwapCountMax = setDelay(QUICKSWAP_COUNT_MAX);
}
开发者ID:showjean,项目名称:ps2avrU,代码行数:7,代码来源:quickswap.c


示例11: setDelay

void KTimerJob::load( KConfig *cfg, const QString& grp )
{
	KConfigGroup groupcfg = cfg->group(grp);
    setDelay( groupcfg.readEntry( "Delay", 100 ) );
    setCommand( groupcfg.readPathEntry( "Command", QString() ) );
    setLoop( groupcfg.readEntry( "Loop", false ) );
    setOneInstance( groupcfg.readEntry( "OneInstance", d->oneInstance ) );
    setState( (States)groupcfg.readEntry( "State", (int)Stopped ) );
}
开发者ID:KDE,项目名称:ktimer,代码行数:9,代码来源:ktimer.cpp


示例12: setDelay

int SensorBase::batch(int handle, int flags, int64_t period_ns, int64_t timeout){
	/*default , not support batch mode or SENSORS_BATCH_WAKE_UPON_FIFO_FULL */
	if(timeout > 0 || flags & SENSORS_BATCH_WAKE_UPON_FIFO_FULL)
		return -EINVAL;
	if(!(flags & SENSORS_BATCH_DRY_RUN)){
		setDelay(handle,period_ns);
	}
	return 0;
}
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_hardware_imx,代码行数:9,代码来源:SensorBase.cpp


示例13: ALOGE

int PSHCommonSensor::batch(int handle, int flags, int64_t period_ns, int64_t timeout) {
        int delay = period_ns / NS_TO_MS;
        int ret = -EINVAL;
        static int oldDataRate = -1;
        static int oldBufferDelay = -1;
        static streaming_flag oldFlag;

        if (handle != device.getHandle()) {
                ALOGE("%s: line: %d: %s handle not match! handle: %d required handle: %d",
                     __FUNCTION__, __LINE__, device.getName(), device.getHandle(), handle);
                return -EINVAL;
        }

        if (period_ns < 0 || timeout < 0)
                return -EINVAL;

        if (timeout == 0) {
                ret = setDelay(handle, period_ns);
                bufferDelay = 0;
                oldBufferDelay = 0;
                return ret;
        }

        bufferDelay = timeout / NS_TO_MS;

        ret = setDelay(handle, period_ns);

        if (oldDataRate == -1) {
                oldDataRate = state.getDataRate();
                oldBufferDelay = bufferDelay;
                oldFlag = flag;
                return ret;
        }

        if (oldDataRate != state.getDataRate() || oldBufferDelay != bufferDelay || oldFlag != flag) {
                oldDataRate = state.getDataRate();
                oldBufferDelay = bufferDelay;
                oldFlag = flag;
                if (state.getActivated())
                        ret = hardwareSet(true);
        }

        return ret;
}
开发者ID:yutokt,项目名称:android_vendor_intel,代码行数:44,代码来源:PSHCommonSensor.cpp


示例14: Timer

Timer::
Timer(double delay, double init)
{
    int clockid = delay < 0.01 ? CLOCK_MONOTONIC : CLOCK_REALTIME;

    fd_ = timerfd_create(clockid, TFD_NONBLOCK);
    SLICK_CHECK_ERRNO(fd_ != -1, "timer.create");

    setDelay(delay, init);
}
开发者ID:RAttab,项目名称:slick,代码行数:10,代码来源:timer.cpp


示例15: moveActor

void moveActor(character *actor, int vx, int vy) {
	if (actor->delay) {
		return;
	}
	
	actor->vx = vx;
	actor->vy = vy;
	
	setDelay(actor, getMovementCost(actor));
}
开发者ID:witheld9,项目名称:Torch,代码行数:10,代码来源:actors.c


示例16: setDelay

boolean JTimerObj::updateProperty(JProperty& prop) {
  if (JANDObj::updateProperty(prop)) return true;
  if (prop.getName() == JString("delay")) {
    setDelay(((JIntegerProperty*)&prop)->value);
    return true;
  } else if (prop.getName() == JString("priority")) {
    priority = ((JIntegerListProperty*)&prop)->value;
    return true;
  }
  return false;
}
开发者ID:neattools,项目名称:neattools,代码行数:11,代码来源:JTimerObj.cpp


示例17: switch

void Scene666::Action1::signal() {
	switch (_actionIndex++) {
	case 0:
		BF_GLOBALS._player.hide();
		setDelay(6);
		break;
	case 1:
		BF_GLOBALS._game->restartGame();
		break;
	}
}
开发者ID:AReim1982,项目名称:scummvm,代码行数:11,代码来源:blueforce_scenes6.cpp


示例18: switch

//------------------------------------------------------------------------
void ADelay::setParameter (VstInt32 index, float value)
{
	ADelayProgram* ap = &programs[curProgram];

	switch (index)
	{
		case kDelay :    setDelay (value);					break;
		case kFeedBack : fFeedBack = ap->fFeedBack = value; break;
		case kOut :      fOut = ap->fOut = value;			break;
	}
}
开发者ID:adambadawy,项目名称:C700,代码行数:12,代码来源:adelay.cpp


示例19: setDelay

void PitchedDelay::updateLatency(int latency)
{
	latencyCompensation.setLength(latency);
	unpitchedDelay.setLength(latency);

	const double minDelay = (latency + 10) / sampleRate;
	const double maxDelay = (delayL.getDataLength() + latency - 10) / sampleRate;
	delayRange = Range<double> (minDelay, maxDelay);

	setDelay(currentTime, preDelayPitch);
}
开发者ID:eduardindi,项目名称:lkjb-dc12,代码行数:11,代码来源:pitcheddelay.cpp


示例20: setDelay

void SequenceManager::process(Event &event) {
	if (((event.eventType == EVENT_BUTTON_DOWN) || (event.eventType == EVENT_KEYPRESS)) &&
		!event.handled && g_globals->_sceneObjects->contains(&_sceneText)) {
		// Remove the text item
		_sceneText.remove();
		setDelay(2);
		event.handled = true;
	} else {
		Action::process(event);
	}
}
开发者ID:MaddTheSane,项目名称:scummvm,代码行数:11,代码来源:converse.cpp



注:本文中的setDelay函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setDensity函数代码示例发布时间:2022-05-30
下一篇:
C++ setDefaultValues函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap