summaryrefslogtreecommitdiff
path: root/src/lib/edje
diff options
context:
space:
mode:
authorChunEon Park <hermet@hermet.pe.kr>2014-12-29 11:59:53 +0900
committerChunEon Park <hermet@hermet.pe.kr>2014-12-29 12:01:21 +0900
commit3f9d952774ddd8fd847906353c0cd89037880abb (patch)
tree26c4dd7586a79c3c0fe9e80b9d0798c1f19aa665 /src/lib/edje
parent21707789d7bb8ed590faf6c3d91e2a0a452f979e (diff)
Edje_Edit: Add sound samples into generated code for the group.
Summary: Include sound samples, that uses in programs of this group in collections block. @fix Reviewers: cedric, Hermet, raster, reutskiy.v.v Projects: #efl Differential Revision: https://phab.enlightenment.org/D1824
Diffstat (limited to 'src/lib/edje')
-rw-r--r--src/lib/edje/edje_edit.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index fae3ac0ecc..18c45b72d0 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -9715,6 +9715,7 @@ edje_edit_source_generate(Evas_Object *obj)
9715 Eina_Strbuf *buf = NULL; 9715 Eina_Strbuf *buf = NULL;
9716 Eina_Bool ret = EINA_TRUE; 9716 Eina_Bool ret = EINA_TRUE;
9717 Eina_List *images = NULL, *color_classes = NULL, *styles = NULL, *fonts = NULL; 9717 Eina_List *images = NULL, *color_classes = NULL, *styles = NULL, *fonts = NULL;
9718 Eina_List *sounds = NULL;
9718 Eina_List *l; 9719 Eina_List *l;
9719 9720
9720 GET_ED_OR_RETURN(NULL); 9721 GET_ED_OR_RETURN(NULL);
@@ -9784,6 +9785,26 @@ edje_edit_source_generate(Evas_Object *obj)
9784 COLLECT_RESOURCE(part_desc->color_class, color_classes); 9785 COLLECT_RESOURCE(part_desc->color_class, color_classes);
9785 } 9786 }
9786 } 9787 }
9788 /* collect all sound samples, that uses in current collection */
9789 for (j = 0;
9790 j < (unsigned int)ed->collection->patterns.table_programs_size;
9791 j++)
9792 {
9793 Edje_Program *epr;
9794 Edje_Sound_Sample *sample;
9795 epr = ed->collection->patterns.table_programs[j];
9796 if ((!epr) || (epr->action != EDJE_ACTION_TYPE_SOUND_SAMPLE))
9797 continue;
9798 for(i = 0; i < (unsigned int)ed->file->sound_dir->samples_count; i++)
9799 {
9800 sample = &ed->file->sound_dir->samples[i];
9801 if (!strcmp(sample->name, epr->sample_name))
9802 {
9803 COLLECT_RESOURCE(sample, sounds);
9804 break;
9805 }
9806 }
9807 }
9787 9808
9788 buf = eina_strbuf_new(); 9809 buf = eina_strbuf_new();
9789 9810
@@ -9842,6 +9863,45 @@ edje_edit_source_generate(Evas_Object *obj)
9842 9863
9843 /* print the main code of group collections */ 9864 /* print the main code of group collections */
9844 BUF_APPEND(I0"collections {\n"); 9865 BUF_APPEND(I0"collections {\n");
9866 /* if sounds were found, print them */
9867 if (sounds)
9868 {
9869 Edje_Sound_Sample *uses_sample;
9870 BUF_APPEND(I1"sounds {\n");
9871 EINA_LIST_FOREACH(sounds, l, uses_sample)
9872 {
9873 BUF_APPEND(I2"sample {\n");
9874 BUF_APPENDF(I3"name: \"%s\" ", uses_sample->name);
9875 switch (uses_sample->compression)
9876 {
9877 case EDJE_SOUND_SOURCE_TYPE_INLINE_RAW:
9878 {
9879 BUF_APPEND("RAW;\n");
9880 break;
9881 }
9882 case EDJE_SOUND_SOURCE_TYPE_INLINE_COMP:
9883 {
9884 BUF_APPEND("COMP;\n");
9885 break;
9886 }
9887 case EDJE_SOUND_SOURCE_TYPE_INLINE_LOSSY:
9888 {
9889 BUF_APPENDF("LOSSY %f;\n", uses_sample->quality);
9890 break;
9891 }
9892 case EDJE_SOUND_SOURCE_TYPE_INLINE_AS_IS:
9893 {
9894 BUF_APPEND("AS_IS;\n");
9895 break;
9896 }
9897 default:
9898 break;
9899 }
9900 BUF_APPENDF(I3"source: \"%s\";\n", uses_sample->snd_src);
9901 BUF_APPEND(I2"}\n");
9902 }
9903 BUF_APPEND(I1"}\n");
9904 }
9845 _edje_generate_source_of_group(ed, ce, buf); 9905 _edje_generate_source_of_group(ed, ce, buf);
9846 BUF_APPEND(I0"}"); 9906 BUF_APPEND(I0"}");
9847 9907