asdfuser pushed a commit to branch master.
commit 1ba22c2bc42f0b964cec4cd191e88d1071996d26
Author: Daniel Willmann <[email protected]>
Date: Mon Mar 18 16:08:34 2013 +0000
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 <[email protected]>
---
src/examples/ecore/ecore_audio_playback.c | 28 ++++++++++++++++++++++++++--
1 file changed, 26 insertions(+), 2 deletions(-)
diff --git a/src/examples/ecore/ecore_audio_playback.c
b/src/examples/ecore/ecore_audio_playback.c
index 6b0f0f4..86ff8c2 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)
--
------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire
the most talented Cisco Certified professionals. Visit the
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html