设为首页 加入收藏

TOP

一个控制音量大小的类
2014-11-23 20:00:36 来源: 作者: 【 】 浏览:5
Tags:一个 控制 音量 大小

在编写多媒体应用软件时,经常要用到音量控制,此类就给你提供了一个很方便的

音量处理方法。

该类提供了如下几个公用接口。(在文件IVolume.h中)。

bool IsAvailable() - Says whether the volume controling is possible

void Enable() - Enables the line of the volume control

void Disable() - Disables the line of the volume control

DWORD GetVolumeMetric() - Retrieves the granularity of volume

DWORD GetMinimalVolume() - Retrieves the minimal volume that can be set

DWORD GetMaximalVolume() - Retrieves the maximal volume that can be set

DWORD GetCurrentVolume() - Retrieve the current volume

void SetCurrentVolume( DWORD dwValue ) - Set the volume

并且,最后一个函数允许注册一个用户定义的回调函数,用来处理音量改变的通知消息。

void RegisterNotificationSink( PONMICVOULUMECHANGE, DWORD )

这个接口通过VolumeOutMaster (VolumeOutMaster.h/cpp), CVolumeOutWave (VolumeOutWave.h/cpp)

CVolumeInXXX (VolumeInXXX.h/cpp)类来执行。

使用这些类非常简单,在源代码的压缩文件里有很详细的使用说明,在此不在赘述。

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇WinAMP插件DIY 下一篇一个完善的ODBC数据库程序

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: