aboutsummaryrefslogtreecommitdiffstats
path: root/binding/media-manager.h
diff options
context:
space:
mode:
authorFarshid Monhaseri <monhaseri.f@gmail.com>2020-01-02 21:37:11 +0330
committerFarshid Monhaseri <monhaseri.f@gmail.com>2020-01-11 09:06:30 +0330
commit7051b6f8422fdb742bf70077eacfd1249ac21d21 (patch)
tree6e2149f9e5c22f3506ae664cb1b553edcc059665 /binding/media-manager.h
parentee883c3f23b4a4b49730396e7522646b9c224ab4 (diff)
Add scan-type(audio,video,image,all) to scanner
Bug-AGL: SPEC-3096 User can pass 'types' as a request property with 'audio','video', 'image','all' values as a single 'string' value or as an array of 'string' values along 'media_result','subscribe','unsubscribe' verbs to scan or register the events with those scan-types. If the user doesn't provide the 'types' request property, the API will function as before with 'audio' and 'video' scan-types. Change-Id: I8ff49f89e2696f600dfb2935403d8b0c8246c07d Signed-off-by: Farshid Monhaseri <monhaseri.f@gmail.com>
Diffstat (limited to 'binding/media-manager.h')
-rw-r--r--binding/media-manager.h32
1 files changed, 28 insertions, 4 deletions
diff --git a/binding/media-manager.h b/binding/media-manager.h
index 4b381dc..c5b6778 100644
--- a/binding/media-manager.h
+++ b/binding/media-manager.h
@@ -97,9 +97,18 @@ void DebugTraceSendMsg(int level, gchar* message);
"ORDER BY " \
"videos.title"
+#define IMAGE_SQL_QUERY \
+ "SELECT files.path, images.title, \"\", \"\", " \
+ " \"\" FROM files " \
+ "INNER JOIN images ON images.id = files.id " \
+ "WHERE files.path LIKE '%s/%%' " \
+ "ORDER BY " \
+ "images.title"
+
typedef struct {
GList *list;
gchar *uri_filter;
+ gint type_filter;
GMutex m;
Scanner1 *lms_proxy;
} stMediaPlayerManage;
@@ -114,6 +123,9 @@ typedef struct tagBinding_RegisterCallback
void BindingAPIRegister(const Binding_RegisterCallback_t* pstRegisterCallback);
int MediaPlayerManagerInit(void);
+gint ScanTypeAppend(gint);
+gint ScanTypeRemove(gint);
+
void ListLock();
void ListUnlock();
@@ -121,7 +133,7 @@ GList* media_lightmediascanner_scan(GList *list, gchar *uri, int scan_type);
struct Media_Item {
gchar *path;
- gint type;
+ gchar *type;
struct {
gchar *title;
gchar *artist;
@@ -132,11 +144,23 @@ struct Media_Item {
};
enum {
- LMS_AUDIO_SCAN,
- LMS_VIDEO_SCAN,
- LMS_SCAN_COUNT,
+ LMS_AUDIO_ID,
+ LMS_VIDEO_ID,
+ LMS_IMAGE_ID,
+ LMS_SCAN_COUNT
};
+#define LMS_AUDIO_SCAN (1 << LMS_AUDIO_ID)
+#define LMS_VIDEO_SCAN (1 << LMS_VIDEO_ID)
+#define LMS_IMAGE_SCAN (1 << LMS_IMAGE_ID)
+
+#define LMS_ALL_SCAN ( LMS_AUDIO_SCAN | LMS_VIDEO_SCAN | LMS_IMAGE_SCAN )
+
+#define MEDIA_AUDIO "audio"
+#define MEDIA_VIDEO "video"
+#define MEDIA_IMAGE "image"
+#define MEDIA_ALL "all"
+
extern const char *lms_scan_types[LMS_SCAN_COUNT];
#endif