

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 <\mbox{\hyperlink{Eina_8h}{Eina.h}}>}
\textcolor{preprocessor}{#include <Evas.h>}
\textcolor{preprocessor}{#include <Ecore.h>}
\textcolor{preprocessor}{#include <\mbox{\hyperlink{Ecore__Evas_8h}{Ecore\_Evas.h}}>}
\textcolor{preprocessor}{#include <\mbox{\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} \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *create\_my\_group(\mbox{\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas}} *canvas)
\{
   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *\mbox{\hyperlink{namespaceedje}{edje}};

   \mbox{\hyperlink{namespaceedje}{edje}} = edje\_object\_add(canvas);
   \textcolor{keywordflow}{if} (!\mbox{\hyperlink{namespaceedje}{edje}})
     \{
        \mbox{\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(\mbox{\hyperlink{namespaceedje}{edje}}, PACKAGE\_DATA\_DIR\textcolor{stringliteral}{"/multisense.edj"},
                             \textcolor{stringliteral}{"example\_group"}))
     \{
        \textcolor{keywordtype}{int} err = edje\_object\_load\_error\_get(\mbox{\hyperlink{namespaceedje}{edje}});
        \textcolor{keyword}{const} \textcolor{keywordtype}{char} *errmsg = edje\_load\_error\_str(err);
        \mbox{\hyperlink{group__Eina__Log__Group_ga2e33caeeeb6051526c01b7fea4d6c91b}{EINA\_LOG\_ERR}}(\textcolor{stringliteral}{"could not load 'example\_group' from multisense.edj: %s"},
                     errmsg);

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

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

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

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

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

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

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

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

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

   \textcolor{keywordflow}{return} 0;
\}
\end{DoxyCodeInclude}
 
\begin{DoxyCodeInclude}
collections \{
   sounds \{
      sample \{
         name: "sound\_name1" RAW;
         source: "duck.wav";
      \}
      tone: "tone-name" 2600;
   \}
   group \{
      name: "example\_group";
      parts \{
         part \{
            name: "sample\_bg";
            type: RECT;
            mouse\_events: 1;
            description \{
               state: "default" 0.0;
               min: 300 150;
               max: 300 150;
               color: 200 200 200 100;
               align: 0.5 0.0;
               rel1 \{
                  relative: 0.0 0.0;
               \}
            \}
         \}
         part \{
            name: "sample\_text";
            type: TEXT;
            mouse\_events: 1;
            repeat\_events: 1;
            description \{
               state: "default" 0.0;
               rel1.to: "sample\_bg";
               rel2.to: "sample\_bg";
               text \{
                  font: "Sans";
                  size: 20;
                  text: "Play Sound Sample";
               \}
            \}
         \}
         part \{
            name: "tone\_bg";
            type: RECT;
             mouse\_events: 1;
            description \{
               state: "default" 0.0;
               min: 300 150;
               max: 300 150;
               align: 0.5 0.0;
               color: 180 180 180 100;
               rel1 \{
                  relative: 0.0 1.0;
                  to: "sample\_bg";
               \}
            \}
         \}
         part \{
            name: "tone\_text";
            type: TEXT;
             mouse\_events: 1;
             repeat\_events: 1;
            description \{
               state: "default" 0.0;
               rel1.to: "tone\_bg";
               rel2.to: "tone\_bg";
               text \{
                  font: "Sans";
                  size: 20;
                  text: "Play Tone";
               \}
            \}
         \}
         programs \{
            program \{
               name: "click\_sample1";
               signal: "mouse,down,1";
               source: "sample\_bg";
               action: PLAY\_SAMPLE "sound\_name1" 1.0;
            \}
            program \{
               name: "click\_tone";
               signal: "mouse,down,1";
               source: "tone\_bg";
               action: PLAY\_TONE "tone-name" 0.1;
            \}
         \}
      \}
   \}
\}
\end{DoxyCodeInclude}
 