Resolved Hardware volume?

Discussion in 'iOS Programming' started by DennisBlah, Mar 7, 2014.

  1. DennisBlah, Mar 7, 2014
    Last edited: Mar 18, 2014

    DennisBlah macrumors 6502

    DennisBlah

    Joined:
    Dec 5, 2013
    Location:
    The Netherlands
    #1
    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];
    
     
  2. ianray macrumors 6502

    Joined:
    Jun 22, 2010
    Location:
    @
    #2
  3. DennisBlah, Mar 14, 2014
    Last edited: Mar 14, 2014

    DennisBlah thread starter macrumors 6502

    DennisBlah

    Joined:
    Dec 5, 2013
    Location:
    The Netherlands
    #3
    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
     
  4. ianray macrumors 6502

    Joined:
    Jun 22, 2010
    Location:
    @
    #4
    Skiing off-piste, in this context, means using (or trying to use) a private framework.
     
  5. DennisBlah thread starter macrumors 6502

    DennisBlah

    Joined:
    Dec 5, 2013
    Location:
    The Netherlands
    #5
    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 ?
     
  6. DennisBlah thread starter macrumors 6502

    DennisBlah

    Joined:
    Dec 5, 2013
    Location:
    The Netherlands
    #6
    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!
     

Share This Page