summaryrefslogtreecommitdiff
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:05:19 +0900
commitb1d46ddf658207102cee6747d358d85dbe762c8a (patch)
tree20817367dbee5144e1b2256b8eba3ae6ae94b875
parent864390c04d6f0ae81705c302386308da1479f619 (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
-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 9fb6d6cf89..08e0bff14e 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -9583,6 +9583,7 @@ edje_edit_source_generate(Evas_Object *obj)
9583 Eina_Strbuf *buf = NULL; 9583 Eina_Strbuf *buf = NULL;
9584 Eina_Bool ret = EINA_TRUE; 9584 Eina_Bool ret = EINA_TRUE;
9585 Eina_List *images = NULL, *color_classes = NULL, *styles = NULL, *fonts = NULL; 9585 Eina_List *images = NULL, *color_classes = NULL, *styles = NULL, *fonts = NULL;
9586 Eina_List *sounds = NULL;
9586 Eina_List *l; 9587 Eina_List *l;
9587 9588
9588 GET_ED_OR_RETURN(NULL); 9589 GET_ED_OR_RETURN(NULL);
@@ -9647,6 +9648,26 @@ edje_edit_source_generate(Evas_Object *obj)
9647 COLLECT_RESOURCE(part_desc->color_class, color_classes); 9648 COLLECT_RESOURCE(part_desc->color_class, color_classes);
9648 } 9649 }
9649 } 9650 }
9651 /* collect all sound samples, that uses in current collection */
9652 for (j = 0;
9653 j < (unsigned int)ed->collection->patterns.table_programs_size;
9654 j++)
9655 {
9656 Edje_Program *epr;
9657 Edje_Sound_Sample *sample;
9658 epr = ed->collection->patterns.table_programs[j];
9659 if ((!epr) || (epr->action != EDJE_ACTION_TYPE_SOUND_SAMPLE))
9660 continue;
9661 for(i = 0; i < (unsigned int)ed->file->sound_dir->samples_count; i++)
9662 {
9663 sample = &ed->file->sound_dir->samples[i];
9664 if (!strcmp(sample->name, epr->sample_name))
9665 {
9666 COLLECT_RESOURCE(sample, sounds);
9667 break;
9668 }
9669 }
9670 }
9650 9671
9651 buf = eina_strbuf_new(); 9672 buf = eina_strbuf_new();
9652 9673
@@ -9701,6 +9722,45 @@ edje_edit_source_generate(Evas_Object *obj)
9701 9722
9702 /* print the main code of group collections */ 9723 /* print the main code of group collections */
9703 BUF_APPEND(I0"collections {\n"); 9724 BUF_APPEND(I0"collections {\n");
9725 /* if sounds were found, print them */
9726 if (sounds)
9727 {
9728 Edje_Sound_Sample *uses_sample;
9729 BUF_APPEND(I1"sounds {\n");
9730 EINA_LIST_FOREACH(sounds, l, uses_sample)
9731 {
9732 BUF_APPEND(I2"sample {\n");
9733 BUF_APPENDF(I3"name: \"%s\" ", uses_sample->name);
9734 switch (uses_sample->compression)
9735 {
9736 case EDJE_SOUND_SOURCE_TYPE_INLINE_RAW:
9737 {
9738 BUF_APPEND("RAW;\n");
9739 break;
9740 }
9741 case EDJE_SOUND_SOURCE_TYPE_INLINE_COMP:
9742 {
9743 BUF_APPEND("COMP;\n");
9744 break;
9745 }
9746 case EDJE_SOUND_SOURCE_TYPE_INLINE_LOSSY:
9747 {
9748 BUF_APPENDF("LOSSY %f;\n", uses_sample->quality);
9749 break;
9750 }
9751 case EDJE_SOUND_SOURCE_TYPE_INLINE_AS_IS:
9752 {
9753 BUF_APPEND("AS_IS;\n");
9754 break;
9755 }
9756 default:
9757 break;
9758 }
9759 BUF_APPENDF(I3"source: \"%s\";\n", uses_sample->snd_src);
9760 BUF_APPEND(I2"}\n");
9761 }
9762 BUF_APPEND(I1"}\n");
9763 }
9704 _edje_generate_source_of_group(ed, ce, buf); 9764 _edje_generate_source_of_group(ed, ce, buf);
9705 BUF_APPEND(I0"}"); 9765 BUF_APPEND(I0"}");
9706 9766