You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by fi...@apache.org on 2012/03/16 19:14:49 UTC
[22/29] ios commit: Update for iOS Unified JS
Update for iOS Unified JS
Added Compass to Cordova.plist
Changes to file so mobile-spec file tests will pass - requires changes in cordova-js
Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/commit/9bf0e8c7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/9bf0e8c7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/9bf0e8c7
Branch: refs/heads/master
Commit: 9bf0e8c7761fc63ec3c08abc8dffdc9a59263843
Parents: 9c52b48
Author: Becky Gibson <be...@apache.org>
Authored: Fri Mar 9 16:50:51 2012 -0500
Committer: Fil Maj <ma...@gmail.com>
Committed: Fri Mar 16 10:56:49 2012 -0700
----------------------------------------------------------------------
Cordova-based Application/Cordova.plist | 2 +
CordovaLib/Classes/CDVFile.h | 11 +++-
CordovaLib/Classes/CDVFile.m | 84 +++++++++++++++-----------
CordovaLib/Classes/CDVSound.h | 17 +++++-
CordovaLib/Classes/CDVSound.m | 44 ++++++++++++-
5 files changed, 116 insertions(+), 42 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/9bf0e8c7/Cordova-based Application/Cordova.plist
----------------------------------------------------------------------
diff --git a/Cordova-based Application/Cordova.plist b/Cordova-based Application/Cordova.plist
index 4a15cdd..117896d 100644
--- a/Cordova-based Application/Cordova.plist
+++ b/Cordova-based Application/Cordova.plist
@@ -26,6 +26,8 @@
</array>
<key>Plugins</key>
<dict>
+ <key>Compass</key>
+ <string>CDVLocation</string>
<key>Accelerometer</key>
<string>CDVAccelerometer</string>
<key>Camera</key>
http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/9bf0e8c7/CordovaLib/Classes/CDVFile.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVFile.h b/CordovaLib/Classes/CDVFile.h
index ccce5d9..6e2fec7 100644
--- a/CordovaLib/Classes/CDVFile.h
+++ b/CordovaLib/Classes/CDVFile.h
@@ -74,7 +74,11 @@ typedef int CDVFileSystemType;
- (void) getFileMetadata:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
- (void) readEntries:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
-- (void) readFile:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
+// DEPRECATED
+- (void) readFile:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options __attribute__((deprecated));
+// DEPRECATED
+
+- (void) readAsText:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
- (void) readAsDataURL:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
-(NSString*) getMimeTypeFromPath: (NSString*) fullPath;
- (void) write:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
@@ -84,7 +88,10 @@ typedef int CDVFileSystemType;
//- (void) deleteDirectory:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
//- (void) deleteFile:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
- (void) getFreeDiskSpace:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
-- (void) truncateFile:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
+// DEPRECATED
+- (void) truncateFile:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options __attribute__((deprecated));
+// DEPRECATED
+- (void) truncate:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/9bf0e8c7/CordovaLib/Classes/CDVFile.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVFile.m b/CordovaLib/Classes/CDVFile.m
index 5ad3867..b28d57f 100644
--- a/CordovaLib/Classes/CDVFile.m
+++ b/CordovaLib/Classes/CDVFile.m
@@ -142,7 +142,7 @@
NSString* jsString = nil;
if (type > 1){
- result = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsInt: NOT_FOUND_ERR cast: @"window.localFileSystem._castError"];
+ result = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsInt: NOT_FOUND_ERR];
jsString = [result toErrorCallbackString:callbackId];
NSLog(@"iOS only supports TEMPORARY and PERSISTENT file systems");
} else {
@@ -153,7 +153,7 @@
NSNumber* pNumAvail = [self checkFreeDiskSpace: fullPath];
//NSLog(@"Free space: %@", [NSString stringWithFormat:@"%qu", [ pNumAvail unsignedLongLongValue ]]);
if (pNumAvail && [pNumAvail unsignedLongLongValue] < size) {
- result = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsInt: QUOTA_EXCEEDED_ERR cast: @"window.localFileSystem._castError"];
+ result = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsInt: QUOTA_EXCEEDED_ERR];
jsString = [result toErrorCallbackString:callbackId];
}
else {
@@ -161,7 +161,7 @@
[fileSystem setObject: (type == TEMPORARY ? kW3FileTemporary : kW3FilePersistent)forKey:@"name"];
NSDictionary* dirEntry = [self getDirectoryEntry: fullPath isDirectory: YES];
[fileSystem setObject:dirEntry forKey:@"root"];
- result = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsDictionary: fileSystem cast: @"window.localFileSystem._castFS"];
+ result = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsDictionary: fileSystem];
jsString = [result toSuccessCallbackString:callbackId];
}
}
@@ -233,7 +233,7 @@
if (!testUri || ![testUri isFileURL]) {
// issue ENCODING_ERR
- result = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsInt: ENCODING_ERR cast: @"window.localFileSystem._castError"];
+ result = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsInt: ENCODING_ERR];
jsString = [result toErrorCallbackString:callbackId];
} else {
NSFileManager* fileMgr = [[NSFileManager alloc] init];
@@ -258,18 +258,18 @@
}
if (foundFullPath == nil) {
// error SECURITY_ERR - not one of the two paths types supported
- result = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsInt: SECURITY_ERR cast: @"window.localFileSystem._castError"];
+ result = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsInt: SECURITY_ERR];
jsString = [result toErrorCallbackString:callbackId];
} else {
NSDictionary* fileSystem = [self getDirectoryEntry: path isDirectory: isDir];
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary: fileSystem cast: @"window.localFileSystem._castEntry"];
+ result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary: fileSystem];
jsString = [result toSuccessCallbackString:callbackId];
}
} else {
// return NOT_FOUND_ERR
- result = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsInt: NOT_FOUND_ERR cast: @"window.localFileSystem._castError"];
+ result = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsInt: NOT_FOUND_ERR];
jsString = [result toErrorCallbackString:callbackId];
}
@@ -403,7 +403,7 @@
} else {
//NSLog(@"newly created file/dir (%@) exists: %d", reqFullPath, [fileMgr fileExistsAtPath:reqFullPath]);
// file existed or was created
- result = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsDictionary: [self getDirectoryEntry: reqFullPath isDirectory: bDirRequest] cast: @"window.localFileSystem._castEntry"];
+ result = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsDictionary: [self getDirectoryEntry: reqFullPath isDirectory: bDirRequest]];
jsString = [result toSuccessCallbackString: callbackId];
}
} // are all possible conditions met?
@@ -413,7 +413,7 @@
if (errorCode > 0) {
// create error callback
- result = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsInt: errorCode cast: @"window.localFileSystem._castError"];
+ result = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsInt: errorCode];
jsString = [result toErrorCallbackString:callbackId];
}
@@ -460,14 +460,14 @@
BOOL bIsDir;
BOOL bExists = [fileMgr fileExistsAtPath: newPath isDirectory: &bIsDir];
if (bExists) {
- result = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsDictionary: [self getDirectoryEntry:newPath isDirectory:bIsDir] cast: @"window.localFileSystem._castEntry"];
+ result = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsDictionary: [self getDirectoryEntry:newPath isDirectory:bIsDir]];
jsString = [result toSuccessCallbackString:callbackId];
}
[fileMgr release];
}
if (!jsString) {
// invalid path or file does not exist
- result = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsInt: NOT_FOUND_ERR cast: @"window.localFileSystem._castError"];
+ result = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsInt: NOT_FOUND_ERR];
jsString = [result toErrorCallbackString: callbackId];
}
[self writeJavascript:jsString];
@@ -496,10 +496,11 @@
if (fileAttribs){
NSDate* modDate = [fileAttribs fileModificationDate];
if (modDate){
- NSNumber* msDate = [NSNumber numberWithDouble:[modDate timeIntervalSince1970]*1000];
- NSMutableDictionary* metadataDict = [NSMutableDictionary dictionaryWithCapacity:1];
- [metadataDict setObject:msDate forKey:@"modificationTime"];
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary: metadataDict cast: @"window.localFileSystem._castDate"];
+ //NSNumber* msDate = [NSNumber numberWithDouble:[modDate timeIntervalSince1970]*1000];
+ //NSMutableDictionary* metadataDict = [NSMutableDictionary dictionaryWithCapacity:1];
+ //[metadataDict setObject:msDate forKey:@"modificationTime"];
+ //result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary: metadataDict cast: @"window.localFileSystem._castDate"];
+ result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDouble: [modDate timeIntervalSince1970]*1000];
jsString = [result toSuccessCallbackString:callbackId];
}
} else {
@@ -510,7 +511,7 @@
errorCode = NOT_FOUND_ERR;
}
// log [NSNumber numberWithDouble: theMessage] objCtype to see what it returns
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt: errorCode cast: @"window.localFileSystem._castError"];
+ result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt: errorCode];
jsString = [result toErrorCallbackString:callbackId];
}
if (jsString){
@@ -560,7 +561,7 @@
[fileMgr release];
}
if (errorCode > 0) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt: errorCode cast:@"window.localFileSystem._castError"];
+ result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt: errorCode];
jsString = [result toErrorCallbackString:callbackId];
} else {
// perform actual remove
@@ -593,7 +594,7 @@
// error if try to remove top level (documents or tmp) dir
if ([fullPath isEqualToString:self.appDocsPath] || [fullPath isEqualToString:self.appTempPath]){
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt: NO_MODIFICATION_ALLOWED_ERR cast:@"window.localFileSystem._castError"];
+ result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt: NO_MODIFICATION_ALLOWED_ERR];
jsString = [result toErrorCallbackString:callbackId];
} else {
jsString = [self doRemove: fullPath callback: callbackId];
@@ -632,11 +633,11 @@
errorCode = NO_MODIFICATION_ALLOWED_ERR;
}
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt: errorCode cast: @"window.localFileSystem._castError"];
+ result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt: errorCode];
jsString = [result toErrorCallbackString:callbackId];
}
} @catch (NSException* e) { // NSInvalidArgumentException if path is . or ..
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt: SYNTAX_ERR cast: @"window.localFileSystem._castError"];
+ result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt: SYNTAX_ERR];
jsString = [result toErrorCallbackString:callbackId];
}
@finally {
@@ -694,22 +695,23 @@
- (void) doCopyMove:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options isCopy:(BOOL)bCopy
{
NSString* callbackId = [arguments pop];
- VERIFY_ARGUMENTS(arguments, 1, callbackId)
+ VERIFY_ARGUMENTS(arguments, 2, callbackId)
// arguments
NSString* srcFullPath = [arguments objectAtIndex:0];
+ NSString* destRootPath = [arguments objectAtIndex:1];
// optional argument
- NSString* newName = ([arguments count] > 1) ? [arguments objectAtIndex:1] : [srcFullPath lastPathComponent]; // use last component from appPath if new name not provided
+ NSString* newName = ([arguments count] > 2) ? [arguments objectAtIndex:2] : [srcFullPath lastPathComponent]; // use last component from appPath if new name not provided
CDVPluginResult* result = nil;
NSString* jsString = nil;
CDVFileError errCode = 0; // !! Currently 0 is not defined, use this to signal error !!
- NSString* destRootPath = nil;
+ /*NSString* destRootPath = nil;
NSString* key = @"fullPath";
if([options valueForKeyIsString:key]){
destRootPath = [options objectForKey:@"fullPath"];
- }
+ }*/
if (!destRootPath) {
// no destination provided
@@ -786,7 +788,7 @@
if (bSuccess) {
// should verify it is there and of the correct type???
NSDictionary* newEntry = [self getDirectoryEntry: newFullPath isDirectory:bSrcIsDir]; //should be the same type as source
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary: newEntry cast: @"window.localFileSystem._castEntry"];
+ result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary: newEntry];
jsString = [result toSuccessCallbackString:callbackId];
}
else {
@@ -806,7 +808,7 @@
}
}
if (errCode > 0) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt: errCode cast: @"window.localFileSystem._castError"];
+ result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt: errCode];
jsString = [result toErrorCallbackString:callbackId];
}
@@ -868,7 +870,7 @@
// make sure it exists and is not a directory
BOOL bExists = [fileMgr fileExistsAtPath:fullPath isDirectory: &bIsDir];
if(!bExists || bIsDir){
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt: NOT_FOUND_ERR cast:@"window.localFileSystem._castError"];
+ result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt: NOT_FOUND_ERR];
jsString = [result toErrorCallbackString:callbackId];
} else {
// create dictionary of file info
@@ -882,7 +884,7 @@
NSDate* modDate = [fileAttrs fileModificationDate];
NSNumber* msDate = [NSNumber numberWithDouble:[modDate timeIntervalSince1970]*1000];
[fileInfo setObject:msDate forKey:@"lastModifiedDate"];
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary: fileInfo cast: @"window.localFileSystem._castDate"];
+ result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary: fileInfo];
jsString = [result toSuccessCallbackString:callbackId];
}
[fileMgr release];
@@ -918,11 +920,11 @@
[entries addObject:entryDict];
}
}
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArray: entries cast: @"window.localFileSystem._castEntries"];
+ result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArray: entries];
jsString = [result toSuccessCallbackString:callbackId];
} else {
// assume not found but could check error for more specific error conditions
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt: NOT_FOUND_ERR cast: @"window.localFileSystem._castError"];
+ result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt: NOT_FOUND_ERR];
jsString = [result toErrorCallbackString:callbackId];
}
@@ -931,6 +933,13 @@
[self writeJavascript: jsString];
}
+// DEPRECATED
+- (void) readFile:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
+{
+ NSLog(@"readFile is DEPRECATED! Use readAsText");
+ [self readAsText: arguments withDict: options];
+}
+
/* read and return file data
* IN:
* NSArray* arguments
@@ -940,7 +949,7 @@
* NSMutableDictionary* options
* empty
*/
-- (void) readFile:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
+- (void) readAsText:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
{
NSString* callbackId = [arguments pop];
VERIFY_ARGUMENTS(arguments, 1, callbackId)
@@ -956,7 +965,7 @@
if(!file){
// invalid path entry
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt: NOT_FOUND_ERR cast: @"window.localFileSystem._castError"];
+ result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt: NOT_FOUND_ERR];
jsString = [result toErrorCallbackString:callbackId];
} else {
NSData* readData = [ file readDataToEndOfFile];
@@ -1027,7 +1036,7 @@
}
}
if (!jsString){
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt: errCode cast: @"window.localFileSystem._castError"];
+ result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt: errCode];
jsString = [result toErrorCallbackString:callbackId];
}
//NSLog(@"readAsDataURL return: %@", jsString);
@@ -1065,9 +1074,14 @@
}
return mimeType;
}
-
+// DEPRECATED
- (void) truncateFile:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
{
+ NSLog(@"truncateFile is DEPRECATED! Use truncate");
+ [self truncate: arguments withDict: options];
+}
+- (void) truncate:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
+{
NSString* callbackId = [arguments pop];
VERIFY_ARGUMENTS(arguments, 2, callbackId)
@@ -1154,7 +1168,7 @@
}
if(!jsString) {
// was an error
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt: errCode cast: @"window.localFileSystem._castError"];
+ result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt: errCode];
jsString = [result toErrorCallbackString:callbackId];
}
[self writeJavascript: jsString];
http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/9bf0e8c7/CordovaLib/Classes/CDVSound.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVSound.h b/CordovaLib/Classes/CDVSound.h
index b4bff62..902fd86 100755
--- a/CordovaLib/Classes/CDVSound.h
+++ b/CordovaLib/Classes/CDVSound.h
@@ -95,6 +95,11 @@ typedef NSUInteger CDVMediaMsg;
}
@property (nonatomic, retain) NSMutableDictionary* soundCache;
@property (nonatomic, retain) AVAudioSession* avSession;
+//DEPRECATED
+- (void) play:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options __attribute__((deprecated));
+- (void) pause:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options __attribute__((deprecated));
+- (void) stop:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options __attribute__((deprecated));
+// DEPRECATED
- (void) startPlayingAudio:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
- (void) pausePlayingAudio:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
@@ -102,7 +107,12 @@ typedef NSUInteger CDVMediaMsg;
- (void) seekToAudio:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
- (void) release:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
- (void) getCurrentPositionAudio:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
-//- (void) prepare:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
+
+// DEPRECATED
+- (void) getCurrentPosition:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options __attribute__((deprecated));
+- (void) prepare:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options __attribute__((deprecated));
+// DEPRECATED
+
- (BOOL) hasAudioSession;
// helper methods
@@ -110,6 +120,11 @@ typedef NSUInteger CDVMediaMsg;
- (BOOL) prepareToPlay: (CDVAudioFile*) audioFile withId: (NSString*)mediaId;
- (NSString*) createMediaErrorWithCode: (CDVMediaError) code message: (NSString*) message;
+// DEPRECATED
+- (void) startAudioRecord:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options __attribute__((deprecated));
+- (void) stopAudioRecord:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options __attribute__((deprecated));
+// DEPRECATED
+
- (void) startRecordingAudio:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
- (void) stopRecordingAudio:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/9bf0e8c7/CordovaLib/Classes/CDVSound.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVSound.m b/CordovaLib/Classes/CDVSound.m
index be4b3be..0a5f756 100644
--- a/CordovaLib/Classes/CDVSound.m
+++ b/CordovaLib/Classes/CDVSound.m
@@ -143,7 +143,12 @@
return [errorDict JSONString];
}
-
+// DEPRECATED
+- (void) play:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
+{
+ NSLog(@"play is DEPRECATED! Use startPlayingAudio.");
+ [self startPlayingAudio:arguments withDict:options];
+}
- (void) startPlayingAudio:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
{
@@ -263,9 +268,11 @@
// if no errors sets status to starting and calls successCallback with no parameters
// Calls the success call back immediately as there is no mechanism to determine that the file is loaded
// other than the return from prepareToPlay. Thus, IMHO not really worth calling
-/*
+
- (void) prepare:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
{
+ NSLog(@"prepare is DEPRECATED! Recoding will be prepared when startPlayingAudio is called");
+
NSString* callbackId = [arguments objectAtIndex:0];
NSString* mediaId = [arguments objectAtIndex:1];
@@ -303,9 +310,14 @@
[super writeJavascript:jsString];
}
-}*/
-
+}
+// DEPRECATED
+- (void) stop:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
+{
+ NSLog(@"stop is DEPRECATED! Use stopPlayingAudio.");
+ [self stopPlayingAudio:arguments withDict:options];
+}
- (void) stopPlayingAudio:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
{
@@ -325,6 +337,12 @@
[super writeJavascript: jsString];
}
}
+// DEPRECATED
+- (void) pause:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
+{
+ NSLog(@"pause is DEPRECATED! Use pausePlayingAudio.");
+ [self pausePlayingAudio:arguments withDict:options];
+}
- (void) pausePlayingAudio:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
{
@@ -400,6 +418,12 @@
}
}
}
+// DEPRECATED
+- (void) getCurrentPosition:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
+{
+ NSLog(@"getCurrentPosition is DEPRECATED! Use getCurrentPositionAudio.");
+ [self getCurrentPositionAudio:arguments withDict:options];
+}
- (void) getCurrentPositionAudio:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
{
@@ -423,6 +447,12 @@
return;
}
+// DEPRECATED
+- (void) startAudioRecord:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
+{
+ NSLog(@"startAudioRecord is DEPRECATED! Use startRecordingAudio.");
+ [self startRecordingAudio:arguments withDict:options];
+}
- (void) startRecordingAudio:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
{
@@ -480,6 +510,12 @@
}
return;
}
+// DEPRECATED
+- (void) stopAudioRecord:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
+{
+ NSLog(@"stopAudioRecord is DEPRECATED! Use stopRecordingAudio.");
+ [self stopRecordingAudio:arguments withDict:options];
+}
- (void) stopRecordingAudio:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
{