[Freeswitch-svn] [commit] r12114 - freeswitch/trunk/src
FreeSWITCH SVN
brian at freeswitch.org
Tue Feb 17 13:08:16 PST 2009
Author: brian
Date: Tue Feb 17 15:08:16 2009
New Revision: 12114
Log:
add volume to switch_cpp
Modified:
freeswitch/trunk/src/switch_cpp.cpp
Modified: freeswitch/trunk/src/switch_cpp.cpp
==============================================================================
--- freeswitch/trunk/src/switch_cpp.cpp (original)
+++ freeswitch/trunk/src/switch_cpp.cpp Tue Feb 17 15:08:16 2009
@@ -1216,6 +1216,29 @@
return SWITCH_STATUS_FALSE;
+ } else if (!strncasecmp(result, "volume", 6)) {
+ char *p;
+
+ if ((p = strchr(result, ':'))) {
+ p++;
+ if (*p == '+' || *p == '-') {
+ int step;
+ if (!(step = atoi(p))) {
+ step = 1;
+ }
+ fhp->vol += step;
+ } else {
+ int vol = atoi(p);
+ fhp->vol = vol;
+ }
+ return SWITCH_STATUS_SUCCESS;
+ }
+
+ if (fhp->vol) {
+ switch_normalize_volume(fhp->vol);
+ }
+
+ return SWITCH_STATUS_FALSE;
} else if (!strcasecmp(result, "pause")) {
if (switch_test_flag(fhp, SWITCH_FILE_PAUSE)) {
switch_clear_flag(fhp, SWITCH_FILE_PAUSE);
More information about the Freeswitch-svn
mailing list