void test_cb2(keynode_t *key, void* data) { struct timeval tv; gettimeofday(&tv, NULL); printf("\x1b[105;37m[VConf]\x1b[0m %d.%6d\n",(int)tv.tv_sec, (int)tv.tv_usec); printf("\x1b[105;37m[VConf]test_cb2 noti get\x1b[0m\n"); switch(vconf_keynode_get_type(key)) { case VCONF_TYPE_INT: printf("key = %s, value = %d(int)\n", vconf_keynode_get_name(key), vconf_keynode_get_int(key)); break; case VCONF_TYPE_BOOL: printf("key = %s, value = %d(bool)\n", vconf_keynode_get_name(key), vconf_keynode_get_bool(key)); break; case VCONF_TYPE_DOUBLE: printf("key = %s, value = %f(double)\n", vconf_keynode_get_name(key), vconf_keynode_get_dbl(key)); break; case VCONF_TYPE_STRING: printf("key = %s, value = %s(string)\n", vconf_keynode_get_name(key), vconf_keynode_get_str(key)); break; default: fprintf(stderr, "Unknown Type(%d)\n", vconf_keynode_get_type(key)); break; } // vconf_del_changed_cb2(vconf_keynode_get_name(key), test_cb2); return; }
static int __sys_lowmem(void *data, void *evt) { keynode_t *key = evt; int val; val = vconf_keynode_get_int(key); if (val >= VCONFKEY_SYSMAN_LOW_MEMORY_SOFT_WARNING) return __sys_do(data, SE_LOWMEM); return 0; }
static int __sys_lowbatt(void *data, void *evt) { keynode_t *key = evt; int val; val = vconf_keynode_get_int(key); /* VCONFKEY_SYSMAN_BAT_CRITICAL_LOW or VCONFKEY_SYSMAN_POWER_OFF */ if (val <= VCONFKEY_SYSMAN_BAT_CRITICAL_LOW) return __sys_do(data, SE_LOWBAT); return 0; }
void test_cb(keynode_t* pKey, void* pData) { switch(vconf_keynode_get_type(pKey)) { case VCONF_TYPE_INT: printf("key = %s, value = %d(int)\n", vconf_keynode_get_name(pKey), vconf_keynode_get_int(pKey)); break; default: break; } tet_result(TET_PASS); g_main_loop_quit(event_loop); }
static int __sys_lowmem_post(void *data, void *evt) { keynode_t *key = evt; int val; val = vconf_keynode_get_int(key); if (val >= VCONFKEY_SYSMAN_LOW_MEMORY_SOFT_WARNING) { #if defined(MEMORY_FLUSH_ACTIVATE) struct appcore *ac = data; ac->ops->cb_app(AE_LOWMEM_POST, ac->ops->data, NULL); #else malloc_trim(0); #endif } return 0; }
void get_operation(int i, const char* parent_dir) { keylist_t *kl=NULL; keynode_t *temp_node; int get_int; double get_dbl; char *get_str; vconf_get_dbl(vconfkeys[i][0], &get_dbl); vconf_get_bool(vconfkeys[i][1], &get_int); get_str=vconf_get_str(vconfkeys[i][2]); free(get_str); vconf_get_int(vconfkeys[i][3], &get_int); kl = vconf_keylist_new(); vconf_get(kl, parent_dir, 0); while((temp_node = vconf_keylist_nextnode(kl))) { switch(vconf_keynode_get_type(temp_node)) { case VCONF_TYPE_INT: printf("key = %s, value = %d\n", vconf_keynode_get_name(temp_node), vconf_keynode_get_int(temp_node)); break; case VCONF_TYPE_BOOL: printf("key = %s, value = %d\n", vconf_keynode_get_name(temp_node), vconf_keynode_get_bool(temp_node)); break; case VCONF_TYPE_DOUBLE: printf("key = %s, value = %f\n", vconf_keynode_get_name(temp_node), vconf_keynode_get_dbl(temp_node)); break; case VCONF_TYPE_STRING: printf("key = %s, value = %s\n", vconf_keynode_get_name(temp_node), vconf_keynode_get_str(temp_node)); break; default: printf("Unknown Type\n"); } } vconf_keylist_free(kl); }
void _mp_app_noti_changed_cb(keynode_t * node, void *data) { struct appdata *ad = (struct appdata *)data; char *keyname = vconf_keynode_get_name(node); DEBUG_TRACE("key changed: %s", keyname); if (strcmp(keyname, VCONFKEY_FILEMANAGER_DB_STATUS) == 0) { int db_state = vconf_keynode_get_int(node); if(db_state == VCONFKEY_FILEMANAGER_DB_UPDATED) { if (mp_playlist_mgr_get_current(ad->playlist_mgr) && !ecore_file_exists(mp_playlist_mgr_get_current(ad->playlist_mgr)->uri)) mp_play_stop_and_updateview(ad, TRUE); #ifndef MP_SOUND_PLAYER else mp_library_update_view(ad); #endif #ifdef MP_ENABLE_INOTIFY _mp_add_inofity_refresh_watch(ad); #endif } } else if (strcmp(keyname, VCONFKEY_SETAPPL_SOUND_STATUS_BOOL) == 0) { bool profile = vconf_keynode_get_bool(node); DEBUG_TRACE("profile changed: %d", profile); if (profile == false) { mp_player_mgr_pause(ad); } } else if (strcmp(keyname, MP_VCONFKEY_PLAYING_PID) == 0) { int playing_pid = vconf_keynode_get_int(node); if (playing_pid != getpid()) { DEBUG_TRACE("other player activated : [pid:%d]", playing_pid); if (ad->player_state == PLAY_STATE_PLAYING) { ad->paused_by_other_player = TRUE; mp_play_control_play_pause(ad, false); } //mp_minicontroller_destroy(ad); } } #if 1 //Minjin else if (strcmp(keyname, MP_LIVE_PLAY_STATE) == 0) { //bool profile = vconf_keynode_get_bool(node); int profile; vconf_get_bool("memory/private/org.tizen.music-player/player_state", &profile); DEBUG_TRACE("profile changed: %d(%s)", profile, MP_LIVE_PLAY_STATE); mp_play_control_play_pause(ad, profile); /* if (profile == false) { //TODO: phase and push vconf if (ad->player_state == PLAY_STATE_PLAYING) { if(mp_player_mgr_pause(ad)) { ad->paused_by_user = TRUE; } } else if (ad->player_state == PLAY_STATE_PREPARING) { WARN_TRACE("player_state is prepareing. set paused_by_user!!!"); ad->paused_by_user = TRUE; } } else { //TODO: get vconf and resume/play music //mp_player_mgr_resume(ad); ad->paused_by_user = FALSE; if (ad->player_state == PLAY_STATE_PAUSED) { if(mp_player_mgr_resume(ad)) { vconf_set_int(MP_VCONFKEY_PLAYING_PID, getpid()); if (ad->player_state == PLAY_STATE_PAUSED) mp_play_resume(ad); ad->player_state = PLAY_STATE_PLAYING; } } else if (ad->player_state == PLAY_STATE_READY) { mp_play_current_file(ad); } else if (ad->player_state == PLAY_STATE_PLAYING) { DEBUG_TRACE("player_state is already playing. Skip event"); } else if (ad->player_state == PLAY_STATE_PREPARING) { WARN_TRACE("player_state is preparing. Skip event"); } else { //silentmode -> go to listview -> click one track -> silent mode play no -> go to playing view -> click play icon mp_play_new_file(ad, TRUE); } } */ } #endif }