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:
#include <Evas.h>
#include <Ecore.h>
#ifndef PACKAGE_DATA_DIR
#define PACKAGE_DATA_DIR "."
#endif
#define WIDTH 300
#define HEIGHT 300
{
edje = edje_object_add(canvas);
if (!edje)
{
return NULL;
}
if (!edje_object_file_set(edje, PACKAGE_DATA_DIR"/multisense.edj",
"example_group"))
{
int err = edje_object_load_error_get(edje);
const char *errmsg = edje_load_error_str(err);
EINA_LOG_ERR(
"could not load 'example_group' from multisense.edj: %s",
errmsg);
return NULL;
}
return edje;
}
int main()
{
Ecore_Evas *window;
if (!window)
{
return -1;
}
edje = create_my_group(canvas);
if (!edje)
return -2;
return 0;
}
Edje Graphical Design Library.
EAPI int ecore_evas_init(void)
Inits the Ecore_Evas system.
Definition: ecore_evas.c:606
EAPI void ecore_evas_show(Ecore_Evas *ee)
Shows an Ecore_Evas' window.
Definition: ecore_evas.c:1506
EAPI Evas * ecore_evas_get(const Ecore_Evas *ee)
Gets an Ecore_Evas's Evas.
Definition: ecore_evas.c:1326
EAPI int ecore_evas_shutdown(void)
Shuts down the Ecore_Evas system.
Definition: ecore_evas.c:674
EAPI Ecore_Evas * ecore_evas_new(const char *engine_name, int x, int y, int w, int h, const char *extra_options)
Creates a new Ecore_Evas based on engine name and common parameters.
Definition: ecore_evas.c:1065
EAPI void ecore_evas_free(Ecore_Evas *ee)
Frees an Ecore_Evas.
Definition: ecore_evas.c:1109
void ecore_main_loop_begin(void)
Runs the application main loop.
Definition: ecore_main.c:1290
int edje_shutdown(void)
Shuts down the Edje library.
Definition: edje_main.c:264
int edje_init(void)
Initializes the Edje library.
Definition: edje_main.c:35
#define EINA_LOG_ERR(fmt,...)
Logs a message with level ERROR on the default domain with the specified format.
Definition: eina_log.h:376
#define EINA_LOG_CRIT(fmt,...)
Logs a message with level CRITICAL on the default domain with the specified format.
Definition: eina_log.h:365
Eo Evas
An opaque handle to an Evas canvas.
Definition: Evas_Common.h:158
void evas_object_del(Evas_Object *obj)
Marks the given Evas object for deletion (when Evas will free its memory).
Definition: evas_object_main.c:928
void evas_object_show(Evas_Object *eo_obj)
Makes the given Evas object visible.
Definition: evas_object_main.c:1814
void evas_object_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
Move the given Evas object to the given location inside its canvas' viewport.
Definition: evas_object_main.c:1171
void evas_object_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
Changes the size of the given Evas object.
Definition: evas_object_main.c:1236
Efl_Canvas_Object Evas_Object
An Evas Object handle.
Definition: Evas_Common.h:180