×
Namespaces

Variants
Actions
Revision as of 13:58, 13 June 2012 by hamishwillee (Talk | contribs)

Use dedicated volume keys in N9 to adjust game or media volume

From Nokia Developer Wiki
Jump to: navigation, search

This article explains how to have dedicated volume keys to adjust media volume in N9

Article Metadata
Tested with
Devices(s): N9
Article
Keywords: Volume keys
Created: teemup (14 May 2012)
Last edited: hamishwillee (13 Jun 2012)

Introduction

By default in N9 when you press the volumekeys the ringing tone volume is adjusted. For Games and other media applications you might wish to enable support for "media volume" adjustments with volume keys instead.

This article explains how you can specify your application to require this behavior.

Summary

First, verify what is the target name of your application. Open the .pro file and see the "TARGET = " value.

For example:

TARGET = myqtgame

Create a folder under your project, named "n9volumekeys" (the folder name does not matter - as long as you use the same path in the latter part). Create a file named your target name, and use the extension ".conf". For this example the filename would be ""n9volumekeys/myqtgame.conf" In the file, include following lines:

[classify gaming]
/opt/usr/bin/myqtgame

Again, replace myqtgame with the exact target name you are using.

Finally, find the correct position in .pro file to add the .conf file to be installed in the device.

unix:!symbian {
...
maemo5 {
...
}
else {
# Classify the application as a game to support volume keys on Harmattan.
gameclassify.files += n9volumekeys/$${TARGET}.conf
gameclassify.path = /usr/share/policy/etc/syspart.conf.d
}
}

Build the application and test on device. You should see that pressing the volume keys on device while your application is running, is now changing the media volume.

For more thorough examples on how to do game audio, please see http://projects.developer.nokia.com/qtgameenabler

39 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×