[Asterisk-cvs] asterisk/apps app_meetme.c,1.104,1.105

kpfleming kpfleming
Tue Sep 6 21:38:46 CDT 2005


Update of /usr/cvsroot/asterisk/apps
In directory mongoose.digium.com:/tmp/cvs-serv24705/apps

Modified Files:
	app_meetme.c 
Log Message:
actually do issue #4170 right... it was supposed to adjust talk volume, not listen volume (sorry)


Index: app_meetme.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_meetme.c,v
retrieving revision 1.104
retrieving revision 1.105
diff -u -d -r1.104 -r1.105
--- app_meetme.c	7 Sep 2005 01:30:00 -0000	1.104
+++ app_meetme.c	7 Sep 2005 01:39:11 -0000	1.105
@@ -147,8 +147,8 @@
 	char usrvalue[50];			/* Custom User Value */
 	char namerecloc[AST_MAX_EXTENSION];	/* Name Recorded file Location */
 	time_t jointime;			/* Time the user joined the conference */
-	int desired_volume;			/* Desired volume adjustment */
-	int actual_volume;			/* Actual volume adjustment (for channels that can't adjust) */
+	int desired_talk_volume;		/* Desired talk volume adjustment */
+	int actual_talk_volume;			/* Actual talk volume adjustment (for channels that can't adjust) */
 };
 
 #define ADMINFLAG_MUTED (1 << 1)	/* User is muted */
@@ -279,7 +279,7 @@
 	15,
 };
 
-static int set_volume(struct ast_conf_user *user, int volume)
+static int set_talk_volume(struct ast_conf_user *user, int volume)
 {
 	signed char gain_adjust;
 
@@ -287,49 +287,49 @@
 	   if successful, don't adjust in the frame reading routine
 	*/
 	gain_adjust = gain_map[volume + 5];
-	return ast_channel_setoption(user->chan, AST_OPTION_TXGAIN, &gain_adjust, sizeof(gain_adjust), 0);
+	return ast_channel_setoption(user->chan, AST_OPTION_RXGAIN, &gain_adjust, sizeof(gain_adjust), 0);
 }
 
-static void tweak_volume(struct ast_conf_user *user, enum volume_action action)
+static void tweak_talk_volume(struct ast_conf_user *user, enum volume_action action)
 {
 	switch (action) {
 	case VOL_UP:
-		switch (user->desired_volume) {
+		switch (user->desired_talk_volume) {
 		case 5:
 			break;
 		case 0:
-			user->desired_volume = 2;
+			user->desired_talk_volume = 2;
 			break;
 		case -2:
-			user->desired_volume = 0;
+			user->desired_talk_volume = 0;
 			break;
 		default:
-			user->desired_volume++;
+			user->desired_talk_volume++;
 			break;
 		}
 		break;
 	case VOL_DOWN:
-		switch (user->desired_volume) {
+		switch (user->desired_talk_volume) {
 		case -5:
 			break;
 		case 2:
-			user->desired_volume = 0;
+			user->desired_talk_volume = 0;
 			break;
 		case 0:
-			user->desired_volume = -2;
+			user->desired_talk_volume = -2;
 			break;
 		default:
-			user->desired_volume--;
+			user->desired_talk_volume--;
 			break;
 		}
 	}
 	/* attempt to make the adjustment in the channel driver;
 	   if successful, don't adjust in the frame reading routine
 	*/
-	if (!set_volume(user, user->desired_volume))
-		user->actual_volume = 0;
+	if (!set_talk_volume(user, user->desired_talk_volume))
+		user->actual_talk_volume = 0;
 	else
-		user->actual_volume = user->desired_volume;
+		user->actual_talk_volume = user->desired_talk_volume;
 }
 
 static void adjust_volume(struct ast_frame *f, int vol)
@@ -1037,8 +1037,8 @@
 			/* if we have just exited from the menu, and the user had a channel-driver
 			   volume adjustment, restore it
 			*/
-			if (!menu_active && menu_was_active && user->desired_volume && !user->actual_volume)
-				set_volume(user, user->desired_volume);
+			if (!menu_active && menu_was_active && user->desired_talk_volume && !user->actual_talk_volume)
+				set_talk_volume(user, user->desired_talk_volume);
 
 			menu_was_active = menu_active;
 
@@ -1187,8 +1187,8 @@
 				if (!f)
 					break;
 				if ((f->frametype == AST_FRAME_VOICE) && (f->subclass == AST_FORMAT_SLINEAR)) {
-					if (user->actual_volume) {
-						adjust_volume(f, user->actual_volume);
+					if (user->actual_talk_volume) {
+						adjust_volume(f, user->actual_talk_volume);
 					}
 					if (confflags &  CONFFLAG_MONITORTALKER) {
 						int totalsilence;
@@ -1244,8 +1244,8 @@
 					/* if we are entering the menu, and the user has a channel-driver
 					   volume adjustment, clear it
 					*/
-					if (!menu_active && user->desired_volume && !user->actual_volume)
-						set_volume(user, 0);
+					if (!menu_active && user->desired_talk_volume && !user->actual_talk_volume)
+						set_talk_volume(user, 0);
 
 					if (musiconhold) {
 			   			ast_moh_stop(chan);
@@ -1309,7 +1309,7 @@
 									break;	
 
 								case '9':
-									tweak_volume(user, VOL_UP);
+									tweak_talk_volume(user, VOL_UP);
 									break;
 
 								case '8':
@@ -1317,7 +1317,7 @@
 									break;
 
 								case '7':
-									tweak_volume(user, VOL_DOWN);
+									tweak_talk_volume(user, VOL_DOWN);
 									break;
 
 								default:
@@ -1364,7 +1364,7 @@
 									}
 									break;
 							case '9':
-								tweak_volume(user, VOL_UP);
+								tweak_talk_volume(user, VOL_UP);
 								break;
 
 							case '8':
@@ -1372,7 +1372,7 @@
 								break;
 
 							case '7':
-								tweak_volume(user, VOL_DOWN);
+								tweak_talk_volume(user, VOL_DOWN);
 								break;
 
 								default:




More information about the svn-commits mailing list