Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
xhjin
Old
#1  
Junior Member - OP
Thanks Meter 0
Posts: 6
Join Date: Jun 2004
Default How to set and get GSM call's volume in eVC4?


Dear all:
I am developping a program to change XDAII's sound.
using waveOutSetVolume() and waveOutGetVolume() can set and get XDAII's volume correctly, when playing multimedia or other applications.
But it does not work for GSM call. I mean in a GSM call, these two functions cannot do anything about gsm's volume.
Who know how to set and get GSM's volume in a call?
using waveOutGetNumDevs() can only return 1, which means only 1 waveform device available. whether it is mean GSM audio device is not a waveform device? then how to control it?
thanks
 
bong99
Old
#2  
Junior Member
Thanks Meter 0
Posts: 14
Join Date: Aug 2003
Do u means ringtone volume?
 
xhjin
Old
#3  
Junior Member - OP
Thanks Meter 0
Posts: 6
Join Date: Jun 2004
YES. Do u have any idea?
 
jwhitham
Old
#4  
Senior Member
Thanks Meter 1
Posts: 164
Join Date: Nov 2003
Location: Reading
Not sure if this will work but try looking up phoneSetRing in the help:-

LONG WINAPI phoneSetRing(
HPHONE hPhone,
DWORD dwRingMode,
DWORD dwVolume
);

hPhone
Handle to the open phone device. The application must be the owner of the phone device.

dwRingMode
Ringing pattern with which to ring the phone. This parameter must be within the range of zero to the value of the dwNumRingModes member in the PHONECAPS structure. If dwNumRingModes is zero, the ring mode of the phone cannot be controlled; if dwNumRingModes is 1, a value of zero for dwRingMode indicates that the phone should not be rung (silence), and other values from 1 to dwNumRingModes are valid ring modes for the phone device.

dwVolume
The volume level with which the phone is ringing. This is a number in the range 0x00000000 (silence) to 0x0000FFFF (maximum volume). The actual granularity and quantization of volume settings in this range are service provider-specific. A value for dwVolume that is out of range is set to the nearest value in the range.

Jamie
 
xhjin
Old
#5  
Junior Member - OP
Thanks Meter 0
Posts: 6
Join Date: Jun 2004
Default I know how to set ring volume, but how to display it?

Dear all:
Now i can set ring volume according some experts help. they had ever past some guides in this forum. I just re-paste part of my program.

void SetGSMVolume(DWORD *devGSMVolumeLevel)
{
HKEY Key = NULL;
//dwPhoneVolumeLevel between 0 and 0xFFFFFFFF

DWORD res = RegOpenKeyEx(HKEY_CURRENT_USER,_T("\\ControlPanel\ \Volume"),0,0,&Key);
if (res == ERROR_SUCCESS)
{
res = RegSetValueEx(Key,_T("Ringer"),0,REG_DWORD,(LPBYTE )devGSMVolumeLevel,sizeof(DWORD));
if (res != ERROR_SUCCESS) {;}
//RegCloseKey(Key);
}
RegCloseKey(Key);
Sleep(500);

}

But I meet another question: I can set any value for the ring, and read it out correctly. But the display on icon is not right. The icon always fixed at some point, I can set it use pen, not program.
Who can help me to synchrize the display and my ring volume?
The value in registry is aligned with what i set, not same with its display.
thanks
 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...