summaryrefslogtreecommitdiff
path: root/src/lib/edje/edje_embryo.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-02-09 19:08:12 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-02-09 19:08:12 +0900
commitdb1990020a9039d867bf620d9f9463dda443f31e (patch)
tree5eee2efd5fbca5563a5359adce32398c977b4508 /src/lib/edje/edje_embryo.c
parent7c7f2eb30032b520d66fe43fa7000ae18264de49 (diff)
edje - feature - add channel types for sounds and ability to mute them
this adds a new feature to be able to assign a sample to a given "type" of audio channel, and then to be able to mute these from code.
Diffstat (limited to 'src/lib/edje/edje_embryo.c')
-rw-r--r--src/lib/edje/edje_embryo.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/lib/edje/edje_embryo.c b/src/lib/edje/edje_embryo.c
index cb20648433..d09ae72024 100644
--- a/src/lib/edje/edje_embryo.c
+++ b/src/lib/edje/edje_embryo.c
@@ -73,8 +73,8 @@
73 * set_state(part_id, state[], Float:state_val) 73 * set_state(part_id, state[], Float:state_val)
74 * get_state(part_id, dst[], maxlen, &Float:val) 74 * get_state(part_id, dst[], maxlen, &Float:val)
75 * set_tween_state(part_id, Float:tween, state1[], Float:state1_val, state2[], Float:state2_val) 75 * set_tween_state(part_id, Float:tween, state1[], Float:state1_val, state2[], Float:state2_val)
76 * play_sample(sample_name, speed) 76 * play_sample(sample_name, speed, ...)
77 * play_tone(tone_name, duration) 77 * play_tone(tone_name, duration, ...)
78 * run_program(program_id) 78 * run_program(program_id)
79 * Direction:get_drag_dir(part_id) 79 * Direction:get_drag_dir(part_id)
80 * get_drag(part_id, &Float:dx, &Float:&dy) 80 * get_drag(part_id, &Float:dx, &Float:&dy)
@@ -915,13 +915,18 @@ _edje_embryo_fn_play_sample(Embryo_Program *ep, Embryo_Cell *params)
915 Edje *ed; 915 Edje *ed;
916 char *sample_name = NULL; 916 char *sample_name = NULL;
917 float speed = 1.0; 917 float speed = 1.0;
918 int channel = 0;
918 919
919 CHKPARAM(2); 920 if (params[0] < (int) (sizeof(Embryo_Cell) * 2))
921 return 0;
920 ed = embryo_program_data_get(ep); 922 ed = embryo_program_data_get(ep);
921 GETSTR(sample_name, params[1]); 923 GETSTR(sample_name, params[1]);
922 if ((!sample_name)) return 0; 924 if ((!sample_name)) return 0;
923 speed = EMBRYO_CELL_TO_FLOAT(params[2]); 925 speed = EMBRYO_CELL_TO_FLOAT(params[2]);
924 _edje_multisense_internal_sound_sample_play(ed, sample_name, (double)speed); 926 if (params[0] == (int) (sizeof(Embryo_Cell) * 3))
927 GETINT(channel, params[3]);
928 _edje_multisense_internal_sound_sample_play(ed, sample_name,
929 (double)speed, channel);
925 return 0; 930 return 0;
926} 931}
927 932
@@ -931,13 +936,18 @@ _edje_embryo_fn_play_tone(Embryo_Program *ep, Embryo_Cell *params)
931 Edje *ed; 936 Edje *ed;
932 char *tone_name = NULL; 937 char *tone_name = NULL;
933 float duration = 0.1; 938 float duration = 0.1;
939 int channel = 0;
934 940
935 CHKPARAM(2); 941 if (params[0] < (int) (sizeof(Embryo_Cell) * 2))
942 return 0;
936 ed = embryo_program_data_get(ep); 943 ed = embryo_program_data_get(ep);
937 GETSTR(tone_name, params[1]); 944 GETSTR(tone_name, params[1]);
938 if ((!tone_name)) return 0; 945 if ((!tone_name)) return 0;
939 duration = EMBRYO_CELL_TO_FLOAT(params[2]); 946 duration = EMBRYO_CELL_TO_FLOAT(params[2]);
940 _edje_multisense_internal_sound_tone_play(ed, tone_name, (double) duration); 947 if (params[0] == (int) (sizeof(Embryo_Cell) * 3))
948 GETINT(channel, params[3]);
949 _edje_multisense_internal_sound_tone_play(ed, tone_name,
950 (double)duration, channel);
941 return 0; 951 return 0;
942} 952}
943 953