diff options
| author | Brian Jordan | 2012-04-26 16:26:54 -0400 |
|---|---|---|
| committer | Brian Jordan | 2012-04-26 16:26:54 -0400 |
| commit | 181c52882cddce58987bbc51b137912b76b30881 (patch) | |
| tree | 81c3e6def6adeb0b017a3da2630e8b00585bb9ab | |
| parent | e69cf8b05494226fcfa9e77483581656948bb361 (diff) | |
| download | Video-Tuneup-181c52882cddce58987bbc51b137912b76b30881.tar.bz2 | |
add internet button handling
| -rw-r--r-- | Video Tuneup/Classes/WebserviceCommunicator.m | 4 | ||||
| -rw-r--r-- | Video Tuneup/ViewController.m | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/Video Tuneup/Classes/WebserviceCommunicator.m b/Video Tuneup/Classes/WebserviceCommunicator.m index 05b35fa..6fedd25 100644 --- a/Video Tuneup/Classes/WebserviceCommunicator.m +++ b/Video Tuneup/Classes/WebserviceCommunicator.m @@ -83,13 +83,13 @@ [fileHandle closeFile]; if(_viewController != nil) { - [_viewController.internetRequestButton setTitle:@"Internet Tune-up (failed)" forState:UIControlStateNormal]; + [_viewController.internetRequestButton setTitle:@"Internet Tune-up (completed)" forState:UIControlStateNormal]; } // This is happening before file is completely sent back. Need to change timeout. NSLog(@"Received song path is %@", songPath); -// [_viewController loadAudioFromFile:[NSURL URLWithString:songPath]]; + [_viewController loadAudioFromFile:[NSURL fileURLWithPath:songPath]]; } @end diff --git a/Video Tuneup/ViewController.m b/Video Tuneup/ViewController.m index 3b99759..1e6f981 100644 --- a/Video Tuneup/ViewController.m +++ b/Video Tuneup/ViewController.m @@ -120,8 +120,12 @@ mScrubber, mediaLibraryButton, mediaLibraryPopover, exportButton; - (IBAction)loadAudioFromFile:(NSURL *)songFileURL { songAsset = [AVURLAsset URLAssetWithURL:songFileURL options:nil]; + NSLog(@"Song asset duration is %f", CMTimeGetSeconds([songAsset duration])); - + if(CMTimeGetSeconds([songAsset duration]) == 0){ + [internetRequestButton setTitle:@"Internet Tune-up (failed)" forState:UIControlStateNormal]; + return; + } NSLog(@"Refreshing editor"); [self refreshEditor]; } |
