rimmed pushed a commit to branch master.

http://git.enlightenment.org/tools/eflete.git/commit/?id=7d41d2c510e6065c6fa32ac4c41edff99e97ba7a

commit 7d41d2c510e6065c6fa32ac4c41edff99e97ba7a
Author: Vyacheslav Reutskiy <v.reuts...@samsung.com>
Date:   Thu Jan 21 14:39:46 2016 +0200

    popup: add popup helper for choose a sound
    
    Change-Id: I159a5718231397d39d26830c45a45d0c41fa6899
---
 src/bin/ui/main_window.h |  5 +++++
 src/bin/ui/popup.c       | 28 ++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+)

diff --git a/src/bin/ui/main_window.h b/src/bin/ui/main_window.h
index ac7b56c..54a7a64 100644
--- a/src/bin/ui/main_window.h
+++ b/src/bin/ui/main_window.h
@@ -352,6 +352,11 @@ popup_fileselector_image_helper(const char *title, 
Evas_Object *follow_up, const
                                 Eina_Bool multi, Eina_Bool is_save);
 
 void
+popup_fileselector_sound_helper(const char *title, Evas_Object *follow_up, 
const char *path,
+                                Helper_Done_Cb func, void *data,
+                                Eina_Bool multi, Eina_Bool is_save);
+
+void
 popup_log_message_helper(const char *msg);
 
 void
diff --git a/src/bin/ui/popup.c b/src/bin/ui/popup.c
index 99a75fd..b3f9e3d 100644
--- a/src/bin/ui/popup.c
+++ b/src/bin/ui/popup.c
@@ -402,6 +402,34 @@ popup_fileselector_image_helper(const char *title, 
Evas_Object *follow_up, const
    _fileselector_helper(title, follow_up, path, multi, is_save, func, data, 
_images_filter);
 }
 
+static Eina_Bool
+_sounds_filter(const char *path,
+               Eina_Bool dir,
+               void *data __UNUSED__)
+{
+   int i;
+   Eina_Bool res;
+   const char *sound_formats[] = { "wav", "ogg", "flac", NULL};
+
+   if (dir) return true;
+   i = 0;
+   while(sound_formats[i])
+     {
+        res = eina_str_has_extension(path, sound_formats[i++]);
+        if (res) return true;
+     }
+
+   return false;
+}
+
+void
+popup_fileselector_sound_helper(const char *title, Evas_Object *follow_up, 
const char *path,
+                                Helper_Done_Cb func, void *data,
+                                Eina_Bool multi, Eina_Bool is_save)
+{
+   _fileselector_helper(title, follow_up, path, multi, is_save, func, data, 
_sounds_filter);
+}
+
 #define ITEM_WIDTH 100
 #define ITEM_HEIGHT 115
 #define GROUP_ITEM_WIDTH 36

-- 


Reply via email to