Port for macOS (#311)

* merged moonlight-mac with moonlight-ios

* reverted to the original project.pbxproj

* cleaned up the code, fixed lots of unnecessary code duplications

* multicontroller support (not tested)

* new class that can be used for further modularization of the MainFrameViewController
This commit is contained in:
Felix Kratz
2018-03-27 08:50:40 +02:00
committed by Cameron Gutman
parent 1c86c4485d
commit 6cc165b589
73 changed files with 5116 additions and 239 deletions
+2 -1
View File
@@ -14,7 +14,8 @@
@interface DataManager : NSObject
- (void) saveSettingsWithBitrate:(NSInteger)bitrate framerate:(NSInteger)framerate height:(NSInteger)height width:(NSInteger)width onscreenControls:(NSInteger)onscreenControls;
- (void) saveSettingsWithBitrate:(NSInteger)bitrate framerate:(NSInteger)framerate height:(NSInteger)height width:(NSInteger)width onscreenControls:(NSInteger)onscreenControls remote:
(NSInteger)streamingRemotely;
- (NSArray*) getHosts;
- (void) updateHost:(TemporaryHost*)host;
+12 -1
View File
@@ -22,11 +22,20 @@
// HACK: Avoid calling [UIApplication delegate] off the UI thread to keep
// Main Thread Checker happy.
if ([NSThread isMainThread]) {
#if TARGET_OS_IPHONE
_appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
#else
_appDelegate = (AppDelegate *)[[NSApplication sharedApplication] delegate];
#endif
}
else {
dispatch_sync(dispatch_get_main_queue(), ^{
#if TARGET_OS_IPHONE
_appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
#else
_appDelegate = (AppDelegate *)[[NSApplication sharedApplication] delegate];
#endif
});
}
@@ -53,7 +62,8 @@
return uid;
}
- (void) saveSettingsWithBitrate:(NSInteger)bitrate framerate:(NSInteger)framerate height:(NSInteger)height width:(NSInteger)width onscreenControls:(NSInteger)onscreenControls {
- (void) saveSettingsWithBitrate:(NSInteger)bitrate framerate:(NSInteger)framerate height:(NSInteger)height width:(NSInteger)width onscreenControls:(NSInteger)onscreenControls remote:
(NSInteger) streamingRemotely {
[_managedObjectContext performBlockAndWait:^{
Settings* settingsToSave = [self retrieveSettings];
@@ -63,6 +73,7 @@
settingsToSave.height = [NSNumber numberWithInteger:height];
settingsToSave.width = [NSNumber numberWithInteger:width];
settingsToSave.onscreenControls = [NSNumber numberWithInteger:onscreenControls];
settingsToSave.streamingRemotely = [NSNumber numberWithInteger:streamingRemotely];
[self saveData];
}];
+1
View File
@@ -18,5 +18,6 @@
@property (nonatomic, retain) NSNumber * width;
@property (nonatomic, retain) NSNumber * onscreenControls;
@property (nonatomic, retain) NSString * uniqueId;
@property (nonatomic, retain) NSNumber * streamingRemotely;
@end
+1
View File
@@ -17,5 +17,6 @@
@dynamic width;
@dynamic onscreenControls;
@dynamic uniqueId;
@dynamic streamingRemotely;
@end
+1
View File
@@ -19,6 +19,7 @@
@property (nonatomic, retain) NSNumber * width;
@property (nonatomic, retain) NSNumber * onscreenControls;
@property (nonatomic, retain) NSString * uniqueId;
@property (nonatomic, retain) NSNumber * streamingRemotely;
- (id) initFromSettings:(Settings*)settings;
+1
View File
@@ -21,6 +21,7 @@
self.width = settings.width;
self.onscreenControls = settings.onscreenControls;
self.uniqueId = settings.uniqueId;
self.streamingRemotely = settings.streamingRemotely;
return self;
}