aboutsummaryrefslogtreecommitdiffstats
path: root/Video Tuneup/Classes
diff options
context:
space:
mode:
authorBrian Jordan2012-04-26 14:25:43 -0400
committerBrian Jordan2012-04-26 14:25:43 -0400
commitcf1969fa1dc7f944b5edf37d04b84996ef0b6320 (patch)
treea8f57dc1ee5405350d6b5e872cf76d542a5d7796 /Video Tuneup/Classes
parent03668582bcd90409def595ea6f4c463e29557664 (diff)
downloadVideo-Tuneup-cf1969fa1dc7f944b5edf37d04b84996ef0b6320.tar.bz2
fix build, add ViewController reference to WebserviceCommunicator
Diffstat (limited to 'Video Tuneup/Classes')
-rw-r--r--Video Tuneup/Classes/WebserviceCommunicator.h7
-rw-r--r--Video Tuneup/Classes/WebserviceCommunicator.m17
2 files changed, 20 insertions, 4 deletions
diff --git a/Video Tuneup/Classes/WebserviceCommunicator.h b/Video Tuneup/Classes/WebserviceCommunicator.h
index 5c0a378..3eb9e7a 100644
--- a/Video Tuneup/Classes/WebserviceCommunicator.h
+++ b/Video Tuneup/Classes/WebserviceCommunicator.h
@@ -7,11 +7,16 @@
//
#import <Foundation/Foundation.h>
+#import "ViewController.h"
-@interface WebserviceCommunicator : NSObject <NSURLConnectionDelegate>
+@interface WebserviceCommunicator : NSObject <NSURLConnectionDelegate>{
+ ViewController* _viewController;
+}
@property (nonatomic, retain) NSFileHandle *fileHandle;
+@property (nonatomic, retain) NSString *songPath;
-(void)mixMusic:(NSURL *)file;
+-(void)setParentController:(ViewController *)viewController;
@end
diff --git a/Video Tuneup/Classes/WebserviceCommunicator.m b/Video Tuneup/Classes/WebserviceCommunicator.m
index bffd7ac..c8ca27f 100644
--- a/Video Tuneup/Classes/WebserviceCommunicator.m
+++ b/Video Tuneup/Classes/WebserviceCommunicator.m
@@ -12,12 +12,12 @@
@implementation WebserviceCommunicator
-@synthesize fileHandle;
+@synthesize fileHandle, songPath;
- (id)init {
self = [super init];
if (self) {
- NSString *songPath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"mixed_song.mp3"];
+ songPath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"mixed_song.mp3"];
[[NSFileManager defaultManager] createFileAtPath:songPath contents:nil attributes:nil];
fileHandle = [NSFileHandle fileHandleForWritingAtPath:songPath];
}
@@ -56,6 +56,12 @@
(void)[[NSURLConnection alloc] initWithRequest:request delegate:self];
}
+
+- (void)setParentController:(ViewController *)viewController {
+ _viewController = viewController;
+}
+
+
#pragma mark NSURLConnection delegate methods
-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
@@ -71,8 +77,13 @@
-(void)connectionDidFinishLoading:(NSURLConnection *)connection {
NSLog(@"Song send finished loading.");
-
+
[fileHandle closeFile];
+
+ // This is happening before file is completely sent back. Need to change timeout.
+
+ NSLog(@"Received song path is %@", songPath);
+// [_viewController loadAudioFromFile:[NSURL URLWithString:songPath]];
}
@end