

This is a simple example in which a rect is created and sound and tone are played on mouse down event.

Focusing on the creation of sample and tone. It should be noted that creation of sample sound is from any supported (sndfile lib) audio file, tone from of specific audible frequency range are controlled by the theme\+:

The full source code follows\+: 
\begin{DoxyCodeInclude}

\textcolor{preprocessor}{#include <\hyperlink{Eina_8h}{Eina.h}>}
\textcolor{preprocessor}{#include <Evas.h>}
\textcolor{preprocessor}{#include <Ecore.h>}
\textcolor{preprocessor}{#include <\hyperlink{Ecore__Evas_8h}{Ecore\_Evas.h}>}
\textcolor{preprocessor}{#include <\hyperlink{Edje_8h}{Edje.h}>}

\textcolor{preprocessor}{#ifndef PACKAGE\_DATA\_DIR}
\textcolor{preprocessor}{#define PACKAGE\_DATA\_DIR "."}
\textcolor{preprocessor}{#endif}

\textcolor{preprocessor}{#define WIDTH  300}
\textcolor{preprocessor}{#define HEIGHT 300}

\textcolor{keyword}{static} \hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object} *create\_my\_group(\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas} *canvas)
\{
   \hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object} *edje;

   edje = edje\_object\_add(canvas);
   \textcolor{keywordflow}{if} (!edje)
     \{
        \hyperlink{group__Eina__Log__Group_ga5b50827f35399f9ff87f5d9d817c764a}{EINA\_LOG\_CRIT}(\textcolor{stringliteral}{"could not create edje object!"});
        \textcolor{keywordflow}{return} NULL;
     \}

   \textcolor{keywordflow}{if} (!edje\_object\_file\_set(edje, PACKAGE\_DATA\_DIR\textcolor{stringliteral}{"/multisense.edj"},
                             \textcolor{stringliteral}{"example\_group"}))
     \{
        \textcolor{keywordtype}{int} err = edje\_object\_load\_error\_get(edje);
        \textcolor{keyword}{const} \textcolor{keywordtype}{char} *errmsg = \hyperlink{group__Edje__Object__File_ga034465c2de4ab495802da20f332c386e}{edje\_load\_error\_str}(err);
        \hyperlink{group__Eina__Log__Group_ga2e33caeeeb6051526c01b7fea4d6c91b}{EINA\_LOG\_ERR}(\textcolor{stringliteral}{"could not load 'example\_group' from multisense.edj: %s"},
                     errmsg);

        \hyperlink{group__Evas__Object__Group__Basic_ga7e7a625dab7a3890532aa13b43117076}{evas\_object\_del}(edje);
        \textcolor{keywordflow}{return} NULL;
     \}

   \hyperlink{group__Evas__Font__Group_ga02da8091bbac768b8e86c7b74b2a94f9}{evas\_object\_move}(edje, 0, 0);
   \hyperlink{group__Evas__Font__Group_ga21e8604c0e4a93e469bff4bd069e82b5}{evas\_object\_resize}(edje, WIDTH, HEIGHT);
   \hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}(edje);
   \textcolor{keywordflow}{return} edje;
\}

\textcolor{keywordtype}{int} main()
\{
   Ecore\_Evas *window;
   \hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas} *canvas;
   \hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object} *edje;

   \hyperlink{group__Ecore__Evas__Group_ga32ddbb6457033ad435a177eb0c4fe235}{ecore\_evas\_init}();
   \hyperlink{group__Edje__General__Group_ga1c9c6594f38023c29fbfb2d0c8c675db}{edje\_init}();

   window = \hyperlink{group__Ecore__Evas__Group_gac7f2cdbcb79635c34317c1183dd04cb0}{ecore\_evas\_new}(NULL, 0, 0, WIDTH, HEIGHT, NULL);
   \textcolor{keywordflow}{if} (!window)
     \{
        \hyperlink{group__Eina__Log__Group_ga5b50827f35399f9ff87f5d9d817c764a}{EINA\_LOG\_CRIT}(\textcolor{stringliteral}{"could not create window."});
        \textcolor{keywordflow}{return} -1;
     \}
   canvas = \hyperlink{group__Ecore__Evas__Group_ga75a7cc694b6069e78df47dab0b0f2d20}{ecore\_evas\_get}(window);

   edje = create\_my\_group(canvas);
   \textcolor{keywordflow}{if} (!edje)
     \textcolor{keywordflow}{return} -2;

   \hyperlink{group__Ecore__Evas__Group_ga4953047ff97d4f1b0d75a7d513d4f317}{ecore\_evas\_show}(window);
   \hyperlink{group__Ecore__Main__Loop__Group_gaf103b9f668bb3e4fed12e52c6180132d}{ecore\_main\_loop\_begin}();

   \hyperlink{group__Evas__Object__Group__Basic_ga7e7a625dab7a3890532aa13b43117076}{evas\_object\_del}(edje);
   \hyperlink{group__Ecore__Evas__Group_gad3ec61f2aa03df4d3dbfd0d311e0c8dc}{ecore\_evas\_free}(window);

   \hyperlink{group__Edje__General__Group_ga01041f6702f2d81bf10c3e41899805cb}{edje\_shutdown}();
   \hyperlink{group__Ecore__Evas__Group_gab8fa311077f749190c9b622f672b2214}{ecore\_evas\_shutdown}();

   \textcolor{keywordflow}{return} 0;
\}
\end{DoxyCodeInclude}
 
\begin{DoxyCodeInclude}
1 collections \{
2    sounds \{
3       sample \{
4          name: "sound\_name1" RAW;
5          source: "duck.wav";
6       \}
7       tone: "tone-name" 2600;
8    \}
9    group \{
10       name: "example\_group";
11       parts \{
12          part \{
13             name: "sample\_bg";
14             type: RECT;
15             mouse\_events: 1;
16             description \{
17                state: "default" 0.0;
18                min: 300 150;
19                max: 300 150;
20                color: 200 200 200 100;
21                align: 0.5 0.0;
22                rel1 \{
23                   relative: 0.0 0.0;
24                \}
25             \}
26          \}
27          part \{
28             name: "sample\_text";
29             type: TEXT;
30             mouse\_events: 1;
31             repeat\_events: 1;
32             description \{
33                state: "default" 0.0;
34                rel1.to: "sample\_bg";
35                rel2.to: "sample\_bg";
36                text \{
37                   font: "Sans";
38                   size: 20;
39                   text: "Play Sound Sample";
40                \}
41             \}
42          \}
43          part \{
44             name: "tone\_bg";
45             type: RECT;
46              mouse\_events: 1;
47             description \{
48                state: "default" 0.0;
49                min: 300 150;
50                max: 300 150;
51                align: 0.5 0.0;
52                color: 180 180 180 100;
53                rel1 \{
54                   relative: 0.0 1.0;
55                   to: "sample\_bg";
56                \}
57             \}
58          \}
59          part \{
60             name: "tone\_text";
61             type: TEXT;
62              mouse\_events: 1;
63              repeat\_events: 1;
64             description \{
65                state: "default" 0.0;
66                rel1.to: "tone\_bg";
67                rel2.to: "tone\_bg";
68                text \{
69                   font: "Sans";
70                   size: 20;
71                   text: "Play Tone";
72                \}
73             \}
74          \}
75          programs \{
76             program \{
77                name: "click\_sample1";
78                signal: "mouse,down,1";
79                source: "sample\_bg";
80                action: PLAY\_SAMPLE "sound\_name1" 1.0;
81             \}
82             program \{
83                name: "click\_tone";
84                signal: "mouse,down,1";
85                source: "tone\_bg";
86                action: PLAY\_TONE "tone-name" 0.1;
87             \}
88          \}
89       \}
90    \}
91 \}
\end{DoxyCodeInclude}
 