aboutsummaryrefslogtreecommitdiffstats
path: root/example/main.c
blob: 327b88cf71d29bfc79abebfc59e824cf9479b2f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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);
}