

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}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <\mbox{\hyperlink{Eina_8h}{Eina.h}}>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <Evas.h>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <Ecore.h>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <\mbox{\hyperlink{Ecore__Evas_8h}{Ecore\_Evas.h}}>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <\mbox{\hyperlink{Edje_8h}{Edje.h}}>}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#ifndef PACKAGE\_DATA\_DIR}}
\DoxyCodeLine{\textcolor{preprocessor}{\#define PACKAGE\_DATA\_DIR "."}}
\DoxyCodeLine{\textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#define WIDTH  300}}
\DoxyCodeLine{\textcolor{preprocessor}{\#define HEIGHT 300}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *create\_my\_group(\mbox{\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas}} *canvas)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *edje;}
\DoxyCodeLine{}
\DoxyCodeLine{   edje = edje\_object\_add(canvas);}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (!edje)}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Eina__Log__Group_ga5b50827f35399f9ff87f5d9d817c764a}{EINA\_LOG\_CRIT}}(\textcolor{stringliteral}{"could not create edje object!"});}
\DoxyCodeLine{        \textcolor{keywordflow}{return} NULL;}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (!edje\_object\_file\_set(edje, PACKAGE\_DATA\_DIR\textcolor{stringliteral}{"/multisense.edj"},}
\DoxyCodeLine{                             \textcolor{stringliteral}{"example\_group"}))}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \textcolor{keywordtype}{int} err = edje\_object\_load\_error\_get(edje);}
\DoxyCodeLine{        \textcolor{keyword}{const} \textcolor{keywordtype}{char} *errmsg = edje\_load\_error\_str(err);}
\DoxyCodeLine{        \mbox{\hyperlink{group__Eina__Log__Group_ga2e33caeeeb6051526c01b7fea4d6c91b}{EINA\_LOG\_ERR}}(\textcolor{stringliteral}{"could not load 'example\_group' from multisense.edj: \%s"},}
\DoxyCodeLine{                     errmsg);}
\DoxyCodeLine{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga7e7a625dab7a3890532aa13b43117076}{evas\_object\_del}}(edje);}
\DoxyCodeLine{        \textcolor{keywordflow}{return} NULL;}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   evas\_object\_move(edje, 0, 0);}
\DoxyCodeLine{   evas\_object\_resize(edje, WIDTH, HEIGHT);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(edje);}
\DoxyCodeLine{   \textcolor{keywordflow}{return} edje;}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordtype}{int} main()}
\DoxyCodeLine{\{}
\DoxyCodeLine{   Ecore\_Evas *window;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas}} *canvas;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *edje;}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_ga32ddbb6457033ad435a177eb0c4fe235}{ecore\_evas\_init}}();}
\DoxyCodeLine{   \mbox{\hyperlink{group__Edje__General__Group_ga1c9c6594f38023c29fbfb2d0c8c675db}{edje\_init}}();}
\DoxyCodeLine{}
\DoxyCodeLine{   window = \mbox{\hyperlink{group__Ecore__Evas__Group_gac7f2cdbcb79635c34317c1183dd04cb0}{ecore\_evas\_new}}(NULL, 0, 0, WIDTH, HEIGHT, NULL);}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (!window)}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Eina__Log__Group_ga5b50827f35399f9ff87f5d9d817c764a}{EINA\_LOG\_CRIT}}(\textcolor{stringliteral}{"could not create window."});}
\DoxyCodeLine{        \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   canvas = \mbox{\hyperlink{group__Ecore__Evas__Group_ga75a7cc694b6069e78df47dab0b0f2d20}{ecore\_evas\_get}}(window);}
\DoxyCodeLine{}
\DoxyCodeLine{   edje = create\_my\_group(canvas);}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (!edje)}
\DoxyCodeLine{     \textcolor{keywordflow}{return} -\/2;}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_ga4953047ff97d4f1b0d75a7d513d4f317}{ecore\_evas\_show}}(window);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Main__Loop__Group_gaf103b9f668bb3e4fed12e52c6180132d}{ecore\_main\_loop\_begin}}();}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga7e7a625dab7a3890532aa13b43117076}{evas\_object\_del}}(edje);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_gad3ec61f2aa03df4d3dbfd0d311e0c8dc}{ecore\_evas\_free}}(window);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Edje__General__Group_ga01041f6702f2d81bf10c3e41899805cb}{edje\_shutdown}}();}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_gab8fa311077f749190c9b622f672b2214}{ecore\_evas\_shutdown}}();}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\}}
\end{DoxyCodeInclude}
 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{collections \{}
\DoxyCodeLine{   sounds \{}
\DoxyCodeLine{      sample \{}
\DoxyCodeLine{         name: "sound\_name1" RAW;}
\DoxyCodeLine{         source: "duck.wav";}
\DoxyCodeLine{      \}}
\DoxyCodeLine{      tone: "tone-\/name" 2600;}
\DoxyCodeLine{   \}}
\DoxyCodeLine{   group \{}
\DoxyCodeLine{      name: "example\_group";}
\DoxyCodeLine{      parts \{}
\DoxyCodeLine{         part \{}
\DoxyCodeLine{            name: "sample\_bg";}
\DoxyCodeLine{            type: RECT;}
\DoxyCodeLine{            mouse\_events: 1;}
\DoxyCodeLine{            description \{}
\DoxyCodeLine{               state: "default" 0.0;}
\DoxyCodeLine{               min: 300 150;}
\DoxyCodeLine{               max: 300 150;}
\DoxyCodeLine{               color: 200 200 200 100;}
\DoxyCodeLine{               align: 0.5 0.0;}
\DoxyCodeLine{               rel1 \{}
\DoxyCodeLine{                  relative: 0.0 0.0;}
\DoxyCodeLine{               \}}
\DoxyCodeLine{            \}}
\DoxyCodeLine{         \}}
\DoxyCodeLine{         part \{}
\DoxyCodeLine{            name: "sample\_text";}
\DoxyCodeLine{            type: TEXT;}
\DoxyCodeLine{            mouse\_events: 1;}
\DoxyCodeLine{            repeat\_events: 1;}
\DoxyCodeLine{            description \{}
\DoxyCodeLine{               state: "default" 0.0;}
\DoxyCodeLine{               rel1.to: "sample\_bg";}
\DoxyCodeLine{               rel2.to: "sample\_bg";}
\DoxyCodeLine{               text \{}
\DoxyCodeLine{                  font: "Sans";}
\DoxyCodeLine{                  size: 20;}
\DoxyCodeLine{                  text: "Play Sound Sample";}
\DoxyCodeLine{               \}}
\DoxyCodeLine{            \}}
\DoxyCodeLine{         \}}
\DoxyCodeLine{         part \{}
\DoxyCodeLine{            name: "tone\_bg";}
\DoxyCodeLine{            type: RECT;}
\DoxyCodeLine{             mouse\_events: 1;}
\DoxyCodeLine{            description \{}
\DoxyCodeLine{               state: "default" 0.0;}
\DoxyCodeLine{               min: 300 150;}
\DoxyCodeLine{               max: 300 150;}
\DoxyCodeLine{               align: 0.5 0.0;}
\DoxyCodeLine{               color: 180 180 180 100;}
\DoxyCodeLine{               rel1 \{}
\DoxyCodeLine{                  relative: 0.0 1.0;}
\DoxyCodeLine{                  to: "sample\_bg";}
\DoxyCodeLine{               \}}
\DoxyCodeLine{            \}}
\DoxyCodeLine{         \}}
\DoxyCodeLine{         part \{}
\DoxyCodeLine{            name: "tone\_text";}
\DoxyCodeLine{            type: TEXT;}
\DoxyCodeLine{             mouse\_events: 1;}
\DoxyCodeLine{             repeat\_events: 1;}
\DoxyCodeLine{            description \{}
\DoxyCodeLine{               state: "default" 0.0;}
\DoxyCodeLine{               rel1.to: "tone\_bg";}
\DoxyCodeLine{               rel2.to: "tone\_bg";}
\DoxyCodeLine{               text \{}
\DoxyCodeLine{                  font: "Sans";}
\DoxyCodeLine{                  size: 20;}
\DoxyCodeLine{                  text: "Play Tone";}
\DoxyCodeLine{               \}}
\DoxyCodeLine{            \}}
\DoxyCodeLine{         \}}
\DoxyCodeLine{         programs \{}
\DoxyCodeLine{            program \{}
\DoxyCodeLine{               name: "click\_sample1";}
\DoxyCodeLine{               signal: "mouse,down,1";}
\DoxyCodeLine{               source: "sample\_bg";}
\DoxyCodeLine{               action: PLAY\_SAMPLE "sound\_name1" 1.0;}
\DoxyCodeLine{            \}}
\DoxyCodeLine{            program \{}
\DoxyCodeLine{               name: "click\_tone";}
\DoxyCodeLine{               signal: "mouse,down,1";}
\DoxyCodeLine{               source: "tone\_bg";}
\DoxyCodeLine{               action: PLAY\_TONE "tone-\/name" 0.1;}
\DoxyCodeLine{            \}}
\DoxyCodeLine{         \}}
\DoxyCodeLine{      \}}
\DoxyCodeLine{   \}}
\DoxyCodeLine{\}}
\end{DoxyCodeInclude}
 