Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0e507cf
commit eb9f85f
Showing
79 changed files
with
122,580 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Specifies intentionally untracked files to ignore when using Git | ||
# http://git-scm.com/docs/gitignore | ||
|
||
node_modules/ | ||
platforms/ | ||
plugins/ |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+57.6 KB
mysoundboard/resources/android/splash/drawable-land-xxhdpi-screen.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+87.3 KB
mysoundboard/resources/android/splash/drawable-land-xxxhdpi-screen.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+54.2 KB
mysoundboard/resources/android/splash/drawable-port-xxhdpi-screen.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+79.9 KB
mysoundboard/resources/android/splash/drawable-port-xxxhdpi-screen.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* Include this file in your html if you are using the CSP mode. */ | ||
|
||
@charset "UTF-8"; | ||
|
||
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], | ||
.ng-cloak, .x-ng-cloak, | ||
.ng-hide:not(.ng-hide-animate) { | ||
display: none !important; | ||
} | ||
|
||
ng\:form { | ||
display: block; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/* Empty. Add your own CSS if you like */ |
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> | ||
<meta http-equiv="Content-Security-Policy" | ||
content="default-src 'self' data: gap: ; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-eval' 'unsafe-inline';"> | ||
<title></title> | ||
|
||
<link href="lib/ionic/css/ionic.css" rel="stylesheet"> | ||
<link href="css/angular-csp.css" rel="stylesheet"> | ||
<link href="css/style.css" rel="stylesheet"> | ||
|
||
<!-- ionic/angularjs js --> | ||
<script src="lib/ionic/js/ionic.bundle.js"></script> | ||
|
||
<!-- cordova script (this will be a 404 during development) --> | ||
<script src="cordova.js"></script> | ||
|
||
<!-- your app's js --> | ||
<script src="js/app.js"></script> | ||
<script src="js/controllers.js"></script> | ||
<script src="js/services.js"></script> | ||
</head> | ||
<body ng-app="mysoundboard"> | ||
|
||
<ion-nav-bar class="bar-stable"> | ||
<ion-nav-back-button> | ||
</ion-nav-back-button> | ||
</ion-nav-bar> | ||
|
||
<ion-nav-view></ion-nav-view> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
angular.module('mysoundboard', ['ionic', 'mysoundboard.controllers', 'mysoundboard.services']) | ||
|
||
.run(function($ionicPlatform) { | ||
$ionicPlatform.ready(function() { | ||
if (window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) { | ||
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); | ||
cordova.plugins.Keyboard.disableScroll(true); | ||
|
||
} | ||
if (window.StatusBar) { | ||
// org.apache.cordova.statusbar required | ||
StatusBar.styleLightContent(); | ||
} | ||
}); | ||
}) | ||
|
||
.config(function($stateProvider, $urlRouterProvider) { | ||
|
||
$stateProvider | ||
|
||
.state('home', { | ||
url: '/home', | ||
controller: 'HomeCtrl', | ||
templateUrl: 'templates/home.html' | ||
}) | ||
.state('new', { | ||
url:'/new', | ||
controller: 'RecordCtrl', | ||
templateUrl: 'templates/new.html' | ||
}); | ||
|
||
|
||
// if none of the above states are matched, use this as the fallback | ||
$urlRouterProvider.otherwise('/home'); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
angular.module('mysoundboard.controllers', []) | ||
|
||
.controller('HomeCtrl', function($scope, Sounds, $ionicPlatform) { | ||
|
||
var getSounds = function() { | ||
console.log('getSounds called'); | ||
Sounds.get().then(function(sounds) { | ||
console.dir(sounds); | ||
$scope.sounds = sounds; | ||
}); | ||
} | ||
|
||
$scope.$on('$ionicView.enter', function(){ | ||
console.log('enter'); | ||
getSounds(); | ||
}); | ||
|
||
$scope.play = function(x) { | ||
console.log('play', x); | ||
Sounds.play(x); | ||
} | ||
|
||
$scope.delete = function(x) { | ||
console.log('delete', x); | ||
Sounds.delete(x).then(function() { | ||
getSounds(); | ||
}); | ||
} | ||
|
||
$scope.cordova = {loaded:false}; | ||
$ionicPlatform.ready(function() { | ||
$scope.$apply(function() { | ||
$scope.cordova.loaded = true; | ||
}); | ||
}); | ||
|
||
}) | ||
.controller('RecordCtrl', function($scope, Sounds, $state, $ionicHistory) { | ||
|
||
$scope.sound = {name:""}; | ||
|
||
$scope.saveSound = function() { | ||
console.log('trying to save '+$scope.sound.name); | ||
|
||
//Simple error checking | ||
if($scope.sound.name === "") { | ||
navigator.notification.alert("Name this sound first.", null, "Error"); | ||
return; | ||
} | ||
|
||
if(!$scope.sound.file) { | ||
navigator.notification.alert("Record a sound first.", null, "Error"); | ||
return; | ||
} | ||
|
||
/* | ||
begin the copy to persist location | ||
first, this path below is persistent on both ios and and | ||
*/ | ||
var loc = cordova.file.dataDirectory; | ||
/* | ||
but now we have an issue with file name. so let's use the existing extension, | ||
but a unique filename based on seconds since epoch | ||
*/ | ||
var extension = $scope.sound.file.split(".").pop(); | ||
var filepart = Date.now(); | ||
var filename = filepart + "." + extension; | ||
console.log("new filename is "+filename); | ||
|
||
window.resolveLocalFileSystemURL(loc, function(d) { | ||
window.resolveLocalFileSystemURL($scope.sound.file, function(fe) { | ||
fe.copyTo(d, filename, function(e) { | ||
console.log('success inc opy'); | ||
console.dir(e); | ||
$scope.sound.file = e.nativeURL; | ||
$scope.sound.path = e.fullPath; | ||
|
||
Sounds.save($scope.sound).then(function() { | ||
$ionicHistory.nextViewOptions({ | ||
disableBack: true | ||
}); | ||
$state.go("home"); | ||
}); | ||
|
||
}, function(e) { | ||
console.log('error in coipy');console.dir(e); | ||
}); | ||
}, function(e) { | ||
console.log("error in inner bullcrap"); | ||
console.dir(e); | ||
}); | ||
|
||
|
||
}, function(e) { | ||
console.log('error in fs');console.dir(e); | ||
}); | ||
|
||
|
||
} | ||
|
||
var captureError = function(e) { | ||
console.log('captureError' ,e); | ||
} | ||
|
||
var captureSuccess = function(e) { | ||
console.log('captureSuccess');console.dir(e); | ||
$scope.sound.file = e[0].localURL; | ||
$scope.sound.filePath = e[0].fullPath; | ||
} | ||
|
||
$scope.record = function() { | ||
navigator.device.capture.captureAudio( | ||
captureSuccess,captureError,{duration:10}); | ||
} | ||
|
||
$scope.play = function() { | ||
if(!$scope.sound.file) { | ||
navigator.notification.alert("Record a sound first.", null, "Error"); | ||
return; | ||
} | ||
var media = new Media($scope.sound.file, function(e) { | ||
media.release(); | ||
}, function(err) { | ||
console.log("media err", err); | ||
}); | ||
media.play(); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
angular.module('mysoundboard.services', []) | ||
|
||
.factory('Sounds', function($q) { | ||
|
||
var deleteSound = function(x) { | ||
console.log("calling deleteSound"); | ||
var deferred = $q.defer(); | ||
getSounds().then(function(sounds) { | ||
sounds.splice(x,1); | ||
localStorage.mysoundboard = JSON.stringify(sounds); | ||
deferred.resolve(); | ||
}); | ||
|
||
return deferred.promise; | ||
|
||
} | ||
|
||
var getSounds = function() { | ||
var deferred = $q.defer(); | ||
var sounds = []; | ||
|
||
if(localStorage.mysoundboard) { | ||
sounds = JSON.parse(localStorage.mysoundboard); | ||
} | ||
deferred.resolve(sounds); | ||
|
||
return deferred.promise; | ||
} | ||
|
||
var playSound = function(x) { | ||
getSounds().then(function(sounds) { | ||
var sound = sounds[x]; | ||
|
||
/* | ||
Ok, so on Android, we just work. | ||
On iOS, we need to rewrite to ../Library/NoCloud/FILE' | ||
*/ | ||
var mediaUrl = sound.file; | ||
if(device.platform.indexOf("iOS") >= 0) { | ||
mediaUrl = "../Library/NoCloud/" + mediaUrl.split("/").pop(); | ||
} | ||
var media = new Media(mediaUrl, function(e) { | ||
media.release(); | ||
}, function(err) { | ||
console.log("media err", err); | ||
}); | ||
media.play(); | ||
}); | ||
} | ||
|
||
var saveSound = function(s) { | ||
console.log("calling saveSound"); | ||
var deferred = $q.defer(); | ||
getSounds().then(function(sounds) { | ||
sounds.push(s); | ||
localStorage.mysoundboard = JSON.stringify(sounds); | ||
deferred.resolve(); | ||
}); | ||
|
||
return deferred.promise; | ||
} | ||
|
||
return { | ||
get:getSounds, | ||
save:saveSound, | ||
delete:deleteSound, | ||
play:playSound | ||
}; | ||
}); |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.