aboutsummaryrefslogtreecommitdiffstats
path: root/example
diff options
context:
space:
mode:
Diffstat (limited to 'example')
-rw-r--r--example/main.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/example/main.c b/example/main.c
new file mode 100644
index 0000000..327b88c
--- /dev/null
+++ b/example/main.c
@@ -0,0 +1,23 @@
+int main() {
+ OSStatus result;
+
+ Float32 volume;
+
+ result = system_volume_get(&volume);
+ if (result != noErr) {
+ printf("Error getting system volume: %d\n", result);
+ return 1;
+ }
+
+ printf("System volume: %f\n", volume);
+
+
+ Float32 new_volume = 0.5;
+ result = system_volume_set(new_volume);
+ if (result != noErr) {
+ printf("Error setting system volume: %d\n", result);
+ return 1;
+ }
+
+ printf("Set volume to: %f\n", new_volume);
+}