Permalink
Browse files

iOS 4 VGA TVOut

  • Loading branch information...
1 parent cbd44d6 commit 5f0077e5193ada0872d3631f6c90914caf8c12cc @nst committed Nov 4, 2010
@@ -1,17 +0,0 @@
-//
-// FirstViewController.h
-// SpyPhone
-//
-// Created by Nicolas Seriot on 11/15/09.
-// Copyright IICT 2009.
-// Licensed under GPL 2.0 http://www.gnu.org/licenses/gpl-2.0.txt
-//
-
-#import <UIKit/UIKit.h>
-
-
-@interface FirstViewController : UIViewController {
-
-}
-
-@end
@@ -1,32 +0,0 @@
-//
-// FirstViewController.m
-// SpyPhone
-//
-// Created by Nicolas Seriot on 11/15/09.
-// Copyright IICT 2009.
-// Licensed under GPL 2.0 http://www.gnu.org/licenses/gpl-2.0.txt
-//
-
-#import "FirstViewController.h"
-
-
-@implementation FirstViewController
-
-- (void)didReceiveMemoryWarning {
- // Releases the view if it doesn't have a superview.
- [super didReceiveMemoryWarning];
-
- // Release any cached data, images, etc that aren't in use.
-}
-
-- (void)viewDidUnload {
- // Release any retained subviews of the main view.
- // e.g. self.myOutlet = nil;
-}
-
-
-- (void)dealloc {
- [super dealloc];
-}
-
-@end
@@ -8,48 +8,40 @@
//
#import "SpyPhoneAppDelegate.h"
+#import "TVOutManager.h"
-//
-//@interface UIApplication (tvout)
-//- (void) startTVOut;
-//@end
-//
@implementation SpyPhoneAppDelegate
@synthesize window;
@synthesize tabBarController;
-
-- (void)applicationDidFinishLaunching:(UIApplication *)application {
-
- // Add the tab bar controller's current view as a subview of the window
- [window addSubview:tabBarController.view];
-
-// BOOL isTVOutEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:@"TVOutEnabled"];
-// if(isTVOutEnabled) {
-// [[TVOutManager sharedInstance] startTVOut];
-// }
-}
-
-
-/*
-// Optional UITabBarControllerDelegate method
-- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController {
-}
-*/
-
-/*
-// Optional UITabBarControllerDelegate method
-- (void)tabBarController:(UITabBarController *)tabBarController didEndCustomizingViewControllers:(NSArray *)viewControllers changed:(BOOL)changed {
-}
-*/
-
-
- (void)dealloc {
[tabBarController release];
[window release];
[super dealloc];
}
+- (void)applicationDidFinishLaunching:(UIApplication *)application {
+
+ // Add the tab bar controller's current view as a subview of the window
+ [window addSubview:tabBarController.view];
+
+ /*
+ // FIXME: TVOut does not work so well
+
+ 1. start SP, suspend
+ 2. plug
+ 3. start SP, suspend
+ 4. start SP, SP quits
+ 5. start SP
+ */
+
+ BOOL isTVOutEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:@"TVOutEnabled"];
+ if(isTVOutEnabled) {
+ [TVOutManager sharedInstance].tvSafeMode = NO;
+ [[TVOutManager sharedInstance] startTVOut];
+ }
+}
+
@end
View
@@ -0,0 +1,38 @@
+//
+// TVOutManager.h
+// TVOutOS4Test
+//
+// Created by Rob Terrell (rob@touchcentric.com) on 8/16/10.
+// Copyright 2010 TouchCentric LLC. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+
+@interface TVOutManager : NSObject {
+
+ UIWindow* deviceWindow;
+ UIWindow* tvoutWindow;
+ NSTimer *updateTimer;
+ UIImage *image;
+ UIImageView *mirrorView;
+ BOOL done;
+ BOOL tvSafeMode;
+ CGAffineTransform startingTransform;
+}
+
+@property(assign) BOOL tvSafeMode;
+
+
++ (TVOutManager *)sharedInstance;
+
+- (void) startTVOut;
+- (void) stopTVOut;
+- (void) updateTVOut;
+- (void) updateLoop;
+- (void) screenDidConnectNotification: (NSNotification*) notification;
+- (void) screenDidDisconnectNotification: (NSNotification*) notification;
+- (void) screenModeDidChangeNotification: (NSNotification*) notification;
+- (void) deviceOrientationDidChange: (NSNotification*) notification;
+
+@end
Oops, something went wrong.

0 comments on commit 5f0077e

Please sign in to comment.