Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

DennisBlah

macrumors 6502
Original poster
Dec 5, 2013
485
2
The Netherlands
Hi all,

I'm finetuning my test application to the dots on the i's.
As for an button test, I also use the AVSystemController to check what happens with the volume. If it goes up, the volume up button has been pressed, if down, down button.

For now, I first have to set the volume to compare it with.
I would like to know how to get the current volume of the device (hardware) not software.

MPMusicPlayerController gives me the software volume back. Instead of the hardware volume.

Anyone have an idea ?

This gives me the current changed hardware volume level:
But only as one button gets pressed.
Code:
float volume = [[[notification userInfo] objectForKey:@"AVSystemController_AudioVolumeNotificationParameter"] floatValue];
 
Last edited:

DennisBlah

macrumors 6502
Original poster
Dec 5, 2013
485
2
The Netherlands
What do you mean, skiing off-piste.
No I haven't checked all functions of AVSystemController, because aparrently its an private framework.. Which I see is included in Celestial! :D
Which sounds very promising. Only thing I have now is missing <Availability2.h>
Can't find much about it on google. Its also not pointing to any framework!??

However without the framework I can get the AVSystemController notifications. I cannot declare the AVSystemController without Celestial, else I wudve just set the volume to 0.5 with
Code:
[[AVSystemController sharedAVSystemController] setActiveCategoryVolumeTo:0.5];

I do added the availablity2 directly to the project, and changed < > to "" but getting lots errors
ARC forbids Objective-C objects in struct abd Redefinitions
 
Last edited:

ianray

macrumors 6502
Jun 22, 2010
452
0
@
Skiing off-piste, in this context, means using (or trying to use) a private framework.
 

DennisBlah

macrumors 6502
Original poster
Dec 5, 2013
485
2
The Netherlands
Skiing off-piste, in this context, means using (or trying to use) a private framework.

Ahh I see, ok. But that doesnt matter :) it's for inhouse distribution.
Do you have any experience using Celestial?

Because the ARC forbids errors I'm getting when include the availablity2.h ?
It's not even because of the availability but some structs in the celestial.

Would it hurt to comment these out? Or am I missing something else ?
 

DennisBlah

macrumors 6502
Original poster
Dec 5, 2013
485
2
The Netherlands
Thanks ianray Celestial is indeed an great help!
I removed al the struct's from which gave me these errors. But still I'm not receiving the current hardware volume, but I'm setting the volume to 0.5.
So basicly I know that the hardware volume is 0.5 :)

thanks for the big help!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.