Beispiel #1
0
static HRESULT WINAPI
IBasicAudio_fnput_Volume(IBasicAudio* iface,long lVol)
{
	CFilterGraph_THIS(iface,basaud);
	QUERYBASICAUDIO

	TRACE("(%p)->()\n",This);

	hr = IBasicAudio_put_Volume(pAudio,lVol);
	IBasicAudio_Release(pAudio);
	return hr;
}
Beispiel #2
0
/***************************************************************************
 *                              MCIQTZ_mciSetAudio              [internal]
 */
static DWORD MCIQTZ_mciSetAudio(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SETAUDIO_PARMSW lpParms)
{
    WINE_MCIQTZ *wma;
    DWORD ret = 0;

    TRACE("(%04x, %08x, %p)\n", wDevID, dwFlags, lpParms);

    if(!lpParms)
        return MCIERR_NULL_PARAMETER_BLOCK;

    wma = MCIQTZ_mciGetOpenDev(wDevID);
    if (!wma)
        return MCIERR_INVALID_DEVICE_ID;

    if (!(dwFlags & MCI_DGV_SETAUDIO_ITEM)) {
        FIXME("Unknown flags (%08x)\n", dwFlags);
        return 0;
    }

    if (dwFlags & MCI_DGV_SETAUDIO_ITEM) {
        switch (lpParms->dwItem) {
        case MCI_DGV_SETAUDIO_VOLUME:
            if (dwFlags & MCI_DGV_SETAUDIO_VALUE) {
                long vol;
                HRESULT hr;
                if (lpParms->dwValue > 1000) {
                    ret = MCIERR_OUTOFRANGE;
                    break;
                }
                if (dwFlags & MCI_TEST)
                    break;
                if (lpParms->dwValue != 0)
                    vol = (long)(2000.0 * (log10(lpParms->dwValue) - 3.0));
                else
                    vol = -10000;
                TRACE("Setting volume to %ld\n", vol);
                hr = IBasicAudio_put_Volume(wma->audio, vol);
                if (FAILED(hr)) {
                    WARN("Cannot set volume (hr = %x)\n", hr);
                    ret = MCIERR_INTERNAL;
                }
            }
            break;
        default:
            FIXME("Unknown item %08x\n", lpParms->dwItem);
            break;
        }
    }

    return ret;
}