src/core/mp-view-mgr.c
src/common/mp-common.c
src/common/mp-edit-callback.c
- src/common/mp-item.c
src/common/mp-menu.c
src/common/mp-ug-launch.c
src/common/mp-widget.c
${CMAKE_SOURCE_DIR}/src/core/mp-volume.c
${CMAKE_SOURCE_DIR}/src/core/mp-view-mgr.c
- ${CMAKE_SOURCE_DIR}/src/common/mp-item.c
${CMAKE_SOURCE_DIR}/src/common/mp-menu.c
${CMAKE_SOURCE_DIR}/src/common/mp-ug-launch.c
${CMAKE_SOURCE_DIR}/src/common/mp-widget.c
#include <Elementary.h>
#include <mp-define.h>
-bool mp_item_update_db(char *fid);
+
int mp_item_share_by_bt(const char *formed_path, int file_cnt);
int mp_media_info_get_sample_rate(mp_media_info_h media,
int *sample_rate);
int mp_media_info_get_duration(mp_media_info_h media, int *duration);
- int mp_media_info_get_played_time(mp_media_info_h media,
- time_t * time);
- int mp_media_info_get_played_count(mp_media_info_h media, int *count);
int mp_media_info_get_added_time(mp_media_info_h media, time_t * time);
int mp_media_info_get_playlist_member_id(mp_media_info_h media,
int *member_id);
int mp_media_info_set_favorite_media_db_only(mp_media_info_h media,
bool favorite);
int mp_media_info_set_favorite(mp_media_info_h media, bool favorite);
- int mp_media_info_set_played_time(mp_media_info_h media, time_t time);
- int mp_media_info_set_played_count(mp_media_info_h media, int count);
int mp_media_info_set_added_time(mp_media_info_h media, time_t time);
//int mp_media_info_set_cloud_thumbnail_path(mp_media_info_h media, const char *path);
MP_CHECK_VAL(ret == 0, -1);
break;
}
- case MP_TRACK_BY_PLAYED_TIME:{
- ret = mp_media_info_set_played_time(item_handle, 0);
- MP_CHECK_VAL(ret == 0, -1);
- break;
- }
case MP_TRACK_BY_FAVORITE:{
ret = mp_media_info_set_favorite(item_handle, 0);
MP_CHECK_VAL(ret == 0, -1);
break;
}
- case MP_TRACK_BY_PLAYED_COUNT:{
- ret = mp_media_info_set_played_count(item_handle, 0);
- MP_CHECK_VAL(ret == 0, -1);
- break;
- }
default:{
ret = mp_media_info_get_media_id(item_handle, &fid);
ret = mp_media_info_get_file_path(item_handle, &uri);
+++ /dev/null
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <sys/time.h>
-#include <glib.h>
-#include <fcntl.h>
-
-#include "music.h"
-#include "mp-item.h"
-#include "mp-menu.h"
-#include "mp-ug-launch.h"
-#include "mp-player-debug.h"
-
-bool mp_item_update_db(char *fid)
-{
-
- mp_media_info_h media;
- int count = 0;
- bool ret = FALSE;
-
- ret = mp_media_info_create(&media, fid);
- if (ret != 0) {
- mp_media_info_destroy(media);
- return false;
- }
-
- time_t current_time = time(NULL);
- mp_media_info_get_played_count(media, &count);
-
- mp_media_info_set_played_count(media, ++count);
- mp_media_info_set_played_time(media, current_time);
-
- mp_media_info_destroy(media);
-
- return TRUE;
-}
return res;
}
-int mp_media_info_get_played_time(mp_media_info_h media, time_t * time)
-{
- int res = MEDIA_CONTENT_ERROR_NONE;
- MP_CHECK_VAL(media, -1);
- MP_CHECK_VAL(media->s.meta, -1);
-
- res = audio_meta_get_played_time(media->s.meta, time);
- if (res != MEDIA_CONTENT_ERROR_NONE) {
- ERROR_TRACE("Error code 0x%x", res);
- }
- return res;
-}
-
-int mp_media_info_get_played_count(mp_media_info_h media, int *count)
-{
- int res = MEDIA_CONTENT_ERROR_NONE;
- MP_CHECK_VAL(media, -1);
- MP_CHECK_VAL(media->s.meta, -1);
-
- res = audio_meta_get_played_count(media->s.meta, count);
- if (res != MEDIA_CONTENT_ERROR_NONE) {
- ERROR_TRACE("Error code 0x%x", res);
- }
- return res;
-}
-
int mp_media_info_get_added_time(mp_media_info_h media, time_t * time)
{
int res = MEDIA_CONTENT_ERROR_NONE;
return res;
}
-int mp_media_info_set_played_time(mp_media_info_h media, time_t time)
-{
- int res = MEDIA_CONTENT_ERROR_NONE;
- MP_CHECK_VAL(media, -1);
- MP_CHECK_VAL(media->s.meta, -1);
-
- res = audio_meta_set_played_time(media->s.meta, time);
- if (res != MEDIA_CONTENT_ERROR_NONE) {
- ERROR_TRACE("Error code 0x%x", res);
- return res;
- }
- res = audio_meta_update_to_db(media->s.meta);
- if (res != MEDIA_CONTENT_ERROR_NONE) {
- ERROR_TRACE("Error code 0x%x", res);
- }
- return res;
-}
-
-int mp_media_info_set_played_count(mp_media_info_h media, int count)
-{
- int res = MEDIA_CONTENT_ERROR_NONE;
- MP_CHECK_VAL(media, -1);
- MP_CHECK_VAL(media->s.meta, -1);
-
- res = audio_meta_set_played_count(media->s.meta, count);
- if (res != MEDIA_CONTENT_ERROR_NONE) {
- ERROR_TRACE("Error code 0x%x", res);
- return res;
- }
- res = audio_meta_update_to_db(media->s.meta);
- if (res != MEDIA_CONTENT_ERROR_NONE) {
- ERROR_TRACE("Error code 0x%x", res);
- }
- return res;
-}
-
int mp_media_info_set_added_time(mp_media_info_h media, time_t time)
{
int res = MEDIA_CONTENT_ERROR_NONE;
return EINA_TRUE;
}
-static Eina_Bool _mp_item_update_db_idler(void *data)
-{
- if (!mp_item_update_db(data)) {
- WARN_TRACE("Error when update db");
- }
- return ECORE_CALLBACK_CANCEL;
-}
-
//this function should be called in player ready state.
bool mp_play_start_in_ready_state(void *data)
{
}
#endif
- if (current_item->uid) {
-
- if (current_item->track_type == MP_TRACK_URI) {
- ecore_idler_add(_mp_item_update_db_idler, current_item->uid);
- }
- }
#ifndef MP_SOUND_PLAYER
mp_view_mgr_post_event(GET_VIEW_MGR, MP_PLAY_TIME_COUNT_UPDATED);
#endif