Permalink
Browse files

more options case problems fixed (damn search-and-replace case-insens…

…itity)
  • Loading branch information...
leegee committed Nov 6, 2012
1 parent 8610abf commit 59b76cea4596b065bd8e06d2924da0f598d51412
Showing with 12 additions and 10 deletions.
  1. +3 −5 Demo/index.html
  2. +7 −4 README.md
  3. +2 −1 Source/PcmImage.js
View
@@ -13,7 +13,7 @@
<script src="../Source/PcmImage.js"></script>
- <script>/*
+ <script>
document.addEvent('domready', function(){
new PcmImage( {
element: document.id('soundtest-gradient'),
@@ -24,11 +24,11 @@
gradient.addColorStop("0","magenta");
gradient.addColorStop("0.5","blue");
gradient.addColorStop("1.0","red");
- this.options.strokeStyle = gradient;
+ this.options.strokestyle = gradient;
+ console.log( this.options.strokestyle );
}
} );
});
- */
</script>
<style>
@@ -238,7 +238,6 @@ <h2>Soundfile PCM Wave Visualisation</h1>
</figure>
-<!--
<figure>
<figcaption>
JavaScript with the <code>onCanvasLoaded</code> callback
@@ -259,7 +258,6 @@ <h2>Soundfile PCM Wave Visualisation</h1>
</figcaption>
<div id='soundtest-gradient' style='background:pink;width:500px;height:100px;'></div>
</figure>
--->
</div></article>
View
@@ -41,7 +41,7 @@ The automatic application of the substitution to the DOM is handled by `PcmImage
playable: true,
overlayclr: 'pink', // #abc #123456
asimg: true,
- strokestyle: 'black', /* foreground colour */
+ strokestyle: 'black', /* foreground colour, defaults to options.element's CSS 'color' */
background: 'lime',
linewidth: 1,
onXhrError: function(){ throw 'XHR Error getting '+this.options.uri },
@@ -67,17 +67,20 @@ Options
`asimg` (boolean): If true, the 'canvas' element on which the graph is drawn will be converted to a standard 'img' element, to allow the user to save the created image.
-`strokeStyle` (string): Supplied to the canvas context to set the foreground colour. Default is to use the value of th `color` style setting of the `element`.
+`strokestyle` (string): Supplied to the canvas context to set the foreground colour. Default is to use the value of the `color` style setting of the `element`.
`background` (string): Supplied to the canvas context to set the background color. Defaul tis to use the `backgroundColor` style setting of the `element`.
-`lineWidth` (number): Supplied to the canvas context, defaults to 1.
+`linewidth` (number): Supplied to the canvas context, defaults to 1.
+
+Events
+------
`onXhrError` (code reference): Fires if an error is encounted fetching the sound file from `uri`.
`onNoBufferError` (code reference): Fires is the data fetched from `uri` is invalid/non-existent.
-`onCanvasLoaded` (code reference): Called after the sound file has been loaded, and the canvas object created, but before rendering begins. Can be used to set rendering options, or to over-ride previously supplied, as in the 'gradient' example above.
+`onCanvasLoaded` (code reference): Called after the sound file has been loaded, and the canvas object created, but before rendering begins. Can be used to set rendering options, or to over-ride previously supplied, as in the 'gradient' example in `Demo/index.html`.
Instantiation of the object creates the image.
View
@@ -50,7 +50,8 @@ var PcmImage = new Class({
onXhrError: function(){ throw 'XHR Error getting '+this.options.uri },
onNoBufferError: function(){
throw 'Error decoding file data from '+self.options.uri;
- }
+ },
+ onCanvasLoaded: function(){}
},
buffer: null, /* Audio buffer object */

0 comments on commit 59b76ce

Please sign in to comment.