Namespaces
Variants
Actions
(Difference between revisions)

用Qt控制音量键

Jump to: navigation, search
m (Hamishwillee - Automated change of category from Lang-CN to Unlikely Category)
m (Hamishwillee - Addition to article of: Category:MeeGo Category:Symbian. (Add platform categories))
Line 49: Line 49:
  
  
  [[Category:Code Examples]][[Category:Lang-Chinese]][[Category:Audio]]
+
  [[Category:Code Examples]][[Category:Lang-Chinese]][[Category:Audio]][[Category:MeeGo]] [[Category:Symbian]]

Revision as of 09:34, 15 February 2012

Article Metadata

Tested with
Devices(s): Nokia N97, N8

Compatibility
Platform(s): S60 5th Edition symbian

Article
Keywords: volume control
Created: flycarl (20 Oct 2010)
Last edited: hamishwillee (15 Feb 2012)

Overview

由于QT中还没有提供对音量键的响应,需要使用symbian Remote control API 控制 音量键。

参照Qt和Symbian C++的混合编程TSS000432 - Utilising media keys

文件夹volumeKey中的 VolumeKey 类提供了一个VolumeKeyPressed( int )信号,

当按音量键 下时 有信号EVolumeDown,

当按音量键 上时 有信号EVolumeUp, 由此可以在程序中控制音量。

使用了QtMobility的multimedia 来播放声音,在代码中设置一个手机中的歌曲名。播放后按音量键可以观察到音量变化。


Download

File:PlayerVolumeKey.zip



History

20 October 2010 1st,直接参照 TSS000432 - Utilising media keys
8 November 2010 2nd,使用symbianApi播放声音,构造时设置默认音量。兼容symbian^3,S60 5th SDK
407 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved