Hi Jules,
I 've tried some stuff in the juce mac windowing and i managed to get the remote working on leopard.
First to get the osx version, i use (in the consructor of appleRemoteDevice with is_leopard a member of appleRemoteDevice)
if (floor(NSAppKitVersionNumber) <= 824 /*NSAppKitVersionNumber10_4 */)
is_leopard = 0;
else
is_leopard = 1;
with NSAppKitVersionNumber declared as extern out of the juce namespace
extern const double NSAppKitVersionNumber;
BEGIN_JUCE_NAMESPACE
you then have to link with the AppKit framework for NSAppKitVersionNumber
Finally, in AppleRemoteDevice::handleCallbackInternal()
static const char buttonPatterns_Tiger[] =
{
14, 7, 6, 5, 14, 7, 6, 5, 0,
14, 8, 6, 5, 14, 8, 6, 5, 0,
14, 12, 11, 6, 5, 0,
14, 13, 11, 6, 5, 0,
14, 9, 6, 5, 14, 9, 6, 5, 0,
14, 10, 6, 5, 14, 10, 6, 5, 0,
14, 6, 5, 4, 2, 0,
14, 6, 5, 3, 2, 0,
14, 6, 5, 14, 6, 5, 0,
18, 14, 6, 5, 18, 14, 6, 5, 0,
19, 0
};
static const char buttonPatterns_Leopard[] =
{
31, 20, 18, 31, 20, 18, 0,
31, 21, 18, 31, 21, 18, 0,
31, 29, 28, 18, 31, 29, 28 ,18,0,
31, 30, 28, 18, 31, 30, 28 ,18,0,
31, 22, 18, 31, 22, 18, 0,
31, 23, 18, 31, 23, 18, 0,
31, 18, 4, 2, 31, 18, 4,2,0,
31, 18, 3, 2, 31, 18, 3,2,0,
31,18,31,18,0,
35,31,18,35,31,18, 0,
19, 0
};
const char * buttonPatterns;
if(is_leopard)
buttonPatterns = buttonPatterns_Leopard;
else
buttonPatterns = buttonPatterns_Tiger;
int buttonNum = (int) menuButton;
int i = 0;
while (i < numElementsInArray (buttonPatterns_Tiger))
{
if (strcmp (cookies, buttonPatterns + i) == 0)
{
buttonPressed ((ButtonType) buttonNum, totalValues > 0);
break;
}
i += strlen (buttonPatterns + i) + 1;
++buttonNum;
}
This work ok execpt for 4 buttons : plus,minus, long right, long left.
I’ve seen those buttons can have a “down state” so the cookie is different of the one i 've put but i cannot find any good documentation from Apple or other about their message format.
Do somebody know where to find the infos?
Cheers,
Pit