Thread View: borland.public.cppbuilder.multimedia
2 messages
2 total messages
Started by Mario Sernicola
Wed, 01 Sep 2004 20:37
Retrieve audio volume of TMediaPlayer component
Author: Mario Sernicola
Date: Wed, 01 Sep 2004 20:37
Date: Wed, 01 Sep 2004 20:37
23 lines
1493 bytes
1493 bytes
Hi,
To set volume of a TMediaPlayer Component I've used this code:
//----------------------------------------------------------------
MCI_DGV_SETAUDIO_PARMS p;
p.dwCallback = 0;
p.dwItem = MCI_DGV_SETAUDIO_VOLUME;
p.dwValue = volume;
p.dwOver = 0;
p.lpstrAlgorithm = NULL;
p.lpstrQuality = NULL;
mciSendCommand(MediaPLayer1->DeviceID, MCI_SETAUDIO,MCI_DGV_SETAUDIO_VALUE |
MCI_DGV_SETAUDIO_ITEM, Cardinal(&p));
How can I retrieve te value of a TMediaPlayer component to implement (for
example) a fade out effect?
Thanks
Mario Sernicola
Re: Retrieve audio volume of TMediaPlayer component
Author: Marcelo R. Lopez, Jr.
Date: Fri, 08 Oct 2004 18:44
Date: Fri, 08 Oct 2004 18:44
64 lines
2548 bytes
2548 bytes
Mario Sernicola wrote:
>Hi,
>
>To set volume of a TMediaPlayer Component I've used this code:
>
>//----------------------------------------------------------------
>
>MCI_DGV_SETAUDIO_PARMS p;
> p.dwCallback = 0;
> p.dwItem = MCI_DGV_SETAUDIO_VOLUME;
> p.dwValue = volume;
> p.dwOver = 0;
> p.lpstrAlgorithm = NULL;
> p.lpstrQuality = NULL;
>
>mciSendCommand(MediaPLayer1->DeviceID, MCI_SETAUDIO,MCI_DGV_SETAUDIO_VALUE |
>MCI_DGV_SETAUDIO_ITEM, Cardinal(&p));
>
>How can I retrieve te value of a TMediaPlayer component to implement (for
>example) a fade out effect?
>
>Thanks
>
>Mario Sernicola
>
>
>
>
>
I think what you're looking for is the: MCI_DGV_STATUS_VOLUME field of
the MCI_STATUS command.
re ( the MMAPI reference )
Think of something like this:
DWORD dwTheVolume = 0;
MCI_STATUS_PARMS theParms;
theParms.dwCallback = 0;
theParms.dwReturn = MCI_SUCCESS;
theParms.dwItem = MCI_DGV_STATUS_VOLUME;
theParms.dwTrack = 0;
MCIERROR mciRC = mciSendCommand(MediaPLayer1->DeviceID, MCI_STATUS,
MCI_STATUS_ITEM, (DWORD) (LPMCI_STATUS_PARMS) &theParms);
if ( mciRC == MCI_SUCCESS )
dwTheVolume = theParms.dwReturn;
else {
// Handle the error.....
}
From the MMAPI reference:
MCI_DGV_STATUS_VOLUME
The dwReturn member returns the average of the volume to the left and
right speakers. Use MCI_DGV_STATUS_NOMINAL with this flag to obtain the
nominal level.
Marcelo
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads