Permalink
Browse files

Update namespaces for info.mindtrove -> uow.audio

  • Loading branch information...
1 parent d8c0a0b commit 9d1670d3a29a88e3df0b552ed44b0ed3cb1a0567 @parente parente committed Sep 15, 2010
View
@@ -5,42 +5,42 @@
* :copyright: Peter Parente 2010
* :license: BSD
**/
-dojo.provide('info.mindtrove.JSonic');
+dojo.provide('uow.audio.JSonic');
dojo.require('dijit._Widget');
// client api version
-info.mindtrove._jsonicVersion = '0.3';
+uow.audio._jsonicVersion = '0.3';
// singleton instance
-info.mindtrove._jsonicInstance = null;
+uow.audio._jsonicInstance = null;
// factory to build a JSonic instance
-info.mindtrove.initJSonic = function(args) {
- if(!info.mindtrove._jsonicInstance) {
- return new info.mindtrove.JSonic(args);
+uow.audio.initJSonic = function(args) {
+ if(!uow.audio._jsonicInstance) {
+ return new uow.audio.JSonic(args);
}
- return info.mindtrove._jsonicInstance;
+ return uow.audio._jsonicInstance;
};
/**
* JSonic widget for application use.
*/
-dojo.declare('info.mindtrove.JSonic', dijit._Widget, {
+dojo.declare('uow.audio.JSonic', dijit._Widget, {
// root of the JSonic server REST API, defaults to /
jsonicURI: '/',
// cache speech / sounds by default or not? defaults to false for privacy
defaultCaching: false,
constructor: function() {
- if(info.mindtrove._jsonicInstance) {
+ if(uow.audio._jsonicInstance) {
throw new Error('JSonic instance already exists');
}
- info.mindtrove._jsonicInstance = this;
+ uow.audio._jsonicInstance = this;
},
postMixInProperties: function() {
// created audio channels
this._channels = {};
// channel-shared cache of sounds and speech
- this._cache = new info.mindtrove.JSonicCache({
+ this._cache = new uow.audio.JSonicCache({
jsonicURI : this.jsonicURI
});
},
@@ -53,7 +53,7 @@ dojo.declare('info.mindtrove.JSonic', dijit._Widget, {
this._channels[ch].destroy();
}
this._cache.destroy();
- info.mindtrove._jsonicInstance = null;
+ uow.audio._jsonicInstance = null;
},
/**
@@ -77,7 +77,7 @@ dojo.declare('info.mindtrove.JSonic', dijit._Widget, {
* :rtype: string
*/
getClientVersion: function() {
- return info.mindtrove._jsonicVersion;
+ return uow.audio._jsonicVersion;
},
/**
@@ -291,7 +291,7 @@ dojo.declare('info.mindtrove.JSonic', dijit._Widget, {
id = id || 'default';
var ch = this._channels[id];
if(ch === undefined) {
- ch = new info.mindtrove.JSonicChannel({
+ ch = new uow.audio.JSonicChannel({
id : 'jsonic.'+id,
cache : this._cache
});
@@ -304,9 +304,9 @@ dojo.declare('info.mindtrove.JSonic', dijit._Widget, {
/**
* Helper class. Contains two dojo.Deferreds for callbacks and errbacks before
* and after a command is processed. Instances returned by many methods in
- * info.mindtrove.JSonic.
+ * uow.audio.JSonic.
*/
-dojo.declare('info.mindtrove.JSonicDeferred', null, {
+dojo.declare('uow.audio.JSonicDeferred', null, {
constructor: function() {
this.before = new dojo.Deferred();
this.after = new dojo.Deferred();
@@ -381,7 +381,7 @@ dojo.declare('info.mindtrove.JSonicDeferred', null, {
* 2. Filenames of speech utterances already synthesized on the server
* 3. Utterance / sound frequency tracking for cache warming
*/
-dojo.declare('info.mindtrove.JSonicCache', dijit._Widget, {
+dojo.declare('uow.audio.JSonicCache', dijit._Widget, {
jsonicURI: null,
postMixInProperties: function() {
// speech engines and their details
@@ -391,7 +391,7 @@ dojo.declare('info.mindtrove.JSonicCache', dijit._Widget, {
// cache of speech filenames
if(localStorage) {
// clear the cache if versions don't match
- if(localStorage['jsonic.version'] != info.mindtrove._jsonicVersion) {
+ if(localStorage['jsonic.version'] != uow.audio._jsonicVersion) {
// reset the cache
this.resetCache();
}
@@ -430,7 +430,7 @@ dojo.declare('info.mindtrove.JSonicCache', dijit._Widget, {
// clear out the cache
delete localStorage['jsonic.cache'];
// update the version number
- localStorage['jsonic.version'] = info.mindtrove._jsonicVersion;
+ localStorage['jsonic.version'] = uow.audio._jsonicVersion;
}
this._speechFiles = {};
if(args) {
@@ -591,7 +591,7 @@ dojo.declare('info.mindtrove.JSonicCache', dijit._Widget, {
/**
* Private. Independent speech / sound channel implementation for JSonic.
*/
-dojo.declare('info.mindtrove.JSonicChannel', dijit._Widget, {
+dojo.declare('uow.audio.JSonicChannel', dijit._Widget, {
cache: null,
postMixInProperties: function() {
// current output, sound or speech
@@ -627,7 +627,7 @@ dojo.declare('info.mindtrove.JSonicChannel', dijit._Widget, {
// copy the args to avoid problems with reuse
args = dojo.clone(args);
// create deferred responses in the copy
- args.defs = new info.mindtrove.JSonicDeferred();
+ args.defs = new uow.audio.JSonicDeferred();
if(args.method == '_setProperty' && args.immediate) {
// set property now
this._setProperty(args);
View
@@ -7,16 +7,16 @@
isDebug: false,
parseOnLoad: false,
baseUrl: './',
- modulePaths: {'info.mindtrove' : '..'}
+ modulePaths: {'uow.audio' : '..'}
};
</script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.4.1/dojo/dojo.xd.js"></script>
<script type="text/javascript" src="/static/trace.js"></script>
<script type="text/javascript">
- dojo.require('info.mindtrove.JSonic');
+ dojo.require('uow.audio.JSonic');
var js;
dojo.ready(function() {
- js = info.mindtrove.initJSonic();
+ js = uow.audio.initJSonic();
for(var i=0; i < 100; i++) {
console.log('saying ' + i)
js.say({text : String(i), cache : true});
View
@@ -1,7 +1,7 @@
About caching
=============
-The JSonic client makes use of various levels of caching to lower the time delay between a call to :meth:`info.mindtrove.JSonic.say` and actual audio output.
+The JSonic client makes use of various levels of caching to lower the time delay between a call to :meth:`uow.audio.JSonic.say` and actual audio output.
URL caching
-----------
View
@@ -1,19 +1,24 @@
Changelog
=========
+Version 0.4
+-----------
+
+* Migrated to uow.audio namespace.
+
Version 0.3
-----------
-* Corrected :meth:`info.mindtrove.JSonicDeferred.callBefore` and :meth:`info.mindtrove.JSonicDeferred.callAfter` method names and examples.
-* Added better enforcement of singleton nature of :class:`info.mindtrove.JSonic`.
+* Corrected :meth:`uow.audio.JSonicDeferred.callBefore` and :meth:`uow.audio.JSonicDeferred.callAfter` method names and examples.
+* Added better enforcement of singleton nature of :class:`uow.audio.JSonic`.
* Invoking the :meth:`dijit._Widget.destroyRecursive` method on the JSonic singleton is now possible. Enables destruction of the singleton to make way for the creation of a new singleton with different options.
* Various JavaScript bug fixes for all browsers.
Version 0.2
-----------
-* Changed :class:`info.mindtrove.JSonic` to a singleton.
-* Added :func:`info.mindtrove.initJSonic` to create or get the singleton.
+* Changed :class:`uow.audio.JSonic` to a singleton.
+* Added :func:`uow.audio.initJSonic` to create or get the singleton.
Version 0.1
-----------
View
@@ -1,4 +1,4 @@
-.. module:: info.mindtrove
+.. module:: uow.audio
:synopsis: Namespace for the JSonic client.
The JavaScript API
@@ -361,11 +361,11 @@ volume
Example code
------------
-The following examples assume an :class:`info.mindtrove.JSonic` instance with caching disabled by default exists in local variable `js`. The following code creates such an instance.
+The following examples assume an :class:`uow.audio.JSonic` instance with caching disabled by default exists in local variable `js`. The following code creates such an instance.
.. sourcecode:: javascript
- var js = info.mindtrove.JSonic();
+ var js = uow.audio.JSonic();
Speaking text
~~~~~~~~~~~~~
View
@@ -68,7 +68,7 @@ Loading the JSonic Dojo module
#. Place the :file:`JSonic.js` file in a web accessible location.
#. Include `Dojo`_ in your web application.
-#. Inform Dojo of the location of the :mod:`info.mindtrove` namespace on disk.
+#. Inform Dojo of the location of the :mod:`uow.audio` namespace on disk.
#. Use :func:`dojo.require` to load the JSonic module.
See the HTML files in the :file:`examples/` folder for complete applications satisfying these requirements. You can run the examples by visiting the :file:`http://yourdomain:8888/static/examples/` URL of the JSonic server if you start the server with the `--static` parameter.
@@ -86,7 +86,7 @@ Speaking "Hello world!"
.. sourcecode:: javascript
- var js = new info.mindtrove.JSonic(args);
+ var js = new uow.audio.JSonic(args);
#. Invoke the :meth:`JSonic.say` method.
@@ -8,7 +8,7 @@
isDebug: false,
parseOnLoad: false,
baseUrl: './',
- modulePaths: {'info.mindtrove' : '..'}
+ modulePaths: {'uow.audio' : '..'}
};
</script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.4.0/dojo/dojo.xd.js"></script>
View
@@ -5,7 +5,7 @@
* :copyright: Peter Parente 2010
* :license: BSD
**/
-dojo.require('info.mindtrove.JSonic');
+dojo.require('uow.audio.JSonic');
var buttonHandlers = {
stop: function(js) {
js.stop({channel : 'default'});
@@ -84,7 +84,7 @@ function onEnd(notice) {
}
dojo.ready(function() {
- var js = info.mindtrove.initJSonic({defaultCaching : true});
+ var js = uow.audio.initJSonic({defaultCaching : true});
js.addObserver(onStart)
dojo.query('button').forEach(function(node) {
dojo.connect(node, 'onclick', dojo.partial(buttonHandlers[node.id], js));
@@ -8,15 +8,15 @@
isDebug: false,
parseOnLoad: false,
baseUrl: './',
- modulePaths: {'info.mindtrove' : '..'}
+ modulePaths: {'uow.audio' : '..'}
};
</script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.4.1/dojo/dojo.xd.js"></script>
<script type="text/javascript">
- dojo.require('info.mindtrove.JSonic');
+ dojo.require('uow.audio.JSonic');
var js;
dojo.ready(function() {
- js = info.mindtrove.initJSonic();
+ js = uow.audio.initJSonic();
js.addObserver(function(notice) {
console.debug(notice.action);
console.log(notice);
@@ -13,7 +13,7 @@
isDebug: false,
parseOnLoad: false,
baseUrl: './',
- modulePaths: {'info.mindtrove' : '..'}
+ modulePaths: {'uow.audio' : '..'}
};
</script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.4.0/dojo/dojo.xd.js"></script>
@@ -33,10 +33,10 @@
});
</script>
<script type="text/javascript">
- dojo.require('info.mindtrove.JSonic');
+ dojo.require('uow.audio.JSonic');
var js;
dojo.ready(function() {
- js = info.mindtrove.initJSonic({defaultCaching : true});
+ js = uow.audio.initJSonic({defaultCaching : true});
// find all the p elements
dojo.query('p').forEach(function(item) {
var line = dojo.byId(item.getAttribute('data-line'));
View
@@ -1,4 +1,4 @@
-dojo.provide('info.mindtrove.tests.concurrent');
+dojo.provide('uow.audio.tests.concurrent');
(function() {
var mods = [
View
@@ -1,24 +1,24 @@
-dojo.provide('info.mindtrove.tests.creation');
+dojo.provide('uow.audio.tests.creation');
module('creation');
test('factory', function() {
- var js1 = info.mindtrove.initJSonic();
+ var js1 = uow.audio.initJSonic();
ok(js1, 'factory created singleton');
- var js2 = info.mindtrove.initJSonic();
+ var js2 = uow.audio.initJSonic();
ok(js2 === js1, 'factory returned singleton');
- var js3 = info.mindtrove.initJSonic({defaultCaching : true});
+ var js3 = uow.audio.initJSonic({defaultCaching : true});
ok(js3 === js2, 'factory returned singleton, ignored params');
js1.destroyRecursive();
- var js4 = info.mindtrove.initJSonic();
+ var js4 = uow.audio.initJSonic();
ok(js1 !== js4, 'factory created new singleton');
js4.destroyRecursive();
});
test('constructor', function() {
- var js1 = new info.mindtrove.JSonic();
+ var js1 = new uow.audio.JSonic();
ok(js1, 'constructor w/ no args');
var x;
try {
- var js2 = new info.mindtrove.JSonic({defaultCaching : true});
+ var js2 = new uow.audio.JSonic({defaultCaching : true});
} catch(e) {
x = e
}
View
@@ -9,7 +9,7 @@
isDebug: false,
parseOnLoad: false,
baseUrl: './',
- modulePaths: {'info.mindtrove' : '..'}
+ modulePaths: {'uow.audio' : '..'}
};
</script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.4.1/dojo/dojo.xd.js"></script>
@@ -28,20 +28,20 @@
var getModOpts = function(args) {
return {
setup: function() {
- this.js = info.mindtrove.initJSonic(args);
+ this.js = uow.audio.initJSonic(args);
},
teardown: function() {
this.js._cache.resetCache();
this.js.destroyRecursive();
}
}
};
- dojo.require('info.mindtrove.JSonic');
- dojo.require('info.mindtrove.tests.creation');
- dojo.require('info.mindtrove.tests.simple');
- dojo.require('info.mindtrove.tests.interrupt');
- dojo.require('info.mindtrove.tests.sequential');
- dojo.require('info.mindtrove.tests.concurrent');
+ dojo.require('uow.audio.JSonic');
+ dojo.require('uow.audio.tests.creation');
+ dojo.require('uow.audio.tests.simple');
+ dojo.require('uow.audio.tests.interrupt');
+ dojo.require('uow.audio.tests.sequential');
+ dojo.require('uow.audio.tests.concurrent');
// start qunit on page load
dojo.ready(start);
</script>
View
@@ -1,4 +1,4 @@
-dojo.provide('info.mindtrove.tests.interrupt');
+dojo.provide('uow.audio.tests.interrupt');
(function() {
var mods = [
View
@@ -1,4 +1,4 @@
-dojo.provide('info.mindtrove.tests.sequential');
+dojo.provide('uow.audio.tests.sequential');
(function() {
var mods = [
View
@@ -1,4 +1,4 @@
-dojo.provide('info.mindtrove.tests.simple');
+dojo.provide('uow.audio.tests.simple');
(function() {
var mods = [

0 comments on commit 9d1670d

Please sign in to comment.