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

C++ ecore_timer_add函数代码示例

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

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



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

示例1: switch

void GestureRecognizer::noGesture(WKTouchEventRef eventRef)
{
    switch (WKTouchEventGetType(eventRef)) {
    case kWKEventTypeTouchStart: {
        WKArrayRef touchPoints = WKTouchEventGetTouchPoints(eventRef);
        switch (WKArrayGetSize(touchPoints)) {
        case 1:
            m_gestureHandler->reset();
            m_recognizerFunction = &GestureRecognizer::singleTapGesture;
            m_firstPressedPoint = toIntPoint(getPointAtIndex(touchPoints, 0));
            ASSERT(!m_tapAndHoldTimer);
            m_tapAndHoldTimer = ecore_timer_add(s_tapAndHoldTimeoutInSeconds, tapAndHoldTimerCallback, this);
            m_doubleTapTimer = ecore_timer_add(s_doubleTapTimeoutInSeconds, doubleTapTimerCallback, this);
            break;
        case 2:
            m_recognizerFunction = &GestureRecognizer::pinchGesture;
            m_gestureHandler->handlePinchStarted(createVectorWithWKArray(touchPoints, 2));
            break;
        default:
            // There's no defined gesture when we touch three or more points.
            notImplemented();
            break;
        }
        break;
    }
    case kWKEventTypeTouchMove:
    case kWKEventTypeTouchEnd:
        break;
    default:
        ASSERT_NOT_REACHED();
        break;
    }
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:33,代码来源:GestureRecognizer.cpp


示例2: shotgun_ping_start

void
shotgun_ping_start(Shotgun_Auth *auth)
{
   auth->et_ping = ecore_timer_add(auth->ping_delay, (Ecore_Task_Cb)ping, auth);
   auth->et_ping_timeout = ecore_timer_add(auth->ping_timeout, (Ecore_Task_Cb)ping_timeout, auth);
   ecore_timer_freeze(auth->et_ping_timeout);
}
开发者ID:Limsik,项目名称:e17,代码行数:7,代码来源:shotgun.c


示例3: _ecore_poller_next_tick_eval

static void
_ecore_poller_next_tick_eval(void)
{
   int i;
   double interval;

   min_interval = -1;
   for (i = 0; i < 15; i++)
     {
        if (pollers[i])
          {
             min_interval = i;
             break;
          }
     }
   if (min_interval < 0)
     {
        /* no pollers */
         if (timer)
           {
              ecore_timer_del(timer);
              timer = NULL;
           }
         return;
     }
   interval_incr = (1 << min_interval);
   interval = interval_incr * poll_interval;
   /* we are at the tick callback - so no need to do inter-tick adjustments
    * so we can fasttrack this as t -= last_tick in theory is 0.0 (though
    * in practice it will be a very very very small value. also the tick
    * callback will adjust the timer interval at the end anyway */
   if (at_tick)
     {
        if (!timer)
          timer = ecore_timer_add(interval, _ecore_poller_cb_timer, NULL);
     }
   else
     {
        double t;

        if (!timer)
          timer = ecore_timer_add(interval, _ecore_poller_cb_timer, NULL);
        else
          {
             t = ecore_time_get();
             if (interval != poll_cur_interval)
               {
                  t -= last_tick; /* time since we last ticked */
     /* delete the timer and reset it to tick off in the new
      * time interval. at the tick this will be adjusted */
                  ecore_timer_del(timer);
                  timer = ecore_timer_add(interval - t,
                                          _ecore_poller_cb_timer, NULL);
               }
          }
     }
   poll_cur_interval = interval;
}
开发者ID:TetragrammatonHermit,项目名称:enlightenment,代码行数:58,代码来源:ecore_poll.c


示例4: ttsd_server_play

int ttsd_server_play(int uid)
{
	app_state_e state;
	if (0 > ttsd_data_get_client_state(uid, &state)) {
		SLOG(LOG_ERROR, TAG_TTSD, "[Server ERROR] uid(%d) is NOT valid  ", uid);
		return TTSD_ERROR_INVALID_PARAMETER;
	}
	
	if (APP_STATE_PLAYING == state) {
		SLOG(LOG_WARN, TAG_TTSD, "[Server WARNING] Current state(%d) is 'play' ", uid);
		return TTSD_ERROR_NONE;
	}

	/* check if engine use network */
	if (ttsd_engine_agent_need_network()) {
		if (false == ttsd_network_is_connected()) {
			SLOG(LOG_ERROR, TAG_TTSD, "[Server ERROR] Disconnect network. Current engine needs network service!!!.");
			return TTSD_ERROR_OUT_OF_NETWORK;
		}
	}

	int current_uid = ttsd_data_get_current_playing();

	if (uid != current_uid && -1 != current_uid) {
		/* Send interrupt message */
		SLOG(LOG_DEBUG, TAG_TTSD, "[Server] Old uid(%d) will be interrupted into 'Pause' state ", current_uid);

		/* pause player */
		if (0 != ttsd_player_pause(current_uid)) {
			SLOG(LOG_WARN, TAG_TTSD, "[Server ERROR] fail to ttsd_player_pause() : uid (%d)", current_uid);
		} 

		/* change state */
		ttsd_data_set_client_state(current_uid, APP_STATE_PAUSED);

		int* temp_uid = (int*)malloc(sizeof(int));
		*temp_uid = current_uid;
		ecore_timer_add(0, __send_interrupt_client, temp_uid);
	}
	
	/* Change current play */
	if (0 != ttsd_data_set_client_state(uid, APP_STATE_PLAYING)) {
		SLOG(LOG_ERROR, TAG_TTSD, "[Server ERROR] Fail to set state : uid(%d)", uid);
		return TTSD_ERROR_OPERATION_FAILED;
	}

	if (0 != __server_play_internal(uid, state)) {
		SLOG(LOG_ERROR, TAG_TTSD, "[Server ERROR] Fail to start synthesis : uid(%d)", uid);
		return TTSD_ERROR_OPERATION_FAILED;
	}

	if (NULL == g_timer)
		ecore_timer_add(0, __start_next_synthesis, NULL);

	return TTSD_ERROR_NONE;
}
开发者ID:tizenorg,项目名称:framework.uifw.voice.tts,代码行数:56,代码来源:ttsd_server.cpp


示例5: main

int
main(int argc, char **argv)
{
   struct context ctxt = {0};

   if (!ecore_init())
     {
        printf("ERROR: Cannot init Ecore!\n");
        return -1;
     }

   _event_type = ecore_event_type_new();

   ctxt.enterer = ecore_idle_enterer_add(_enterer_cb, &ctxt);
   ctxt.exiter = ecore_idle_exiter_add(_exiter_cb, &ctxt);
//   ctxt.idler = ecore_idler_add(_idler_cb, &ctxt);
   ctxt.idler = eo_add_custom(ECORE_IDLER_CLASS, NULL, ecore_idler_constructor(_idler_cb, &ctxt));
   ctxt.handler = ecore_event_handler_add(_event_type,
                                          _event_handler_cb,
                                          &ctxt);
   ctxt.timer = ecore_timer_add(0.0005, _timer_cb, &ctxt);

   ecore_main_loop_begin();
   ecore_shutdown();

   return 0;
}
开发者ID:TetragrammatonHermit,项目名称:enlightenment,代码行数:27,代码来源:ecore_idler_example.c


示例6: setSharedTimerFireTime

void setSharedTimerFireTime(double fireTime)
{
    double interval = fireTime - currentTime();

    stopSharedTimer();
    g_sharedTimer = ecore_timer_add(interval, timerEvent, 0);
}
开发者ID:azrul2202,项目名称:WebKit-Smartphone,代码行数:7,代码来源:SharedTimerEfl.cpp


示例7: _queue_render

static void
_queue_render(Miniview *mv)
{
   mv->to_render = 1;
   if ((!mv->deferred_renderer) && (mv->is_shown))
     mv->deferred_renderer = ecore_timer_add(0.1, _deferred_renderer, mv);
}
开发者ID:billiob,项目名称:terminology,代码行数:7,代码来源:miniview.c


示例8: window_move_cb

static void
window_move_cb (Ecore_Evas * ee)
{
  if (refresh_timer)
    ecore_timer_del (refresh_timer);
  refresh_timer = ecore_timer_add (MOVE_REFRESH, fix_bg, ee);
}
开发者ID:playya,项目名称:Enlightenment,代码行数:7,代码来源:esmart_test.c


示例9: tts_prepare

int tts_prepare(tts_h tts)
{
	SLOG(LOG_DEBUG, TAG_TTSC, "===== Prepare TTS");

	tts_client_s* client = tts_client_get(tts);

	/* check handle */
	if (NULL == client) {
		SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] A handle is not available");
		SLOG(LOG_DEBUG, TAG_TTSC, "=====");
		SLOG(LOG_DEBUG, TAG_TTSC, " ");
		return TTS_ERROR_INVALID_PARAMETER;
	}

	/* check state */
	if (client->current_state != TTS_STATE_CREATED) {
		SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Invalid State: Current state is not 'CREATED'"); 
		SLOG(LOG_DEBUG, TAG_TTSC, "=====");
		SLOG(LOG_DEBUG, TAG_TTSC, " ");
		return TTS_ERROR_INVALID_STATE;
	}

	ecore_timer_add(0, __tts_connect_daemon, (void*)tts);

	SLOG(LOG_DEBUG, TAG_TTSC, "=====");
	SLOG(LOG_DEBUG, TAG_TTSC, " ");

	return TTS_ERROR_NONE;
}
开发者ID:tizenorg,项目名称:framework.uifw.voice.tts,代码行数:29,代码来源:tts.c


示例10: _handle_anim

static int
_handle_anim(E_Smart_Data *sd)
{
   double t;

   if (sd->timer) ecore_timer_del(sd->timer);
   sd->timer = NULL;
   sd->frame = 0;
   sd->frame_count = 0;
   if (!evas_object_image_animated_get(sd->obj)) return 0;
   // FIXME: hack around jiyouns BUG!!!!!!!!
   {
      const char *file;
      char buf[256];
      snprintf(buf, sizeof(buf), "%ld", (long)sd);
      evas_object_image_file_get(sd->obj, &file, NULL);
      evas_object_image_file_set(sd->obj, file, buf);
   }
   sd->frame_count = evas_object_image_animated_frame_count_get(sd->obj);
   if (sd->frame_count < 2) return 0;
   evas_object_show(sd->obj);
   t = evas_object_image_animated_frame_duration_get(sd->obj, sd->frame, 0);
   sd->timer = ecore_timer_add(t, _frame_anim, sd);
   return 1;
}
开发者ID:haxworx,项目名称:Enform,代码行数:25,代码来源:e_icon.c


示例11: scrolling_start

void
scrolling_start(Scrolling *s)
{
  if (!s) return;

  ecore_timer_add(0.01, _scrolling_move_cb, s);
}
开发者ID:Limsik,项目名称:e17,代码行数:7,代码来源:scrolling.c


示例12: mp_app_key_up_cb

Eina_Bool
mp_app_key_up_cb(void *data, int type, void *event)
{
	struct appdata *ad = data;
	MP_CHECK_VAL(ad, ECORE_CALLBACK_PASS_ON);

	Ecore_Event_Key *key = event;
	MP_CHECK_VAL(key, ECORE_CALLBACK_PASS_ON);

	if (!g_strcmp0(key->keyname, KEY_VOLUMEUP)) {
		mp_volume_key_event_send(MP_VOLUME_KEY_UP, true);
	}
	else if (!g_strcmp0(key->keyname, KEY_VOLUMEDOWN)) {
		mp_volume_key_event_send(MP_VOLUME_KEY_DOWN, true);
	}
	else if (!g_strcmp0(key->keyname, KEY_MEDIA)) {
		DEBUG_TRACE("Key pressed");
		if (ad->ear_key_press_cnt > 3)
		{
			DEBUG_TRACE("pressed more than 3times");
			return ECORE_CALLBACK_PASS_ON;
		}
		if (ad->ear_key_timer)
		{
			ecore_timer_del(ad->ear_key_timer);
			ad->ear_key_timer = NULL;
		}
		ad->ear_key_timer = ecore_timer_add(0.5, _mp_app_ear_key_timer_cb, ad);
		ad->ear_key_press_cnt++;
	}

	return ECORE_CALLBACK_PASS_ON;
}
开发者ID:minjinsong,项目名称:tizen-music-player,代码行数:33,代码来源:mp-app.c


示例13: tts_unprepare

int tts_unprepare(tts_h tts)
{
	SLOG(LOG_DEBUG, TAG_TTSC, "===== Unprepare TTS");

	tts_client_s* client = tts_client_get(tts);

	/* check handle */
	if (NULL == client) {
		SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] A handle is not available");
		return TTS_ERROR_INVALID_PARAMETER;
	}

	/* check state */
	if (client->current_state != TTS_STATE_READY) {
		SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Invalid State: Current state is not 'READY'"); 
		SLOG(LOG_DEBUG, TAG_TTSC, "=====");
		SLOG(LOG_DEBUG, TAG_TTSC, " ");
		return TTS_ERROR_INVALID_STATE;
	}

	int ret = tts_dbus_request_finalize(client->uid);
	if (0 != ret) {
		SLOG(LOG_WARN, TAG_TTSC, "[ERROR] Fail to request finalize");
	}

	client->before_state = client->current_state;
	client->current_state = TTS_STATE_CREATED;

	ecore_timer_add(0, __tts_notify_state_changed, (void*)tts);

	SLOG(LOG_DEBUG, TAG_TTSC, "=====");
	SLOG(LOG_DEBUG, TAG_TTSC, " ");

	return TTS_ERROR_NONE;
}
开发者ID:tizenorg,项目名称:framework.uifw.voice.tts,代码行数:35,代码来源:tts.c


示例14: connline_plugin_trigger_callback

int connline_plugin_trigger_callback(struct connline_context *context,
						connline_callback_f callback,
						enum connline_event event,
						char **changed_property)
{
	struct callback_trigger_data *trigger;
	Eina_Hash *context_ht;

	if (callback == NULL || context == NULL)
		return -EINVAL;

	trigger = calloc(1, sizeof(struct callback_trigger_data));
	if (trigger == NULL)
		return -ENOMEM;

	trigger->callback = callback;
	trigger->context = context;
	trigger->event = event;
	trigger->changed_property = changed_property;

	trigger->e_timer = ecore_timer_add(0, trigger_run, trigger);

	context_ht = eina_hash_find(triggers_table, context);
	if (context_ht == NULL) {
		context_ht = eina_hash_pointer_new(remove_trigger);

		eina_hash_add(triggers_table, context, context_ht);
	}

	eina_hash_add(context_ht, trigger->e_timer, trigger);

	return 0;
}
开发者ID:connectivity,项目名称:connline,代码行数:33,代码来源:efl.c


示例15: _init

static void _init(EWeather *eweather)
{
    Instance *inst = calloc(1, sizeof(Instance));
    eweather->plugin.data = inst;
    inst->weather = eweather;
    inst->count = 11;

    EWeather_Data *e_data = eweather_data_current_get(inst->weather);
    snprintf(e_data->city, sizeof(e_data->city),
            "Paris");
    snprintf(e_data->region, sizeof(e_data->region),
            "IDF");
    snprintf(e_data->country, sizeof(e_data->country),
            "FR");

    e_data = eweather_data_get(inst->weather, 1);
    snprintf(e_data->city, sizeof(e_data->city),
            "Paris");
    snprintf(e_data->region, sizeof(e_data->region),
            "IDF");
    snprintf(e_data->country, sizeof(e_data->country),
            "FR");

    e_data = eweather_data_get(inst->weather, 2);
    snprintf(e_data->city, sizeof(e_data->city),
            "Paris");
    snprintf(e_data->region, sizeof(e_data->region),
            "IDF");
    snprintf(e_data->country, sizeof(e_data->country),
            "FR");


    inst->check_timer = ecore_timer_add(0, _weather_cb_check, inst);
}
开发者ID:amitesh-singh,项目名称:Enlightenment,代码行数:34,代码来源:test.c


示例16: esql_connect_timeout_set

/**
 * @brief Set a timeout to disconnect after no activity
 * @param e The #Esql object (NOT NULL)
 * @param timeout The timeout in seconds
 *
 * Use this function to apply a timer policy to an Esql object and force disconnection
 * after @p timeout seconds of inactivity.
 * @note Setting a value <= 0 will disable this feature.
 */
void
esql_connect_timeout_set(Esql  *e,
                         double timeout)
{
   EINA_SAFETY_ON_NULL_RETURN(e);

   e->timeout = timeout;
   if (e->pool)
     {
        esql_pool_connect_timeout_set((Esql_Pool*)e, timeout);
        return;
     }
   if (timeout > 0.0)
     {
        if (e->timeout_timer)
          {
             ecore_timer_interval_set(e->timeout_timer, e->timeout);
             ecore_timer_reset(e->timeout_timer);
          }
        else e->timeout_timer = ecore_timer_add(timeout, (Ecore_Task_Cb)esql_timeout_cb, e);
     }
   else
     {
        ecore_timer_del(e->timeout_timer);
        e->timeout_timer = NULL;
        e->timeout = 0;
     }
}
开发者ID:Limsik,项目名称:e17,代码行数:37,代码来源:esql_connect.c


示例17: _next_level

static void
_next_level(Game *game, int level)
{
    char buf[32];

    if (level > LEVEL_MAX)
    {
        edje_object_signal_emit(game->base, "player_won", "");
        game->mode = OFF;
        return;
    }

    _score_inc(game, 100 * (level - LEVEL_DEFAULT));
    snprintf(buf, sizeof(buf), "%i", level - LEVEL_DEFAULT + 1);
    edje_object_part_text_set(game->base, "level", buf);
    if (level != LEVEL_DEFAULT)
        edje_object_signal_emit(game->base, "next_level", "");
    game->mode = PLAYING;
    game->level = level;
    _create_seq(game);
    game->step = 0;

    if (level == LEVEL_DEFAULT)
        _cpu_turn(game);
    else
        game->turn_timer = ecore_timer_add(1.0, _cpu_turn_cb, game);
}
开发者ID:gzorin,项目名称:e17,代码行数:27,代码来源:main.c


示例18: _ecore_pa_time_restart

void
_ecore_pa_time_restart(pa_time_event *event, const struct timeval *tv)
{
   struct timeval now;
   double interval;

   /* If tv is NULL disable timer */
   if (!tv)
     {
        ecore_timer_del(event->timer);
        event->timer = NULL;
        return;
     }

   event->tv = *tv;

   if (gettimeofday(&now, NULL) == -1)
     {
        ERR("Failed to get the current time!");
        return;
     }

   interval = (tv->tv_sec - now.tv_sec) + (tv->tv_usec - now.tv_usec) / 1000;
   if (event->timer)
     {
        event->timer = ecore_timer_add(interval, _ecore_time_wrapper, event);
     }
   else
     {
        ecore_timer_interval_set(event->timer, interval);
        ecore_timer_reset(event->timer);
     }
}
开发者ID:wjhendr,项目名称:enlightenment,代码行数:33,代码来源:ecore_audio_pulse.c


示例19: ecore_file_monitor_backend_add

Ecore_File_Monitor *
ecore_file_monitor_backend_add(const char *path,
                            void (*func) (void *data, Ecore_File_Monitor *em,
                                          Ecore_File_Event event,
                                          const char *path),
                            void *data)
{
   Ecore_File_Monitor *em;
   size_t len;

   if (!path) return NULL;
   if (!func) return NULL;

   em = calloc(1, sizeof(Ecore_File_Monitor_Poll));
   if (!em) return NULL;

   if (!_timer)
     _timer = ecore_timer_add(_interval, _ecore_file_monitor_poll_handler, NULL);
   else
     ecore_timer_interval_set(_timer, ECORE_FILE_INTERVAL_MIN);

   em->path = strdup(path);
   len = strlen(em->path);
   if (em->path[len - 1] == '/' && strcmp(em->path, "/"))
     em->path[len - 1] = 0;

   em->func = func;
   em->data = data;

   ECORE_FILE_MONITOR_POLL(em)->mtime = ecore_file_mod_time(em->path);
   _monitors = ECORE_FILE_MONITOR(eina_inlist_append(EINA_INLIST_GET(_monitors), EINA_INLIST_GET(em)));

   if (ecore_file_exists(em->path))
     {
        if (ecore_file_is_dir(em->path))
          {
             /* Check for subdirs */
             Eina_List *files;
             char *file;

             files = ecore_file_ls(em->path);
             EINA_LIST_FREE(files, file)
                    {
                       Ecore_File *f;
                       char buf[PATH_MAX];

                       f = calloc(1, sizeof(Ecore_File));
                       if (!f)
                    {
                       free(file);
                         continue;
                    }

                       snprintf(buf, sizeof(buf), "%s/%s", em->path, file);
                       f->name = file;
                       f->mtime = ecore_file_mod_time(buf);
                       f->is_dir = ecore_file_is_dir(buf);
                       em->files = (Ecore_File *) eina_inlist_append(EINA_INLIST_GET(em->files), EINA_INLIST_GET(f));
                    }
          }
开发者ID:caivega,项目名称:efl-1,代码行数:60,代码来源:ecore_file_monitor_poll.c


示例20: __tts_cb_set_state

int __tts_cb_set_state(int uid, int state)
{
	tts_client_s* client = tts_client_get_by_uid(uid);
	if( NULL == client ) {
		SLOG(LOG_ERROR, TAG_TTSC, "Handle not found");
		return -1;
	}

	tts_state_e state_from_daemon = (tts_state_e)state;

	if (client->current_state == state_from_daemon) {
		SLOG(LOG_DEBUG, TAG_TTSC, "Current state has already been %d", client->current_state);
		return 0;
	}

	if (NULL != client->state_changed_cb) {
		ecore_timer_add(0, __tts_notify_state_changed, client->tts);
	} else {
		SLOG(LOG_WARN, TAG_TTSC, "[WARNING] State changed callback is null");
	}

	client->before_state = client->current_state;
	client->current_state = state_from_daemon;

	return 0;
}
开发者ID:tizenorg,项目名称:framework.uifw.voice.tts,代码行数:26,代码来源:tts.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ ecore_x_sync函数代码示例发布时间:2022-05-30
下一篇:
C++ ecore_shutdown函数代码示例发布时间: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