diff options
author | Memphiz <memphis@machzwo.de> | 2013-02-17 14:45:58 +0100 |
---|---|---|
committer | S. Davilla <davilla@4pi.com> | 2013-02-19 11:50:18 -0500 |
commit | 3d1d94bb9a6952711e844f51c9479e8961863c2d (patch) | |
tree | 973ad3a89dcd0409b9620c87653ebd1fa1706743 | |
parent | 6e80100407eb259d027ec30315e457ac1506a0f1 (diff) |
[atv2] - fix the annoyance to need to click twice to startup xbmc on atv2 running ios5.x - we have a single click startup now woohoo :D
-rw-r--r-- | xbmc/osx/atv2/XBMCAppliance.m | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/xbmc/osx/atv2/XBMCAppliance.m b/xbmc/osx/atv2/XBMCAppliance.m index 75aa17abf5..218687922b 100644 --- a/xbmc/osx/atv2/XBMCAppliance.m +++ b/xbmc/osx/atv2/XBMCAppliance.m @@ -142,7 +142,32 @@ - (id) applianceCategories { - return _applianceCategories; + // on ios 5.x this gets called whenever a user hits the xbmc icon + // in the frontrow mainmenu + // we use this indication for faking the "select" key. + // This leads to a one click start of XBMC instead of needing + // to hit select on the only XBMC category called "XBMC" again ;) + Class cls = NSClassFromString(@"ATVVersionInfo"); + if (cls != nil && [[cls currentOSVersion] rangeOfString:@"5."].location != NSNotFound) + { + // eventaction 5 == kBREventRemoteActionPlay from XBMCController.m + // value == 1 meanse we pressed that key + BREvent *eventKeySelect = [BREvent eventWithAction:5 value:1]; + // when we suppress the sound below + // this will even suppress the initial click + // sound because this is threaded + // thats why we just play that first click sound + // directly here before suppressing the sounds + // and doing the fake click (which would result in an unwanted + // second click sound without that hack) + [BRSoundHandler playSound:1];// sound number 1 is the ios click sound + // ios >= 5 only - so ignore the compiler warning on older SDKs + // since we guarded that code with the currentOSVersion above + [BRSoundHandler setSoundSuppressed:TRUE]; + [[BRApplication sharedApplication] postEvent:eventKeySelect]; + } + + return _applianceCategories; } - (id) identifierForContentAlias:(id)contentAlias |