Skip to content

Commit 9d1670d

Browse files
committed
Update namespaces for info.mindtrove -> uow.audio
1 parent d8c0a0b commit 9d1670d

16 files changed

+67
-62
lines changed

JSonic.js

+21-21
Original file line numberDiff line numberDiff line change
@@ -5,42 +5,42 @@
55
* :copyright: Peter Parente 2010
66
* :license: BSD
77
**/
8-
dojo.provide('info.mindtrove.JSonic');
8+
dojo.provide('uow.audio.JSonic');
99
dojo.require('dijit._Widget');
1010

1111
// client api version
12-
info.mindtrove._jsonicVersion = '0.3';
12+
uow.audio._jsonicVersion = '0.3';
1313
// singleton instance
14-
info.mindtrove._jsonicInstance = null;
14+
uow.audio._jsonicInstance = null;
1515

1616
// factory to build a JSonic instance
17-
info.mindtrove.initJSonic = function(args) {
18-
if(!info.mindtrove._jsonicInstance) {
19-
return new info.mindtrove.JSonic(args);
17+
uow.audio.initJSonic = function(args) {
18+
if(!uow.audio._jsonicInstance) {
19+
return new uow.audio.JSonic(args);
2020
}
21-
return info.mindtrove._jsonicInstance;
21+
return uow.audio._jsonicInstance;
2222
};
2323

2424
/**
2525
* JSonic widget for application use.
2626
*/
27-
dojo.declare('info.mindtrove.JSonic', dijit._Widget, {
27+
dojo.declare('uow.audio.JSonic', dijit._Widget, {
2828
// root of the JSonic server REST API, defaults to /
2929
jsonicURI: '/',
3030
// cache speech / sounds by default or not? defaults to false for privacy
3131
defaultCaching: false,
3232
constructor: function() {
33-
if(info.mindtrove._jsonicInstance) {
33+
if(uow.audio._jsonicInstance) {
3434
throw new Error('JSonic instance already exists');
3535
}
36-
info.mindtrove._jsonicInstance = this;
36+
uow.audio._jsonicInstance = this;
3737
},
3838

3939
postMixInProperties: function() {
4040
// created audio channels
4141
this._channels = {};
4242
// channel-shared cache of sounds and speech
43-
this._cache = new info.mindtrove.JSonicCache({
43+
this._cache = new uow.audio.JSonicCache({
4444
jsonicURI : this.jsonicURI
4545
});
4646
},
@@ -53,7 +53,7 @@ dojo.declare('info.mindtrove.JSonic', dijit._Widget, {
5353
this._channels[ch].destroy();
5454
}
5555
this._cache.destroy();
56-
info.mindtrove._jsonicInstance = null;
56+
uow.audio._jsonicInstance = null;
5757
},
5858

5959
/**
@@ -77,7 +77,7 @@ dojo.declare('info.mindtrove.JSonic', dijit._Widget, {
7777
* :rtype: string
7878
*/
7979
getClientVersion: function() {
80-
return info.mindtrove._jsonicVersion;
80+
return uow.audio._jsonicVersion;
8181
},
8282

8383
/**
@@ -291,7 +291,7 @@ dojo.declare('info.mindtrove.JSonic', dijit._Widget, {
291291
id = id || 'default';
292292
var ch = this._channels[id];
293293
if(ch === undefined) {
294-
ch = new info.mindtrove.JSonicChannel({
294+
ch = new uow.audio.JSonicChannel({
295295
id : 'jsonic.'+id,
296296
cache : this._cache
297297
});
@@ -304,9 +304,9 @@ dojo.declare('info.mindtrove.JSonic', dijit._Widget, {
304304
/**
305305
* Helper class. Contains two dojo.Deferreds for callbacks and errbacks before
306306
* and after a command is processed. Instances returned by many methods in
307-
* info.mindtrove.JSonic.
307+
* uow.audio.JSonic.
308308
*/
309-
dojo.declare('info.mindtrove.JSonicDeferred', null, {
309+
dojo.declare('uow.audio.JSonicDeferred', null, {
310310
constructor: function() {
311311
this.before = new dojo.Deferred();
312312
this.after = new dojo.Deferred();
@@ -381,7 +381,7 @@ dojo.declare('info.mindtrove.JSonicDeferred', null, {
381381
* 2. Filenames of speech utterances already synthesized on the server
382382
* 3. Utterance / sound frequency tracking for cache warming
383383
*/
384-
dojo.declare('info.mindtrove.JSonicCache', dijit._Widget, {
384+
dojo.declare('uow.audio.JSonicCache', dijit._Widget, {
385385
jsonicURI: null,
386386
postMixInProperties: function() {
387387
// speech engines and their details
@@ -391,7 +391,7 @@ dojo.declare('info.mindtrove.JSonicCache', dijit._Widget, {
391391
// cache of speech filenames
392392
if(localStorage) {
393393
// clear the cache if versions don't match
394-
if(localStorage['jsonic.version'] != info.mindtrove._jsonicVersion) {
394+
if(localStorage['jsonic.version'] != uow.audio._jsonicVersion) {
395395
// reset the cache
396396
this.resetCache();
397397
}
@@ -430,7 +430,7 @@ dojo.declare('info.mindtrove.JSonicCache', dijit._Widget, {
430430
// clear out the cache
431431
delete localStorage['jsonic.cache'];
432432
// update the version number
433-
localStorage['jsonic.version'] = info.mindtrove._jsonicVersion;
433+
localStorage['jsonic.version'] = uow.audio._jsonicVersion;
434434
}
435435
this._speechFiles = {};
436436
if(args) {
@@ -591,7 +591,7 @@ dojo.declare('info.mindtrove.JSonicCache', dijit._Widget, {
591591
/**
592592
* Private. Independent speech / sound channel implementation for JSonic.
593593
*/
594-
dojo.declare('info.mindtrove.JSonicChannel', dijit._Widget, {
594+
dojo.declare('uow.audio.JSonicChannel', dijit._Widget, {
595595
cache: null,
596596
postMixInProperties: function() {
597597
// current output, sound or speech
@@ -627,7 +627,7 @@ dojo.declare('info.mindtrove.JSonicChannel', dijit._Widget, {
627627
// copy the args to avoid problems with reuse
628628
args = dojo.clone(args);
629629
// create deferred responses in the copy
630-
args.defs = new info.mindtrove.JSonicDeferred();
630+
args.defs = new uow.audio.JSonicDeferred();
631631
if(args.method == '_setProperty' && args.immediate) {
632632
// set property now
633633
this._setProperty(args);

debug/issue19.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
isDebug: false,
88
parseOnLoad: false,
99
baseUrl: './',
10-
modulePaths: {'info.mindtrove' : '..'}
10+
modulePaths: {'uow.audio' : '..'}
1111
};
1212
</script>
1313
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.4.1/dojo/dojo.xd.js"></script>
1414
<script type="text/javascript" src="/static/trace.js"></script>
1515
<script type="text/javascript">
16-
dojo.require('info.mindtrove.JSonic');
16+
dojo.require('uow.audio.JSonic');
1717
var js;
1818
dojo.ready(function() {
19-
js = info.mindtrove.initJSonic();
19+
js = uow.audio.initJSonic();
2020
for(var i=0; i < 100; i++) {
2121
console.log('saying ' + i)
2222
js.say({text : String(i), cache : true});

doc/cache.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
About caching
22
=============
33

4-
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.
4+
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.
55

66
URL caching
77
-----------

doc/changelog.rst

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
Changelog
22
=========
33

4+
Version 0.4
5+
-----------
6+
7+
* Migrated to uow.audio namespace.
8+
49
Version 0.3
510
-----------
611

7-
* Corrected :meth:`info.mindtrove.JSonicDeferred.callBefore` and :meth:`info.mindtrove.JSonicDeferred.callAfter` method names and examples.
8-
* Added better enforcement of singleton nature of :class:`info.mindtrove.JSonic`.
12+
* Corrected :meth:`uow.audio.JSonicDeferred.callBefore` and :meth:`uow.audio.JSonicDeferred.callAfter` method names and examples.
13+
* Added better enforcement of singleton nature of :class:`uow.audio.JSonic`.
914
* 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.
1015
* Various JavaScript bug fixes for all browsers.
1116

1217
Version 0.2
1318
-----------
1419

15-
* Changed :class:`info.mindtrove.JSonic` to a singleton.
16-
* Added :func:`info.mindtrove.initJSonic` to create or get the singleton.
20+
* Changed :class:`uow.audio.JSonic` to a singleton.
21+
* Added :func:`uow.audio.initJSonic` to create or get the singleton.
1722

1823
Version 0.1
1924
-----------

doc/js.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. module:: info.mindtrove
1+
.. module:: uow.audio
22
:synopsis: Namespace for the JSonic client.
33

44
The JavaScript API
@@ -361,11 +361,11 @@ volume
361361
Example code
362362
------------
363363

364-
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.
364+
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.
365365

366366
.. sourcecode:: javascript
367367

368-
var js = info.mindtrove.JSonic();
368+
var js = uow.audio.JSonic();
369369

370370
Speaking text
371371
~~~~~~~~~~~~~

doc/start.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Loading the JSonic Dojo module
6868

6969
#. Place the :file:`JSonic.js` file in a web accessible location.
7070
#. Include `Dojo`_ in your web application.
71-
#. Inform Dojo of the location of the :mod:`info.mindtrove` namespace on disk.
71+
#. Inform Dojo of the location of the :mod:`uow.audio` namespace on disk.
7272
#. Use :func:`dojo.require` to load the JSonic module.
7373

7474
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!"
8686

8787
.. sourcecode:: javascript
8888

89-
var js = new info.mindtrove.JSonic(args);
89+
var js = new uow.audio.JSonic(args);
9090

9191
#. Invoke the :meth:`JSonic.say` method.
9292

examples/buttons.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
isDebug: false,
99
parseOnLoad: false,
1010
baseUrl: './',
11-
modulePaths: {'info.mindtrove' : '..'}
11+
modulePaths: {'uow.audio' : '..'}
1212
};
1313
</script>
1414
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.4.0/dojo/dojo.xd.js"></script>

examples/buttons.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* :copyright: Peter Parente 2010
66
* :license: BSD
77
**/
8-
dojo.require('info.mindtrove.JSonic');
8+
dojo.require('uow.audio.JSonic');
99
var buttonHandlers = {
1010
stop: function(js) {
1111
js.stop({channel : 'default'});
@@ -84,7 +84,7 @@ function onEnd(notice) {
8484
}
8585

8686
dojo.ready(function() {
87-
var js = info.mindtrove.initJSonic({defaultCaching : true});
87+
var js = uow.audio.initJSonic({defaultCaching : true});
8888
js.addObserver(onStart)
8989
dojo.query('button').forEach(function(node) {
9090
dojo.connect(node, 'onclick', dojo.partial(buttonHandlers[node.id], js));

examples/console.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
isDebug: false,
99
parseOnLoad: false,
1010
baseUrl: './',
11-
modulePaths: {'info.mindtrove' : '..'}
11+
modulePaths: {'uow.audio' : '..'}
1212
};
1313
</script>
1414
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.4.1/dojo/dojo.xd.js"></script>
1515
<script type="text/javascript">
16-
dojo.require('info.mindtrove.JSonic');
16+
dojo.require('uow.audio.JSonic');
1717
var js;
1818
dojo.ready(function() {
19-
js = info.mindtrove.initJSonic();
19+
js = uow.audio.initJSonic();
2020
js.addObserver(function(notice) {
2121
console.debug(notice.action);
2222
console.log(notice);

examples/deferreds.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
isDebug: false,
1414
parseOnLoad: false,
1515
baseUrl: './',
16-
modulePaths: {'info.mindtrove' : '..'}
16+
modulePaths: {'uow.audio' : '..'}
1717
};
1818
</script>
1919
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.4.0/dojo/dojo.xd.js"></script>
@@ -33,10 +33,10 @@
3333
});
3434
</script>
3535
<script type="text/javascript">
36-
dojo.require('info.mindtrove.JSonic');
36+
dojo.require('uow.audio.JSonic');
3737
var js;
3838
dojo.ready(function() {
39-
js = info.mindtrove.initJSonic({defaultCaching : true});
39+
js = uow.audio.initJSonic({defaultCaching : true});
4040
// find all the p elements
4141
dojo.query('p').forEach(function(item) {
4242
var line = dojo.byId(item.getAttribute('data-line'));

tests/concurrent.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
dojo.provide('info.mindtrove.tests.concurrent');
1+
dojo.provide('uow.audio.tests.concurrent');
22

33
(function() {
44
var mods = [

tests/creation.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
dojo.provide('info.mindtrove.tests.creation');
1+
dojo.provide('uow.audio.tests.creation');
22

33
module('creation');
44
test('factory', function() {
5-
var js1 = info.mindtrove.initJSonic();
5+
var js1 = uow.audio.initJSonic();
66
ok(js1, 'factory created singleton');
7-
var js2 = info.mindtrove.initJSonic();
7+
var js2 = uow.audio.initJSonic();
88
ok(js2 === js1, 'factory returned singleton');
9-
var js3 = info.mindtrove.initJSonic({defaultCaching : true});
9+
var js3 = uow.audio.initJSonic({defaultCaching : true});
1010
ok(js3 === js2, 'factory returned singleton, ignored params');
1111
js1.destroyRecursive();
12-
var js4 = info.mindtrove.initJSonic();
12+
var js4 = uow.audio.initJSonic();
1313
ok(js1 !== js4, 'factory created new singleton');
1414
js4.destroyRecursive();
1515
});
1616
test('constructor', function() {
17-
var js1 = new info.mindtrove.JSonic();
17+
var js1 = new uow.audio.JSonic();
1818
ok(js1, 'constructor w/ no args');
1919
var x;
2020
try {
21-
var js2 = new info.mindtrove.JSonic({defaultCaching : true});
21+
var js2 = new uow.audio.JSonic({defaultCaching : true});
2222
} catch(e) {
2323
x = e
2424
}

tests/index.html

+8-8
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
isDebug: false,
1010
parseOnLoad: false,
1111
baseUrl: './',
12-
modulePaths: {'info.mindtrove' : '..'}
12+
modulePaths: {'uow.audio' : '..'}
1313
};
1414
</script>
1515
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.4.1/dojo/dojo.xd.js"></script>
@@ -28,20 +28,20 @@
2828
var getModOpts = function(args) {
2929
return {
3030
setup: function() {
31-
this.js = info.mindtrove.initJSonic(args);
31+
this.js = uow.audio.initJSonic(args);
3232
},
3333
teardown: function() {
3434
this.js._cache.resetCache();
3535
this.js.destroyRecursive();
3636
}
3737
}
3838
};
39-
dojo.require('info.mindtrove.JSonic');
40-
dojo.require('info.mindtrove.tests.creation');
41-
dojo.require('info.mindtrove.tests.simple');
42-
dojo.require('info.mindtrove.tests.interrupt');
43-
dojo.require('info.mindtrove.tests.sequential');
44-
dojo.require('info.mindtrove.tests.concurrent');
39+
dojo.require('uow.audio.JSonic');
40+
dojo.require('uow.audio.tests.creation');
41+
dojo.require('uow.audio.tests.simple');
42+
dojo.require('uow.audio.tests.interrupt');
43+
dojo.require('uow.audio.tests.sequential');
44+
dojo.require('uow.audio.tests.concurrent');
4545
// start qunit on page load
4646
dojo.ready(start);
4747
</script>

tests/interrupt.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
dojo.provide('info.mindtrove.tests.interrupt');
1+
dojo.provide('uow.audio.tests.interrupt');
22

33
(function() {
44
var mods = [

tests/sequential.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
dojo.provide('info.mindtrove.tests.sequential');
1+
dojo.provide('uow.audio.tests.sequential');
22

33
(function() {
44
var mods = [

tests/simple.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
dojo.provide('info.mindtrove.tests.simple');
1+
dojo.provide('uow.audio.tests.simple');
22

33
(function() {
44
var mods = [

0 commit comments

Comments
 (0)