2 * Copyright 2017 Konsulko Group
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef MEDIAPLAYER_MANAGER_H
18 #define MEDIAPLAYER_MANAGER_H
22 #include <glib-object.h>
24 #include "lightmediascanner_interface.h"
26 /* Debug Trace Level */
27 #define DT_LEVEL_ERROR (1 << 1)
28 #define DT_LEVEL_WARNING (1 << 2)
29 #define DT_LEVEL_NOTICE (1 << 3)
30 #define DT_LEVEL_INFO (1 << 4)
31 #define DT_LEVEL_DEBUG (1 << 5)
34 #define LOGE(fmt, args...) \
35 DebugTraceSendMsg(DT_LEVEL_ERROR, g_strdup_printf("[%d:%s]" fmt, __LINE__, __FUNCTION__, ## args))
36 #define LOGW(fmt, args...) \
37 DebugTraceSendMsg(DT_LEVEL_WARNING, g_strdup_printf("[%d:%s]" fmt, __LINE__, __FUNCTION__, ## args))
38 #define LOGN(fmt, args...) \
39 DebugTraceSendMsg(DT_LEVEL_NOTICE, g_strdup_printf("[%d:%s]" fmt, __LINE__, __FUNCTION__, ## args))
40 #define LOGI(fmt, args...) \
41 DebugTraceSendMsg(DT_LEVEL_INFO, g_strdup_printf("[%d:%s]" fmt, __LINE__, __FUNCTION__, ## args))
42 #define LOGD(fmt, args...) \
43 DebugTraceSendMsg(DT_LEVEL_DEBUG, g_strdup_printf("[%d:%s]" fmt, __LINE__, __FUNCTION__, ## args))
46 #define _DEBUG_PRINT_DBUS
47 #define LOCAL_PRINT_DEBUG
50 #ifdef LOCAL_PRINT_DEBUG
51 #define D_PRINTF(fmt, args...) \
52 g_print("[DEBUG][%d:%s]"fmt, __LINE__, __FUNCTION__, ## args)
53 #define D_PRINTF_RAW(fmt, args...) \
54 g_print(""fmt, ## args)
56 #define D_PRINTF(fmt, args...)
57 #define D_PRINTF_RAW(fmt, args...)
58 #endif /* ifdef _DEBUG */
60 void DebugTraceSendMsg(int level, gchar* message);
63 #define AGENT_SERVICE "org.agent"
66 #define LIGHTMEDIASCANNER_SERVICE "org.lightmediascanner"
69 #define LIGHTMEDIASCANNER_PATH "/org/lightmediascanner/Scanner1"
72 #define LIGHTMEDIASCANNER_INTERFACE "org.lightmediascanner.Scanner1"
73 #define UDISKS_INTERFACE "org.freedesktop.UDisks"
74 #define FREEDESKTOP_PROPERTIES "org.freedesktop.DBus.Properties"
77 #define SQL_QUERY "SELECT files.path FROM files LEFT JOIN audios " \
78 "WHERE audios.id = files.id ORDER BY " \
79 "audios.artist_id, audios.album_id, audios.trackno"
85 } stMediaPlayerManage;
87 typedef struct tagBinding_RegisterCallback
89 void (*binding_device_added)(GList *list);
90 void (*binding_device_removed)(const char *obj_path);
91 } Binding_RegisterCallback_t;
93 /* ------ PUBLIC PLUGIN FUNCTIONS --------- */
94 void BindingAPIRegister(const Binding_RegisterCallback_t* pstRegisterCallback);
95 int MediaPlayerManagerInit(void);
100 GList* media_lightmediascanner_scan(void);