Permalink
Browse files

updated to Cordova namespace

  • Loading branch information...
1 parent 78de9d8 commit 988ac92195950f8c2821d88622f5285819f3a4ac @triceam committed Aug 13, 2012
@@ -1,27 +1,27 @@
var PGLowLatencyAudio = {
preloadFX: function ( id, assetPath, success, fail) {
- return PhoneGap.exec(success, fail, "PGLowLatencyAudio", "preloadFX", [id, assetPath]);
+ return cordova.exec(success, fail, "PGLowLatencyAudio", "preloadFX", [id, assetPath]);
},
preloadAudio: function ( id, assetPath, voices, success, fail) {
- return PhoneGap.exec(success, fail, "PGLowLatencyAudio", "preloadAudio", [id, assetPath, voices]);
+ return cordova.exec(success, fail, "PGLowLatencyAudio", "preloadAudio", [id, assetPath, voices]);
},
play: function (id, success, fail) {
- return PhoneGap.exec(success, fail, "PGLowLatencyAudio", "play", [id]);
+ return cordova.exec(success, fail, "PGLowLatencyAudio", "play", [id]);
},
stop: function (id, success, fail) {
- return PhoneGap.exec(success, fail, "PGLowLatencyAudio", "stop", [id]);
+ return cordova.exec(success, fail, "PGLowLatencyAudio", "stop", [id]);
},
loop: function (id, success, fail) {
- return PhoneGap.exec(success, fail, "PGLowLatencyAudio", "loop", [id]);
+ return cordova.exec(success, fail, "PGLowLatencyAudio", "loop", [id]);
},
unload: function (id, success, fail) {
- return PhoneGap.exec(success, fail, "PGLowLatencyAudio", "unload", [id]);
+ return cordova.exec(success, fail, "PGLowLatencyAudio", "unload", [id]);
}
@@ -22,9 +22,9 @@
import android.media.SoundPool;
import android.util.Log;
-import com.phonegap.api.Plugin;
-import com.phonegap.api.PluginResult;
-import com.phonegap.api.PluginResult.Status;
+import org.apache.cordova.api.Plugin;
+import org.apache.cordova.api.PluginResult;
+import org.apache.cordova.api.PluginResult.Status;
/**
* @author triceam
@@ -58,10 +58,12 @@ public PluginResult execute(String action, JSONArray data, String callbackId)
{
PluginResult result = null;
initSoundPool();
+
try
{
String audioID = data.getString(0);
+ Log.d(audioID, action);
if ( PRELOAD_FX.equals( action ) )
{
@@ -70,7 +72,7 @@ public PluginResult execute(String action, JSONArray data, String callbackId)
String assetPath =data.getString(1);
String fullPath = "www/".concat( assetPath );
- AssetManager am = ctx.getResources().getAssets();
+ AssetManager am = ctx.getResources().getAssets();
AssetFileDescriptor afd = am.openFd(fullPath);
int assetIntID = soundPool.load(afd, 1);
soundMap.put( audioID , assetIntID );

0 comments on commit 988ac92

Please sign in to comment.