Permalink
Browse files

Creating github project for Timelapse Calculator app for iPhone

  • Loading branch information...
0 parents commit 7ffab8d95e23bd7dbf834189787ef42e82016a97 @sighmon committed Jan 29, 2011
@@ -0,0 +1,15 @@
+# Xcode
+build/*
+*.pbxuser
+!default.pbxuser
+*.mode1v3
+!default.mode1v3
+*.mode2v3
+!default.mode2v3
+*.perspectivev3
+!default.perspectivev3
+*.xcworkspace
+!default.xcworkspace
+xcuserdata
+profile
+*.moved-aside
@@ -0,0 +1,44 @@
+//
+// FlipsideViewController.h
+// Timelapse
+//
+// Created by Simon Loffler on 24/12/10.
+// Copyright 2010 sighmon.com. All rights reserved.
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+
+#import <UIKit/UIKit.h>
+
+@protocol FlipsideViewControllerDelegate;
+
+
+@interface FlipsideViewController : UIViewController <UIWebViewDelegate> {
+ id <FlipsideViewControllerDelegate> delegate;
+
+ UIWebView *creditsView;
+}
+
+@property (nonatomic, assign) id <FlipsideViewControllerDelegate> delegate;
+@property (nonatomic, retain) IBOutlet UIWebView *creditsView;
+
+- (IBAction)done:(id)sender;
+
+@end
+
+
+@protocol FlipsideViewControllerDelegate
+- (void)flipsideViewControllerDidFinish:(FlipsideViewController *)controller;
+@end
+
@@ -0,0 +1,104 @@
+//
+// FlipsideViewController.m
+// Timelapse
+//
+// Created by Simon Loffler on 24/12/10.
+// Copyright 2010 sighmon.com. All rights reserved.
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+
+#import "FlipsideViewController.h"
+
+
+@implementation FlipsideViewController
+
+@synthesize delegate, creditsView;
+
+
+- (void)viewDidLoad {
+ [super viewDidLoad];
+
+ self.view.backgroundColor = [UIColor viewFlipsideBackgroundColor];
+
+ // self.creditsView.scalesPageToFit = YES;
+ creditsView.delegate = self;
+
+ // Load the credits UIWebView now
+
+ NSString *mainPath = [[NSBundle mainBundle] bundlePath];
+ NSURL *baseURL = [NSURL fileURLWithPath:mainPath];
+ NSString *path = [[NSBundle mainBundle] pathForResource:@"credits" ofType:@"html"];
+ NSFileHandle *readHandle = [NSFileHandle fileHandleForReadingAtPath:path];
+
+ NSString *htmlString = [[NSString alloc] initWithData:
+ [readHandle readDataToEndOfFile] encoding:NSUTF8StringEncoding];
+
+ // to make html content transparent to its parent view -
+ // 1) set the webview's backgroundColor property to [UIColor clearColor]
+ // 2) use the content in the html: <body style="background-color: transparent">
+ // 3) opaque property set to NO
+ //
+ creditsView.opaque = NO;
+ creditsView.backgroundColor = [UIColor clearColor];
+ [self.creditsView loadHTMLString:htmlString baseURL:baseURL];
+ [htmlString release];
+}
+
+
+- (IBAction)done:(id)sender {
+ [self.delegate flipsideViewControllerDidFinish:self];
+}
+
+
+- (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;
+}
+
+// This makes the links in the info pages open up in Safari, instead of the UIWebView
+
+- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
+ if (navigationType == UIWebViewNavigationTypeLinkClicked) {
+ [[UIApplication sharedApplication] openURL:[request URL]];
+ return NO;
+ }
+
+ return YES;
+}
+
+/*
+// Override to allow orientations other than the default portrait orientation.
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
+ // Return YES for supported orientations
+ return (interfaceOrientation == UIInterfaceOrientationPortrait);
+}
+*/
+
+
+- (void)dealloc {
+ [creditsView release];
+ [super dealloc];
+}
+
+
+@end
@@ -0,0 +1,98 @@
+//
+// MainViewController.h
+// Timelapse
+//
+// Created by Simon Loffler on 24/12/10.
+// Copyright 2010 sighmon.com. All rights reserved.
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+
+#import "FlipsideViewController.h"
+#import <MessageUI/MessageUI.h>
+#import <MessageUI/MFMailComposeViewController.h>
+
+#define kShootingDays 0
+#define kShootingHours 1
+#define kShootingMinutes 2
+#define kShootingSeconds 3
+
+#define kPlaybackHours 0
+#define kPlaybackMinutes 1
+#define kPlaybackSeconds 2
+#define kPlaybackFrames 3
+
+@interface MainViewController : UIViewController <FlipsideViewControllerDelegate, UIPickerViewDelegate, UIPickerViewDataSource, MFMailComposeViewControllerDelegate>
+{
+ IBOutlet UITextField *intervalField;
+ IBOutlet UITextField *shotsField;
+ IBOutlet UITextField *fpsField;
+
+ IBOutlet UIPickerView *shootingPicker;
+ IBOutlet UIPickerView *playbackPicker;
+
+ NSDictionary *shootingDuration;
+ NSArray *shootingDays;
+ NSArray *shootingHours;
+ NSArray *shootingMinutes;
+ NSArray *shootingSeconds;
+
+ NSDictionary *playbackDuration;
+ NSArray *playbackHours;
+ NSArray *playbackMinutes;
+ NSArray *playbackSeconds;
+ NSArray *playbackFrames;
+}
+
+@property (nonatomic, retain) UITextField *intervalField;
+@property (nonatomic, retain) UITextField *shotsField;
+@property (nonatomic, retain) UITextField *fpsField;
+
+@property (nonatomic, retain) UIPickerView *shootingPicker;
+@property (nonatomic, retain) NSDictionary *shootingDuration;
+@property (nonatomic, retain) NSArray *shootingDays;
+@property (nonatomic, retain) NSArray *shootingHours;
+@property (nonatomic, retain) NSArray *shootingMinutes;
+@property (nonatomic, retain) NSArray *shootingSeconds;
+
+@property (nonatomic, retain) UIPickerView *playbackPicker;
+@property (nonatomic, retain) NSDictionary *playbackDuration;
+@property (nonatomic, retain) NSArray *playbackHours;
+@property (nonatomic, retain) NSArray *playbackMinutes;
+@property (nonatomic, retain) NSArray *playbackSeconds;
+@property (nonatomic, retain) NSArray *playbackFrames;
+
+- (IBAction)showInfo:(id)sender;
+- (IBAction)resetAll:(id)sender;
+- (IBAction)composeEmail:(id)sender;
+
+- (IBAction)textFieldDoneEditing:(id)sender;
+- (IBAction)backgroundClick:(id)sender;
+
+- (void)calcRealTimeWithShots: (int) shots andInterval: (int) interval;
+- (void)calcPlaybackTimeWithShots: (int) shots andPlaybackFPS: (int) playbackFPS;
+
+- (void)playbackCentricWithHours: (int) hrs andMinutes: (int) mins andSeconds: (int) secs
+ andFrames: (int) frames andInterval: (int) interval andFPS: (int) fps;
+
+- (void)shootCentricWithDays: (int) days andHours: (int) hrs andMinutes: (int) mins andSeconds: (int) secs
+ andInterval: (int) interval andPlaybackFPS: (int) playbackFPS;
+
+- (void)updateSettingsScript;
+- (void)updatePlaybackScript;
+- (void)updateShootingScript;
+
+- (NSString *)stringFromDays: (int) days andHours: (int) hrs andMinutes: (int) mins andSeconds: (int) secs andFrames: (int) frames;
+
+@end
Oops, something went wrong.

0 comments on commit 7ffab8d

Please sign in to comment.