cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [6/6] ios commit: Remove deprecated methods in CDVSound
Date Sat, 06 Oct 2012 02:19:49 GMT
Remove deprecated methods in CDVSound

They've been deprecated for 7 months now.


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/59ef6439
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/59ef6439
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/59ef6439

Branch: refs/heads/master
Commit: 59ef64397056e84bcca99fb239abc5ca7ef9ab7d
Parents: afb673b
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Fri Oct 5 16:03:26 2012 -0400
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Fri Oct 5 16:03:26 2012 -0400

----------------------------------------------------------------------
 CordovaLib/Classes/CDVSound.h |   22 ---------
 CordovaLib/Classes/CDVSound.m |   86 ------------------------------------
 2 files changed, 0 insertions(+), 108 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/59ef6439/CordovaLib/Classes/CDVSound.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVSound.h b/CordovaLib/Classes/CDVSound.h
index 7fbd52c..6551621 100644
--- a/CordovaLib/Classes/CDVSound.h
+++ b/CordovaLib/Classes/CDVSound.h
@@ -87,14 +87,6 @@ typedef NSUInteger CDVMediaMsg;
 }
 @property (nonatomic, strong) NSMutableDictionary* soundCache;
 @property (nonatomic, strong) AVAudioSession* avSession;
-// DEPRECATED
-- (void)play:(CDVInvokedUrlCommand*)command __attribute__((deprecated));
-
-- (void)pause:(CDVInvokedUrlCommand*)command __attribute__((deprecated));
-
-- (void)stop:(CDVInvokedUrlCommand*)command __attribute__((deprecated));
-
-// DEPRECATED
 
 - (void)startPlayingAudio:(CDVInvokedUrlCommand*)command;
 - (void)pausePlayingAudio:(CDVInvokedUrlCommand*)command;
@@ -103,13 +95,6 @@ typedef NSUInteger CDVMediaMsg;
 - (void)release:(CDVInvokedUrlCommand*)command;
 - (void)getCurrentPositionAudio:(CDVInvokedUrlCommand*)command;
 
-// DEPRECATED
-- (void)getCurrentPosition:(CDVInvokedUrlCommand*)command __attribute__((deprecated));
-
-- (void)prepare:(CDVInvokedUrlCommand*)command __attribute__((deprecated));
-
-// DEPRECATED
-
 - (BOOL)hasAudioSession;
 
 // helper methods
@@ -117,13 +102,6 @@ typedef NSUInteger CDVMediaMsg;
 - (BOOL)prepareToPlay:(CDVAudioFile*)audioFile withId:(NSString*)mediaId;
 - (NSString*)createMediaErrorWithCode:(CDVMediaError)code message:(NSString*)message;
 
-// DEPRECATED
-- (void)startAudioRecord:(CDVInvokedUrlCommand*)command __attribute__((deprecated));
-
-- (void)stopAudioRecord:(CDVInvokedUrlCommand*)command __attribute__((deprecated));
-
-// DEPRECATED
-
 - (void)startRecordingAudio:(CDVInvokedUrlCommand*)command;
 - (void)stopRecordingAudio:(CDVInvokedUrlCommand*)command;
 

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/59ef6439/CordovaLib/Classes/CDVSound.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVSound.m b/CordovaLib/Classes/CDVSound.m
index 2f66385..6598fa1 100644
--- a/CordovaLib/Classes/CDVSound.m
+++ b/CordovaLib/Classes/CDVSound.m
@@ -144,13 +144,6 @@
     return [errorDict cdvjk_JSONString];
 }
 
-// DEPRECATED
-- (void)play:(CDVInvokedUrlCommand*)command
-{
-    NSLog(@"play is DEPRECATED!  Use startPlayingAudio.");
-    [self startPlayingAudio:command];
-}
-
 - (void)create:(CDVInvokedUrlCommand*)command
 {
     NSString* mediaId = [command.arguments objectAtIndex:0];
@@ -315,57 +308,6 @@
     return bError;
 }
 
-// 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:(CDVInvokedUrlCommand*)command
-{
-    NSLog(@"prepare is DEPRECATED! Recoding will be prepared when startPlayingAudio is called");
-
-    NSString* callbackId = command.callbackId;
-
-    NSString* mediaId = [command.arguments objectAtIndex:0];
-    BOOL bError = NO;
-    CDVMediaStates state = MEDIA_STARTING;
-    NSString* jsString = nil;
-
-    CDVAudioFile* audioFile = [[self soundCache] objectForKey:mediaId];
-    if (audioFile == nil) {
-        // did not already exist, try to create
-        audioFile = [self audioFileForResource:[command.arguments objectAtIndex:1] withId:mediaId];
-        if (audioFile == nil) {
-            // create failed
-            bError = YES;
-        } else {
-            bError = [self prepareToPlay:audioFile withId:mediaId];
-        }
-    } else {
-        // audioFile already existed in the cache no need to prepare it again, indicate state
-        if (audioFile.player && [audioFile.player isPlaying]) {
-            state = MEDIA_RUNNING;
-        }
-    }
-
-    if (!bError) {
-        // NSLog(@"Prepared audio sample '%@' for playback.", audioFile.resourcePath);
-        CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
-        jsString = [NSString stringWithFormat:@"%@(\"%@\",%d,%d);\n%@", @"cordova.require('cordova/plugin/Media').onStatus",
mediaId, MEDIA_STATE, state, [result toSuccessCallbackString:callbackId]];
-    } else {
-        jsString = [NSString stringWithFormat:@"%@(\"%@\",%d,%@);", @"cordova.require('cordova/plugin/Media').onStatus",
mediaId, MEDIA_ERROR, [self createMediaErrorWithCode:MEDIA_ERR_NONE_SUPPORTED message:nil]];
-    }
-    if (jsString) {
-        [self.commandDelegate evalJs:jsString];
-    }
-}
-
-// DEPRECATED
-- (void)stop:(CDVInvokedUrlCommand*)command
-{
-    NSLog(@"stop is DEPRECATED!  Use stopPlayingAudio.");
-    [self stopPlayingAudio:command];
-}
-
 - (void)stopPlayingAudio:(CDVInvokedUrlCommand*)command
 {
     NSString* mediaId = [command.arguments objectAtIndex:0];
@@ -383,13 +325,6 @@
     }
 }
 
-// DEPRECATED
-- (void)pause:(CDVInvokedUrlCommand*)command
-{
-    NSLog(@"pause is DEPRECATED!  Use pausePlayingAudio.");
-    [self pausePlayingAudio:command];
-}
-
 - (void)pausePlayingAudio:(CDVInvokedUrlCommand*)command
 {
     NSString* mediaId = [command.arguments objectAtIndex:0];
@@ -454,13 +389,6 @@
     }
 }
 
-// DEPRECATED
-- (void)getCurrentPosition:(CDVInvokedUrlCommand*)command
-{
-    NSLog(@"getCurrentPosition is DEPRECATED!  Use getCurrentPositionAudio.");
-    [self getCurrentPositionAudio:command];
-}
-
 - (void)getCurrentPositionAudio:(CDVInvokedUrlCommand*)command
 {
     NSString* callbackId = command.callbackId;
@@ -478,13 +406,6 @@
     [self.commandDelegate evalJs:jsString];
 }
 
-// DEPRECATED
-- (void)startAudioRecord:(CDVInvokedUrlCommand*)command
-{
-    NSLog(@"startAudioRecord is DEPRECATED!  Use startRecordingAudio.");
-    [self startRecordingAudio:command];
-}
-
 - (void)startRecordingAudio:(CDVInvokedUrlCommand*)command
 {
     NSString* callbackId = command.callbackId;
@@ -545,13 +466,6 @@
     return;
 }
 
-// DEPRECATED
-- (void)stopAudioRecord:(CDVInvokedUrlCommand*)command
-{
-    NSLog(@"stopAudioRecord is DEPRECATED!  Use stopRecordingAudio.");
-    [self stopRecordingAudio:command];
-}
-
 - (void)stopRecordingAudio:(CDVInvokedUrlCommand*)command
 {
     NSString* mediaId = [command.arguments objectAtIndex:0];


Mime
View raw message