I did some looking around and found a good work around to allow me to control the OS volume level from my Apple remote. At first I wanted to use the built-in function System.Exec but for some reason I could never get it to work in userdata/keymaps/keymap.xml. I opened a bug report on this.
It was posted, in another thread, that apple scripts could be called via the RunScript command. So for those who are interested here are the changes I made to be able to control the OS volume level using the Apple Remote while XBMC was playing a movie:
userdata/keymaps/keymap.xml:
Code:
<keymap>
<Home>
<joystick name="AppleRemote">
<button id="6"></button>
<button id="8">ActivateWindow(shutdownmenu)</button>
</joystick>
</Home>
<FullscreenVideo>
<joystick name="AppleRemote">
<button id="1">RunScript(../scripts/VolumeUp.applescript)</button>
<button id="2">RunScript(../scripts/VolumeDown.applescript)</button>
<button id="3">StepBack</button>
<button id="4">StepForward</button>
<button id="5">Pause</button>
<button id="6">Stop</button>
<button id="7">OSD</button>
<button id="8">ShowVideoMenu</button>
<button id="9">Rewind</button>
<button id="10">FastForward</button>
<button id="11">Rewind</button>
</joystick>
</FullscreenVideo>
<VideoMenu>
<joystick name="AppleRemote">
<button id="5">Select</button>
<button id="6">Stop</button>
<button id="7">OSD</button>
<button id="8">ShowVideoMenu</button>
</joystick>
</VideoMenu>
</keymap>
VolumeUp.applescript:
Code:
-- volume up 10
set current_volume to output volume of (get volume settings)
if current_volume is less than 100 then
set current_volume to current_volume + 10
end if
set volume output volume current_volume
VolumeDown.applescript:
Code:
-- volume down 10
set current_volume to output volume of (get volume settings)
if current_volume is greater than 0 then
set current_volume to current_volume - 10
end if
set volume output volume current_volume
A few things to note about the above files. If you noticed I used "../scripts" in keymap.xml. The nice thing about this is if you share the userdata among multiple machines, that have different users, no change is required. I place my scripts in the scripts directory that is at the same level as the keymaps directory. I also changed button ID 8 from FullScreen to ShowVideoMenu as I wanted to be able to easily access the DVD menu without having to go through the OSD menu.
The above work around seems to work really well. You don't lose the ability to change the XBMC volume level, you would now have to go through the OSD menu to change it.
One thing not included in this work around is the ability to show what the OS volume level is changing to. I would love to be able to display the volume level like OS X does with its tranparent window. I will research more and see what I can find. I did open a feature request to have a built-in capability to change the OS volume level in XBMC.