disable background hostCard update while streaming
This commit is contained in:
1 parent
0728959ebe
commit
eb41536749
3 files changed
+15
-5
No files matched your search
@@ -16,6 +16,7 @@
|
|||||||
- (void)wakeupButtonTappedForHost:(TemporaryHost *)host;
|
- (void)wakeupButtonTappedForHost:(TemporaryHost *)host;
|
||||||
- (void)pairButtonTappedForHost:(TemporaryHost *)host;
|
- (void)pairButtonTappedForHost:(TemporaryHost *)host;
|
||||||
- (void)hostCardLongPressed:(TemporaryHost *)host view:(UIView *)view;
|
- (void)hostCardLongPressed:(TemporaryHost *)host view:(UIView *)view;
|
||||||
|
- (bool)isStreaming;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -509,10 +509,12 @@ static const float REFRESH_CYCLE = 2.0f;
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NSLog(@"hostCard update loop %f", CACurrentMediaTime());
|
||||||
|
|
||||||
[self updateContentsForHost:_host];
|
[self updateContentsForHost:_host];
|
||||||
|
|
||||||
// Queue the next refresh cycle
|
// Queue the next refresh cycle
|
||||||
[self performSelector:@selector(updateLoop) withObject:self afterDelay:REFRESH_CYCLE];
|
if(![self.delegate isStreaming]) [self performSelector:@selector(updateLoop) withObject:self afterDelay:REFRESH_CYCLE];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) updateContentsForHost:(TemporaryHost*)host {
|
- (void) updateContentsForHost:(TemporaryHost*)host {
|
||||||
|
|||||||
@@ -69,6 +69,7 @@
|
|||||||
NSCache* _boxArtCache;
|
NSCache* _boxArtCache;
|
||||||
bool _background;
|
bool _background;
|
||||||
bool _enteredAppView;
|
bool _enteredAppView;
|
||||||
|
bool _settingsViewExpanded;
|
||||||
UIView* menuSeparator;
|
UIView* menuSeparator;
|
||||||
UIView* snapshot;
|
UIView* snapshot;
|
||||||
SettingsViewController* settingsViewController;
|
SettingsViewController* settingsViewController;
|
||||||
@@ -1119,6 +1120,7 @@ static NSMutableSet* hostList;
|
|||||||
- (void)revealController:(SWRevealViewController *)revealController willMoveToPosition:(FrontViewPosition)position {
|
- (void)revealController:(SWRevealViewController *)revealController willMoveToPosition:(FrontViewPosition)position {
|
||||||
settingsViewController = (SettingsViewController*)[revealController rearViewController];
|
settingsViewController = (SettingsViewController*)[revealController rearViewController];
|
||||||
revealController.navBarMenuDelegate = settingsViewController;
|
revealController.navBarMenuDelegate = settingsViewController;
|
||||||
|
_settingsViewExpanded = position != FrontViewPositionLeft;
|
||||||
if (position == FrontViewPositionLeft) {
|
if (position == FrontViewPositionLeft) {
|
||||||
self.navigationItem.leftBarButtonItems = @[_settingsButton];
|
self.navigationItem.leftBarButtonItems = @[_settingsButton];
|
||||||
}
|
}
|
||||||
@@ -1788,11 +1790,12 @@ static NSMutableSet* hostList;
|
|||||||
[super viewWillAppear:NO];
|
[super viewWillAppear:NO];
|
||||||
|
|
||||||
/* this makes background color works*/
|
/* this makes background color works*/
|
||||||
/*
|
|
||||||
for (UIView *subview in self.view.subviews) {
|
|
||||||
[subview removeFromSuperview]; // 暂时移除所有子视图
|
|
||||||
}*/
|
|
||||||
|
|
||||||
|
if(!_settingsViewExpanded){
|
||||||
|
for (UIView *subview in self.view.subviews) {
|
||||||
|
[subview removeFromSuperview]; // 暂时移除所有子视图
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// We can get here on home press while streaming
|
// We can get here on home press while streaming
|
||||||
// since the stream view segues to us just before
|
// since the stream view segues to us just before
|
||||||
@@ -2008,6 +2011,10 @@ static NSMutableSet* hostList;
|
|||||||
return !self.revealViewController.isStreaming && _enteredAppView;
|
return !self.revealViewController.isStreaming && _enteredAppView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (bool)isStreaming{
|
||||||
|
return self.revealViewController.isStreaming;
|
||||||
|
}
|
||||||
|
|
||||||
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
|
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||||
UICollectionViewCell* cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"AppCell" forIndexPath:indexPath];
|
UICollectionViewCell* cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"AppCell" forIndexPath:indexPath];
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user