summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Willmann <d.willmann@samsung.com>2013-03-18 16:08:34 +0000
committerDaniel Willmann <d.willmann@samsung.com>2013-03-18 16:08:34 +0000
commit27484f3c1b010cb15eb7d96929f135111d5466ce (patch)
treed562f0adc48cc7383c18435776497a72cb98305e
parent4719b693e93e6a09bbf29b6f5ebbf592e1e952c3 (diff)
downloadefl-27484f3c1b010cb15eb7d96929f135111d5466ce.tar.gz
ecore_audio_playback: Support changing of speed
Implement ecore_audio_input_speed_set() in playback example Fix volume limit off-by-one check while I'm at it Signed-off-by: Daniel Willmann <d.willmann@samsung.com>
-rw-r--r--src/examples/ecore/ecore_audio_playback.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/examples/ecore/ecore_audio_playback.c b/src/examples/ecore/ecore_audio_playback.c
index 6b0f0f4783..86ff8c25a1 100644
--- a/src/examples/ecore/ecore_audio_playback.c
+++ b/src/examples/ecore/ecore_audio_playback.c
@@ -87,18 +87,42 @@ handle_cmd(char *cmd, size_t bread)
}
else if (!strncmp(cmd, "+", bread))
{
- if (volume <= 1.5)
+ if (volume < 1.5)
volume += 0.01;
ecore_audio_output_volume_set(out, volume);
printf("Volume: %3.0f%%\n", volume * 100);
}
else if (!strncmp(cmd, "-", bread))
{
- if (volume >= 0)
+ if (volume > 0)
volume -= 0.01;
ecore_audio_output_volume_set(out, volume);
printf("Volume: %3.0f%%\n", volume * 100);
}
+ else if (!strncmp(cmd, "*", bread))
+ {
+ double speed;
+ EINA_LIST_FOREACH(out_inputs, input, in)
+ {
+ speed = ecore_audio_input_speed_get(in);
+ if (speed < 2.0)
+ speed += 0.01;
+ ecore_audio_input_speed_set(in, speed);
+ printf("Speed: %3.0f%% (%s)\n", speed * 100, ecore_audio_input_name_get(in));
+ }
+ }
+ else if (!strncmp(cmd, "/", bread))
+ {
+ double speed;
+ EINA_LIST_FOREACH(out_inputs, input, in)
+ {
+ speed = ecore_audio_input_speed_get(in);
+ if (speed > 0.5)
+ speed -= 0.01;
+ ecore_audio_input_speed_set(in, speed);
+ printf("Speed: %3.0f%% (%s)\n", speed * 100, ecore_audio_input_name_get(in));
+ }
+ }
else if (!strncmp(cmd, " ", bread))
{
EINA_LIST_FOREACH(out_inputs, input, in)