Permalink
Browse files

update NDK-Samples next for NDK 2.0

  • Loading branch information...
1 parent 38b89ca commit bca4b2a4351b3b1f5d9e100a8921cfcfda7219be @jhoffmannrim jhoffmannrim committed Jan 26, 2012
Showing with 8,447 additions and 5,494 deletions.
  1. +6 −4 .gitignore
  2. +1 −1 Accelerometer/NOTICE
  3. +12 −12 Accelerometer/bar-descriptor.xml
  4. +1 −1 Accelerometer/dialogutil.c
  5. +2 −2 Accelerometer/dialogutil.h
  6. +1 −1 Accelerometer/main.c
  7. +10 −10 Accelerometer/readme.txt
  8. +1 −1 AudioControl/NOTICE
  9. +12 −12 AudioControl/bar-descriptor.xml
  10. +1 −1 AudioControl/dialogutil.c
  11. +2 −2 AudioControl/dialogutil.h
  12. +33 −33 AudioControl/main.c
  13. +12 −12 AudioControl/readme.txt
  14. +11 −2 BelligerentBlocks/.cproject
  15. +1 −1 BelligerentBlocks/NOTICE
  16. +0 −1 BelligerentBlocks/README.txt
  17. +2 −2 BelligerentBlocks/bar-descriptor.xml
  18. +36 −32 BelligerentBlocks/src/GameLogic.cpp
  19. +1 −1 BelligerentBlocks/src/GameLogic.h
  20. +1 −1 BelligerentBlocks/src/Main.cpp
  21. +4 −2 BelligerentBlocks/src/Platform.cpp
  22. +1 −1 BelligerentBlocks/src/Platform.h
  23. +1 −1 BelligerentBlocks/src/Sound.cpp
  24. +1 −1 BelligerentBlocks/src/Sound.h
  25. +1 −1 BelligerentBlocks/src/Sprite.cpp
  26. +1 −1 BelligerentBlocks/src/Sprite.h
  27. +241 −96 BelligerentBlocks/src/bbutil.c
  28. +4 −6 BelligerentBlocks/src/bbutil.h
  29. +1 −1 Channels/NOTICE
  30. +12 −12 Channels/bar-descriptor.xml
  31. +1 −1 Channels/dialogutil.c
  32. +2 −2 Channels/dialogutil.h
  33. +19 −19 Channels/main.c
  34. +20 −21 Channels/readme.txt
  35. +4 −0 CubeRotate/.cproject
  36. +1 −1 CubeRotate/NOTICE
  37. +12 −12 CubeRotate/bar-descriptor.xml
  38. +290 −145 CubeRotate/bbutil.c
  39. +4 −6 CubeRotate/bbutil.h
  40. +3 −0 CubeRotate/common.mk
  41. +109 −109 CubeRotate/main.c
  42. +2 −0 CubeRotate/manifest.properties
  43. +12 −11 CubeRotate/readme.txt
  44. +1 −1 Dialog/NOTICE
  45. +12 −12 Dialog/bar-descriptor.xml
  46. +11 −6 Dialog/main.c
  47. +14 −13 Dialog/readme.txt
  48. +5 −1 FallingBlocks/.cproject
  49. +1 −1 FallingBlocks/NOTICE
  50. +12 −12 FallingBlocks/bar-descriptor.xml
  51. +290 −145 FallingBlocks/bbutil.c
  52. +4 −6 FallingBlocks/bbutil.h
  53. +3 −0 FallingBlocks/common.mk
  54. +378 −378 FallingBlocks/main.c
  55. +3 −1 FallingBlocks/manifest.properties
  56. +16 −15 FallingBlocks/readme.txt
  57. +15 −12 {OpenGLES11Template → GLES11Template}/.cproject
  58. +1 −1 {OpenGLES11Template → GLES11Template}/.project
  59. 0 {OpenGLES11Template → GLES11Template}/LICENSE
  60. 0 {VideoWindow/src → GLES11Template}/Makefile
  61. +2 −2 {OpenGLES11Template → GLES11Template}/NOTICE
  62. 0 {OpenGLES11Template/x86 → GLES11Template/arm}/Makefile
  63. 0 {OpenGLES11Template/x86/o-g → GLES11Template/arm/o.le-v7-g}/Makefile
  64. 0 {OpenGLES11Template → GLES11Template}/arm/o.le-v7/Makefile
  65. +19 −19 {OpenGLES11Template → GLES11Template}/bar-descriptor.xml
  66. +290 −145 {OpenGLES11Template → GLES11Template}/bbutil.c
  67. +4 −6 {OpenGLES11Template → GLES11Template}/bbutil.h
  68. +4 −1 {OpenGLES11Template → GLES11Template}/common.mk
  69. +225 −0 GLES11Template/main.c
  70. +5 −3 {OpenGLES11Template → GLES11Template}/manifest.properties
  71. +14 −12 {OpenGLES11Template → GLES11Template}/readme.txt
  72. 0 {OpenGLES11Template/arm → GLES11Template/x86}/Makefile
  73. 0 {OpenGLES11Template/arm/o.le-v7-g → GLES11Template/x86/o-g}/Makefile
  74. +178 −0 GLES20Template/.cproject
  75. +84 −0 GLES20Template/.project
  76. +232 −0 GLES20Template/LICENSE
  77. 0 {OpenGLES11Template → GLES20Template}/Makefile
  78. +73 −0 GLES20Template/NOTICE
  79. +8 −0 GLES20Template/arm/Makefile
  80. +1 −0 GLES20Template/arm/o.le-v7-g/Makefile
  81. +1 −0 GLES20Template/arm/o.le-v7/Makefile
  82. +93 −0 GLES20Template/bar-descriptor.xml
  83. +1,052 −0 GLES20Template/bbutil.c
  84. +132 −0 GLES20Template/bbutil.h
  85. +39 −0 GLES20Template/common.mk
  86. +350 −0 GLES20Template/main.c
  87. +57 −0 GLES20Template/manifest.properties
  88. +35 −0 GLES20Template/readme.txt
  89. +8 −0 GLES20Template/x86/Makefile
  90. +1 −0 GLES20Template/x86/o-g/Makefile
  91. +1 −1 Geolocation/NOTICE
  92. +12 −12 Geolocation/bar-descriptor.xml
  93. +1 −1 Geolocation/dialogutil.c
  94. +2 −2 Geolocation/dialogutil.h
  95. +6 −6 Geolocation/main.c
  96. +11 −10 Geolocation/readme.txt
  97. +1 −1 Gesture/NOTICE
  98. +12 −12 Gesture/bar-descriptor.xml
  99. +8 −9 Gesture/main.c
  100. +1 −1 Gesture/manifest.properties
  101. +14 −14 Gesture/readme.txt
  102. +15 −12 GoodCitizen/.cproject
  103. +1 −1 GoodCitizen/NOTICE
  104. +12 −12 GoodCitizen/bar-descriptor.xml
  105. +290 −145 GoodCitizen/bbutil.c
  106. +4 −6 GoodCitizen/bbutil.h
  107. +3 −0 GoodCitizen/common.mk
  108. +618 −613 GoodCitizen/main.c
  109. +3 −1 GoodCitizen/manifest.properties
  110. +14 −13 GoodCitizen/readme.txt
  111. +1 −1 HelloWorldConsole/NOTICE
  112. +12 −12 HelloWorldConsole/bar-descriptor.xml
  113. +3 −3 HelloWorldConsole/main.c
  114. +1 −1 HelloWorldConsole/manifest.properties
  115. +11 −11 HelloWorldConsole/readme.txt
  116. +1 −1 HelloWorldDisplay/NOTICE
  117. +12 −12 HelloWorldDisplay/bar-descriptor.xml
  118. +290 −145 HelloWorldDisplay/bbutil.c
  119. +4 −6 HelloWorldDisplay/bbutil.h
  120. +3 −0 HelloWorldDisplay/common.mk
  121. +166 −169 HelloWorldDisplay/main.c
  122. +3 −1 HelloWorldDisplay/manifest.properties
  123. +14 −13 HelloWorldDisplay/readme.txt
  124. +1 −1 HttpProxy/NOTICE
  125. +12 −12 HttpProxy/bar-descriptor.xml
  126. +1 −1 HttpProxy/dialogutil.c
  127. +2 −2 HttpProxy/dialogutil.h
  128. +3 −3 HttpProxy/main.c
  129. +1 −1 HttpProxy/manifest.properties
  130. +12 −12 HttpProxy/readme.txt
  131. +1 −1 Keyboard/NOTICE
  132. +12 −12 Keyboard/bar-descriptor.xml
  133. +744 −492 Keyboard/bbutil.c
  134. +65 −76 Keyboard/bbutil.h
  135. +3 −0 Keyboard/common.mk
  136. +131 −74 Keyboard/main.c
  137. +12 −13 Keyboard/readme.txt
  138. +1 −1 LocaleSample/NOTICE
  139. +12 −12 LocaleSample/bar-descriptor.xml
  140. +1 −1 LocaleSample/dialogutil.c
  141. +2 −2 LocaleSample/dialogutil.h
  142. +1 −1 LocaleSample/main.c
  143. +1 −1 LocaleSample/manifest.properties
  144. +13 −13 LocaleSample/readme.txt
  145. +1 −1 NetworkStatus/NOTICE
  146. +12 −12 NetworkStatus/bar-descriptor.xml
  147. +1 −1 NetworkStatus/dialogutil.c
  148. +2 −2 NetworkStatus/dialogutil.h
  149. +1 −1 NetworkStatus/main.c
  150. +1 −1 NetworkStatus/manifest.properties
  151. +12 −11 NetworkStatus/readme.txt
  152. +0 −221 OpenGLES11Template/main.c
  153. +1 −1 PaymentService/NOTICE
  154. +12 −12 PaymentService/bar-descriptor.xml
  155. +9 −1 PaymentService/main.c
  156. +1 −1 PaymentService/manifest.properties
  157. +15 −14 PaymentService/readme.txt
  158. +1 −1 PlayAudio/NOTICE
  159. +12 −12 PlayAudio/bar-descriptor.xml
  160. +1 −1 PlayAudio/dialogutil.c
  161. +2 −2 PlayAudio/dialogutil.h
  162. +1 −1 PlayAudio/main.c
  163. +13 −13 PlayAudio/readme.txt
  164. +1 −1 PlayWav/NOTICE
  165. +12 −12 PlayWav/bar-descriptor.xml
  166. +1 −1 PlayWav/dialogutil.c
  167. +2 −2 PlayWav/dialogutil.h
  168. +1 −1 PlayWav/main.c
  169. +9 −9 PlayWav/readme.txt
  170. +1 −1 ScreenTemplate/NOTICE
  171. +12 −12 ScreenTemplate/bar-descriptor.xml
  172. +1 −1 ScreenTemplate/common.mk
  173. +1 −1 ScreenTemplate/main.c
  174. +2 −2 ScreenTemplate/manifest.properties
  175. +9 −9 ScreenTemplate/readme.txt
  176. +1 −1 VideoPlayback/NOTICE
  177. +12 −12 VideoPlayback/bar-descriptor.xml
  178. +156 −156 VideoPlayback/main.c
  179. +12 −12 VideoPlayback/readme.txt
  180. +203 −203 VideoWindow/LICENSE
  181. +5 −5 VideoWindow/NOTICE
  182. +95 −95 VideoWindow/bar-descriptor.xml
  183. +631 −631 VideoWindow/main.c
  184. +1 −1 VideoWindow/manifest.properties
  185. +35 −35 VideoWindow/readme.txt
  186. +0 −631 VideoWindow/src/main.c
View
@@ -40,6 +40,12 @@ FallingBlocks/arm/o.le-v7-g/FallingBlocks
FallingBlocks/arm/o.le-v7/FallingBlocks
FallingBlocks/x86/o-g/FallingBlocks
FallingBlocks/x86/o/FallingBlocks
+GLES11Template/arm/o.le-v7-g/GLES11Template
+GLES11Template/arm/o.le-v7/GLES11Template
+GLES11Template/x86/o-g/GLES11Template
+GLES20Template/arm/o.le-v7-g/GLES20Template
+GLES20Template/arm/o.le-v7/GLES20Template
+GLES20Template/x86/o-g/GLES20Template
Geolocation/arm/o.le-v7-g/Geolocation
Geolocation/arm/o.le-v7/Geolocation
Geolocation/x86/o-g/Geolocation
@@ -76,10 +82,6 @@ NetworkStatus/arm/o.le-v7-g/NetworkStatus
NetworkStatus/arm/o.le-v7/NetworkStatus
NetworkStatus/x86/o-g/NetworkStatus
NetworkStatus/x86/o/NetworkStatus
-OpenGLES11Template/arm/o.le-v7-g/OpenGLES11Template
-OpenGLES11Template/arm/o.le-v7/OpenGLES11Template
-OpenGLES11Template/x86/o-g/OpenGLES11Template
-OpenGLES11Template/x86/o/OpenGLES11Template
PaymentService/arm/o.le-v7-g/PaymentService
PaymentService/arm/o.le-v7/PaymentService
PaymentService/x86/o-g/PaymentService
@@ -1,5 +1,5 @@
Accelerometer
-Copyright (c) 2011 Research In Motion Limited.
+Copyright (c) 2011-2012 Research In Motion Limited.
This product includes software developed at
Research In Motion Limited (http://www.rim.com/).
@@ -11,19 +11,19 @@
Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
<id>com.example.Accelerometer</id>
- <!-- The name that is displayed in the BlackBerry Tablet OS application installer.
+ <!-- The name that is displayed in the BlackBerry Tablet OS application installer.
May have multiple values for each language. See samples or xsd schema file. Optional. -->
<name>Accelerometer</name>
-
- <!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade.
+
+ <!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade.
Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
An updated version of application must have a versionNumber value higher than the previous version. Required. -->
<versionNumber>1.0.0</versionNumber>
- <!-- Fourth digit segment of the package version. First three segments are taken from the
+ <!-- Fourth digit segment of the package version. First three segments are taken from the
<versionNumber> element. Must be an integer from 0 to 2^16-1 -->
<buildId>1</buildId>
-
+
<!-- A string value (such as "v1", "2.5", or "Alpha 1") that represents the version of the application, as it should be shown to users. Optional. -->
<!-- <versionLabel></versionLabel> -->
@@ -37,17 +37,17 @@
<!-- Name of author which is used for signing. Must match the developer name of your development certificate. -->
<author>Example Inc.</author>
<splashscreen>sample-splashscreen-landscape.png:sample-splashscreen-portrait.png</splashscreen>
-
+
<!-- Unique author ID assigned by signing authority. Required if using debug tokens. -->
<!-- <authorId>ABC1234YjsnUk235h</authorId> -->
-
+
<initialWindow>
<aspectRatio>landscape</aspectRatio>
<autoOrients>false</autoOrients>
<systemChrome>none</systemChrome>
<transparent>false</transparent>
</initialWindow>
-
+
<!-- The category where the application appears. Either core.games or core.media. -->
<category>core.games</category>
<asset path="icon.png">icon.png</asset>
@@ -71,18 +71,18 @@
<platformArchitecture>x86</platformArchitecture>
<asset path="x86/o-g/Accelerometer" entry="true" type="Qnx/Elf">Accelerometer</asset>
</configuration>
-
+
<!-- The icon for the application, which should be 86x86. -->
<icon>
<image>icon.png</image>
</icon>
-
+
<!-- The splash screen that will appear when your application is launching. Should be 1024x600. -->
<!-- <splashscreen></splashscreen> -->
<!-- Request permission to execute native code. Required for native applications. -->
<action system="true">run_native</action>
-
+
<!-- The permissions requested by your application. -->
<!-- <action>access_shared</action> -->
<!-- <action>record_audio</action> -->
@@ -96,5 +96,5 @@
<!-- Ensure that shared libraries in the package are found at run-time. -->
<env var="LD_LIBRARY_PATH" value="app/native/lib"/>
-
+
</qnx>
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Research In Motion Limited.
+ * Copyright (c) 2011-2012 Research In Motion Limited.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Research In Motion Limited.
+ * Copyright (c) 2011-2012 Research In Motion Limited.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -43,7 +43,7 @@ void destroy_dialog();
/**
* Displays a message to the dialog created by create_dialog() and
- * outputs that message to stderr. This means it will get added
+ * outputs that message to stderr. This means it will get added
* to the log file in the sandbox and output to the console.
*
* @param msg the message to be displayed.
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Research In Motion Limited.
+ * Copyright (c) 2011-2012 Research In Motion Limited.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -2,33 +2,33 @@ Accelerometer
========================================================================
Sample Description:
-
- The Accelerometer sample is an application that is designed to show you how to
+
+ The Accelerometer sample is an application that is designed to show you how to
handle updates from the accelerometer sensor
-
+
When you run the application, the value of the pitch and roll of the device is
printed to the console, and updated every 25 milliseconds.
-
+
Feature summary
- Handling navigator events
- Handling accelerometer updates
========================================================================
Requirements:
- - BlackBerry Native SDK for Tablet OS 1.0 or later
+ - BlackBerry Native SDK for Tablet OS 2.0 or later
- One of the following:
- - BlackBerry PlayBook tablet running BlackBerry Tablet OS 1.0 or later
- - BlackBerry Tablet Simulator 1.0 or later
-
+ - BlackBerry PlayBook tablet running BlackBerry Tablet OS 2.0 or later
+ - BlackBerry Tablet Simulator 2.0 or later
+
========================================================================
Importing a project into the Native SDK:
-
+
1. From the the Sample apps page, download and extract the sample application.
2. Launch the Native SDK.
3. On the File menu, click Import.
4. Expand General, and select Existing Projects into Workspace. Click Next.
5. Browse to the location where you extracted the sample app, and click OK.
- The sample project should display in the the Projects section.
+ The sample project should display in the the Projects section.
6. Click Finish to import the project into your workspace.
View
@@ -1,5 +1,5 @@
AudioControl
-Copyright (c) 2011 Research In Motion Limited.
+Copyright (c) 2011-2012 Research In Motion Limited.
This product includes software developed at
Research In Motion Limited (http://www.rim.com/).
@@ -11,19 +11,19 @@
Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
<id>com.example.AudioControl</id>
- <!-- The name that is displayed in the BlackBerry Tablet OS application installer.
+ <!-- The name that is displayed in the BlackBerry Tablet OS application installer.
May have multiple values for each language. See samples or xsd schema file. Optional. -->
<name>AudioControl</name>
-
- <!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade.
+
+ <!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade.
Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
An updated version of application must have a versionNumber value higher than the previous version. Required. -->
<versionNumber>1.0.0</versionNumber>
- <!-- Fourth digit segment of the package version. First three segments are taken from the
+ <!-- Fourth digit segment of the package version. First three segments are taken from the
<versionNumber> element. Must be an integer from 0 to 2^16-1 -->
<buildId>1</buildId>
-
+
<!-- A string value (such as "v1", "2.5", or "Alpha 1") that represents the version of the application, as it should be shown to users. Optional. -->
<!-- <versionLabel></versionLabel> -->
@@ -37,17 +37,17 @@
<!-- Name of author which is used for signing. Must match the developer name of your development certificate. -->
<author>Example Inc.</author>
<splashscreen>sample-splashscreen-landscape.png:sample-splashscreen-portrait.png</splashscreen>
-
+
<!-- Unique author ID assigned by signing authority. Required if using debug tokens. -->
<!-- <authorId>ABC1234YjsnUk235h</authorId> -->
-
+
<initialWindow>
<aspectRatio>landscape</aspectRatio>
<autoOrients>false</autoOrients>
<systemChrome>none</systemChrome>
<transparent>false</transparent>
</initialWindow>
-
+
<!-- The category where the application appears. Either core.games or core.media. -->
<category>core.games</category>
<asset path="icon.png">icon.png</asset>
@@ -71,18 +71,18 @@
<platformArchitecture>x86</platformArchitecture>
<asset path="x86/o-g/AudioControl" entry="true" type="Qnx/Elf">AudioControl</asset>
</configuration>
-
+
<!-- The icon for the application, which should be 86x86. -->
<icon>
<image>icon.png</image>
</icon>
-
+
<!-- The splash screen that will appear when your application is launching. Should be 1024x600. -->
<!-- <splashscreen></splashscreen> -->
<!-- Request permission to execute native code. Required for native applications. -->
<action system="true">run_native</action>
-
+
<!-- The permissions requested by your application. -->
<!-- <action>access_shared</action> -->
<!-- <action>record_audio</action> -->
@@ -96,5 +96,5 @@
<!-- Ensure that shared libraries in the package are found at run-time. -->
<env var="LD_LIBRARY_PATH" value="app/native/lib"/>
-
+
</qnx>
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Research In Motion Limited.
+ * Copyright (c) 2011-2012 Research In Motion Limited.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Research In Motion Limited.
+ * Copyright (c) 2011-2012 Research In Motion Limited.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -43,7 +43,7 @@ void destroy_dialog();
/**
* Displays a message to the dialog created by create_dialog() and
- * outputs that message to stderr. This means it will get added
+ * outputs that message to stderr. This means it will get added
* to the log file in the sandbox and output to the console.
*
* @param msg the message to be displayed.
View
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Research In Motion Limited.
+ * Copyright (c) 2011-2012 Research In Motion Limited.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -144,38 +144,38 @@ main(int argc, char *argv[])
if (BPS_FAILURE == audiomixer_request_events(0)) {
show_dialog_message("Unable to request audio mixer events.");
} else {
- /*
- * Retrieve and display the current audio mixer status
- */
- float headphone_volume;
- audiomixer_get_output_level(AUDIOMIXER_OUTPUT_HEADPHONE, &headphone_volume);
- float speaker_volume;
- audiomixer_get_output_level(AUDIOMIXER_OUTPUT_SPEAKER, &speaker_volume);
- float input_gain;
- audiomixer_get_input_level(AUDIOMIXER_INPUT, &input_gain);
-
- bool is_headphone_muted;
- audiomixer_get_output_mute(AUDIOMIXER_OUTPUT_HEADPHONE, &is_headphone_muted);
- bool is_speaker_muted;
- audiomixer_get_output_mute(AUDIOMIXER_OUTPUT_SPEAKER, &is_speaker_muted);
- bool is_input_muted;
- audiomixer_get_input_mute(AUDIOMIXER_INPUT, &is_input_muted);
-
- char tmp[MSG_SIZE];
- snprintf(msg, MSG_SIZE, "Audio Mixer Status\n");
- snprintf(tmp, MSG_SIZE, "Headphone Volume: %f\n", headphone_volume);
- strlcat(msg, tmp, MSG_SIZE);
- snprintf(tmp, MSG_SIZE, "Speaker Volume: %f\n", speaker_volume);
- strlcat(msg, tmp, MSG_SIZE);
- snprintf(tmp, MSG_SIZE, "Input Gain: %f\n", input_gain);
- strlcat(msg, tmp, MSG_SIZE);
- snprintf(tmp, MSG_SIZE, "Headphone Muted: %s\n", bool_str(is_headphone_muted));
- strlcat(msg, tmp, MSG_SIZE);
- snprintf(tmp, MSG_SIZE, "Speaker Muted: %s\n", bool_str(is_speaker_muted));
- strlcat(msg, tmp, MSG_SIZE);
- snprintf(tmp, MSG_SIZE, "Input Muted: %s\n\n", bool_str(is_input_muted));
- strlcat(msg, tmp, MSG_SIZE);
- show_dialog_message(msg);
+ /*
+ * Retrieve and display the current audio mixer status
+ */
+ float headphone_volume;
+ audiomixer_get_output_level(AUDIOMIXER_OUTPUT_HEADPHONE, &headphone_volume);
+ float speaker_volume;
+ audiomixer_get_output_level(AUDIOMIXER_OUTPUT_SPEAKER, &speaker_volume);
+ float input_gain;
+ audiomixer_get_input_level(AUDIOMIXER_INPUT, &input_gain);
+
+ bool is_headphone_muted;
+ audiomixer_get_output_mute(AUDIOMIXER_OUTPUT_HEADPHONE, &is_headphone_muted);
+ bool is_speaker_muted;
+ audiomixer_get_output_mute(AUDIOMIXER_OUTPUT_SPEAKER, &is_speaker_muted);
+ bool is_input_muted;
+ audiomixer_get_input_mute(AUDIOMIXER_INPUT, &is_input_muted);
+
+ char tmp[MSG_SIZE];
+ snprintf(msg, MSG_SIZE, "Audio Mixer Status\n");
+ snprintf(tmp, MSG_SIZE, "Headphone Volume: %f\n", headphone_volume);
+ strlcat(msg, tmp, MSG_SIZE);
+ snprintf(tmp, MSG_SIZE, "Speaker Volume: %f\n", speaker_volume);
+ strlcat(msg, tmp, MSG_SIZE);
+ snprintf(tmp, MSG_SIZE, "Input Gain: %f\n", input_gain);
+ strlcat(msg, tmp, MSG_SIZE);
+ snprintf(tmp, MSG_SIZE, "Headphone Muted: %s\n", bool_str(is_headphone_muted));
+ strlcat(msg, tmp, MSG_SIZE);
+ snprintf(tmp, MSG_SIZE, "Speaker Muted: %s\n", bool_str(is_speaker_muted));
+ strlcat(msg, tmp, MSG_SIZE);
+ snprintf(tmp, MSG_SIZE, "Input Muted: %s\n\n", bool_str(is_input_muted));
+ strlcat(msg, tmp, MSG_SIZE);
+ show_dialog_message(msg);
}
/*
Oops, something went wrong.

0 comments on commit bca4b2a

Please sign in to comment.