diff options
Diffstat (limited to 'docs/dymaxion/soundmanagerv297a-20101010/demo')
267 files changed, 16683 insertions, 0 deletions
diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/360 button.psd b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/360 button.psd Binary files differnew file mode 100755 index 0000000..afd0498 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/360 button.psd diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/360-button-pause-light.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/360-button-pause-light.gif Binary files differnew file mode 100755 index 0000000..cf9eab3 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/360-button-pause-light.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/360-button-pause-light.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/360-button-pause-light.png Binary files differnew file mode 100755 index 0000000..8f66539 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/360-button-pause-light.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/360-button-pause.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/360-button-pause.gif Binary files differnew file mode 100755 index 0000000..6e589ea --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/360-button-pause.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/360-button-pause.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/360-button-pause.png Binary files differnew file mode 100755 index 0000000..dc84def --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/360-button-pause.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/360-button-play-light.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/360-button-play-light.gif Binary files differnew file mode 100755 index 0000000..eb36483 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/360-button-play-light.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/360-button-play-light.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/360-button-play-light.png Binary files differnew file mode 100755 index 0000000..a2f6557 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/360-button-play-light.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/360-button-play.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/360-button-play.gif Binary files differnew file mode 100755 index 0000000..b97cd7f --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/360-button-play.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/360-button-play.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/360-button-play.png Binary files differnew file mode 100755 index 0000000..ce2d9a3 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/360-button-play.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/360player-visualization.css b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/360player-visualization.css new file mode 100755 index 0000000..96cc582 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/360player-visualization.css @@ -0,0 +1,88 @@ +/* larger canvas, spectrum + EQ visualization and other items */
+
+.ui360,
+.sm2-360ui {
+ /* size of the container for the circle, etc. */
+ width:256px;
+ height:256px;
+}
+
+.ui360 {
+ position:relative;
+ /* a little extra spacing */
+ padding-top:1px;
+ padding-bottom:1px;
+ margin-bottom:-18px; /* approximate "line height" we want */
+ padding-left:248px;
+ margin-left:0px;
+ background-position:22.6% 50%; /* (~109px) initial play button position */
+}
+
+.ui360 a {
+ font:14px "helvetica neue",helvetica,monaco,lucida,terminal,monospace;
+ white-space:nowrap;
+ line-height:256px;
+}
+
+.sm2-360ui {
+ margin-left:-256px;
+}
+
+.ui360 .sm2-timing {
+ line-height:256px;
+}
+
+.ui360 .sm2-timing {
+ font:bold 24px "helvetica neue",helvetica,monaco,lucida,terminal,monospace;
+ color:#333;
+ text-align:center;
+ line-height:256px;
+ text-indent:0px;
+}
+
+.sm2-inline-list .ui360,
+.sm2-inline-list .sm2-360ui {
+ margin-left:0px;
+}
+
+.sm2-inline-list .ui360 {
+ margin:8px 13px 7px 0px;
+ padding-left:0px;
+ background-position:50% 50%; /* initial play button position */
+}
+
+.sm2-inline-list .sm2-360ui {
+ border:1px solid #eee;
+}
+
+.sm2-inline-list .ui360 a {
+ position:absolute;
+ left:0px;
+ bottom:0px;
+ margin-left:1px;
+ width:100%; /* 2px padding in box */
+ height:auto;
+ font-size:x-small;
+ padding:2px 0px;
+ color:#999;
+ line-height:15px;
+ text-align:center;
+ display:inline;
+ -moz-border-radius:0px;
+ -khtml-border-radius:0px;
+ border-radius:0px;
+}
+
+.sm2-inline-list .ui360 a:focus,
+.sm2-inline-list .ui360 a:active {
+ background-color:transparent;
+}
+
+/* Use a bigger loading image for this layout */
+
+.ui360 .sm2-360ui.sm2_buffering .sm2-360btn,
+.ui360 .sm2-360ui.sm2_buffering .sm2-360btn:hover {
+ background:transparent url(icon_loading_spinner_bigger.gif) no-repeat 50% 50%;
+ opacity:0.5;
+ visibility:visible;
+}
\ No newline at end of file diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/360player.css b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/360player.css new file mode 100755 index 0000000..a961dc5 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/360player.css @@ -0,0 +1,258 @@ +/* General warning: Beta-ish. Code could be a bit cleaner. */
+
+.ui360,
+.ui360 * {
+ position:relative;
+}
+
+.ui360,
+.sm2-360ui {
+ /* size of the container for the circle, etc. */
+ width:50px;
+ height:50px;
+}
+
+.ui360 {
+ position:relative;
+ /* a little extra spacing */
+ padding-top:1px;
+ padding-bottom:1px;
+ margin-bottom:-18px; /* approximate "line height" we want */
+ padding-left:42px; /* 50px, with a few off - margin used for visualization UI */
+}
+
+.ui360 a {
+ line-height:50px;
+}
+
+.sm2-360ui {
+ margin-left:-50px;
+}
+
+.ui360 {
+ width:auto;
+}
+
+.ui360,
+.ui360 * {
+ vertical-align:middle;
+}
+
+.sm2-360ui {
+ position:relative;
+ display:inline-block; /* firefox 3 et al */
+ float:left; /* firefox 2 needs this, inline-block would work with fx3 and others */
+ *float:left; /* IE 6+7 */
+ *display:inline;
+ *clear:left;
+}
+
+.sm2-360ui.sm2_playing,
+.sm2-360ui.sm2_paused {
+ /* bump on top when active */
+ z-index:10;
+}
+
+.ui360 a.sm2_link { /* this class added to playable links by SM2 */
+ position:relative;
+}
+
+.ui360 a {
+ color:#000;
+ text-decoration:none;
+}
+
+.ui360 a,
+.ui360 a:hover,
+.ui360 a:focus {
+ padding:2px;
+ margin-left:-2px;
+ margin-top:-2px;
+}
+
+.ui360 a:hover,
+.ui360 a:focus {
+ background:#eee;
+ -moz-border-radius:3px;
+ -webkit-border-radius:3px;
+ -khtml-border-radius:3px;
+ border-radius:3px;
+ outline:none;
+}
+
+.ui360 .sm2-canvas {
+ position:absolute;
+ left:0px;
+ top:0px;
+}
+
+.ui360 .sm2-timing {
+ position:absolute;
+ display:block;
+ left:0px;
+ top:0px;
+ width:100%;
+ height:100%;
+ margin:0px;
+ font:11px "helvetica neue",helvetica,monaco,lucida,terminal,monospace;
+ color:#666;
+ text-align:center;
+ line-height:50px;
+}
+
+.ui360 .sm2-timing.alignTweak {
+ text-indent:1px; /* devious center-alignment tweak for Safari (might break things for others.) */
+}
+
+.ui360 .sm2-cover {
+ position:absolute;
+ left:0px;
+ top:0px;
+ z-index:2;
+ display:none;
+}
+
+.ui360 .sm2-360btn {
+ position:absolute;
+ top:50%;
+ left:50%;
+ width:22px;
+ height:22px;
+ margin-left:-11px;
+ margin-top:-11px;
+ cursor:pointer;
+ z-index:3;
+}
+
+.ui360 .sm2-360btn-default {
+}
+
+.ui360 .sm2-360data {
+ display:inline-block;
+ font-family:helvetica;
+}
+
+.ui360 .sm2-360ui.sm2_playing .sm2-cover,
+.ui360 .sm2-360ui.sm2_paused .sm2-cover {
+ display:block;
+}
+
+/* this could be optimized a fair bit. */
+
+.ui360,
+.ui360 .sm2-360btn-default {
+ background:transparent url(360-button-play.png) no-repeat 50% 50%;
+ _background:transparent url(360-button-play.gif) no-repeat 50% 50%; /* IE 6-only: special crap GIF */
+ cursor:pointer;
+}
+
+.ui360 {
+ /*
+ "fake" button shown before SM2 has started, non-JS/non-SM2 case etc.
+ background image will be removed via JS, in threeSixyPlayer.init()
+ */
+ background-position:6px 50%;
+}
+
+.ui360 .sm2-360ui.sm2_paused .sm2-360btn {
+ background:transparent url(360-button-play.png) no-repeat 50% 50%;
+ _background:transparent url(360-button-play.gif) no-repeat 50% 50%;
+ cursor:pointer;
+}
+
+.ui360 .sm2-360btn-default:hover,
+.ui360 .sm2-360ui.sm2_paused .sm2-360btn:hover {
+ background:transparent url(360-button-play-light.png) no-repeat 50% 50%;
+ _background:transparent url(360-button-play.gif) no-repeat 50% 50%;
+ cursor:pointer;
+}
+
+.ui360 .sm2-360ui.sm2_playing .sm2-360btn:hover,
+.ui360 .sm2-360btn-playing:hover {
+ background:transparent url(360-button-pause-light.png) no-repeat 50% 50%;
+ _background:transparent url(360-button-pause-light.gif) no-repeat 50% 50%;
+ cursor:pointer;
+}
+
+
+.ui360 .sm2-360ui.sm2_playing .sm2-timing {
+ visibility:visible;
+}
+
+.ui360 .sm2-360ui.sm2_buffering .sm2-timing {
+ visibility:hidden;
+}
+
+.ui360 .sm2-360ui .sm2-timing,
+.ui360 .sm2-360ui .sm2-360btn:hover + .sm2-timing,
+.ui360 .sm2-360ui.sm2_paused .sm2-timing {
+ visibility:hidden;
+}
+
+.ui360 .sm2-360ui.sm2_dragging .sm2-timing,
+.ui360 .sm2-360ui.sm2_dragging .sm2-360btn:hover + .sm2-timing {
+ /* paused + dragging */
+ visibility:visible;
+}
+
+.ui360 .sm2-360ui.sm2_playing .sm2-360btn,
+x.ui360 .sm2-360btn-playing,
+.ui360 .sm2-360ui.sm2_dragging .sm2-360btn,
+.ui360 .sm2-360ui.sm2_dragging .sm2-360btn:hover,
+.ui360 .sm2-360ui.sm2_dragging .sm2-360btn-playing:hover {
+ /* don't let pause button show on hover when dragging (or paused and dragging) */
+ background:transparent;
+ cursor:auto;
+}
+
+.ui360 .sm2-360ui.sm2_buffering .sm2-360btn,
+.ui360 .sm2-360ui.sm2_buffering .sm2-360btn:hover {
+ background:transparent url(icon_loading_spinner.gif) no-repeat 50% 50%;
+ opacity:0.5;
+ visibility:visible;
+}
+
+/* inline list style */
+
+.sm2-inline-list .ui360,
+.sm2-inline-block .ui360 {
+ position:relative;
+ display:inline-block;
+ float:left;
+ _display:inline;
+ margin-bottom:-15px;
+}
+
+.sm2-inline-list .ui360 {
+ margin-bottom:0px;
+}
+
+.sm2-inline-block .ui360 {
+ margin-right:8px;
+}
+
+.sm2-inline-list .ui360 a {
+ display:none;
+}
+
+/* annotations */
+
+ul.ui360playlist {
+ list-style-type:none;
+}
+
+ul.ui360playlist,
+ul.ui360playlist li {
+ margin:0px;
+ padding:0px;
+}
+
+div.ui360 div.metadata {
+ display:none;
+}
+
+div.ui360 a span.metadata,
+div.ui360 a span.metadata * {
+ /* name of track, note etc. */
+ vertical-align:baseline;
+}
\ No newline at end of file diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/canvas-visualization-basic.html b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/canvas-visualization-basic.html new file mode 100755 index 0000000..789846b --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/canvas-visualization-basic.html @@ -0,0 +1,125 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+<title>360° MP3 player UI demo (SoundManager 2): Javascript + Canvas Visualization, basic example</title>
+<meta name="description" content="Basic example of 360-degree circular control for MP3 links, with EQ and spectrum visualization options" />
+<!-- demo: make the fonts nicer etc. -->
+<link rel="stylesheet" type="text/css" href="../index.css" />
+
+<!-- soundManager.useFlashBlock: related CSS -->
+<link rel="stylesheet" type="text/css" href="../flashblock/flashblock.css" />
+
+<!-- required -->
+<link rel="stylesheet" type="text/css" href="360player.css" />
+<link rel="stylesheet" type="text/css" href="360player-visualization.css" />
+
+<!-- special IE-only canvas fix -->
+<!--[if IE]><script type="text/javascript" src="script/excanvas.js"></script><![endif]-->
+
+<!-- Apache-licensed animation library -->
+<script type="text/javascript" src="script/berniecode-animator.js"></script>
+
+<!-- the core stuff -->
+<script type="text/javascript" src="../../script/soundmanager2.js"></script>
+<script type="text/javascript" src="script/360player.js"></script>
+
+<script type="text/javascript">
+
+soundManager.url = '../../swf/'; // path to directory containing SM2 SWF
+
+soundManager.useFastPolling = true; // increased JS callback frequency, combined with useHighPerformance = true
+
+threeSixtyPlayer.config.scaleFont = (navigator.userAgent.match(/msie/i)?false:true);
+threeSixtyPlayer.config.showHMSTime = true;
+
+// enable some spectrum stuffs
+
+threeSixtyPlayer.config.useWaveformData = true;
+threeSixtyPlayer.config.useEQData = true;
+
+// enable this in SM2 as well, as needed
+
+if (threeSixtyPlayer.config.useWaveformData) {
+ soundManager.flash9Options.useWaveformData = true;
+}
+if (threeSixtyPlayer.config.useEQData) {
+ soundManager.flash9Options.useEQData = true;
+}
+if (threeSixtyPlayer.config.usePeakData) {
+ soundManager.flash9Options.usePeakData = true;
+}
+
+// favicon is expensive CPU-wise, but can be enabled.
+threeSixtyPlayer.config.useFavIcon = false;
+
+</script>
+
+<link rel="stylesheet" type="text/css" href="demo.css" />
+<style type="text/css">
+
+#left h2 {
+ padding-top:0px;
+ margin-bottom:0.25em;
+ color:#666;
+}
+
+pre.block {
+ margin-top:0.5em;
+}
+
+/* special case */
+
+#left {
+ width:auto;
+ max-width:100%;
+}
+
+</style>
+
+</head>
+
+<body>
+
+<div id="left">
+
+ <h1><a href="http://schillmania.com/projects/soundmanager2/demo/360-player/">360° Player Demo</a> - Visualization Example, Basic Template</h1>
+
+ <p class="note" style="color:#666;margin-bottom:0.5em">Canvas-based UI with visualization options. <b>Note: No EQ/spectrum support for IE (too slow.) Data not available in HTML5.</b></p>
+
+ <div style="clear:left"></div>
+
+ <div id="sm2-container">
+ <!-- sm2 flash goes here -->
+ </div>
+
+ <!-- here are the MP3 links, which are decorated with the 360 canvas element/UI etc. -->
+
+ <h2 style="margin-top:1em">Inline list</h2>
+
+ <div class="sm2-inline-list"> <!-- remove this class to have one item per line -->
+
+ <div class="ui360"><a href="../../demo/mpc/audio/CRASH_1.mp3">Crash 1</a></div>
+ <div class="ui360"><a href="../../demo/mpc/audio/CRASH_5.mp3">Crash 5</a></div>
+ <div class="ui360"><a href="../../demo/mpc/audio/CRASH_6.mp3">Crash 6</a></div>
+ <div class="ui360"><a href="../../demo/mpc/audio/CHINA_1.mp3">China 1</a></div>
+
+ </div>
+
+ <h2 style="clear:both;padding-top:1em">Block list</h2>
+
+ <div>
+ <div class="ui360"><a href="../../demo/_mp3/sine,%20square,%20sawtooth,%20rando.mp3">Sine, Square, Sawtooth, Wave (Warning: LOUD)</a></div>
+ <div class="ui360"><a href="../../demo/_mp3/1hz-10khz-sweep.mp3">1-10 Khz Sweep (Warning: LOUD)</a></div>
+ </div>
+
+ </div>
+
+ <p style="margin-left:1em">
+ <a href="http://www.schillmania.com/projects/soundmanager2/" title="SoundManager 2 home">SoundManager 2 project page</a> (not an MP3 link)
+ </p>
+
+</div>
+
+</body>
+</html>
diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/canvas-visualization.html b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/canvas-visualization.html new file mode 100755 index 0000000..cb8071f --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/canvas-visualization.html @@ -0,0 +1,328 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+<title>360° MP3 player UI demo (SoundManager 2): Javascript + Canvas Visualization</title>
+<meta name="description" content="Javascript + Canvas + SoundManager 2: 360-degree circular control / jog wheel example for playing MP3 links, with EQ and spectrum visualization options" />
+<!-- demo, make the fonts nicer etc. -->
+<link rel="stylesheet" type="text/css" href="../index.css" />
+
+<!-- soundManager.useFlashBlock: related CSS -->
+<link rel="stylesheet" type="text/css" href="../flashblock/flashblock.css" />
+
+<!-- required -->
+<link rel="stylesheet" type="text/css" href="360player.css" />
+<link rel="stylesheet" type="text/css" href="360player-visualization.css" />
+
+<!-- special IE-only canvas fix -->
+<!--[if IE]><script type="text/javascript" src="script/excanvas.js"></script><![endif]-->
+
+<!-- Apache-licensed animation library -->
+<script type="text/javascript" src="script/berniecode-animator.js"></script>
+
+<!-- the core stuff -->
+<script type="text/javascript" src="../../script/soundmanager2.js"></script>
+<script type="text/javascript" src="script/360player.js"></script>
+
+<script type="text/javascript">
+
+soundManager.url = '../../swf/'; // path to directory containing SM2 SWF
+
+soundManager.useFastPolling = true; // increased JS callback frequency, combined with useHighPerformance = true
+
+threeSixtyPlayer.config.scaleFont = (navigator.userAgent.match(/msie/i)?false:true);
+threeSixtyPlayer.config.showHMSTime = true;
+
+// enable some spectrum stuffs
+
+threeSixtyPlayer.config.useWaveformData = true;
+threeSixtyPlayer.config.useEQData = true;
+
+// enable this in SM2 as well, as needed
+
+if (threeSixtyPlayer.config.useWaveformData) {
+ soundManager.flash9Options.useWaveformData = true;
+}
+if (threeSixtyPlayer.config.useEQData) {
+ soundManager.flash9Options.useEQData = true;
+}
+if (threeSixtyPlayer.config.usePeakData) {
+ soundManager.flash9Options.usePeakData = true;
+}
+
+// favicon is expensive CPU-wise, but can be used.
+if (window.location.href.match(/hifi/i)) {
+ threeSixtyPlayer.config.useFavIcon = true;
+}
+
+</script>
+
+<!-- DEMO only, customization UI: Yahoo! YUI colorpicker stuff -->
+<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.7.0/build/slider/assets/skins/sam/slider.css" />
+<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.7.0/build/colorpicker/assets/skins/sam/colorpicker.css" />
+<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
+<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/animation/animation-min.js"></script>
+<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/dragdrop/dragdrop-min.js"></script>
+<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/slider/slider-min.js"></script>
+<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/element/element-min.js"></script>
+<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/colorpicker/colorpicker-min.js"></script>
+
+<link rel="stylesheet" type="text/css" href="demo.css" />
+<style type="text/css">
+
+#left h2 {
+ padding-top:0px;
+ margin-bottom:0.25em;
+ color:#666;
+}
+
+pre.block {
+ margin-top:0.5em;
+}
+
+/* special case */
+
+#left {
+ width:auto;
+ max-width:100%;
+}
+
+</style>
+
+<!-- demo configuration stuff, you don't need this -->
+<link rel="stylesheet" type="text/css" href="demo-slider-controls.css" />
+<script type="text/javascript" src="demo-slider-controls.js"></script>
+
+</head>
+
+<body>
+
+<div id="left">
+
+ <h1><a href="http://www.schillmania.com/projects/soundmanager2/" title="Javascript MP3 player project home">SoundManager 2</a> / <a href="http://schillmania.com/projects/soundmanager2/demo/360-player/">360° Player Demo</a>: JS + Canvas Visualization</h1>
+
+ <p class="note" style="color:#666;margin-bottom:0.5em">Canvas-based UI with visualization options. <b>Note: Spectrum/EQ visualizations disabled for IE (too slow.) Data is not currently available under HTML5.</b></p>
+ <p class="note" style="color:#666;margin-bottom:0.5em">You can also <a href="#debug=1" onclick="window.location.href = this.href;window.location.reload()" title="Enable debug mode, show frames per second">show FPS</a><span id="config-link"> or <a href="#customize" onclick="window.location.href=this.href;window.location.reload()">customize the UI</a></span><span id="hifi">, or see the <a href="#hifi=1" onclick="window.location.href=this.href;window.location.reload()">hi-fi version</a></span>. Check the <a href="canvas-visualization-basic.html">basic template</a> for a minimal code example; also see the <a href="../360-player/" title="360° player UI">default 360° UI</a>.</p>
+
+ <!-- customization crap -->
+
+ <div id="config-ui" style="clear:both;position:relative;max-width:1110px;margin-top:1em;display:none">
+
+ <div style="position:relative">
+
+ <form action="#" method="get">
+
+ <div id="controls">
+
+ <div class="checkbox">
+ <div>
+ <input id="use-waveform" type="checkbox" checked="checked" title="Enable waveform feature." onclick="controller.updateExample();controller.updateExampleCode()" value="Apply" /> Waveform
+ <input id="disabled-1" type="checkbox" title="Enable EQ (spectrum) feature." onclick="controller.updateExample();controller.updateExampleCode()" value="Apply" style="margin-left:1em" checked="checked" /> EQ
+ <input type="checkbox" name="use-amplifier" id="use-amplifier" checked="checked" onclick="controller.updateExample();controller.updateExampleCode()" style="margin-left:1em"> Amplifier
+ </div>
+ </div>
+
+ <div style="clear:left"></div>
+
+ <dl class="col">
+
+ <dt>Circle Diameter</dt>
+ <dd class="title">Size</dd>
+ <dd>1-256</dd>
+ <dd class="control">
+ <div class="bar" title="Click to move here"></div>
+ <div class="slider" title="Size of circle"></div>
+ </dd>
+
+ <dt>Waveform Thickness</dt>
+ <dd class="title">thickness</dd>
+ <dd>1-100</dd>
+ <dd class="control">
+ <div class="bar" title="Click to move here"></div>
+ <div class="slider" title="Thickness of line"></div>
+ </dd>
+
+ <dt>Wave Downsample</dt>
+ <dd class="title">(Scale)</dd>
+ <dd>1-16</dd>
+ <dd class="control">
+ <div class="bar" title="Click to move here"></div>
+ <div class="slider" title="Primary (inner circle) colour"></div>
+ </dd>
+
+ <dt>EQ Thickness</dt>
+ <dd class="title">thickness</dd>
+ <dd>1-50</dd>
+ <dd class="control">
+ <div class="bar" title="Click to move here"></div>
+ <div class="slider" title="Thickness of line"></div>
+ </dd>
+
+ <dt>EQ Downsample</dt>
+ <dd class="title">(Scale)</dd>
+ <dd>1-16</dd>
+ <dd class="control">
+ <div class="bar" title="Click to move here"></div>
+ <div class="slider" title="Primary (inner circle) colour"></div>
+ </dd>
+
+ </dl>
+
+ <div id="options" class="col">
+
+ <div>
+ Waveform position:
+ <input type="radio" name="waveform-inside" id="waveform-inside" value="true" checked="checked" onclick="controller.updateExample();controller.updateExampleCode()"> Inside | <input type="radio" name="waveform-inside" id="waveform-inside" value="false" onclick="controller.updateExample();controller.updateExampleCode()"> Outside
+ </div>
+
+ <div>
+ EQ position:
+ <input type="radio" name="eq-inside" id="eq-inside" value="true" onclick="controller.updateExample();controller.updateExampleCode()"> Inside | <input type="radio" name="eq-inside" id="eq-inside" value="false" checked="checked" onclick="controller.updateExample();controller.updateExampleCode()"> Outside
+ </div>
+
+ <div>
+ Waveform color:
+ <input type="text" name="waveform-color" id="waveform-color" value="#000000" onclick="createCP(this,setWaveformColor)" />
+ </div>
+
+ <div>
+ EQ color:
+ <input type="text" name="eq-color" id="eq-color" value="#000000" onclick="createCP(this,setEQColor)" />
+ </div>
+
+ <div>
+ Loaded ring color:
+ <input type="text" name="loaded-ring-color" id="loaded-ring-color" value="#000000" onclick="createCP(this,setLoadedRingColor)" />
+ </div>
+
+ <div>
+ Progress ring color:
+ <input type="text" name="progress-ring-color" id="progress-ring-color" value="#000000" onclick="createCP(this,setProgressRingColor)" />
+ </div>
+
+ <div>
+ Background ring color:
+ <input type="text" name="bg-ring-color" id="bg-ring-color" value="#000000" onclick="createCP(this,setBackgroundRingColor)" />
+ </div>
+
+ <p class="compact">
+ <input type="button" onclick="controller.randomize()" value="Randomize controls" title="Assign random control values" style="font-size:x-small" />
+ </p>
+
+ </form>
+
+ </div>
+
+ <div id="cp-container">
+ <!-- color picker stuff goes here -->
+ </div>
+
+ <div id="config-code-block" style="float:right;display:inline;margin-left:1em;margin-top:-0.7em">
+ <!--
+ <pre id="config-link" class="block"><code style="cursor:pointer" onclick="document.getElementById('config-link').style.display='none';document.getElementById('config-pre-block').style.display='block';return false"> [click to show code] </code></pre>
+ -->
+ <pre id="config-pre-block" class="block"><code id="config-code">Code goes here</code></pre>
+ </div>
+
+ </div>
+
+ </div>
+
+ <p style="clear:left">Get a sound playing, then adjust the values to see real-time updates.</p>
+
+ </div>
+
+ <!-- here are the MP3 links, which are decorated with the 360 canvas element/UI etc. -->
+
+ <div id="sm2-container">
+ <!-- sm2 flash goes here -->
+ </div>
+
+ <h2 style="margin-top:1em">Inline list</h2>
+
+ <div class="sm2-inline-list"> <!-- remove this class to have one item per line -->
+
+ <div class="ui360"><a href="http://freshly-ground.com/data/audio/sm2/SonReal%20-%20I%20Tried.mp3">SonReal - I Tried</a></div>
+ <div class="ui360"><a href="http://freshly-ground.com/data/audio/sm2/SonReal%20-%20People%20Asking.mp3">SonReal - People Asking</a></div>
+ <div class="ui360"><a href="http://freshly-ground.com/data/audio/mpc/20060826%20-%20Armstrong.mp3">20060826 - Armstrong Groove</a></div>
+ <div class="ui360"><a href="../../demo/_mp3/sine,%20square,%20sawtooth,%20rando.mp3">Sine, Square, Sawtooth, Wave (Warning: <span style="color:#ff3333">LOUD</span>)</a></div>
+
+ </div>
+
+ <p class="note" style="clear:both;padding-top:1em">"I Tried" and "People Asking" courtesy of <a href="http://sonreal.bandcamp.com/album/the-lightyear-mixtape" title="The Lightyear Mixtape from SonReal, Vancouver-based hip-hop artist">SonReal</a>, from the "Lightyear" Mixtape.</p>
+
+ <h2 style="clear:left;padding-top:1em">Block list</h2>
+
+ <div>
+ <div class="ui360"><a href="http://freshly-ground.com/data/audio/mpc/20090207%20-%20Loverman.mp3">20090207 - Loverman</a></div>
+ <div class="ui360"><a href="../../demo/_mp3/1hz-10khz-sweep.mp3">1-10 Khz Sweep (Warning: <span style="color:#ff3333">LOUD</span>)</a></div>
+ </div>
+
+
+ <div style="clear:left"></div>
+
+ <h2 style="clear:left;padding-top:1em">Variant: Annotations/meta-data</h2>
+
+
+ <ul class="ui360playlist">
+
+ <li>
+
+ <div class="ui360">
+ <a href="http://freshly-ground.com/data/audio/binaural/A%20Virtual%20Haircut%20in%20San%20Francisco%20%283%20Scenes%29.mp3">A Virtual Haircut (3 scenes)</a>
+ <div class="metadata">
+ <div class="duration">4:43</div> <!-- total track time (for positioning while loading, until determined -->
+ <ul>
+ <li><p>Electric razor</p><span>0:00</span></li> <!-- first scene -->
+ <li><p>Water, scissors</p><span>2:41</span></li> <!-- start time of second scene -->
+ <li><p>More razor work</p><span>4:00</span></li>
+ </ul>
+ </div>
+ </div>
+
+ </li>
+
+ <li>
+
+ <div class="ui360">
+ <a href="http://freshly-ground.com/data/audio/binaural/Rubber%20Chicken%20Launch%20%28office%29.mp3">Rubber Chicken Launch (Office)</a>
+
+ <div class="metadata">
+ <div class="duration">0:47</div>
+ <ul>
+ <li><p>First attempt</p><span>0:00</span></li>
+ <li><p>Fire!</p><span>0:02</span></li>
+ <li><p>"Too much angle"</p><span>0:05</span></li>
+ <li><p>Random chicken noise</p><span>0:18</span></li>
+ <li><p>"Wait a second"</p><span>0:31</span></li>
+ <li><p>Derrr..</p><span>0:34</span></li>
+ <li><p>Launch attempt #2</p><span>0:36</span></li>
+ <li><p>"Wrong angle"</p><span>0:39</span></li>
+ <li><p>"Fail"</p><span>0:42</span></li>
+ </ul>
+ </div>
+
+
+ </div>
+
+ </li>
+
+ </ul>
+
+ <div style="clear:both"></div>
+
+ <p style="margin-left:1em">
+ <a href="http://www.schillmania.com/projects/soundmanager2/" title="SoundManager 2 home">SoundManager 2 project page</a> (not an MP3 link)
+ </p>
+
+ <script type="text/javascript">
+ if (window.location.toString().match(/#customize/i)) {
+ document.getElementById('config-link').style.display = 'none';
+ document.getElementById('config-ui').style.display = 'block';
+ }
+ </script>
+
+</div>
+
+</body>
+</html>
diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/demo-slider-controls.css b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/demo-slider-controls.css new file mode 100755 index 0000000..27281c0 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/demo-slider-controls.css @@ -0,0 +1,179 @@ +#cp-container { position:relative;float:left;display:inline; margin-left:1em;padding: 6px; background-color: #f6f6f6; border:1px solid #eee; width: 320px; height:180px;z-index:2; }
+
+.yui-picker-controls li,
+.yui-picker-controls input {
+ font-size:1em;
+ font-family:"helvetica neue",helvetica,arial,verdana;
+}
+
+#controls {
+ position:relative;
+ margin-top:1.5em;
+ font-size:0.85em;
+}
+
+#options {
+ float:left;
+ display:inline;
+ margin-bottom:0.5em;
+ margin-top:-1.2em;
+}
+
+#controls .checkbox {
+ float:left;
+ display:inline;
+ width:21.2em;
+ margin-right:2.5em;
+}
+
+#controls .checkbox div {
+ /* tab */
+ width:auto;
+ padding:0.4em;
+ border:1px solid #ddd;
+ border-bottom:none;
+ background:#eee;
+}
+
+#controls .checkbox div,
+#controls .checkbox input {
+ font-family:arial,tahoma,verdana,"sans serif";
+ font-size:1em;
+ vertical-align:middle;
+}
+
+#controls dl {
+ width:21em;
+}
+
+#controls dl.col {
+ position:relative;
+ float:left;
+ display:inline;
+ margin:0px;
+ margin-right:1em;
+ padding:0.75em;
+/*
+ height:12.4em;
+*/
+ height:auto;
+ border:1px solid #ddd;
+ background:#f6f6f6;
+}
+
+#controls .disabled {
+ color:#ccc;
+}
+
+#controls .disabled dt,
+#controls .disabled dd {
+ color:#999;
+ opacity:0.5;
+}
+
+#controls dl dd p {
+ margin:0px;
+ padding:0px;
+}
+
+#controls dt,
+#controls dd {
+ margin:0px;
+ padding:0px;
+}
+
+#controls dt {
+ border-bottom:none;
+}
+
+#controls dt {
+ float:left;
+ display:inline;
+ background:transparent;
+ padding-right:0.7em;
+ margin-right:0.7em;
+ border-right:1px solid #ccc;
+ font-size:1.1em;
+ color:#333;
+ font-family:"helvetica neue",helvetica,verdana,arial,"sans serif";
+}
+
+#controls dd {
+ margin:0px;
+ padding:0px;
+ font-size:0.9em;
+ vertical-align:middle;
+ color:#666;
+}
+
+#controls .title {
+ float:left;
+ display:inline;
+ margin-right:0.6em;
+ color:#333;
+}
+
+/* those slider bits you might be wondering about */
+
+#controls .control {
+ position:relative;
+ border-left:0px;
+ width:214px;
+ height:20px;
+}
+
+#controls .control .bar {
+ position:absolute;
+ left:0px;
+ top:0px;
+ width:214px;
+ height:20px;
+ background:transparent url(../_image/slider-bar.gif) no-repeat 0px 9px;
+ cursor:pointer;
+ cursor:hand;
+}
+
+#controls .control .slider {
+ position:absolute;
+ left:0px;
+ top:0px;
+ width:20px;
+ height:20px;
+ background:transparent url(../_image/slider.png) no-repeat 0px 0px;
+ *background:none;
+ filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='../_image/slider.png');
+ cursor:pointer;
+ cursor:hand;
+}
+
+#controls .control .slider:hover {
+ background:transparent url(../_image/slider-1.png) no-repeat 0px 0px;
+ *background:none;
+}
+
+#controls .control .slider.hover {
+ filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='../_image/slider-1.png');
+}
+
+#controls .disabled .control .slider {
+ background:transparent url(../_image/slider-disabled.png) no-repeat 0px 0px;
+ *background:none;
+ filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='../_image/slider-disabled.png');
+}
+
+#controls .disabled .control .slider:hover {
+ background:transparent url(../_image/slider-disabled-1.png) no-repeat 0px 0px;
+ *background:none;
+}
+
+#controls .disabled .control .slider.hover {
+ filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='../_image/slider-disabled-1.png');
+}
+
+#controls input[type=text] {
+ width:5em;
+}
+
+#options div {
+ margin-bottom:0.25em;
+}
\ No newline at end of file diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/demo-slider-controls.js b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/demo-slider-controls.js new file mode 100755 index 0000000..16a02dc --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/demo-slider-controls.js @@ -0,0 +1,711 @@ +/*
+ Ancient fireworks slider control code (2005)
+ http://schillmania.com/projects/fireworks/
+ --------------------------------------------
+ Not required for your use!
+*/
+
+function Animator2() {
+ var self = this;
+ this.tweens = [];
+ this.tweens['default'] = [1,2,3,4,5,6,7,8,9,10,9,8,7,6,5,4,3,2,1];
+ this.tweens['blast'] = [12,12,11,10,10,9,8,7,6,5,4,3,2,1];
+ this.tweens['fade'] = [10,10,10,10,10,10,10,10,10,10];
+ this.queue = [];
+ this.queue.IDs = [];
+ this.active = false;
+ this.timer = null;
+
+ this.createTween = function(start,end,type) {
+ // return array of tween coordinate data (start->end)
+ type = type||'default';
+ var tween = [start];
+ var tmp = start;
+ var diff = end-start;
+ var x = self.tweens[type].length;
+ for (var i=0; i<x; i++) {
+ tmp += diff*self.tweens[type][i]*0.01;
+ tween[i] = new Object();
+ tween[i].data = tmp;
+ tween[i].event = null;
+ }
+ return tween;
+ }
+
+ this.enqueue = function(o,fMethod,fOnComplete) {
+ // add object and associated methods to animation queue
+ // writeDebug('animator.enqueue()');
+ if (!fMethod) {
+ // writeDebug('animator.enqueue(): missing fMethod');
+ }
+ if (typeof(self.queue.IDs[o.oID])=='undefined') {
+ // writeDebug('animator.enqueue(): added '+o.oID);
+ var i = self.queue.length;
+ self.queue.IDs[o.oID] = i;
+ self.queue[i] = o;
+ } else {
+ // writeDebug('animator.enqueue(): '+o.oID+' already queued');
+ var i = self.queue.IDs[o.oID]; // retrieve queue index
+ self.queue[i].active = true;
+ self.queue[i].frame = 0;
+ }
+ o.active = true; // flag for animation
+ self.queue[i]._method = fMethod;
+ self.queue[i]._oncomplete = fOnComplete?fOnComplete:null;
+ }
+
+ this.animate = function() {
+ var active = 0;
+ for (var i=self.queue.length; i--;) {
+ if (self.queue[i].active) {
+ self.queue[i]._method();
+ active++;
+ }
+ }
+ if (active==0 && self.timer) {
+ // all animations finished
+ self.stop();
+ } else {
+ // writeDebug(active+' active');
+ }
+ }
+
+ this.start = function() {
+ if (self.timer || self.active) {
+ // writeDebug('animator.start(): already active');
+ return false;
+ }
+ // writeDebug('animator.start()'); // report only if started
+ self.active = true;
+ self.timer = setInterval(self.animate,mc.intervalRate);
+ }
+
+ this.stop = function() {
+ // writeDebug('animator.stop()',true);
+ clearInterval(self.timer);
+ self.timer = null;
+ self.active = false;
+ self.queue = [];
+ self.queue.IDs = [];
+ }
+
+}
+
+function MainController() {
+ var self = this;
+ this.intervalRate = 20; // rate (ms) to run animation at, general best default = 20
+ this.DEBUG = true; // debug mode disabled by default
+ this.oFW = null;
+ this.isIE = (navigator.appVersion.indexOf('MSIE')+1);
+ this.isOpera = (navigator.userAgent.toLowerCase().indexOf('opera')+1);
+ if (this.isOpera) this.isIE = false; // no impersonation allowed here!
+ this.animator = null;
+ this.gOID = 0; // global object ID counter (for animation queue)
+ this.particleTypes = 6;
+ this.particleXY = 10;
+ this.tweenFade = [100,90,80,70,60,50,40,30,20,10,0];
+ this.isSafari = (navigator.appVersion.toLowerCase().indexOf('safari')+1?1:0);
+ this.canvasX = null;
+ this.canvasY = null;
+ this.screenY = null; // screen area (not entire page)
+ self.scrollY = null;
+
+ self.getWindowCoords = function() {
+ self.canvasX = (document.documentElement.clientWidth||document.body.clientWidth||document.body.scrollWidth);
+ self.canvasY = (document.documentElement.clientHeight||document.body.clientHeight||document.body.scrollHeight);
+ self.screenY = self.canvasY;
+ self.scrollY = parseInt(window.scrollY||document.documentElement.scrollTop||document.body.scrollTop);
+ self.canvasY += self.scrollY;
+ }
+
+ this.getWindowCoordsAlt = function() {
+ self.canvasX = window.innerWidth;
+ self.canvasY = window.innerHeight;
+ self.screenY = self.canvasY;
+ self.scrollY = parseInt(window.scrollY||document.documentElement.scrollTop||document.body.scrollTop);
+ self.canvasY += self.scrollY;
+ }
+
+ this.getPanX = function(x) {
+ x = parseInt(x);
+ var pos = x/self.canvasX;
+ if (pos<0.4) {
+ pos *= -1;
+ } else if (pos >= 0.4 && pos <= 0.6) {
+ pos = 0.5;
+ }
+ pos = parseInt(pos*100);
+ // writeDebug('getPanX('+x+'): '+pos+'%');
+ return pos;
+ }
+
+ this.isEmpty = function(o) {
+ // needs further hacking
+ return (typeof(o)=='undefined'||(o==null&&o!=0)||(o==''&&o!=0)||o=='null');
+ }
+
+ this.init = function() {
+// self.oFW = document.getElementById('fw');
+// self.oFP = document.getElementById('fp');
+// if (typeof(enableDebugMode)!='undefined' && (self.DEBUG||window.location.toString().toLowerCase().indexOf('debug')>=0)) enableDebugMode();
+ self.getWindowCoords();
+ self.animator = new Animator2();
+ }
+
+ this.destructor = function() {
+/*
+ for (var i=self.fireworks.length; i--;) {
+ self.fireworks[i] = null;
+ }
+ self.fireworks = null;
+ if (soundManager) {
+ soundManager.destructor();
+ soundManager = null;
+ }
+*/
+ }
+
+ if (this.isSafari || this.isOpera) this.getWindowCoords = this.getWindowCoordsAlt;
+
+}
+
+
+function Controller(o) {
+ var self = this;
+ this.o = o;
+ this.controls = [];
+ this.cb = [];
+ this.options = [];
+ this.functionExample = document.getElementById('function-example');
+ this.fbIE = null;
+
+ this.randomize = function() {
+ for (var i=1; i<self.controls.length; i++) {
+ setTimeout(self.controls[i].randomize,20+(20*i+1));
+ }
+ }
+
+ this.cbClick = function(nIndex) {
+ document.getElementById('controls').getElementsByTagName('dl')[nIndex].className = 'col'+(this.checked==false||this.checked==''?' disabled':'');
+ self.updateExample();
+ self.updateExampleCode();
+ }
+
+ this.updateExample = function() {
+ if (threeSixtyPlayer) {
+ var val = self.controls[0].value;
+ threeSixtyPlayer.config.circleDiameter = self.controls[0].value;
+ threeSixtyPlayer.config.circleRadius = self.controls[0].value/2;
+ // update some stuff
+
+ // set the cover width/height to match the canvas
+ if (threeSixtyPlayer.lastSound) {
+ // always set cover to max area?
+ // threeSixtyPlayer.lastSound._data.oCover.style.width = 250+'px';
+ // threeSixtyPlayer.lastSound._data.oCover.style.height = 250+'px';
+ // threeSixtyPlayer.lastSound._data.oCover.style.width = threeSixtyPlayer.config.circleDiameter+'px';
+ // threeSixtyPlayer.lastSound._data.oCover.style.height = threeSixtyPlayer.config.circleDiameter+'px';
+ threeSixtyPlayer.refreshCoords(threeSixtyPlayer.lastSound);
+ }
+
+ threeSixtyPlayer.config.waveformDataLineRatio = (self.controls[1].value/100)*2;
+
+ threeSixtyPlayer.config.waveformDataDownsample = (self.controls[2].value);
+
+ threeSixtyPlayer.config.eqDataLineRatio = parseInt((self.controls[3].value/100)*3*1000)/1000;
+
+ threeSixtyPlayer.config.eqDataDownsample = (self.controls[4].value);
+
+ threeSixtyPlayer.config.useEQData = (document.getElementById('disabled-1').checked?true:false);
+
+ // radio buttons
+
+ threeSixtyPlayer.config.useWaveformData=(document.getElementById('use-waveform').checked?true:false);
+
+ threeSixtyPlayer.config.waveformDataOutside = document.getElementById('waveform-inside').checked?false:true;
+
+ threeSixtyPlayer.config.eqDataOutside = document.getElementById('eq-inside').checked?false:true;
+
+ threeSixtyPlayer.config.useAmplifier = (document.getElementById('use-amplifier').checked?true:false);
+
+ // threeSixtyPlayer.refreshCoords();
+ }
+ }
+
+ this.updateExampleCode = function() {
+ // set innerHTML
+document.getElementById('config-code').innerHTML = "\
+// 360player.js, config section\n\
+this.config = {\n\
+ playNext: <span>false</span>,\n\
+ autoPlay: <span>false</span>,\n\
+ loadRingColor: <span>'"+threeSixtyPlayer.config.loadRingColor+"'</span>,\n\
+ playRingColor: <span>'"+threeSixtyPlayer.config.playRingColor+"'</span>,\n\
+ backgroundRingColor: <span>'"+threeSixtyPlayer.config.backgroundRingColor+"'</span>,\n\
+ circleDiameter: <span>"+threeSixtyPlayer.config.circleDiameter+"</span>,\n\
+ circleRadius: <span>"+threeSixtyPlayer.config.circleRadius+"</span>,\n\
+ imageRoot: <span>'"+threeSixtyPlayer.config.imageRoot+"'</span>,\n\
+ animDuration: <span>"+threeSixtyPlayer.config.animDuration+"</span>,\n\
+ animTransition: <span>Animator.tx.bouncy</span>,\n\
+ showHMSTime: <span>"+threeSixtyPlayer.config.showHMSTime+"</span>,\n\
+\n\
+ useWaveformData: <span>"+threeSixtyPlayer.config.useWaveformData+"</span>,\n\
+ waveformDataColor: <span>'"+threeSixtyPlayer.config.waveformDataColor+"'</span>,\n\
+ waveformDataDownsample: <span>"+threeSixtyPlayer.config.waveformDataDownsample+"</span>,\n\
+ waveformDataOutside: <span>"+threeSixtyPlayer.config.waveformDataOutside+"</span>,\n\
+ waveformDataConstrain: <span>false</span>,\n\
+ waveformDataLineRatio: <span>"+threeSixtyPlayer.config.waveformDataLineRatio+"</span>,\n\
+\n\
+ useEQData: <span>"+threeSixtyPlayer.config.useEQData+"</span>,\n\
+ eqDataColor: <span>'"+threeSixtyPlayer.config.eqDataColor+"'</span>,\n\
+ eqDataDownsample: <span>"+threeSixtyPlayer.config.eqDataDownsample+"</span>,\n\
+ eqDataOutside: <span>"+threeSixtyPlayer.config.eqDataOutside+"</span>,\n\
+ eqDataLineRatio: <span>"+threeSixtyPlayer.config.eqDataLineRatio+"</span>,\n\
+\n\
+ usePeakData: <span>"+threeSixtyPlayer.config.usePeakData+"</span>,\n\
+ peakDataColor: <span>'"+threeSixtyPlayer.config.peakDataColor+"'</span>,\n\
+ peakDataOutside: <span>"+threeSixtyPlayer.config.peakDataOutside+"</span>,\n\
+ peakDataLineRatio: <span>"+threeSixtyPlayer.config.peakDataLineRatio+"</span>,\n\
+\n\
+ useAmplifier: <span>"+threeSixtyPlayer.config.useAmplifier+"</span>\n\
+\n\
+}";
+document.getElementById('config-code').style.display = 'block'; // weird Fx fix
+ }
+
+ this.createCustomFirework = function() {
+ }
+
+ this.destructor = function() {
+ for (var i=self.controls.length; i--;) {
+ self.controls[i].destructor();
+ }
+ for (i=self.cb.length; i--;) {
+ self.cb.onclick = null;
+ self.cb[i] = null;
+ }
+ for (i=self.options.length; i--;) {
+ self.options[i] = null;
+ }
+ if (navigator.userAgent.match(/msie/i)) {
+ self.fbIE.onmouseover = null;
+ self.fbIE.onmouseout = null;
+ self.fbIE = null;
+ }
+ self.cb = null;
+ self.options = null;
+ self.controls = null;
+ self.functionExample = null;
+ self.o = null;
+ }
+
+ var items = parseInt(this.o.length/3);
+ for (var i=0; i<items; i++) {
+ this.controls[this.controls.length] = new Slider(this.o[(3*i)+2].getElementsByTagName('div')[1],this.o[(3*i)+1],this.o[(3*i)+2].getElementsByTagName('div')[0]);
+ }
+ this.cb = [document.getElementById('disabled-0'),document.getElementById('disabled-1')];
+/*
+ for (i=this.cb.length; i--;) {
+ this.cb[i]._index = i;
+ this.cb[i].onclick = this.cbClick;
+ }
+*/
+ this.options = [];
+/*
+ this.cb[1].checked = false;
+ this.options = [document.getElementById('opt-random0'),document.getElementById('opt-random1')];
+ this.options[0].checked = false;
+ this.options[1].checked = true;
+ if (navigator.userAgent.match(/msie/i)) {
+ this.fbIE = document.getElementById('fireButton');
+ this.fbIE.onmouseover = function() {this.className='hover';}
+ this.fbIE.onmouseout = function() {this.className='';}
+ }
+*/
+
+ setTimeout(function(){
+ var values = [
+ 256,
+ 65,
+ 40,
+ 72,
+ 48
+ ];
+ for (var i=0; i<values.length; i++) {
+ self.controls[i].setValue(values[i]); // defaults
+ }
+ },1);
+}
+
+function Slider(o,oV,oB) {
+ var self = this;
+ this.o = o;
+ this.oV = oV;
+ this.oB = oB;
+ this.scale = parseInt(oV.innerHTML.toString().substr(2));
+ this.oID = 'sc'+(gOID++);
+ this.offX = 0;
+ this.x = 0;
+ this.xMin = 0-10;
+ this.xMax = self.o.parentNode.offsetWidth-10;
+ this.value = 0;
+ this.timer = null;
+ this._className = this.o.className;
+ this.tween = [];
+ this.frame = 0;
+
+ this.over = function() {
+ this.className = self._className+' hover';
+ event.cancelBubble=true;
+ return false;
+ }
+
+ this.out = function() {
+ this.className = self._className;
+ event.cancelBubble=true;
+ return false;
+ }
+
+ this.down = function(e) {
+ var e = e?e:event;
+ self.offX = e.clientX-self.o.offsetLeft;
+ addEvent(document,'mousemove',self.move);
+ addEvent(document,'mouseup',self.up);
+ return false;
+ }
+
+ this.barClick = function(e) {
+ var e=e?e:event;
+ self.slide(self.x,e.clientX-self.o.parentNode.parentNode.offsetLeft-self.o.offsetWidth);
+ }
+
+ this.move = function(e) {
+ var e=e?e:event;
+ var x = e.clientX-self.offX;
+ if (x>self.xMax) {
+ x = self.xMax;
+ } else if (x<self.xMin) {
+ x = self.xMin;
+ }
+ if (x != self.x) {
+ self.moveTo(x);
+ self.doUpdate();
+ controller.updateExample();
+ controller.updateExampleCode();
+ }
+ e.stopPropgation?e.stopPropagation():e.cancelBubble=true;
+ return false;
+ }
+
+ this.up = function(e) {
+ removeEvent(document,'mousemove',self.move);
+ removeEvent(document,'mouseup',self.up);
+ // controller.updateExample();
+ controller.updateExampleCode();
+ }
+
+ this.slide = function(x0,x1) {
+ self.tween = mc.animator.createTween(x0,x1);
+ mc.animator.enqueue(self,self.animate,function(){
+ controller.updateExample()
+ controller.updateExampleCode();
+ });
+ mc.animator.start();
+ }
+
+ this.moveTo = function(x) {
+ self.x = x;
+ self.o.style.marginLeft = x+'px';
+ }
+
+ this.animate = function() {
+ self.moveTo(self.tween[self.frame].data);
+ self.doUpdate(50);
+ controller.updateExample();
+ if (self.frame++>=self.tween.length-1) {
+ self.active = false;
+ self.frame = 0;
+ if (self._oncomplete) self._oncomplete();
+// self.doUpdate();
+ return false;
+ }
+ self.doUpdate();
+ return true;
+ }
+
+ this.doUpdate = function(t) {
+ // if (!self.timer) self.timer = setTimeout(self.update,t||20);
+ self.update();
+ }
+
+ this.update = function() {
+ self.timer = null;
+ self.value = 1+parseInt(self.x/self.xMax*(self.scale-1));
+ if (self.value<1) self.value = 1;
+ // if (self.oV.innerHTML != self.value) self.oV.innerHTML = self.value;
+ // self.oV.innerHTML = self.value;
+ }
+
+ this.setValue = function(x) {
+ self.slide(self.x,Math.min(self.xMax,x));
+ }
+
+ this.randomize = function() {
+ self.slide(self.x,parseInt(Math.random()*self.xMax));
+ }
+
+ this.destructor = function() {
+ self.o.onmouseover = null;
+ self.o.onmouseout = null;
+ self.o.onmousedown = null;
+ self.o = null;
+ self.oV = null;
+ self.oB.onclick = null;
+ self.oB = null;
+ }
+
+ if (soundManager.isIE) {
+ // IE is lame, no :hover
+ this.o.onmouseover = this.over;
+ this.o.onmouseout = this.out;
+ }
+
+ this.o.onmousedown = this.down;
+ this.oB.onclick = this.barClick;
+ self.update();
+
+}
+
+var gOID = 0;
+
+function demoInit() {
+ controller = new Controller(document.getElementById('controls').getElementsByTagName('dd'));
+}
+
+function demoDestuctor() {
+ controller.destructor();
+ controller = null;
+}
+
+var controller = null;
+
+var mc = new MainController();
+// create null objects if APIs not present
+
+function createCP(oInput,oHandler) {
+ var Event = YAHOO.util.Event;
+
+ cpHandler = oHandler;
+ if (picker != null) {
+ // picker.showcontrols(true);
+ var c = oInput.value.substr(1);
+ picker.setValue(hex2decArray([c.substr(0,2),c.substr(2,2),c.substr(4,2)]),true); // be silent
+ return false;
+ }
+
+ Event.onDOMReady(function() {
+ picker = new YAHOO.widget.ColorPicker("cp-container", {
+ showhsvcontrols: true,
+ showhexcontrols: true,
+ images: {
+ PICKER_THUMB: "../_image/picker_thumb.png",
+ HUE_THUMB: "../_image/hue_thumb.png"
+ }
+ });
+
+// picker.showcontrols(false);
+ //a listener for logging RGB color changes;
+ //this will only be visible if logger is enabled:
+ var onRgbChange = function(o) {
+ /*o is an object
+ { newValue: (array of R, G, B values),
+ prevValue: (array of R, G, B values),
+ type: "rgbChange"
+ }
+ */
+ cpHandler(o.newValue);
+ controller.updateExampleCode();
+ }
+
+ //subscribe to the rgbChange event;
+ picker.on("rgbChange", onRgbChange);
+
+ //use setValue to reset the value to white:
+ Event.on("reset", "click", function(e) {
+ picker.setValue([255, 255, 255], false); //false here means that rgbChange
+ //wil fire; true would silence it
+ });
+
+ //use the "get" method to get the current value
+ //of one of the Color Picker's properties; in
+ //this case, we'll get the hex value and write it
+ //to the log:
+ Event.on("gethex", "click", function(e) {
+ console.log("Current hex value: " + picker.get("hex"));
+ });
+
+ });
+}
+
+var picker = null;
+
+cpHandler = function() {
+}
+
+
+ // hex -> dec / dec -> hex
+ // http://www.southwest.com.au/~jfuller/binary/converter.htm
+
+ function dec2hex(cval) {
+ if (cval > 255) cval = 255;
+ var hexascii = "0123456789ABCDEF";
+ var cval0 = Math.floor(cval/16);
+ var cval1 = cval-(cval0*16);
+ var c1 = hexascii.charAt(cval0);
+ var c2 = hexascii.charAt(cval1);
+ return (c1+c2);
+ }
+
+ function hex2dec(cval) {
+ cval = cval.toUpperCase();
+ var tval = 0;
+ var hexascii = "0123456789ABCDEF";
+ var mychar, ch;
+ for (var c=0; c<cval.length; c++) {
+ mychar = cval.charAt(c);
+ for (ch=0; ch<16; ch++) {
+ if (mychar == hexascii.charAt(ch)) {
+ tval += ch;
+ if (c<cval.length-1) tval *= 16;
+ }
+ }
+ }
+ return tval;
+ }
+
+ function hex2decArray(hArray) {
+ var result = [];
+ for (var i=0,j=hArray.length; i<j; i++) {
+ result[i] = hex2dec(hArray[i]);
+ }
+ return result;
+ }
+
+ function dec2hexArray(dArray) {
+ var result = [];
+ for (var i=0,j=dArray.length; i<j; i++) {
+ result[i] = dec2hex(dArray[i]);
+ }
+ return result;
+ }
+
+
+/*
+
+
+threeSixtyPlayer.config.waveformDataColor = '#'+dec2hexArray([self.controls[5].value,self.controls[6].value,self.controls[7].value]).join('');
+
+threeSixtyPlayer.config.eqDataColor = '#'+dec2hexArray([self.controls[8].value,self.controls[9].value,self.controls[10].value]).join('');
+
+threeSixtyPlayer.config.loadRingColor = '#'+dec2hexArray([self.controls[11].value,self.controls[12].value,self.controls[13].value]).join('');
+
+threeSixtyPlayer.config.playRingColor = '#'+dec2hexArray([self.controls[14].value,self.controls[15].value,self.controls[16].value]).join('');
+
+threeSixtyPlayer.config.waveformDataLineRatio = (self.controls[1].value/100)*2;
+
+threeSixtyPlayer.config.waveformDataDownsample = (self.controls[2].value);
+
+threeSixtyPlayer.config.eqDataLineRatio = (self.controls[3].value/100)*3;
+
+threeSixtyPlayer.config.eqDataDownsample = (self.controls[4].value);
+
+*/
+
+function _id(sID) {
+ return document.getElementById(sID);
+}
+
+function setWaveformColor(sColor) {
+ var value = '#'+(dec2hexArray(sColor).join(''));
+ threeSixtyPlayer.config.waveformDataColor = value;
+ _id('waveform-color').value = value;
+}
+
+function setEQColor(sColor) {
+ var value = '#'+dec2hexArray(sColor).join('');
+ _id('eq-color').value = value;
+ threeSixtyPlayer.config.eqDataColor = value;
+}
+
+function setLoadedRingColor(sColor) {
+ var value = '#'+dec2hexArray(sColor).join('');
+ _id('loaded-ring-color').value = value;
+ threeSixtyPlayer.config.loadRingColor = value;
+}
+
+function setProgressRingColor(sColor) {
+ var value = '#'+dec2hexArray(sColor).join('');
+ _id('progress-ring-color').value = value;
+ threeSixtyPlayer.config.playRingColor = value;
+}
+
+function setBackgroundRingColor(sColor) {
+ var value = '#'+dec2hexArray(sColor).join('');
+ _id('bg-ring-color').value = value;
+ threeSixtyPlayer.config.backgroundRingColor = value;
+}
+
+function addEvent(o,evtName,evtHandler) {
+ typeof(attachEvent)=='undefined'?o.addEventListener(evtName,evtHandler,false):o.attachEvent('on'+evtName,evtHandler);
+}
+
+function removeEvent(o,evtName,evtHandler) {
+ typeof(attachEvent)=='undefined'?o.removeEventListener(evtName,evtHandler,false):o.detachEvent('on'+evtName,evtHandler);
+}
+
+if (window.location.toString().match(/#customize/i)) {
+ addEvent(window,'resize',mc.getWindowCoords);
+ addEvent(window,'scroll',mc.getWindowCoords);
+ addEvent(window,'load',mc.init);
+ addEvent(window,'load',demoInit);
+}
+
+if (window.location.toString().match(/hifi/i)) {
+ soundManager.onready(function(){
+ document.getElementById('hifi').style.display = 'none';
+ threeSixtyPlayer.config = {
+ playNext: false,
+ autoPlay: false,
+ loadRingColor: '#ccc',
+ playRingColor: '#000',
+ backgroundRingColor: '#eee',
+ circleDiameter: 256,
+ circleRadius: 128,
+ imageRoot: '',
+ animDuration: 500,
+ animTransition: Animator.tx.bouncy,
+ showHMSTime: true,
+
+ useWaveformData: true,
+ waveformDataColor: '#0099ff',
+ waveformDataDownsample: 1,
+ waveformDataOutside: true,
+ waveformDataConstrain: false,
+ waveformDataLineRatio: 0.56,
+
+ useEQData: true,
+ eqDataColor: '#339933',
+ eqDataDownsample: 1,
+ eqDataOutside: true,
+ eqDataLineRatio: 0.72,
+
+ usePeakData: true,
+ peakDataColor: '#ff33ff',
+ peakDataOutside: true,
+ peakDataLineRatio: 0.5,
+
+ useAmplifier: true
+
+ }
+ });
+}
\ No newline at end of file diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/demo.css b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/demo.css new file mode 100755 index 0000000..c513764 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/demo.css @@ -0,0 +1,75 @@ +/*
+
+ -------------------------------------------------------------
+
+ In-page demo CSS - see external CSS for actual relevant stuff.
+
+ --------------------------------------------------------------
+
+ */
+
+#soundmanager-debug {
+ /* SM2 debug container (optional, makes debug more useable) */
+ position:absolute;position:fixed;*position:absolute;bottom:10px;right:10px;width:50em;height:18em;overflow:auto;background:#fff;margin:1em;padding:1em;border:1px solid #999;font-family:"lucida console",verdana,tahoma,"sans serif";font-size:x-small;line-height:1.5em;opacity:0.9;filter:alpha(opacity=90);
+}
+
+body {
+ font:75% normal verdana,arial,tahoma,"sans serif";
+}
+
+h1, h2, h3 {
+ font:3em arial,tahoma,verdana;
+ font-weight:normal;
+ margin-bottom:0px;
+}
+
+h1 {
+ margin-top:0.25em;
+}
+
+h1, h2 {
+ letter-spacing:-1px; /* zomg web x.0! ;) */
+}
+
+h2 {
+ font-size:2em;
+ margin-top:0px;
+ margin-bottom:0.1em;
+}
+
+h3 {
+ font-size:1.5em;
+ margin-bottom:1em;
+}
+
+h1 a,
+h1 a:hover {
+ color:#000;
+ text-decoration:none;
+}
+
+h1 a:hover {
+ text-decoration:underline;
+}
+
+ul.notes {
+ margin-left:0px;
+ padding-left:1.5em;
+}
+
+.note {
+ margin-top:0px;
+ font-style:italic;
+ color:#999;
+ margin-bottom:0px;
+}
+
+pre {
+ font-size:1.2em;
+ _font-size:1em;
+}
+
+#left {
+ max-width:56em;
+ margin-left:1em;
+}
diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/empty.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/empty.gif Binary files differnew file mode 100755 index 0000000..35d42e8 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/empty.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/icon_loading_dots.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/icon_loading_dots.gif Binary files differnew file mode 100755 index 0000000..078b55f --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/icon_loading_dots.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/icon_loading_spinner.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/icon_loading_spinner.gif Binary files differnew file mode 100755 index 0000000..9cf90cf --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/icon_loading_spinner.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/icon_loading_spinner_bigger.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/icon_loading_spinner_bigger.gif Binary files differnew file mode 100755 index 0000000..1c72ebb --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/icon_loading_spinner_bigger.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/index.html b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/index.html new file mode 100755 index 0000000..b3ec4b1 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/index.html @@ -0,0 +1,166 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+<title>360° MP3 player UI demo (SoundManager 2)</title> +<meta name="robots" content="noindex" />
+<meta name="description" content="Javascript-driven sound, canvas-based MP3 player UI demo: 360-degree circular control / jog wheel example for playing MP3 links using SoundManager 2, Javascript and Canvas.">
+
+<!-- required -->
+<link rel="stylesheet" type="text/css" href="360player.css" />
+
+<!-- special IE-only canvas fix -->
+<!--[if IE]><script type="text/javascript" src="script/excanvas.js"></script><![endif]-->
+
+<!-- Apache-licensed animation library -->
+<script type="text/javascript" src="script/berniecode-animator.js"></script>
+
+<!-- the core stuff -->
+<script type="text/javascript" src="../../script/soundmanager2.js"></script>
+<script type="text/javascript" src="script/360player.js"></script>
+
+<script type="text/javascript">
+soundManager.url = '../../swf/';
+</script>
+
+<!-- stuff you don't need -->
+<!-- makes the fonts nicer etc. -->
+<link rel="stylesheet" type="text/css" href="../index.css" />
+<link rel="stylesheet" type="text/css" href="demo.css" />
+
+<!-- soundManager.useFlashBlock: related CSS -->
+<link rel="stylesheet" type="text/css" href="../flashblock/flashblock.css" />
+
+<style type="text/css">
+
+/* Demo page, general layout */
+
+#left {
+ position:relative;
+ width:950px;
+ max-width:100%;
+}
+
+#left h2 {
+ padding-top:0px;
+ margin-bottom:0.25em;
+ color:#666;
+}
+
+pre.block {
+ margin-top:0.5em;
+}
+
+</style>
+
+</head>
+
+<body>
+
+<div id="left">
+
+ <h1><a href="http://www.schillmania.com/projects/soundmanager2/" title="Javascript MP3 player project home">SoundManager 2</a> / <a href="http://schillmania.com/projects/soundmanager2/demo/360-player/">360° Player</a>: JS + Canvas UI</h1>
+
+ <p class="note" style="color:#666;margin-bottom:0.5em">Canvas-based UI. Load progress, seek, play/pause etc. Also see <a href="canvas-visualization.html" title="Javascript canvas visualization with waveform/eq data">360° UI visualization</a> demo.</p>
+
+<div id="sm2-container">
+ <!-- flash movie is added here -->
+</div>
+
+<div style="margin-top:1.25em">
+
+ <div style="float:left;display:inline"> <!-- float is just for this demo layout, you don't need it. -->
+
+ <div class="ui360" style="margin-top:-0.55em"><a href="../jsAMP-preview/audio/rain.mp3">Rain</a></div>
+
+ <div class="ui360"><a href="http://freshly-ground.com/data/audio/mpc/20090119%20-%20Untitled%20Groove.mp3">20090119 - Untitled Groove</a></div>
+
+ </div>
+
+
+ <div style="float:left;display:inline;margin-left:40px;border-left:1px solid #ccc;padding-left:30px;width:140px">
+
+ <p style="margin-top:1em;margin-bottom:0px">Alternate style: inline</p>
+
+ <div class="sm2-inline-list" style="margin-bottom:10px"> <!-- note the CSS class, changes the layout -->
+
+ <div class="ui360"><a href="http://www.freshly-ground.com/data/audio/binaural/Mak.mp3">Angry cow sound?</a></div>
+ <div class="ui360"><a href="http://www.freshly-ground.com/data/audio/binaural/Things that open, close and roll.mp3">Things that open, close and roll</a></div>
+ <div class="ui360"><a href="http://www.freshly-ground.com/misc/music/20060826%20-%20Armstrong.mp3">20060826 - Armstrong</a></div>
+
+ </div>
+
+ </div>
+
+</div>
+
+<div style="clear:both"></div>
+
+
+ <h3>How This Works</h3>
+
+ <p>The script looks for a container element matching <code>div.<span>ui360</span></code>, and then the first link inside of it.</p>
+
+ <div>
+
+<pre class="block"><code><div class="<span>ui360</span>">
+ <a href="/path/to/an.mp3">
+</div></code></pre>
+
+ </div>
+
+ <p>When the link is clicked, the script adds a <code>UI</code> template to the block, prepending it in front of the MP3 link:</p>
+
+<pre class="block"><code><div class="<span>ui360</span>">
+ <span><span><-- dynamically-inserted block --></span></span>
+ <div class="<span>ui</span>">
+ <canvas class="<span>sm2-canvas</span>"></canvas>
+ <img class="<span>sm2-360btn</span>" />
+ <div class="<span>sm2-timing</span>"></div>
+ <div class="<span>sm2-cover</span>"></div>
+ </div>
+ <span><span><-- /UI --></span></span>
+ <a href="<span>/path/to/an.mp3</span>">
+</div></code></pre>
+
+<h3>Customizing the UI</h3>
+
+<p>The player's default 50x50-pixel canvas is defined both within JavaScript and CSS. For an example with different values, see this <a href="canvas-visualization.html" title="360° UI: larger version">larger version</a>.</p>
+
+<pre class="block"><code>threeSixtyPlayer.config = {
+ playNext: <span>false</span>, <span><span>// stop after one sound, or play through list until end</span></span>
+ autoPlay: <span>false</span>, <span><span>// start playing the first sound right away</span></span>
+ loadRingColor: <span>'#ccc',</span> <span><span>// amount of sound which has loaded</span></span>
+ playRingColor: <span>'#000'</span>, <span><span>// amount of sound which has played</span></span>
+ backgroundRingColor: <span>'#eee', </span><span><span>// "default" color shown underneath everything else</span></span>
+ imageRoot: <span>''</span>,</span> <span><span>// path to prepend for empty.gif used for play/pause button
+ animDuration: <span>500</span>,
+ animTransition: <span>Animator.tx.bouncy</span> <span><span>// http://www.berniecode.com/writing/animator.html</span></span>
+}</code></pre>
+
+<p>The CSS for the canvas UI block is a bit ugly, but JavaScript reads the width of the <code>.sm2-360ui</code> element in the DOM as set by CSS and uses that to later draw and update the canvas element while playing.</p>
+
+<pre class="block"><code>.ui360,
+.sm2-360ui {
+ <span><span>/* size of the container for the circle, etc. */</span></span>
+ width:<span>50px</span>;</span>
+ height:<span>50px</span>;</span>
+}
+</code></pre>
+
+<h3>Third-party Components</h3>
+
+<p>This demo includes use of <a href="http://www.berniecode.com/writing/animator.html">Bernie's Better Animation Class</a> (Apache licensed) for some animation effects.</p>
+<p>Also, some loader/spinner icons from <a href="http://ajaxload.info">ajaxload.info</a> are used for showing loading/buffering states.</p>
+
+<hr />
+
+ <p>
+ <a href="http://www.schillmania.com/projects/soundmanager2/" title="SoundManager 2 home">SoundManager 2 project page</a> (not an MP3 link)
+ </p>
+
+
+</div>
+
+</body>
+</html>
diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/script/360player.js b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/script/360player.js new file mode 100755 index 0000000..419559c --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/script/360player.js @@ -0,0 +1,1270 @@ +/*
+
+ SoundManager 2 Demo: 360-degree / "donut player"
+ ------------------------------------------------
+ http://schillmania.com/projects/soundmanager2/
+
+ An inline player with a circular UI.
+ Based on the original SM2 inline player.
+ Inspired by Apple's preview feature in the
+ iTunes music store (iPhone), among others.
+
+ Requires SoundManager 2 Javascript API.
+ Also uses Bernie's Better Animation Class (BSD):
+ http://www.berniecode.com/writing/animator.html
+
+*/
+
+function ThreeSixtyPlayer() {
+ var self = this;
+ var pl = this;
+ var sm = soundManager; // soundManager instance
+ var uA = navigator.userAgent;
+ var isIE = (uA.match(/msie/i));
+ var isOpera = (uA.match(/opera/i));
+ var isSafari = (uA.match(/safari/i));
+ var isChrome = (uA.match(/chrome/i));
+ var isFirefox = (uA.match(/firefox/i));
+ var isTouchDevice = (uA.match(/ipad|iphone/i));
+ this.excludeClass = 'threesixty-exclude'; // CSS class for ignoring MP3 links
+
+ this.links = [];
+ this.sounds = [];
+ this.soundsByURL = [];
+ this.indexByURL = [];
+ this.lastSound = null;
+ this.soundCount = 0;
+ this.oUITemplate = null;
+ this.oUIImageMap = null;
+ this.vuMeter = null;
+
+ this.config = {
+
+ playNext: false, // stop after one sound, or play through list until end
+ autoPlay: false, // start playing the first sound right away
+ loadRingColor: '#ccc', // how much has loaded
+ playRingColor: '#000', // how much has played
+ backgroundRingColor: '#eee', // color shown underneath load + play ("not yet loaded" color)
+
+ // optional segment/annotation (metadata) stuff..
+ segmentRingColor: 'rgba(255,255,255,0.33)', // metadata/annotation (segment) colors
+ segmentRingColorAlt: 'rgba(0,0,0,0.1)',
+ loadRingColorMetadata: '#ddd', // "annotations" load color
+ playRingColorMetadata: 'rgba(96,160,224,0.99)', // how much has played when metadata is present
+ playRingColorMetadata: 'rgba(128,192,256,0.9)', // how much has played when metadata is present
+
+ circleDiameter: null, // set dynamically according to values from CSS
+ circleRadius: null,
+ imageRoot: '', // image path to prepend for transparent .GIF - eg. /images/
+ animDuration: 500,
+ animTransition: Animator.tx.bouncy, // http://www.berniecode.com/writing/animator.html
+ showHMSTime: false, // hours:minutes:seconds vs. seconds-only
+ scaleFont: false, // also set the font size (if possible) while animating the circle
+
+ // optional: spectrum or EQ graph in canvas (not supported in IE, too slow via ExCanvas)
+ useWaveformData: false,
+ waveformDataColor: '#0099ff',
+ waveformDataDownsample: 3, // use only one in X (of a set of 256 values) - 1 means all 256
+ waveformDataOutside: false,
+ waveformDataConstrain: false, // if true, +ve values only - keep within inside circle
+ waveformDataLineRatio: 0.64,
+
+ // "spectrum frequency" option
+ useEQData: false,
+ eqDataColor: '#339933',
+ eqDataDownsample: 4, // use only one in X (of 256 values)
+ eqDataOutside: true,
+ eqDataLineRatio: 0.54,
+
+ // enable "amplifier" (canvas pulses like a speaker) effect
+ usePeakData: true,
+ peakDataColor: '#ff33ff',
+ peakDataOutside: true,
+ peakDataLineRatio: 0.5,
+
+ useAmplifier: true, // "pulse" like a speaker
+
+ fontSizeMax: null, // set according to CSS
+
+ useFavIcon: false // Experimental (also requires usePeakData: true).. Try to draw a "VU Meter" in the favicon area, if browser supports it (Firefox + Opera as of 2009)
+
+ }
+
+ this.css = {
+ // CSS class names appended to link during various states
+ sDefault: 'sm2_link', // default state
+ sBuffering: 'sm2_buffering',
+ sPlaying: 'sm2_playing',
+ sPaused: 'sm2_paused'
+ }
+
+ this.addEventHandler = function(o,evtName,evtHandler) {
+ typeof(attachEvent)=='undefined'?o.addEventListener(evtName,evtHandler,false):o.attachEvent('on'+evtName,evtHandler);
+ }
+
+ this.removeEventHandler = function(o,evtName,evtHandler) {
+ typeof(attachEvent)=='undefined'?o.removeEventListener(evtName,evtHandler,false):o.detachEvent('on'+evtName,evtHandler);
+ }
+
+ this.hasClass = function(o,cStr) {
+ return (typeof(o.className)!='undefined'?o.className.match(new RegExp('(\\s|^)'+cStr+'(\\s|$)')):false);
+ }
+
+ this.addClass = function(o,cStr) {
+ if (!o || !cStr || self.hasClass(o,cStr)) return false;
+ o.className = (o.className?o.className+' ':'')+cStr;
+ }
+
+ this.removeClass = function(o,cStr) {
+ if (!o || !cStr || !self.hasClass(o,cStr)) return false;
+ o.className = o.className.replace(new RegExp('( '+cStr+')|('+cStr+')','g'),'');
+ }
+
+ this.getElementsByClassName = function(className,tagNames,oParent) {
+ var doc = (oParent||document);
+ var matches = [];
+ var i,j;
+ var nodes = [];
+ if (typeof tagNames != 'undefined' && typeof tagNames != 'string') {
+ for (i=tagNames.length; i--;) {
+ if (!nodes || !nodes[tagNames[i]]) {
+ nodes[tagNames[i]] = doc.getElementsByTagName(tagNames[i]);
+ }
+ }
+ } else if (tagNames) {
+ nodes = doc.getElementsByTagName(tagNames);
+ } else {
+ nodes = doc.all||doc.getElementsByTagName('*');
+ }
+ if (typeof(tagNames)!='string') {
+ for (i=tagNames.length; i--;) {
+ for (j=nodes[tagNames[i]].length; j--;) {
+ if (self.hasClass(nodes[tagNames[i]][j],className)) {
+ matches.push(nodes[tagNames[i]][j]);
+ }
+ }
+ }
+ } else {
+ for (i=0; i<nodes.length; i++) {
+ if (self.hasClass(nodes[i],className)) {
+ matches.push(nodes[i]);
+ }
+ }
+ }
+ return matches;
+ }
+
+ this.getParentByNodeName = function(oChild,sParentNodeName) {
+ if (!oChild || !sParentNodeName) return false;
+ sParentNodeName = sParentNodeName.toLowerCase();
+ while (oChild.parentNode && sParentNodeName != oChild.parentNode.nodeName.toLowerCase()) {
+ oChild = oChild.parentNode;
+ }
+ return (oChild.parentNode && sParentNodeName == oChild.parentNode.nodeName.toLowerCase()?oChild.parentNode:null);
+ }
+
+ this.getParentByClassName = function(oChild,sParentClassName) {
+ if (!oChild || !sParentClassName) return false;
+ while (oChild.parentNode && !self.hasClass(oChild.parentNode,sParentClassName)) {
+ oChild = oChild.parentNode;
+ }
+ return (oChild.parentNode && self.hasClass(oChild.parentNode,sParentClassName)?oChild.parentNode:null);
+ }
+
+ this.getSoundByURL = function(sURL) {
+ return (typeof self.soundsByURL[sURL] != 'undefined'?self.soundsByURL[sURL]:null);
+ }
+
+ this.isChildOfNode = function(o,sNodeName) {
+ if (!o || !o.parentNode) {
+ return false;
+ }
+ sNodeName = sNodeName.toLowerCase();
+ do {
+ o = o.parentNode;
+ } while (o && o.parentNode && o.nodeName.toLowerCase() != sNodeName);
+ return (o && o.nodeName.toLowerCase() == sNodeName?o:null);
+ }
+
+ this.isChildOfClass = function(oChild,oClass) {
+ if (!oChild || !oClass) return false;
+ while (oChild.parentNode && !self.hasClass(oChild,oClass)) {
+ oChild = self.findParent(oChild);
+ }
+ return (self.hasClass(oChild,oClass));
+ }
+
+ this.findParent = function(o) {
+ if (!o || !o.parentNode) return false;
+ o = o.parentNode;
+ if (o.nodeType == 2) {
+ while (o && o.parentNode && o.parentNode.nodeType == 2) {
+ o = o.parentNode;
+ }
+ }
+ return o;
+ }
+
+ this.getStyle = function(o,sProp) {
+ // http://www.quirksmode.org/dom/getstyles.html
+ try {
+ if (o.currentStyle) {
+ return o.currentStyle[sProp];
+ } else if (window.getComputedStyle) {
+ return document.defaultView.getComputedStyle(o,null).getPropertyValue(sProp);
+ }
+ } catch(e) {
+ // oh well
+ }
+ return null;
+ }
+
+ this.findXY = function(obj) {
+ var curleft = 0;
+ var curtop = 0;
+ do {
+ curleft += obj.offsetLeft;
+ curtop += obj.offsetTop;
+ } while (obj = obj.offsetParent);
+ return [curleft,curtop];
+ }
+
+ this.getMouseXY = function(e) {
+ // http://www.quirksmode.org/js/events_properties.html
+ e = e?e:event;
+ if (isTouchDevice && e.touches) {
+ e = e.touches[0];
+ }
+ if (e.pageX || e.pageY) {
+ return [e.pageX,e.pageY];
+ } else if (e.clientX || e.clientY) {
+ return [e.clientX+self.getScrollLeft(),e.clientY+self.getScrollTop()];
+ }
+ }
+
+ this.getScrollLeft = function() {
+ return (document.body.scrollLeft+document.documentElement.scrollLeft);
+ }
+
+ this.getScrollTop = function() {
+ return (document.body.scrollTop+document.documentElement.scrollTop);
+ }
+
+ this.events = {
+
+ // handlers for sound events as they're started/stopped/played
+
+ play: function() {
+ pl.removeClass(this._360data.oUIBox,this._360data.className);
+ this._360data.className = pl.css.sPlaying;
+ pl.addClass(this._360data.oUIBox,this._360data.className);
+ self.fanOut(this);
+ },
+
+ stop: function() {
+ pl.removeClass(this._360data.oUIBox,this._360data.className);
+ this._360data.className = '';
+ self.fanIn(this);
+ },
+
+ pause: function() {
+ pl.removeClass(this._360data.oUIBox,this._360data.className);
+ this._360data.className = pl.css.sPaused;
+ pl.addClass(this._360data.oUIBox,this._360data.className);
+ },
+
+ resume: function() {
+ pl.removeClass(this._360data.oUIBox,this._360data.className);
+ this._360data.className = pl.css.sPlaying;
+ pl.addClass(this._360data.oUIBox,this._360data.className);
+ },
+
+ finish: function() {
+ pl.removeClass(this._360data.oUIBox,this._360data.className);
+ this._360data.className = '';
+ // self.clearCanvas(this._360data.oCanvas);
+ this._360data.didFinish = true; // so fan draws full circle
+ self.fanIn(this);
+ if (pl.config.playNext) {
+ var nextLink = (pl.indexByURL[this._360data.oLink.href]+1);
+ if (nextLink<pl.links.length) {
+ pl.handleClick({'target':pl.links[nextLink]});
+ }
+ }
+ },
+
+ whileloading: function() {
+ if (this.paused) {
+ self.updatePlaying.apply(this);
+ }
+ },
+
+ whileplaying: function() {
+ self.updatePlaying.apply(this);
+ this._360data.fps++;
+ },
+
+ bufferchange: function() {
+ if (this.isBuffering) {
+ pl.addClass(this._360data.oUIBox,pl.css.sBuffering);
+ } else {
+ pl.removeClass(this._360data.oUIBox,pl.css.sBuffering);
+ }
+ }
+
+ }
+
+ this.stopEvent = function(e) {
+ if (typeof e != 'undefined' && typeof e.preventDefault != 'undefined') {
+ e.preventDefault();
+ } else if (typeof event != 'undefined' && typeof event.returnValue != 'undefined') {
+ event.returnValue = false;
+ }
+ return false;
+ }
+
+ this.getTheDamnLink = (isIE)?function(e) {
+ // I really didn't want to have to do this.
+ return (e && e.target?e.target:window.event.srcElement);
+ }:function(e) {
+ return e.target;
+ }
+
+ this.handleClick = function(e) {
+ // a sound link was clicked
+ if (e.button > 1) {
+ // only catch left-clicks
+ return true;
+ }
+ var o = self.getTheDamnLink(e);
+ if (o.nodeName.toLowerCase() != 'a') {
+ o = self.isChildOfNode(o,'a');
+ if (!o) return true;
+ }
+ if (!self.isChildOfClass(o,'ui360')) {
+ // not a link we're interested in
+ return true;
+ }
+ var sURL = o.getAttribute('href');
+ if (!o.href || !sm.canPlayLink(o) || self.hasClass(o,self.excludeClass)) {
+ return true; // pass-thru for non-MP3/non-links
+ }
+ sm._writeDebug('handleClick()');
+ var soundURL = (o.href);
+ var thisSound = self.getSoundByURL(soundURL);
+ if (thisSound) {
+ // already exists
+ if (thisSound == self.lastSound) {
+ // and was playing (or paused)
+ thisSound.togglePause();
+ } else {
+ // different sound
+ thisSound.togglePause(); // start playing current
+ sm._writeDebug('sound different than last sound: '+self.lastSound.sID);
+ if (self.lastSound) {
+ self.stopSound(self.lastSound);
+ }
+ }
+ } else {
+ // append some dom shiz
+
+ // create sound
+ thisSound = sm.createSound({
+ id:'ui360Sound'+(self.soundCount++),
+ url:soundURL,
+ onplay:self.events.play,
+ onstop:self.events.stop,
+ onpause:self.events.pause,
+ onresume:self.events.resume,
+ onfinish:self.events.finish,
+ onbufferchange:self.events.bufferchange,
+ whileloading:self.events.whileloading,
+ whileplaying:self.events.whileplaying
+ });
+ var oContainer = o.parentNode;
+ // tack on some custom data
+
+ thisSound._360data = {
+ oUI360: self.getParentByClassName(o,'ui360'), // the (whole) entire container
+ oLink: o, // DOM node for reference within SM2 object event handlers
+ className: self.css.sPlaying,
+ oUIBox: self.getElementsByClassName('sm2-360ui','div',oContainer)[0],
+ oCanvas: self.getElementsByClassName('sm2-canvas','canvas',oContainer)[0],
+ oButton: self.getElementsByClassName('sm2-360btn','img',oContainer)[0],
+ oTiming: self.getElementsByClassName('sm2-timing','div',oContainer)[0],
+ oCover: self.getElementsByClassName('sm2-cover','div',oContainer)[0],
+ lastTime: null,
+ didFinish: null,
+ pauseCount:0,
+ radius:0,
+ amplifier: (self.config.usePeakData?0.9:1), // TODO: x1 if not being used, else use dynamic "how much to amplify by" value
+ radiusMax: self.config.circleDiameter*0.175, // circle radius
+ width:0,
+ widthMax: self.config.circleDiameter*0.4, // width of the outer ring
+ lastValues: {
+ bytesLoaded: 0,
+ bytesTotal: 0,
+ position: 0,
+ durationEstimate: 0
+ }, // used to track "last good known" values before sound finish/reset for anim
+ animating: false,
+ oAnim: new Animator({
+ duration: self.config.animDuration,
+ transition:self.config.animTransition,
+ onComplete: function() {
+ // var thisSound = this;
+ // thisSound._360data.didFinish = false; // reset full circle
+ }
+ }),
+ oAnimProgress: function(nProgress) {
+ var thisSound = this;
+ thisSound._360data.radius = parseInt(thisSound._360data.radiusMax*thisSound._360data.amplifier*nProgress);
+ thisSound._360data.width = parseInt(thisSound._360data.widthMax*thisSound._360data.amplifier*nProgress);
+ if (self.config.scaleFont && self.config.fontSizeMax != null) {
+ thisSound._360data.oTiming.style.fontSize = parseInt(Math.max(1,self.config.fontSizeMax*nProgress))+'px';
+ thisSound._360data.oTiming.style.opacity = nProgress;
+ }
+ if (thisSound.paused || thisSound.playState == 0 || thisSound._360data.lastValues.bytesLoaded == 0 || thisSound._360data.lastValues.position == 0) {
+ self.updatePlaying.apply(thisSound);
+ }
+ },
+ fps: 0
+ };
+
+ // "Metadata" (annotations)
+ if (typeof self.Metadata != 'undefined' && self.getElementsByClassName('metadata','div',thisSound._360data.oUI360).length) {
+ thisSound._360data.metadata = new self.Metadata(thisSound,self);
+ }
+
+ // set the cover width/height to match the canvas
+ thisSound._360data.oCover.style.width = self.config.circleDiameter+'px';
+ thisSound._360data.oCover.style.height = self.config.circleDiameter+'px';
+
+ // minimize ze font
+ if (self.config.scaleFont && self.config.fontSizeMax != null) {
+ thisSound._360data.oTiming.style.fontSize = '1px';
+ }
+
+ // set up ze animation
+ thisSound._360data.oAnim.addSubject(thisSound._360data.oAnimProgress,thisSound);
+
+ // animate the radius out nice
+ self.refreshCoords(thisSound);
+
+ self.updatePlaying.apply(thisSound);
+
+ self.soundsByURL[soundURL] = thisSound;
+ self.sounds.push(thisSound);
+ if (self.lastSound) {
+ self.stopSound(self.lastSound);
+ }
+ thisSound.play();
+ }
+
+ self.lastSound = thisSound; // reference for next call
+
+ if (typeof e != 'undefined' && typeof e.preventDefault != 'undefined') {
+ e.preventDefault();
+ } else if (typeof event != 'undefined') {
+ event.returnValue = false;
+ }
+ return false;
+ }
+
+ this.fanOut = function(oSound) {
+ var thisSound = oSound;
+ if (thisSound._360data.animating == 1) {
+ return false;
+ }
+ thisSound._360data.animating = 0;
+ soundManager._writeDebug('fanOut: '+thisSound.sID+': '+thisSound._360data.oLink.href);
+ thisSound._360data.oAnim.seekTo(1); // play to end
+ window.setTimeout(function() {
+ // oncomplete hack
+ thisSound._360data.animating = 0;
+ },self.config.animDuration+20);
+ }
+
+ this.fanIn = function(oSound) {
+ var thisSound = oSound;
+ if (thisSound._360data.animating == -1) {
+ return false;
+ }
+ thisSound._360data.animating = -1;
+ soundManager._writeDebug('fanIn: '+thisSound.sID+': '+thisSound._360data.oLink.href);
+ // massive hack
+ thisSound._360data.oAnim.seekTo(0); // play to end
+ window.setTimeout(function() {
+ // reset full 360 fill after animation has completed (oncomplete hack)
+ thisSound._360data.didFinish = false;
+ thisSound._360data.animating = 0;
+ self.resetLastValues(thisSound);
+ },self.config.animDuration+20);
+
+ }
+
+ this.resetLastValues = function(oSound) {
+ var oData = oSound._360data;
+ oData.lastValues.position = 0;
+ // oData.lastValues.bytesLoaded = 0; // will likely be cached, if file is small
+ // oData.lastValues.bytesTotal = 0;
+ // oData.lastValues.durationEstimate = 0;
+ }
+
+ this.refreshCoords = function(thisSound) {
+ thisSound._360data.canvasXY = self.findXY(thisSound._360data.oCanvas);
+ // thisSound._360data.canvasMid = [Math.floor(thisSound._360data.oCanvas.offsetWidth/2), Math.floor(thisSound._360data.oCanvas.offsetHeight/2)]; // doesn't work in IE, w/h are wrong
+ thisSound._360data.canvasMid = [self.config.circleRadius,self.config.circleRadius];
+ thisSound._360data.canvasMidXY = [thisSound._360data.canvasXY[0]+thisSound._360data.canvasMid[0], thisSound._360data.canvasXY[1]+thisSound._360data.canvasMid[1]];
+ }
+
+ this.stopSound = function(oSound) {
+ soundManager._writeDebug('stopSound: '+oSound.sID);
+ soundManager.stop(oSound.sID);
+ soundManager.unload(oSound.sID);
+ }
+
+ this.buttonClick = function(e) {
+ var o = e?(e.target?e.target:e.srcElement):event.srcElement;
+ self.handleClick({target:self.getParentByClassName(o,'sm2-360ui').nextSibling}); // link next to the nodes we inserted
+ return false;
+ }
+
+ this.buttonMouseDown = function(e) {
+ // user might decide to drag from here
+ // watch for mouse move
+ if (!isTouchDevice) {
+ document.onmousemove = function(e) {
+ // should be boundary-checked, really (eg. move 3px first?)
+ self.mouseDown(e);
+ }
+ } else {
+ self.addEventHandler(document,'touchmove',self.mouseDown);
+ }
+ self.stopEvent(e);
+ return false;
+ }
+
+ this.mouseDown = function(e) {
+ if (!self.lastSound) {
+ self.stopEvent(e);
+ return false;
+ }
+ var thisSound = self.lastSound;
+ // just in case, update coordinates (maybe the element moved since last time.)
+ self.refreshCoords(thisSound);
+ var oData = self.lastSound._360data;
+ self.addClass(oData.oUIBox,'sm2_dragging');
+ oData.pauseCount = (self.lastSound.paused?1:0);
+ // self.lastSound.pause();
+ self.mmh(e?e:event);
+ if (isTouchDevice) {
+ self.removeEventHandler(document,'touchmove',self.mouseDown);
+ self.addEventHandler(document,'touchmove',self.mmh);
+ self.addEventHandler(document,'touchend',self.mouseUp);
+ } else {
+ document.onmousemove = self.mmh;
+ document.onmouseup = self.mouseUp;
+ }
+ self.stopEvent(e);
+ return false;
+ }
+
+ this.mouseUp = function(e) {
+ var oData = self.lastSound._360data;
+ self.removeClass(oData.oUIBox,'sm2_dragging');
+ if (oData.pauseCount == 0) {
+ self.lastSound.resume();
+ }
+ if (!isTouchDevice) {
+ document.onmousemove = null;
+ document.onmouseup = null;
+ } else {
+ self.removeEventHandler(document,'touchmove',self.mmh);
+ self.removeEventHandler(document,'touchend',self.mouseUP);
+ }
+ }
+
+ var fullCircle = 360;
+
+ this.mmh = function(e) {
+ if (typeof e == 'undefined') {
+ var e = event;
+ }
+ var oSound = self.lastSound;
+ var coords = self.getMouseXY(e);
+ var x = coords[0];
+ var y = coords[1];
+ var deltaX = x-oSound._360data.canvasMidXY[0];
+ var deltaY = y-oSound._360data.canvasMidXY[1];
+ var angle = Math.floor(fullCircle-(self.rad2deg(Math.atan2(deltaX,deltaY))+180));
+ oSound.setPosition(oSound.durationEstimate*(angle/fullCircle));
+ self.stopEvent(e);
+ return false;
+ }
+
+ // assignMouseDown();
+
+ this.drawSolidArc = function(oCanvas, color, radius, width, radians, startAngle, noClear) {
+
+ // thank you, http://www.snipersystems.co.nz/community/polarclock/tutorial.html
+
+ var x = radius;
+ var y = radius;
+
+ var canvas = oCanvas;
+
+ if (canvas.getContext){
+ // use getContext to use the canvas for drawing
+ var ctx = canvas.getContext('2d');
+ }
+
+ // var startAngle = 0;
+ var oCanvas = ctx;
+
+ if (!noClear) {
+ self.clearCanvas(canvas);
+ }
+ // ctx.restore();
+
+ if (color) {
+ ctx.fillStyle = color;
+ } else {
+ // ctx.fillStyle = 'black';
+ }
+
+ oCanvas.beginPath();
+
+ if (isNaN(radians)) {
+ radians = 0;
+ }
+
+ var innerRadius = radius-width;
+ var doesntLikeZero = (isOpera || isSafari); // safari 4 doesn't actually seem to mind.
+
+ if (!doesntLikeZero || (doesntLikeZero && radius > 0)) {
+ oCanvas.arc(0, 0, radius, startAngle, radians, false);
+ var endPoint = self.getArcEndpointCoords(innerRadius, radians);
+ oCanvas.lineTo(endPoint.x, endPoint.y);
+ oCanvas.arc(0, 0, innerRadius, radians, startAngle, true);
+ oCanvas.closePath();
+ oCanvas.fill();
+ }
+
+ }
+
+ this.getArcEndpointCoords = function(radius, radians) {
+ return {
+ x: radius * Math.cos(radians),
+ y: radius * Math.sin(radians)
+ };
+ }
+
+
+this.deg2rad = function(nDeg) {
+ return (nDeg * Math.PI/180);
+}
+
+this.rad2deg = function(nRad) {
+ return (nRad * 180/Math.PI);
+}
+
+this.getTime = function(nMSec,bAsString) {
+ // convert milliseconds to mm:ss, return as object literal or string
+ var nSec = Math.floor(nMSec/1000);
+ var min = Math.floor(nSec/60);
+ var sec = nSec-(min*60);
+ // if (min == 0 && sec == 0) return null; // return 0:00 as null
+ return (bAsString?(min+':'+(sec<10?'0'+sec:sec)):{'min':min,'sec':sec});
+}
+
+this.clearCanvas = function(oCanvas) {
+ var canvas = oCanvas;
+ var ctx = null;
+ if (canvas.getContext){
+ // use getContext to use the canvas for drawing
+ ctx = canvas.getContext('2d');
+ }
+ var width = canvas.offsetWidth;
+ var height = canvas.offsetHeight;
+ ctx.clearRect(-(width/2), -(height/2), width, height);
+}
+
+
+var fullCircle = (isOpera||isChrome?359.9:360); // I dunno what Opera doesn't like about this.
+
+this.updatePlaying = function() {
+ if (this.bytesLoaded) {
+ this._360data.lastValues.bytesLoaded = this.bytesLoaded;
+ this._360data.lastValues.bytesTotal = this.bytesTotal;
+ }
+ if (this.position) {
+ this._360data.lastValues.position = this.position;
+ }
+ if (this.durationEstimate) {
+ this._360data.lastValues.durationEstimate = this.durationEstimate;
+ }
+
+ self.drawSolidArc(this._360data.oCanvas,self.config.backgroundRingColor,this._360data.width,this._360data.radius,self.deg2rad(fullCircle),false);
+
+ self.drawSolidArc(this._360data.oCanvas,(this._360data.metadata?self.config.loadRingColorMetadata:self.config.loadRingColor),this._360data.width,this._360data.radius,self.deg2rad(fullCircle*(this._360data.lastValues.bytesLoaded/this._360data.lastValues.bytesTotal)),0,true);
+
+ if (this._360data.lastValues.position != 0) {
+ // don't draw if 0 (full black circle in Opera)
+ self.drawSolidArc(this._360data.oCanvas,(this._360data.metadata?self.config.playRingColorMetadata:self.config.playRingColor),this._360data.width,this._360data.radius,self.deg2rad((this._360data.didFinish==1?fullCircle:fullCircle*(this._360data.lastValues.position/this._360data.lastValues.durationEstimate))),0,true);
+ }
+
+ // metadata goes here
+ if (this._360data.metadata) {
+ this._360data.metadata.events.whileplaying();
+ }
+
+ var timeNow = (self.config.showHMSTime?self.getTime(this.position,true):parseInt(this.position/1000));
+
+ if (timeNow != this._360data.lastTime) {
+ this._360data.lastTime = timeNow;
+ this._360data.oTiming.innerHTML = timeNow;
+ }
+
+ // draw spectrum, if applicable
+ if (!isIE) { // IE can render maybe 3 or 4 FPS when including the wave/EQ, so don't bother.
+ self.updateWaveform(this);
+ // self.updateWaveformOld(this);
+ }
+
+ if (self.config.useFavIcon && self.vuMeter) {
+ self.vuMeter.updateVU(this);
+ }
+
+}
+
+ this.updateWaveform = function(oSound) {
+
+ if ((!self.config.useWaveformData && !self.config.useEQData) || (!sm.features.waveformData && !sm.features.eqData)) {
+ // feature not enabled..
+ return false;
+ }
+
+ if (!oSound.waveformData.left.length && !oSound.eqData.length && !oSound.peakData.left) {
+ // no data (or errored out/paused/unavailable?)
+ return false;
+ }
+
+ /* use for testing the data */
+ /*
+ for (i=0; i<256; i++) {
+ oSound.eqData[i] = 1-(i/256);
+ }
+ */
+
+ var oCanvas = oSound._360data.oCanvas.getContext('2d');
+ var offX = 0;
+ var offY = parseInt(self.config.circleDiameter/2);
+ var scale = offY/2; // Y axis (+/- this distance from 0)
+ var lineWidth = Math.floor(self.config.circleDiameter-(self.config.circleDiameter*0.175)/(self.config.circleDiameter/255)); // width for each line
+ lineWidth = 1;
+ var lineHeight = 1;
+ var thisY = 0;
+ var offset = offY;
+
+ if (self.config.useWaveformData) {
+ // raw waveform
+ var downSample = self.config.waveformDataDownsample; // only sample X in 256 (greater number = less sample points)
+ downSample = Math.max(1,downSample); // make sure it's at least 1
+ var dataLength = 256;
+ var sampleCount = (dataLength/downSample);
+ var startAngle = 0;
+ var endAngle = 0;
+ var waveData = null;
+ var innerRadius = (self.config.waveformDataOutside?1:(self.config.waveformDataConstrain?0.5:0.565));
+ var scale = (self.config.waveformDataOutside?0.7:0.75);
+ var perItemAngle = self.deg2rad((360/sampleCount)*self.config.waveformDataLineRatio); // 0.85 = clean pixel lines at 150? // self.deg2rad(360*(Math.max(1,downSample-1))/sampleCount);
+ for (var i=0; i<dataLength; i+=downSample) {
+ startAngle = self.deg2rad(360*(i/(sampleCount)*1/downSample)); // +0.67 - counter for spacing
+ endAngle = startAngle+perItemAngle;
+ waveData = oSound.waveformData.left[i];
+ if (waveData<0 && self.config.waveformDataConstrain) {
+ waveData = Math.abs(waveData);
+ }
+ self.drawSolidArc(oSound._360data.oCanvas,self.config.waveformDataColor,oSound._360data.width*innerRadius,oSound._360data.radius*scale*1.25*waveData,endAngle,startAngle,true);
+ }
+ }
+
+ if (self.config.useEQData) {
+ // EQ spectrum
+ var downSample = self.config.eqDataDownsample; // only sample N in 256
+ var yDiff = 0;
+ downSample = Math.max(1,downSample); // make sure it's at least 1
+ var eqSamples = 192; // drop the last 25% of the spectrum (>16500 Hz), most stuff won't actually use it.
+ var sampleCount = (eqSamples/downSample);
+ var innerRadius = (self.config.eqDataOutside?1:0.565);
+ var direction = (self.config.eqDataOutside?-1:1);
+ var scale = (self.config.eqDataOutside?0.5:0.75);
+ var startAngle = 0;
+ var endAngle = 0;
+ var perItemAngle = self.deg2rad((360/sampleCount)*self.config.eqDataLineRatio); // self.deg2rad(360/(sampleCount+1));
+ var playedAngle = self.deg2rad((oSound._360data.didFinish==1?360:360*(oSound._360data.lastValues.position/oSound._360data.lastValues.durationEstimate)));
+ var j=0;
+ var iAvg = 0;
+ for (var i=0; i<eqSamples; i+=downSample) {
+ startAngle = self.deg2rad(360*(i/eqSamples));
+ endAngle = startAngle+perItemAngle;
+ self.drawSolidArc(oSound._360data.oCanvas,(endAngle>playedAngle?self.config.eqDataColor:self.config.playRingColor),oSound._360data.width*innerRadius,oSound._360data.radius*scale*(oSound.eqData.left[i]*direction),endAngle,startAngle,true);
+ }
+ }
+
+ if (self.config.usePeakData) {
+ if (!oSound._360data.animating) {
+ var nPeak = (oSound.peakData.left||oSound.peakData.right);
+ // GIANT HACK: use EQ spectrum data for bass frequencies
+ var eqSamples = 3;
+ for (var i=0; i<eqSamples; i++) {
+ nPeak = (nPeak||oSound.eqData[i]);
+ }
+ oSound._360data.amplifier = (self.config.useAmplifier?(0.9+(nPeak*0.1)):1);
+ oSound._360data.radiusMax = self.config.circleDiameter*0.175*oSound._360data.amplifier;
+ oSound._360data.widthMax = self.config.circleDiameter*0.4*oSound._360data.amplifier;
+ oSound._360data.radius = parseInt(oSound._360data.radiusMax*oSound._360data.amplifier);
+ oSound._360data.width = parseInt(oSound._360data.widthMax*oSound._360data.amplifier);
+ }
+ }
+
+ }
+
+ this.updateWaveformOld = function(oSound) {
+
+ if ((!self.config.useWaveformData && !self.config.useEQData && !self.config.usePeakData) || (!sm.features.waveformData && !sm.features.eqData && !sm.features.peakData)) {
+ // feature not enabled..
+ return false;
+ }
+
+ if (!oSound.waveformData.left.length && !oSound.eqData.length && !oSound.peakData.left.length) {
+ // no data (or errored out/paused/unavailable?)
+ return false;
+ }
+
+ var oCanvas = oSound._360data.oCanvas.getContext('2d');
+ var offX = 0;
+ var offY = parseInt(self.config.circleDiameter*2/3);
+ var scale = offY*1/3; // Y axis (+/- this distance from 0)
+ var downSample = 1;
+ downSample = Math.max(1,downSample);
+ var j = oSound.waveformData.left.length;
+ var lineWidth = Math.max(1,((j*1/downSample)/self.config.circleDiameter));
+ var lineHeight = scale*2.5;
+ var thisY = 0;
+ var offset = offY;
+ var rotateDeg = -90;
+ oCanvas.rotate(self.deg2rad(rotateDeg*-1)); // compensate for arc starting at EAST // http://stackoverflow.com/questions/319267/tutorial-for-html-canvass-arc-function
+ oCanvas.translate(-self.config.circleRadius,-self.config.circleRadius);
+
+ if (self.config.useWaveformData) {
+ for (var i=0; i<j; i+=downSample) {
+ thisY = offY+(oSound.waveformData.left[i]*scale);
+ oCanvas.fillRect((i/j*(self.config.circleDiameter-lineWidth)+1),thisY,lineWidth,lineHeight);
+ }
+ } else {
+ // EQ spectrum
+ var offset = 9;
+ var yDiff = 0;
+ for (var i=0; i<128; i+=4) {
+ yDiff = oSound.eqData[i]*scale;
+ oCanvas.fillRect(i/128*(self.config.circleDiameter-4),self.config.circleDiameter-yDiff,lineWidth*3,yDiff);
+ }
+ }
+
+ // finished drawing..
+ oCanvas.translate(self.config.circleRadius,self.config.circleRadius);
+ oCanvas.rotate(self.deg2rad(rotateDeg)); // compensate for arc starting at EAST
+
+ }
+
+ this.callbackCount = 0;
+ this.peakDataHistory = [];
+
+ this.getUIHTML = function() {
+ return [
+ '<canvas class="sm2-canvas" width="'+self.config.circleDiameter+'" height="'+self.config.circleDiameter+'"></canvas>',
+ ' <img src="'+self.config.imageRoot+'empty.gif" class="sm2-360btn sm2-360btn-default" style="border:none" />', // note use of imageMap, edit or remove if you use a different-size image.
+ ' <div class="sm2-timing'+(navigator.userAgent.match(/safari/i)?' alignTweak':'')+'"></div>', // + Ever-so-slight Safari horizontal alignment tweak
+ ' <div class="sm2-cover"></div>'
+ ];
+ }
+
+ this.init = function() {
+ sm._writeDebug('threeSixtyPlayer.init()');
+ var oItems = self.getElementsByClassName('ui360','div');
+ var oLinks = [];
+
+ for (var i=0,j=oItems.length; i<j; i++) {
+ oLinks.push(oItems[i].getElementsByTagName('a')[0]);
+ // remove "fake" play button (unsupported case)
+ oItems[i].style.backgroundImage = 'none';
+ }
+ // grab all links, look for .mp3
+ var foundItems = 0;
+ var oCanvas = null;
+ var oCanvasCTX = null;
+ var oCover = null;
+
+ self.oUITemplate = document.createElement('div');
+ self.oUITemplate.className = 'sm2-360ui';
+
+ // fake a 360 UI so we can get some numbers from CSS, etc.
+
+ var oFakeUI = document.createElement('div');
+ oFakeUI.className = 'ui360';
+
+ var oFakeUIBox = oFakeUI.appendChild(self.oUITemplate.cloneNode(true));
+ oFakeUI.style.position = 'absolute';
+ oFakeUI.style.left = '-9999px';
+ var uiHTML = self.getUIHTML();
+
+ oFakeUIBox.innerHTML = uiHTML[1]+uiHTML[2]+uiHTML[3];
+ delete uiHTML;
+
+ var oTemp = document.body.appendChild(oFakeUI);
+
+ self.config.circleDiameter = parseInt(oFakeUIBox.offsetWidth);
+ self.config.circleRadius = parseInt(self.config.circleDiameter/2);
+ var oTiming = self.getElementsByClassName('sm2-timing','div',oTemp)[0];
+ self.config.fontSizeMax = parseInt(self.getStyle(oTiming,'font-size'));
+ if (isNaN(self.config.fontSizeMax)) {
+ // getStyle() etc. didn't work.
+ self.config.fontSizeMax = null;
+ }
+ // soundManager._writeDebug('diameter, font size: '+self.config.circleDiameter+','+self.config.fontSizeMax);
+
+ oFakeUI.parentNode.removeChild(oFakeUI);
+ delete oFakeUI;
+ delete oFakeUIBox;
+ delete oTemp;
+
+ // canvas needs inline width and height, doesn't quite work otherwise
+ self.oUITemplate.innerHTML = self.getUIHTML().join('');
+
+ for (i=0,j=oLinks.length; i<j; i++) {
+ if (sm.canPlayLink(oLinks[i]) && !self.hasClass(oLinks[i],self.excludeClass)) {
+ self.addClass(oLinks[i],self.css.sDefault); // add default CSS decoration
+ self.links[foundItems] = (oLinks[i]);
+ self.indexByURL[oLinks[i].href] = foundItems; // hack for indexing
+ foundItems++;
+ // add canvas shiz
+ var oUI = oLinks[i].parentNode.insertBefore(self.oUITemplate.cloneNode(true),oLinks[i]);
+
+ if (isIE && typeof G_vmlCanvasManager != 'undefined') { // IE only
+ var o = oLinks[i].parentNode;
+ var o2 = document.createElement('canvas');
+ o2.className = 'sm2-canvas';
+ var oID = 'sm2_canvas_'+parseInt(Math.random()*1048576);
+ o2.id = oID;
+ o2.width = self.config.circleDiameter;
+ o2.height = self.config.circleDiameter;
+ oUI.appendChild(o2);
+ G_vmlCanvasManager.initElement(o2); // Apply ExCanvas compatibility magic
+ oCanvas = document.getElementById(oID);
+ } else {
+ // add a handler for the button
+ oCanvas = oLinks[i].parentNode.getElementsByTagName('canvas')[0];
+ }
+ oCover = self.getElementsByClassName('sm2-cover','div',oLinks[i].parentNode)[0];
+ var oBtn = oLinks[i].parentNode.getElementsByTagName('img')[0];
+ var oBtn = oLinks[i].parentNode.getElementsByTagName('img')[0]
+ self.addEventHandler(oBtn,'click',self.buttonClick);
+ if (!isTouchDevice) {
+ self.addEventHandler(oCover,'mousedown',self.mouseDown);
+ } else {
+ self.addEventHandler(oCover,'touchstart',self.mouseDown);
+ }
+ oCanvasCTX = oCanvas.getContext('2d');
+ oCanvasCTX.translate(self.config.circleRadius,self.config.circleRadius);
+ oCanvasCTX.rotate(self.deg2rad(-90)); // compensate for arc starting at EAST // http://stackoverflow.com/questions/319267/tutorial-for-html-canvass-arc-function
+ }
+ }
+ if (foundItems>0) {
+ self.addEventHandler(document,'click',self.handleClick);
+ if (self.config.autoPlay) {
+ self.handleClick({target:self.links[0],preventDefault:function(){}});
+ }
+ }
+ sm._writeDebug('threeSixtyPlayer.init(): Found '+foundItems+' relevant items.');
+
+ if (self.config.useFavIcon && typeof this.VUMeter != 'undefined') {
+ this.vuMeter = new this.VUMeter(this);
+ }
+
+ }
+
+}
+
+// Optional: VU Meter component
+
+ThreeSixtyPlayer.prototype.VUMeter = function(oParent) {
+
+ var self = oParent;
+ var me = this;
+ this.vuMeterData = [];
+ this.vuDataCanvas = null;
+ var _head = document.getElementsByTagName('head')[0];
+ var isOpera = (navigator.userAgent.match(/opera/i));
+ var isFirefox = (navigator.userAgent.match(/firefox/i));
+
+ this.setPageIcon = function(sDataURL) {
+
+ if (!self.config.useFavIcon || !self.config.usePeakData || !sDataURL) {
+ return false;
+ }
+
+ var link = document.getElementById('sm2-favicon');
+ if (link) {
+ _head.removeChild(link);
+ link = null;
+ }
+ if (!link) {
+ link = document.createElement('link');
+ link.id = 'sm2-favicon';
+ link.rel = 'shortcut icon';
+ link.type = 'image/png';
+ link.href = sDataURL;
+ document.getElementsByTagName('head')[0].appendChild(link);
+ }
+ }
+
+ this.resetPageIcon = function() {
+ if (!self.config.useFavIcon) {
+ return false;
+ }
+ var link = document.getElementById('favicon');
+ if (link) {
+ link.href = '/favicon.ico';
+ }
+ }
+
+ this.updateVU = function(oSound) {
+ if (soundManager.flashVersion >= 9 && self.config.useFavIcon && self.config.usePeakData) {
+ me.setPageIcon(me.vuMeterData[parseInt(16*oSound.peakData.left)][parseInt(16*oSound.peakData.right)]);
+ }
+ }
+
+ this.createVUData = function() {
+ var i=0;
+ var j=0;
+ var canvas = me.vuDataCanvas.getContext('2d');
+ var vuGrad = canvas.createLinearGradient(0, 16, 0, 0);
+ vuGrad.addColorStop(0,'rgb(0,192,0)');
+ vuGrad.addColorStop(0.30,'rgb(0,255,0)');
+ vuGrad.addColorStop(0.625,'rgb(255,255,0)');
+ vuGrad.addColorStop(0.85,'rgb(255,0,0)');
+ var bgGrad = canvas.createLinearGradient(0, 16, 0, 0);
+ var outline = 'rgba(0,0,0,0.2)';
+ bgGrad.addColorStop(0,outline);
+ bgGrad.addColorStop(1,'rgba(0,0,0,0.5)');
+ for (i=0; i<16; i++) {
+ me.vuMeterData[i] = [];
+ }
+ for (var i=0; i<16; i++) {
+ for (j=0; j<16; j++) {
+ // reset/erase canvas
+ me.vuDataCanvas.setAttribute('width',16);
+ me.vuDataCanvas.setAttribute('height',16);
+ // draw new stuffs
+ canvas.fillStyle = bgGrad;
+ canvas.fillRect(0,0,7,15);
+ canvas.fillRect(8,0,7,15);
+ /*
+ // shadow
+ canvas.fillStyle = 'rgba(0,0,0,0.1)';
+ canvas.fillRect(1,15-i,7,17-(17-i));
+ canvas.fillRect(9,15-j,7,17-(17-j));
+ */
+ canvas.fillStyle = vuGrad;
+ canvas.fillRect(0,15-i,7,16-(16-i));
+ canvas.fillRect(8,15-j,7,16-(16-j));
+ // and now, clear out some bits.
+ canvas.clearRect(0,3,16,1);
+ canvas.clearRect(0,7,16,1);
+ canvas.clearRect(0,11,16,1);
+ me.vuMeterData[i][j] = me.vuDataCanvas.toDataURL('image/png');
+ // for debugging VU images
+ /*
+ var o = document.createElement('img');
+ o.style.marginRight = '5px';
+ o.src = vuMeterData[i][j];
+ document.documentElement.appendChild(o);
+ */
+ }
+ }
+ };
+
+ this.testCanvas = function(noOpaque) {
+ // canvas + toDataURL();
+ var c = document.createElement('canvas');
+ var ctx = null;
+ if (!c || typeof c.getContext == 'undefined') {
+ return null;
+ }
+ ctx = c.getContext('2d');
+ if (!ctx || typeof c.toDataURL != 'function') {
+ return null;
+ }
+ // just in case..
+ try {
+ var ok = c.toDataURL('image/png');
+ } catch(e) {
+ // no canvas or no toDataURL()
+ return null;
+ }
+ // assume we're all good.
+ return c;
+ }
+
+ this.init = function() {
+ if (self.config.useFavIcon) {
+ me.vuDataCanvas = me.testCanvas(true);
+ if (me.vuDataCanvas && (isFirefox || isOpera)) {
+ // these browsers support dynamically-updating the favicon
+ me.createVUData();
+ } else {
+ // browser doesn't support doing this
+ self.config.useFavIcon = false;
+ }
+ }
+ }
+
+ this.init();
+
+}
+
+// completely optional: Metadata/annotations/segments code
+
+ThreeSixtyPlayer.prototype.Metadata = function(oSound, oParent) {
+ soundManager._wD('Metadata()');
+ var me = this;
+ var oBox = oSound._360data.oUI360;
+ var o = oBox.getElementsByTagName('ul')[0];
+ var oItems = o.getElementsByTagName('li');
+ var isFirefox = (navigator.userAgent.match(/firefox/i));
+ this.lastWPExec = 0;
+ this.refreshInterval = 250;
+
+ var isAlt = false;
+
+ this.events = {
+ whileplaying: function() {
+ var width = oSound._360data.width;
+ var radius = oSound._360data.radius;
+ var fullDuration = (oSound.durationEstimate||(me.totalTime*1000));
+ var isAlt = null;
+ for (var i=0,j=me.data.length; i<j; i++) {
+ isAlt = (i%2==0);
+ oParent.drawSolidArc(oSound._360data.oCanvas,(isAlt?oParent.config.segmentRingColorAlt:oParent.config.segmentRingColor),isAlt?width:width, isAlt?radius/2:radius/2, oParent.deg2rad(360*(me.data[i].endTimeMS/fullDuration)), oParent.deg2rad(360*((me.data[i].startTimeMS||1)/fullDuration)), true);
+ }
+ var d = new Date();
+ if (d-me.lastWPExec>me.refreshInterval) {
+ me.refresh();
+ me.lastWPExec = d;
+ }
+ }
+ }
+
+ this.refresh = function() {
+ // Display info as appropriate
+ var index = null;
+ var now = oSound.position;
+ var metadata = oSound._360data.metadata.data;
+ for (var i=0, j=metadata.length; i<j; i++) {
+ if (now >= metadata[i].startTimeMS && now <= metadata[i].endTimeMS) {
+ index = i;
+ break;
+ }
+ }
+ if (index != metadata.currentItem && index < metadata.length) {
+ // update
+ oSound._360data.oLink.innerHTML = metadata.mainTitle+' <span class="metadata"><span class="sm2_divider"> | </span><span class="sm2_metadata">'+metadata[index].title+'</span></span>';
+ // self.setPageTitle(metadata[index].title+' | '+metadata.mainTitle);
+ metadata.currentItem = index;
+ }
+ }
+
+ this.totalTime = 0;
+
+ this.strToTime = function(sTime) {
+ var segments = sTime.split(':');
+ var seconds = 0;
+ for (var i=segments.length; i--;) {
+ seconds += parseInt(segments[i])*Math.pow(60,segments.length-1-i,10); // hours, minutes
+ }
+ return seconds;
+ }
+
+ this.data = [];
+ this.data.givenDuration = null;
+ this.data.currentItem = null;
+ this.data.mainTitle = oSound._360data.oLink.innerHTML;
+ for (var i=0; i<oItems.length; i++) {
+ this.data[i] = {
+ o: null,
+ title: oItems[i].getElementsByTagName('p')[0].innerHTML,
+ startTime: oItems[i].getElementsByTagName('span')[0].innerHTML,
+ startSeconds: me.strToTime(oItems[i].getElementsByTagName('span')[0].innerHTML.replace(/[()]/g,'')),
+ duration: 0,
+ durationMS: null,
+ startTimeMS: null,
+ endTimeMS: null,
+ oNote: null
+ }
+ }
+ var oDuration = oParent.getElementsByClassName('duration','div',oBox);
+ this.data.givenDuration = (oDuration.length?me.strToTime(oDuration[0].innerHTML)*1000:0);
+ for (i=0; i<this.data.length; i++) {
+ this.data[i].duration = parseInt(this.data[i+1]?this.data[i+1].startSeconds:(me.data.givenDuration?me.data.givenDuration:oSound.durationEstimate)/1000)-this.data[i].startSeconds;
+ this.data[i].startTimeMS = this.data[i].startSeconds*1000;
+ this.data[i].durationMS = this.data[i].duration*1000;
+ this.data[i].endTimeMS = this.data[i].startTimeMS+this.data[i].durationMS;
+ this.totalTime += this.data[i].duration;
+ }
+}
+
+var threeSixtyPlayer = null;
+
+if (navigator.userAgent.match(/webkit/i) && navigator.userAgent.match(/mobile/i)) {
+ // iPad, iPhone etc.
+ soundManager.useHTML5Audio = true;
+}
+
+soundManager.debugMode = (window.location.href.match(/debug=1/i)); // disable or enable debug output
+soundManager.consoleOnly = true;
+soundManager.flashVersion = 9;
+soundManager.useHighPerformance = true;
+soundManager.useFlashBlock = true;
+
+// soundManager.useFastPolling = true; // for more aggressive, faster UI updates (higher CPU use)
+
+// FPS data, testing/debug only
+if (soundManager.debugMode) {
+ var t = window.setInterval(function(){
+ if (threeSixtyPlayer && threeSixtyPlayer.lastSound && threeSixtyPlayer.lastSound._360data.fps && typeof window.isHome === 'undefined') {
+ soundManager._writeDebug('fps: ~'+threeSixtyPlayer.lastSound._360data.fps);
+ threeSixtyPlayer.lastSound._360data.fps = 0;
+ }
+ },1000);
+}
+
+threeSixtyPlayer = new ThreeSixtyPlayer();
+
+if (threeSixtyPlayer.config.useWaveformData) {
+ soundManager.flash9Options.useWaveformData = true;
+}
+if (threeSixtyPlayer.config.useEQData) {
+ soundManager.flash9Options.useEQData = true;
+}
+if (threeSixtyPlayer.config.usePeakData) {
+ soundManager.flash9Options.usePeakData = true;
+}
+
+soundManager.onready(function(){
+ if (soundManager.supported()) {
+ // soundManager.createSound() etc. may now be called
+ threeSixtyPlayer.init();
+ }
+});
\ No newline at end of file diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/script/berniecode-animator.js b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/script/berniecode-animator.js new file mode 100755 index 0000000..1e852e5 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/script/berniecode-animator.js @@ -0,0 +1,674 @@ +/*
+ Animator.js 1.1.9
+
+ This library is released under the BSD license:
+
+ Copyright (c) 2006, Bernard Sumption. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer. Redistributions in binary
+ form must reproduce the above copyright notice, this list of conditions and
+ the following disclaimer in the documentation and/or other materials
+ provided with the distribution. Neither the name BernieCode nor
+ the names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ DAMAGE.
+
+*/
+
+// http://www.berniecode.com/writing/animator.html
+
+// Applies a sequence of numbers between 0 and 1 to a number of subjects
+// construct - see setOptions for parameters
+function Animator(options) {
+ this.setOptions(options);
+ var _this = this;
+ this.timerDelegate = function(){_this.onTimerEvent()};
+ this.subjects = [];
+ this.subjectScopes = [];
+ this.target = 0;
+ this.state = 0;
+ this.lastTime = null;
+};
+Animator.prototype = {
+ // apply defaults
+ setOptions: function(options) {
+ this.options = Animator.applyDefaults({
+ interval: 20, // time between animation frames
+ duration: 400, // length of animation
+ onComplete: function(){},
+ onStep: function(){},
+ transition: Animator.tx.easeInOut
+ }, options);
+ },
+ // animate from the current state to provided value
+ seekTo: function(to) {
+ this.seekFromTo(this.state, to);
+ },
+ // animate from the current state to provided value
+ seekFromTo: function(from, to) {
+ this.target = Math.max(0, Math.min(1, to));
+ this.state = Math.max(0, Math.min(1, from));
+ this.lastTime = new Date().getTime();
+ if (!this.intervalId) {
+ this.intervalId = window.setInterval(this.timerDelegate, this.options.interval);
+ }
+ },
+ // animate from the current state to provided value
+ jumpTo: function(to) {
+ this.target = this.state = Math.max(0, Math.min(1, to));
+ this.propagate();
+ },
+ // seek to the opposite of the current target
+ toggle: function() {
+ this.seekTo(1 - this.target);
+ },
+ // add a function or an object with a method setState(state) that will be called with a number
+ // between 0 and 1 on each frame of the animation
+ addSubject: function(subject,scope) {
+ this.subjects[this.subjects.length] = subject;
+ this.subjectScopes[this.subjectScopes.length] = scope;
+ return this;
+ },
+ // remove all subjects
+ clearSubjects: function() {
+ this.subjects = [];
+ this.subjectScopes = [];
+ },
+ // forward the current state to the animation subjects
+ propagate: function() {
+ var value = this.options.transition(this.state);
+ for (var i=0; i<this.subjects.length; i++) {
+ if (this.subjects[i].setState) {
+ this.subjects[i].setState(value);
+ } else {
+ this.subjects[i].apply(this.subjectScopes[i],[value]);
+ }
+ }
+ },
+ // called once per frame to update the current state
+ onTimerEvent: function() {
+ var now = new Date().getTime();
+ var timePassed = now - this.lastTime;
+ this.lastTime = now;
+ var movement = (timePassed / this.options.duration) * (this.state < this.target ? 1 : -1);
+ if (Math.abs(movement) >= Math.abs(this.state - this.target)) {
+ this.state = this.target;
+ } else {
+ this.state += movement;
+ }
+
+ try {
+ this.propagate();
+ } finally {
+ this.options.onStep.call(this);
+ if (this.target == this.state) {
+ window.clearInterval(this.intervalId);
+ this.intervalId = null;
+ this.options.onComplete.call(this);
+ }
+ }
+ },
+ // shortcuts
+ play: function() {this.seekFromTo(0, 1)},
+ reverse: function() {this.seekFromTo(1, 0)},
+ // return a string describing this Animator, for debugging
+ inspect: function() {
+ var str = "#<Animator:\n";
+ for (var i=0; i<this.subjects.length; i++) {
+ str += this.subjects[i].inspect();
+ }
+ str += ">";
+ return str;
+ }
+}
+// merge the properties of two objects
+Animator.applyDefaults = function(defaults, prefs) {
+ prefs = prefs || {};
+ var prop, result = {};
+ for (prop in defaults) result[prop] = prefs[prop] !== undefined ? prefs[prop] : defaults[prop];
+ return result;
+}
+// make an array from any object
+Animator.makeArray = function(o) {
+ if (o == null) return [];
+ if (!o.length) return [o];
+ var result = [];
+ for (var i=0; i<o.length; i++) result[i] = o[i];
+ return result;
+}
+// convert a dash-delimited-property to a camelCaseProperty (c/o Prototype, thanks Sam!)
+Animator.camelize = function(string) {
+ var oStringList = string.split('-');
+ if (oStringList.length == 1) return oStringList[0];
+
+ var camelizedString = string.indexOf('-') == 0
+ ? oStringList[0].charAt(0).toUpperCase() + oStringList[0].substring(1)
+ : oStringList[0];
+
+ for (var i = 1, len = oStringList.length; i < len; i++) {
+ var s = oStringList[i];
+ camelizedString += s.charAt(0).toUpperCase() + s.substring(1);
+ }
+ return camelizedString;
+}
+// syntactic sugar for creating CSSStyleSubjects
+Animator.apply = function(el, style, options) {
+ if (style instanceof Array) {
+ return new Animator(options).addSubject(new CSSStyleSubject(el, style[0], style[1]));
+ }
+ return new Animator(options).addSubject(new CSSStyleSubject(el, style));
+}
+// make a transition function that gradually accelerates. pass a=1 for smooth
+// gravitational acceleration, higher values for an exaggerated effect
+Animator.makeEaseIn = function(a) {
+ return function(state) {
+ return Math.pow(state, a*2);
+ }
+}
+// as makeEaseIn but for deceleration
+Animator.makeEaseOut = function(a) {
+ return function(state) {
+ return 1 - Math.pow(1 - state, a*2);
+ }
+}
+// make a transition function that, like an object with momentum being attracted to a point,
+// goes past the target then returns
+Animator.makeElastic = function(bounces) {
+ return function(state) {
+ state = Animator.tx.easeInOut(state);
+ return ((1-Math.cos(state * Math.PI * bounces)) * (1 - state)) + state;
+ }
+}
+// make an Attack Decay Sustain Release envelope that starts and finishes on the same level
+//
+Animator.makeADSR = function(attackEnd, decayEnd, sustainEnd, sustainLevel) {
+ if (sustainLevel == null) sustainLevel = 0.5;
+ return function(state) {
+ if (state < attackEnd) {
+ return state / attackEnd;
+ }
+ if (state < decayEnd) {
+ return 1 - ((state - attackEnd) / (decayEnd - attackEnd) * (1 - sustainLevel));
+ }
+ if (state < sustainEnd) {
+ return sustainLevel;
+ }
+ return sustainLevel * (1 - ((state - sustainEnd) / (1 - sustainEnd)));
+ }
+}
+// make a transition function that, like a ball falling to floor, reaches the target and/
+// bounces back again
+Animator.makeBounce = function(bounces) {
+ var fn = Animator.makeElastic(bounces);
+ return function(state) {
+ state = fn(state);
+ return state <= 1 ? state : 2-state;
+ }
+}
+
+// pre-made transition functions to use with the 'transition' option
+Animator.tx = {
+ easeInOut: function(pos){
+ return ((-Math.cos(pos*Math.PI)/2) + 0.5);
+ },
+ linear: function(x) {
+ return x;
+ },
+ easeIn: Animator.makeEaseIn(1.5),
+ easeOut: Animator.makeEaseOut(1.5),
+ strongEaseIn: Animator.makeEaseIn(2.5),
+ strongEaseOut: Animator.makeEaseOut(2.5),
+ elastic: Animator.makeElastic(1),
+ veryElastic: Animator.makeElastic(3),
+ bouncy: Animator.makeBounce(1),
+ veryBouncy: Animator.makeBounce(3)
+}
+
+// animates a pixel-based style property between two integer values
+function NumericalStyleSubject(els, property, from, to, units) {
+ this.els = Animator.makeArray(els);
+ if (property == 'opacity' && window.ActiveXObject) {
+ this.property = 'filter';
+ } else {
+ this.property = Animator.camelize(property);
+ }
+ this.from = parseFloat(from);
+ this.to = parseFloat(to);
+ this.units = units != null ? units : 'px';
+}
+NumericalStyleSubject.prototype = {
+ setState: function(state) {
+ var style = this.getStyle(state);
+ var visibility = (this.property == 'opacity' && state == 0) ? 'hidden' : '';
+ var j=0;
+ for (var i=0; i<this.els.length; i++) {
+ try {
+ this.els[i].style[this.property] = style;
+ } catch (e) {
+ // ignore fontWeight - intermediate numerical values cause exeptions in firefox
+ if (this.property != 'fontWeight') throw e;
+ }
+ if (j++ > 20) return;
+ }
+ },
+ getStyle: function(state) {
+ state = this.from + ((this.to - this.from) * state);
+ if (this.property == 'filter') return "alpha(opacity=" + Math.round(state*100) + ")";
+ if (this.property == 'opacity') return state;
+ return Math.round(state) + this.units;
+ },
+ inspect: function() {
+ return "\t" + this.property + "(" + this.from + this.units + " to " + this.to + this.units + ")\n";
+ }
+}
+
+// animates a colour based style property between two hex values
+function ColorStyleSubject(els, property, from, to) {
+ this.els = Animator.makeArray(els);
+ this.property = Animator.camelize(property);
+ this.to = this.expandColor(to);
+ this.from = this.expandColor(from);
+ this.origFrom = from;
+ this.origTo = to;
+}
+
+ColorStyleSubject.prototype = {
+ // parse "#FFFF00" to [256, 256, 0]
+ expandColor: function(color) {
+ var hexColor, red, green, blue;
+ hexColor = ColorStyleSubject.parseColor(color);
+ if (hexColor) {
+ red = parseInt(hexColor.slice(1, 3), 16);
+ green = parseInt(hexColor.slice(3, 5), 16);
+ blue = parseInt(hexColor.slice(5, 7), 16);
+ return [red,green,blue]
+ }
+ if (window.DEBUG) {
+ alert("Invalid colour: '" + color + "'");
+ }
+ },
+ getValueForState: function(color, state) {
+ return Math.round(this.from[color] + ((this.to[color] - this.from[color]) * state));
+ },
+ setState: function(state) {
+ var color = '#'
+ + ColorStyleSubject.toColorPart(this.getValueForState(0, state))
+ + ColorStyleSubject.toColorPart(this.getValueForState(1, state))
+ + ColorStyleSubject.toColorPart(this.getValueForState(2, state));
+ for (var i=0; i<this.els.length; i++) {
+ this.els[i].style[this.property] = color;
+ }
+ },
+ inspect: function() {
+ return "\t" + this.property + "(" + this.origFrom + " to " + this.origTo + ")\n";
+ }
+}
+
+// return a properly formatted 6-digit hex colour spec, or false
+ColorStyleSubject.parseColor = function(string) {
+ var color = '#', match;
+ if(match = ColorStyleSubject.parseColor.rgbRe.exec(string)) {
+ var part;
+ for (var i=1; i<=3; i++) {
+ part = Math.max(0, Math.min(255, parseInt(match[i])));
+ color += ColorStyleSubject.toColorPart(part);
+ }
+ return color;
+ }
+ if (match = ColorStyleSubject.parseColor.hexRe.exec(string)) {
+ if(match[1].length == 3) {
+ for (var i=0; i<3; i++) {
+ color += match[1].charAt(i) + match[1].charAt(i);
+ }
+ return color;
+ }
+ return '#' + match[1];
+ }
+ return false;
+}
+// convert a number to a 2 digit hex string
+ColorStyleSubject.toColorPart = function(number) {
+ if (number > 255) number = 255;
+ var digits = number.toString(16);
+ if (number < 16) return '0' + digits;
+ return digits;
+}
+ColorStyleSubject.parseColor.rgbRe = /^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i;
+ColorStyleSubject.parseColor.hexRe = /^\#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;
+
+// Animates discrete styles, i.e. ones that do not scale but have discrete values
+// that can't be interpolated
+function DiscreteStyleSubject(els, property, from, to, threshold) {
+ this.els = Animator.makeArray(els);
+ this.property = Animator.camelize(property);
+ this.from = from;
+ this.to = to;
+ this.threshold = threshold || 0.5;
+}
+
+DiscreteStyleSubject.prototype = {
+ setState: function(state) {
+ var j=0;
+ for (var i=0; i<this.els.length; i++) {
+ this.els[i].style[this.property] = state <= this.threshold ? this.from : this.to;
+ }
+ },
+ inspect: function() {
+ return "\t" + this.property + "(" + this.from + " to " + this.to + " @ " + this.threshold + ")\n";
+ }
+}
+
+// animates between two styles defined using CSS.
+// if style1 and style2 are present, animate between them, if only style1
+// is present, animate between the element's current style and style1
+function CSSStyleSubject(els, style1, style2) {
+ els = Animator.makeArray(els);
+ this.subjects = [];
+ if (els.length == 0) return;
+ var prop, toStyle, fromStyle;
+ if (style2) {
+ fromStyle = this.parseStyle(style1, els[0]);
+ toStyle = this.parseStyle(style2, els[0]);
+ } else {
+ toStyle = this.parseStyle(style1, els[0]);
+ fromStyle = {};
+ for (prop in toStyle) {
+ fromStyle[prop] = CSSStyleSubject.getStyle(els[0], prop);
+ }
+ }
+ // remove unchanging properties
+ var prop;
+ for (prop in fromStyle) {
+ if (fromStyle[prop] == toStyle[prop]) {
+ delete fromStyle[prop];
+ delete toStyle[prop];
+ }
+ }
+ // discover the type (numerical or colour) of each style
+ var prop, units, match, type, from, to;
+ for (prop in fromStyle) {
+ var fromProp = String(fromStyle[prop]);
+ var toProp = String(toStyle[prop]);
+ if (toStyle[prop] == null) {
+ if (window.DEBUG) alert("No to style provided for '" + prop + '"');
+ continue;
+ }
+
+ if (from = ColorStyleSubject.parseColor(fromProp)) {
+ to = ColorStyleSubject.parseColor(toProp);
+ type = ColorStyleSubject;
+ } else if (fromProp.match(CSSStyleSubject.numericalRe)
+ && toProp.match(CSSStyleSubject.numericalRe)) {
+ from = parseFloat(fromProp);
+ to = parseFloat(toProp);
+ type = NumericalStyleSubject;
+ match = CSSStyleSubject.numericalRe.exec(fromProp);
+ var reResult = CSSStyleSubject.numericalRe.exec(toProp);
+ if (match[1] != null) {
+ units = match[1];
+ } else if (reResult[1] != null) {
+ units = reResult[1];
+ } else {
+ units = reResult;
+ }
+ } else if (fromProp.match(CSSStyleSubject.discreteRe)
+ && toProp.match(CSSStyleSubject.discreteRe)) {
+ from = fromProp;
+ to = toProp;
+ type = DiscreteStyleSubject;
+ units = 0; // hack - how to get an animator option down to here
+ } else {
+ if (window.DEBUG) {
+ alert("Unrecognised format for value of "
+ + prop + ": '" + fromStyle[prop] + "'");
+ }
+ continue;
+ }
+ this.subjects[this.subjects.length] = new type(els, prop, from, to, units);
+ }
+}
+
+CSSStyleSubject.prototype = {
+ // parses "width: 400px; color: #FFBB2E" to {width: "400px", color: "#FFBB2E"}
+ parseStyle: function(style, el) {
+ var rtn = {};
+ // if style is a rule set
+ if (style.indexOf(":") != -1) {
+ var styles = style.split(";");
+ for (var i=0; i<styles.length; i++) {
+ var parts = CSSStyleSubject.ruleRe.exec(styles[i]);
+ if (parts) {
+ rtn[parts[1]] = parts[2];
+ }
+ }
+ }
+ // else assume style is a class name
+ else {
+ var prop, value, oldClass;
+ oldClass = el.className;
+ el.className = style;
+ for (var i=0; i<CSSStyleSubject.cssProperties.length; i++) {
+ prop = CSSStyleSubject.cssProperties[i];
+ value = CSSStyleSubject.getStyle(el, prop);
+ if (value != null) {
+ rtn[prop] = value;
+ }
+ }
+ el.className = oldClass;
+ }
+ return rtn;
+
+ },
+ setState: function(state) {
+ for (var i=0; i<this.subjects.length; i++) {
+ this.subjects[i].setState(state);
+ }
+ },
+ inspect: function() {
+ var str = "";
+ for (var i=0; i<this.subjects.length; i++) {
+ str += this.subjects[i].inspect();
+ }
+ return str;
+ }
+}
+// get the current value of a css property,
+CSSStyleSubject.getStyle = function(el, property){
+ var style;
+ if(document.defaultView && document.defaultView.getComputedStyle){
+ style = document.defaultView.getComputedStyle(el, "").getPropertyValue(property);
+ if (style) {
+ return style;
+ }
+ }
+ property = Animator.camelize(property);
+ if(el.currentStyle){
+ style = el.currentStyle[property];
+ }
+ return style || el.style[property]
+}
+
+
+CSSStyleSubject.ruleRe = /^\s*([a-zA-Z\-]+)\s*:\s*(\S(.+\S)?)\s*$/;
+CSSStyleSubject.numericalRe = /^-?\d+(?:\.\d+)?(%|[a-zA-Z]{2})?$/;
+CSSStyleSubject.discreteRe = /^\w+$/;
+
+// required because the style object of elements isn't enumerable in Safari
+/*
+CSSStyleSubject.cssProperties = ['background-color','border','border-color','border-spacing',
+'border-style','border-top','border-right','border-bottom','border-left','border-top-color',
+'border-right-color','border-bottom-color','border-left-color','border-top-width','border-right-width',
+'border-bottom-width','border-left-width','border-width','bottom','color','font-size','font-size-adjust',
+'font-stretch','font-style','height','left','letter-spacing','line-height','margin','margin-top',
+'margin-right','margin-bottom','margin-left','marker-offset','max-height','max-width','min-height',
+'min-width','orphans','outline','outline-color','outline-style','outline-width','overflow','padding',
+'padding-top','padding-right','padding-bottom','padding-left','quotes','right','size','text-indent',
+'top','width','word-spacing','z-index','opacity','outline-offset'];*/
+
+
+CSSStyleSubject.cssProperties = ['azimuth','background','background-attachment','background-color','background-image','background-position','background-repeat','border-collapse','border-color','border-spacing','border-style','border-top','border-top-color','border-right-color','border-bottom-color','border-left-color','border-top-style','border-right-style','border-bottom-style','border-left-style','border-top-width','border-right-width','border-bottom-width','border-left-width','border-width','bottom','clear','clip','color','content','cursor','direction','display','elevation','empty-cells','css-float','font','font-family','font-size','font-size-adjust','font-stretch','font-style','font-variant','font-weight','height','left','letter-spacing','line-height','list-style','list-style-image','list-style-position','list-style-type','margin','margin-top','margin-right','margin-bottom','margin-left','max-height','max-width','min-height','min-width','orphans','outline','outline-color','outline-style','outline-width','overflow','padding','padding-top','padding-right','padding-bottom','padding-left','pause','position','right','size','table-layout','text-align','text-decoration','text-indent','text-shadow','text-transform','top','vertical-align','visibility','white-space','width','word-spacing','z-index','opacity','outline-offset','overflow-x','overflow-y'];
+
+
+// chains several Animator objects together
+function AnimatorChain(animators, options) {
+ this.animators = animators;
+ this.setOptions(options);
+ for (var i=0; i<this.animators.length; i++) {
+ this.listenTo(this.animators[i]);
+ }
+ this.forwards = false;
+ this.current = 0;
+}
+
+AnimatorChain.prototype = {
+ // apply defaults
+ setOptions: function(options) {
+ this.options = Animator.applyDefaults({
+ // by default, each call to AnimatorChain.play() calls jumpTo(0) of each animator
+ // before playing, which can cause flickering if you have multiple animators all
+ // targeting the same element. Set this to false to avoid this.
+ resetOnPlay: true
+ }, options);
+ },
+ // play each animator in turn
+ play: function() {
+ this.forwards = true;
+ this.current = -1;
+ if (this.options.resetOnPlay) {
+ for (var i=0; i<this.animators.length; i++) {
+ this.animators[i].jumpTo(0);
+ }
+ }
+ this.advance();
+ },
+ // play all animators backwards
+ reverse: function() {
+ this.forwards = false;
+ this.current = this.animators.length;
+ if (this.options.resetOnPlay) {
+ for (var i=0; i<this.animators.length; i++) {
+ this.animators[i].jumpTo(1);
+ }
+ }
+ this.advance();
+ },
+ // if we have just play()'d, then call reverse(), and vice versa
+ toggle: function() {
+ if (this.forwards) {
+ this.seekTo(0);
+ } else {
+ this.seekTo(1);
+ }
+ },
+ // internal: install an event listener on an animator's onComplete option
+ // to trigger the next animator
+ listenTo: function(animator) {
+ var oldOnComplete = animator.options.onComplete;
+ var _this = this;
+ animator.options.onComplete = function() {
+ if (oldOnComplete) oldOnComplete.call(animator);
+ _this.advance();
+ }
+ },
+ // play the next animator
+ advance: function() {
+ if (this.forwards) {
+ if (this.animators[this.current + 1] == null) return;
+ this.current++;
+ this.animators[this.current].play();
+ } else {
+ if (this.animators[this.current - 1] == null) return;
+ this.current--;
+ this.animators[this.current].reverse();
+ }
+ },
+ // this function is provided for drop-in compatibility with Animator objects,
+ // but only accepts 0 and 1 as target values
+ seekTo: function(target) {
+ if (target <= 0) {
+ this.forwards = false;
+ this.animators[this.current].seekTo(0);
+ } else {
+ this.forwards = true;
+ this.animators[this.current].seekTo(1);
+ }
+ }
+}
+
+// an Accordion is a class that creates and controls a number of Animators. An array of elements is passed in,
+// and for each element an Animator and a activator button is created. When an Animator's activator button is
+// clicked, the Animator and all before it seek to 0, and all Animators after it seek to 1. This can be used to
+// create the classic Accordion effect, hence the name.
+// see setOptions for arguments
+function Accordion(options) {
+ this.setOptions(options);
+ var selected = this.options.initialSection, current;
+ if (this.options.rememberance) {
+ current = document.location.hash.substring(1);
+ }
+ this.rememberanceTexts = [];
+ this.ans = [];
+ var _this = this;
+ for (var i=0; i<this.options.sections.length; i++) {
+ var el = this.options.sections[i];
+ var an = new Animator(this.options.animatorOptions);
+ var from = this.options.from + (this.options.shift * i);
+ var to = this.options.to + (this.options.shift * i);
+ an.addSubject(new NumericalStyleSubject(el, this.options.property, from, to, this.options.units));
+ an.jumpTo(0);
+ var activator = this.options.getActivator(el);
+ activator.index = i;
+ activator.onclick = function(){_this.show(this.index)};
+ this.ans[this.ans.length] = an;
+ this.rememberanceTexts[i] = activator.innerHTML.replace(/\s/g, "");
+ if (this.rememberanceTexts[i] === current) {
+ selected = i;
+ }
+ }
+ this.show(selected);
+}
+
+Accordion.prototype = {
+ // apply defaults
+ setOptions: function(options) {
+ this.options = Object.extend({
+ // REQUIRED: an array of elements to use as the accordion sections
+ sections: null,
+ // a function that locates an activator button element given a section element.
+ // by default it takes a button id from the section's "activator" attibute
+ getActivator: function(el) {return document.getElementById(el.getAttribute("activator"))},
+ // shifts each animator's range, for example with options {from:0,to:100,shift:20}
+ // the animators' ranges will be 0-100, 20-120, 40-140 etc.
+ shift: 0,
+ // the first page to show
+ initialSection: 0,
+ // if set to true, document.location.hash will be used to preserve the open section across page reloads
+ rememberance: true,
+ // constructor arguments to the Animator objects
+ animatorOptions: {}
+ }, options || {});
+ },
+ show: function(section) {
+ for (var i=0; i<this.ans.length; i++) {
+ this.ans[i].seekTo(i > section ? 1 : 0);
+ }
+ if (this.options.rememberance) {
+ document.location.hash = this.rememberanceTexts[section];
+ }
+ }
+}
diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/script/excanvas.js b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/script/excanvas.js new file mode 100755 index 0000000..d748873 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/360-player/script/excanvas.js @@ -0,0 +1,17 @@ +// Excanvas (Explorer Canvas) R43
+// http://excanvas.sourceforge.net/
+// Copyright 2006 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+if(!document.createElement("canvas").getContext){(function(){var u=Math;var v=u.round;var r=u.sin;var C=u.cos;var l=u.abs;var B=u.sqrt;var a=10;var n=a/2;function g(){return this.context_||(this.context_=new p(this))}var t=Array.prototype.slice;function D(j,m,E){var i=t.call(arguments,2);return function(){return j.apply(m,i.concat(t.call(arguments)))}}var h={init:function(i){if(/MSIE/.test(navigator.userAgent)&&!window.opera){var j=i||document;j.createElement("canvas");j.attachEvent("onreadystatechange",D(this.init_,this,j))}},init_:function(F){if(!F.namespaces.g_vml_){F.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml","#default#VML")}if(!F.namespaces.g_o_){F.namespaces.add("g_o_","urn:schemas-microsoft-com:office:office","#default#VML")}if(!F.styleSheets.ex_canvas_){var E=F.createStyleSheet();E.owningElement.id="ex_canvas_";E.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}g_vml_\\:*{behavior:url(#default#VML)}g_o_\\:*{behavior:url(#default#VML)}"}var m=F.getElementsByTagName("canvas");for(var j=0;j<m.length;j++){this.initElement(m[j])}},initElement:function(j){if(!j.getContext){j.getContext=g;j.innerHTML="";j.attachEvent("onpropertychange",A);j.attachEvent("onresize",b);var i=j.attributes;if(i.width&&i.width.specified){j.style.width=i.width.nodeValue+"px"}else{j.width=j.clientWidth}if(i.height&&i.height.specified){j.style.height=i.height.nodeValue+"px"}else{j.height=j.clientHeight}}return j}};function A(j){var i=j.srcElement;switch(j.propertyName){case"width":i.style.width=i.attributes.width.nodeValue+"px";i.getContext().clearRect();break;case"height":i.style.height=i.attributes.height.nodeValue+"px";i.getContext().clearRect();break}}function b(j){var i=j.srcElement;if(i.firstChild){i.firstChild.style.width=i.clientWidth+"px";i.firstChild.style.height=i.clientHeight+"px"}}h.init();var e=[];for(var y=0;y<16;y++){for(var x=0;x<16;x++){e[y*16+x]=y.toString(16)+x.toString(16)}}function q(){return[[1,0,0],[0,1,0],[0,0,1]]}function d(E,m){var j=q();for(var i=0;i<3;i++){for(var H=0;H<3;H++){var F=0;for(var G=0;G<3;G++){F+=E[i][G]*m[G][H]}j[i][H]=F}}return j}function w(j,i){i.fillStyle=j.fillStyle;i.lineCap=j.lineCap;i.lineJoin=j.lineJoin;i.lineWidth=j.lineWidth;i.miterLimit=j.miterLimit;i.shadowBlur=j.shadowBlur;i.shadowColor=j.shadowColor;i.shadowOffsetX=j.shadowOffsetX;i.shadowOffsetY=j.shadowOffsetY;i.strokeStyle=j.strokeStyle;i.globalAlpha=j.globalAlpha;i.arcScaleX_=j.arcScaleX_;i.arcScaleY_=j.arcScaleY_;i.lineScale_=j.lineScale_}function c(m){var G,F=1;m=String(m);if(m.substring(0,3)=="rgb"){var I=m.indexOf("(",3);var j=m.indexOf(")",I+1);var H=m.substring(I+1,j).split(",");G="#";for(var E=0;E<3;E++){G+=e[Number(H[E])]}if(H.length==4&&m.substr(3,1)=="a"){F=H[3]}}else{G=m}return{color:G,alpha:F}}function s(i){switch(i){case"butt":return"flat";case"round":return"round";case"square":default:return"square"}}function p(j){this.m_=q();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.strokeStyle="#000";this.fillStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=a*1;this.globalAlpha=1;this.canvas=j;var i=j.ownerDocument.createElement("div");i.style.width=j.clientWidth+"px";i.style.height=j.clientHeight+"px";i.style.overflow="hidden";i.style.position="absolute";j.appendChild(i);this.element_=i;this.arcScaleX_=1;this.arcScaleY_=1;this.lineScale_=1}var k=p.prototype;k.clearRect=function(){this.element_.innerHTML=""};k.beginPath=function(){this.currentPath_=[]};k.moveTo=function(j,i){var m=this.getCoords_(j,i);this.currentPath_.push({type:"moveTo",x:m.x,y:m.y});this.currentX_=m.x;this.currentY_=m.y};k.lineTo=function(j,i){var m=this.getCoords_(j,i);this.currentPath_.push({type:"lineTo",x:m.x,y:m.y});this.currentX_=m.x;this.currentY_=m.y};k.bezierCurveTo=function(m,j,J,I,H,F){var i=this.getCoords_(H,F);var G=this.getCoords_(m,j);var E=this.getCoords_(J,I);o(this,G,E,i)};function o(i,E,m,j){i.currentPath_.push({type:"bezierCurveTo",cp1x:E.x,cp1y:E.y,cp2x:m.x,cp2y:m.y,x:j.x,y:j.y});i.currentX_=j.x;i.currentY_=j.y}k.quadraticCurveTo=function(H,m,j,i){var G=this.getCoords_(H,m);var F=this.getCoords_(j,i);var I={x:this.currentX_+2/3*(G.x-this.currentX_),y:this.currentY_+2/3*(G.y-this.currentY_)};var E={x:I.x+(F.x-this.currentX_)/3,y:I.y+(F.y-this.currentY_)/3};o(this,I,E,F)};k.arc=function(K,I,J,F,j,m){J*=a;var O=m?"at":"wa";var L=K+C(F)*J-n;var N=I+r(F)*J-n;var i=K+C(j)*J-n;var M=I+r(j)*J-n;if(L==i&&!m){L+=0.125}var E=this.getCoords_(K,I);var H=this.getCoords_(L,N);var G=this.getCoords_(i,M);this.currentPath_.push({type:O,x:E.x,y:E.y,radius:J,xStart:H.x,yStart:H.y,xEnd:G.x,yEnd:G.y})};k.rect=function(m,j,i,E){this.moveTo(m,j);this.lineTo(m+i,j);this.lineTo(m+i,j+E);this.lineTo(m,j+E);this.closePath()};k.strokeRect=function(m,j,i,E){var F=this.currentPath_;this.beginPath();this.moveTo(m,j);this.lineTo(m+i,j);this.lineTo(m+i,j+E);this.lineTo(m,j+E);this.closePath();this.stroke();this.currentPath_=F};k.fillRect=function(m,j,i,E){var F=this.currentPath_;this.beginPath();this.moveTo(m,j);this.lineTo(m+i,j);this.lineTo(m+i,j+E);this.lineTo(m,j+E);this.closePath();this.fill();this.currentPath_=F};k.createLinearGradient=function(j,E,i,m){var F=new z("gradient");F.x0_=j;F.y0_=E;F.x1_=i;F.y1_=m;return F};k.createRadialGradient=function(E,G,m,j,F,i){var H=new z("gradientradial");H.x0_=E;H.y0_=G;H.r0_=m;H.x1_=j;H.y1_=F;H.r1_=i;return H};k.drawImage=function(R,m){var K,I,M,Z,P,N,T,ab;var L=R.runtimeStyle.width;var Q=R.runtimeStyle.height;R.runtimeStyle.width="auto";R.runtimeStyle.height="auto";var J=R.width;var X=R.height;R.runtimeStyle.width=L;R.runtimeStyle.height=Q;if(arguments.length==3){K=arguments[1];I=arguments[2];P=N=0;T=M=J;ab=Z=X}else{if(arguments.length==5){K=arguments[1];I=arguments[2];M=arguments[3];Z=arguments[4];P=N=0;T=J;ab=X}else{if(arguments.length==9){P=arguments[1];N=arguments[2];T=arguments[3];ab=arguments[4];K=arguments[5];I=arguments[6];M=arguments[7];Z=arguments[8]}else{throw Error("Invalid number of arguments")}}}var aa=this.getCoords_(K,I);var E=T/2;var j=ab/2;var Y=[];var i=10;var G=10;Y.push(" <g_vml_:group",' coordsize="',a*i,",",a*G,'"',' coordorigin="0,0"',' style="width:',i,"px;height:",G,"px;position:absolute;");if(this.m_[0][0]!=1||this.m_[0][1]){var F=[];F.push("M11=",this.m_[0][0],",","M12=",this.m_[1][0],",","M21=",this.m_[0][1],",","M22=",this.m_[1][1],",","Dx=",v(aa.x/a),",","Dy=",v(aa.y/a),"");var V=aa;var U=this.getCoords_(K+M,I);var S=this.getCoords_(K,I+Z);var O=this.getCoords_(K+M,I+Z);V.x=u.max(V.x,U.x,S.x,O.x);V.y=u.max(V.y,U.y,S.y,O.y);Y.push("padding:0 ",v(V.x/a),"px ",v(V.y/a),"px 0;filter:progid:DXImageTransform.Microsoft.Matrix(",F.join(""),", sizingmethod='clip');")}else{Y.push("top:",v(aa.y/a),"px;left:",v(aa.x/a),"px;")}Y.push(' ">','<g_vml_:image src="',R.src,'"',' style="width:',a*M,"px;"," height:",a*Z,'px;"',' cropleft="',P/J,'"',' croptop="',N/X,'"',' cropright="',(J-P-T)/J,'"',' cropbottom="',(X-N-ab)/X,'"'," />","</g_vml_:group>");this.element_.insertAdjacentHTML("BeforeEnd",Y.join(""))};k.stroke=function(ae){var J=[];var K=false;var ap=c(ae?this.fillStyle:this.strokeStyle);var aa=ap.color;var ak=ap.alpha*this.globalAlpha;var F=10;var M=10;J.push("<g_vml_:shape",' filled="',!!ae,'"',' style="position:absolute;width:',F,"px;height:",M,'px;"',' coordorigin="0 0" coordsize="',a*F," ",a*M,'"',' stroked="',!ae,'"',' path="');var L=false;var ao={x:null,y:null};var V={x:null,y:null};for(var aj=0;aj<this.currentPath_.length;aj++){var ai=this.currentPath_[aj];var an;switch(ai.type){case"moveTo":an=ai;J.push(" m ",v(ai.x),",",v(ai.y));break;case"lineTo":J.push(" l ",v(ai.x),",",v(ai.y));break;case"close":J.push(" x ");ai=null;break;case"bezierCurveTo":J.push(" c ",v(ai.cp1x),",",v(ai.cp1y),",",v(ai.cp2x),",",v(ai.cp2y),",",v(ai.x),",",v(ai.y));break;case"at":case"wa":J.push(" ",ai.type," ",v(ai.x-this.arcScaleX_*ai.radius),",",v(ai.y-this.arcScaleY_*ai.radius)," ",v(ai.x+this.arcScaleX_*ai.radius),",",v(ai.y+this.arcScaleY_*ai.radius)," ",v(ai.xStart),",",v(ai.yStart)," ",v(ai.xEnd),",",v(ai.yEnd));break}if(ai){if(ao.x==null||ai.x<ao.x){ao.x=ai.x}if(V.x==null||ai.x>V.x){V.x=ai.x}if(ao.y==null||ai.y<ao.y){ao.y=ai.y}if(V.y==null||ai.y>V.y){V.y=ai.y}}}J.push(' ">');if(!ae){var U=this.lineScale_*this.lineWidth;if(U<1){ak*=U}J.push("<g_vml_:stroke",' opacity="',ak,'"',' joinstyle="',this.lineJoin,'"',' miterlimit="',this.miterLimit,'"',' endcap="',s(this.lineCap),'"',' weight="',U,'px"',' color="',aa,'" />')}else{if(typeof this.fillStyle=="object"){var N=this.fillStyle;var S=0;var ah={x:0,y:0};var ab=0;var Q=1;if(N.type_=="gradient"){var P=N.x0_/this.arcScaleX_;var m=N.y0_/this.arcScaleY_;var O=N.x1_/this.arcScaleX_;var aq=N.y1_/this.arcScaleY_;var am=this.getCoords_(P,m);var al=this.getCoords_(O,aq);var I=al.x-am.x;var G=al.y-am.y;S=Math.atan2(I,G)*180/Math.PI;if(S<0){S+=360}if(S<0.000001){S=0}}else{var am=this.getCoords_(N.x0_,N.y0_);var j=V.x-ao.x;var E=V.y-ao.y;ah={x:(am.x-ao.x)/j,y:(am.y-ao.y)/E};j/=this.arcScaleX_*a;E/=this.arcScaleY_*a;var ag=u.max(j,E);ab=2*N.r0_/ag;Q=2*N.r1_/ag-ab}var Z=N.colors_;Z.sort(function(H,i){return H.offset-i.offset});var T=Z.length;var Y=Z[0].color;var X=Z[T-1].color;var ad=Z[0].alpha*this.globalAlpha;var ac=Z[T-1].alpha*this.globalAlpha;var af=[];for(var aj=0;aj<T;aj++){var R=Z[aj];af.push(R.offset*Q+ab+" "+R.color)}J.push('<g_vml_:fill type="',N.type_,'"',' method="none" focus="100%"',' color="',Y,'"',' color2="',X,'"',' colors="',af.join(","),'"',' opacity="',ac,'"',' g_o_:opacity2="',ad,'"',' angle="',S,'"',' focusposition="',ah.x,",",ah.y,'" />')}else{J.push('<g_vml_:fill color="',aa,'" opacity="',ak,'" />')}}J.push("</g_vml_:shape>");this.element_.insertAdjacentHTML("beforeEnd",J.join(""))};k.fill=function(){this.stroke(true)};k.closePath=function(){this.currentPath_.push({type:"close"})};k.getCoords_=function(E,j){var i=this.m_;return{x:a*(E*i[0][0]+j*i[1][0]+i[2][0])-n,y:a*(E*i[0][1]+j*i[1][1]+i[2][1])-n}};k.save=function(){var i={};w(this,i);this.aStack_.push(i);this.mStack_.push(this.m_);this.m_=d(q(),this.m_)};k.restore=function(){w(this.aStack_.pop(),this);this.m_=this.mStack_.pop()};k.translate=function(m,j){var i=[[1,0,0],[0,1,0],[m,j,1]];this.m_=d(i,this.m_)};k.rotate=function(j){var E=C(j);var m=r(j);var i=[[E,m,0],[-m,E,0],[0,0,1]];this.m_=d(i,this.m_)};k.scale=function(G,F){this.arcScaleX_*=G;this.arcScaleY_*=F;var j=[[G,0,0],[0,F,0],[0,0,1]];var i=this.m_=d(j,this.m_);var E=i[0][0]*i[1][1]-i[0][1]*i[1][0];this.lineScale_=B(l(E))};k.clip=function(){};k.arcTo=function(){};k.createPattern=function(){return new f};function z(i){this.type_=i;this.x0_=0;this.y0_=0;this.r0_=0;this.x1_=0;this.y1_=0;this.r1_=0;this.colors_=[]}z.prototype.addColorStop=function(j,i){i=c(i);this.colors_.push({offset:j,color:i.color,alpha:i.alpha})};function f(){}G_vmlCanvasManager=h;CanvasRenderingContext2D=p;CanvasGradient=z;CanvasPattern=f})()};
\ No newline at end of file diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/360ui-screenshot1.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/360ui-screenshot1.png Binary files differnew file mode 100755 index 0000000..8684432 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/360ui-screenshot1.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/360ui-screenshot2.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/360ui-screenshot2.png Binary files differnew file mode 100755 index 0000000..b0700fe --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/360ui-screenshot2.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/360ui-screenshot3.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/360ui-screenshot3.png Binary files differnew file mode 100755 index 0000000..8ba6617 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/360ui-screenshot3.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/360ui-screenshot4.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/360ui-screenshot4.png Binary files differnew file mode 100755 index 0000000..ab67cc7 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/360ui-screenshot4.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/8tracks-logo.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/8tracks-logo.png Binary files differnew file mode 100755 index 0000000..e1dbc64 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/8tracks-logo.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/discogs.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/discogs.gif Binary files differnew file mode 100755 index 0000000..d039d51 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/discogs.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/flash9-dark.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/flash9-dark.png Binary files differnew file mode 100755 index 0000000..d76a3a1 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/flash9-dark.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/flash9.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/flash9.png Binary files differnew file mode 100755 index 0000000..77da060 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/flash9.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/getsatisfaction-icon.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/getsatisfaction-icon.gif Binary files differnew file mode 100755 index 0000000..f3762c7 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/getsatisfaction-icon.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/hue_thumb.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/hue_thumb.png Binary files differnew file mode 100755 index 0000000..413ee98 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/hue_thumb.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/lastfm.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/lastfm.png Binary files differnew file mode 100755 index 0000000..623005a --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/lastfm.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/mixcrate.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/mixcrate.png Binary files differnew file mode 100755 index 0000000..7e21115 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/mixcrate.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/muxtape-logo.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/muxtape-logo.png Binary files differnew file mode 100755 index 0000000..a29bfd7 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/muxtape-logo.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/new-bw.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/new-bw.png Binary files differnew file mode 100755 index 0000000..e9dc665 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/new-bw.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/new-dark.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/new-dark.png Binary files differnew file mode 100755 index 0000000..549158d --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/new-dark.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/new.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/new.png Binary files differnew file mode 100755 index 0000000..62e05e4 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/new.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/opera.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/opera.png Binary files differnew file mode 100755 index 0000000..9baf845 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/opera.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/picker_thumb.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/picker_thumb.png Binary files differnew file mode 100755 index 0000000..f757cc6 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/picker_thumb.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/slider-1.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/slider-1.png Binary files differnew file mode 100755 index 0000000..b7a5f32 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/slider-1.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/slider-bar.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/slider-bar.gif Binary files differnew file mode 100755 index 0000000..8e25d0e --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/slider-bar.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/slider.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/slider.png Binary files differnew file mode 100755 index 0000000..abcbf8b --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/slider.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/soundcloud-thecloudplayer-logo.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/soundcloud-thecloudplayer-logo.png Binary files differnew file mode 100755 index 0000000..f88af99 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/soundcloud-thecloudplayer-logo.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/speaker.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/speaker.png Binary files differnew file mode 100755 index 0000000..9197793 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/speaker.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/wedge.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/wedge.png Binary files differnew file mode 100755 index 0000000..b55dd08 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_image/wedge.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/1hz-10khz-sweep.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/1hz-10khz-sweep.mp3 Binary files differnew file mode 100755 index 0000000..226ac1e --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/1hz-10khz-sweep.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/440hz.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/440hz.mp3 Binary files differnew file mode 100755 index 0000000..e2dd5e0 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/440hz.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/880hz.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/880hz.mp3 Binary files differnew file mode 100755 index 0000000..756e8d9 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/880hz.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/background0.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/background0.mp3 Binary files differnew file mode 100755 index 0000000..3816dd7 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/background0.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/background1.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/background1.mp3 Binary files differnew file mode 100755 index 0000000..9e9c638 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/background1.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/background2.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/background2.mp3 Binary files differnew file mode 100755 index 0000000..ec251cf --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/background2.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/bass.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/bass.mp3 Binary files differnew file mode 100755 index 0000000..adc281f --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/bass.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/button-0.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/button-0.mp3 Binary files differnew file mode 100755 index 0000000..243c3e5 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/button-0.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/button-1.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/button-1.mp3 Binary files differnew file mode 100755 index 0000000..a2833fd --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/button-1.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/click-high.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/click-high.mp3 Binary files differnew file mode 100755 index 0000000..afb09d7 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/click-high.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/click-low.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/click-low.mp3 Binary files differnew file mode 100755 index 0000000..9cbe8fe --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/click-low.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/coins.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/coins.mp3 Binary files differnew file mode 100755 index 0000000..f0c2401 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/coins.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/fancy-beer-bottle-pop.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/fancy-beer-bottle-pop.mp3 Binary files differnew file mode 100755 index 0000000..4498874 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/fancy-beer-bottle-pop.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/mak.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/mak.mp3 Binary files differnew file mode 100755 index 0000000..9bc9af3 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/mak.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/mouseover.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/mouseover.mp3 Binary files differnew file mode 100755 index 0000000..9e9a4f4 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/mouseover.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/mouseover2.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/mouseover2.mp3 Binary files differnew file mode 100755 index 0000000..9273f99 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/mouseover2.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/mouseover3.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/mouseover3.mp3 Binary files differnew file mode 100755 index 0000000..93d04be --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/mouseover3.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/select.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/select.mp3 Binary files differnew file mode 100755 index 0000000..9f9c711 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/select.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/sine, square, sawtooth, rando.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/sine, square, sawtooth, rando.mp3 Binary files differnew file mode 100755 index 0000000..a649164 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/_mp3/sine, square, sawtooth, rando.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-1/css/animation.css b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-1/css/animation.css new file mode 100755 index 0000000..380a671 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-1/css/animation.css @@ -0,0 +1,74 @@ +body {
+ font-size:75%;
+}
+
+h1, h2, h3 {
+ font:normal 3em "Helvetica Neue Light","Helvetica Neue",helvetica,georgia,"times new roman","Arial Rounded MT Bold",verdana,tahoma,arial,"sans serif";
+ font-weight:normal;
+ margin-bottom:0px;
+}
+
+h1, h2 {
+ letter-spacing:-1px; /* zomg web x.0! ;) */
+}
+
+h1, h2, h3 {
+ padding-bottom:1px;
+ margin-bottom:0.25em;
+}
+
+h1 {
+ margin-top:0px;
+ margin-bottom:0px;
+ background-color:#666;
+ color:#ccc;
+ margin-left:-5px;
+ padding-left:5px;
+ padding-right:5px;
+ padding-bottom:5px;
+}
+
+h1,
+h1 a {
+ color:#fff;
+ text-decoration:none;
+}
+
+h1 a:hover {
+ text-decoration:underline;
+}
+
+h2 {
+ font-size:2em;
+ margin-top:1em;
+ background-color:#aaa;
+ color:#fff;
+ padding:5px;
+ margin-left:-5px;
+ min-width:23em;
+}
+
+h3 {
+ font-size:1.65em;
+ margin-top:0.5em;
+ margin-bottom:0.25em;
+ color:#333;
+ min-width:28em;
+}
+
+h3 a {
+ font-size:small;
+}
+
+h4 {
+ color:#444;
+}
+p {
+ font:normal 1em/2em verdana,tahoma,arial,"sans serif";
+}
+
+.balls img {
+ position:absolute;
+ width:12px;
+ height:12px;
+}
\ No newline at end of file diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-1/image/ball.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-1/image/ball.gif Binary files differnew file mode 100755 index 0000000..0f13534 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-1/image/ball.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-1/index.html b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-1/index.html new file mode 100755 index 0000000..7d010a8 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-1/index.html @@ -0,0 +1,46 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+<link rel="stylesheet" href="../template/template.css" media="screen" />
+<link rel="stylesheet" href="css/animation.css" media="screen" />
+<script type="text/javascript" src="../../script/soundmanager2-nodebug-jsmin.js"></script>
+<script type="text/javascript" src="script/animation.js"></script>
+</head>
+<body>
+
+<div style="margin-right:43em">
+
+<h1>Interval-based animation (with sound)</h1>
+
+<p>
+ Click + drag for fun.
+</p>
+
+<h2>Speeding Up ExternalInterface: Keep .swf in view</h2>
+
+<p>SoundManager 2 now incorporates a "high performance" mode, which has been shown to noticeably improve timing and frequency of flash callbacks. This is important for timing, reducing delay between a JS call and the sound being played, etc.</p>
+
+<p>To reduce audio delay and timing issues from slow JS/Flash communication, SM2 will try to ensure that the flash movie is visible on screen at all times. If hidden or otherwise off-screen, Flash will be given lower priority and thus JS/flash "lag" (ie., delay) will be introduced when trying to play audio "in sync."</p>
+
+<p>Generally, positioning the flash movie using position:fixed and bottom/left or bottom/right 0px is the less-intrusive option.</p>
+
+<p style="margin:0px;padding:0px">
+ <input id="useMouse" name="usemouse" value="usemouse" type="checkbox"> Throw from mouse
+</p>
+<p style="margin:0px;padding:0px">
+ <button id="b-start" onclick="startAnimation()" disabled="disabled">Start</button>
+ <button id="b-stop" onclick="stopAnimation()" disabled="disabled">Stop</button>
+</p>
+
+
+<p>Sound source: <a href="http://freesound.iua.upf.edu/samplesViewSingle.php?id=19987">"Acclivity"</a>, Free Sound Project</p>
+
+</div>
+
+<div id="ball-container" class="balls">
+ <img src="image/ball.gif" alt="" />
+</div>
+
+</body>
+</html> diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-1/script/animation.js b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-1/script/animation.js new file mode 100755 index 0000000..f167761 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-1/script/animation.js @@ -0,0 +1,189 @@ +var balls = [];
+var canvasX = 0;
+var canvasY = 0;
+var timer = null;
+var m_lastX = 0;
+var m_lastY = 0;
+var M_SPACE = 24;
+var B_VMIN = 5;
+var B_VMAX = 5;
+var B_WIDTH = 13;
+var B_HEIGHT = 13;
+var useMouse = null;
+var ballSound = null;
+var ballPopSound = null;
+
+function rnd(n) {
+ return Math.random()*n;
+}
+
+function rndI(n) {
+ return parseInt(rnd(n));
+}
+
+function createBall(oParent) {
+ oParent.appendChild(balls[0].cloneNode(true));
+ initBall(balls[balls.length-1],balls.length);
+}
+
+function createBallAtMouse(e) {
+ e = e?e:event;
+ createBall(document.getElementById('ball-container'));
+ with (balls[balls.length-1]) {
+ _x = e.clientX;
+ _y = e.clientY;
+ if (useMouse.checked != false) {
+ _vX = (m_lastX-e.clientX)*-0.7;
+ _vY = (m_lastY-e.clientY)*-0.7;
+ } else {
+ _vX = 0;
+ _vY = 0;
+ }
+ }
+ moveBall(balls[balls.length-1]);
+}
+
+function initBall(oBall,i) {
+ oBall._id = 'ball'+i;
+ oBall._active = true;
+ oBall._x = rnd(canvasX);
+ oBall._y = rnd(canvasY);
+ oBall._vX = B_VMIN+rnd(B_VMAX)*(Math.random()>0.5?1:-1);
+ oBall._vY = B_VMIN+rnd(B_VMAX);
+ oBall.style.display = 'block';
+}
+
+function moveBall(oBall) {
+ oBall._x += oBall._vX;
+ oBall._y += (oBall._vY++); // gravity!
+ var bounce = false;
+ if ((oBall._vX>0 && oBall._x+oBall._vX+B_WIDTH>canvasX) || (oBall._vX<0 && oBall._x+oBall._vX<0)) {
+ oBall._vX *= -1;
+ bounce = true;
+ }
+ if ((oBall._vY>0 && oBall._y+oBall._vY+B_HEIGHT>canvasY) || (oBall._vY<0 && oBall._y+oBall._vY<0)) {
+ // bounce on Y axis - with resistance on both axes
+ if (oBall._vY>0) oBall._y = canvasY-B_HEIGHT; // bounce exactly from bottom
+ oBall._vY *= -(oBall._vY>1?0.6:1);
+ bounce = true;
+ if (Math.abs(oBall._vX)>0.5) {
+ oBall._vX *= 0.85;
+ } else {
+ oBall._vX = 0;
+ }
+ if (Math.abs(oBall._vY)<=3 && Math.abs(oBall._vX==0)) {
+ oBall._active = false;
+ bounce = false;
+ ballPopSound.play();
+ oBall.style.display = 'none';
+ }
+ }
+ oBall.style.left = oBall._x+'px';
+ oBall.style.top = oBall._y+'px';
+ if (bounce) ballSound.play({pan:getPan(oBall._x,canvasX)});
+}
+
+function getPan(x,canvasX) {
+ var pos = x/canvasX;
+ var pan = null;
+ if (pos<=0.4) {
+ pan = Math.floor(-100+(pos/0.4*100));
+ } else if (pos>0.4 && pos<=0.5) {
+ pan = 0;
+ } else {
+ pan = Math.floor(pos*100);
+ }
+ return pan;
+}
+
+function animateStuff() {
+ for (var i=balls.length; i--;) {
+ if (balls[i]._active) moveBall(balls[i]);
+ }
+}
+
+function startAnimation() {
+ if (!timer) timer = setInterval(animateStuff,20);
+ document.getElementById('b-start').disabled = true;
+ document.getElementById('b-stop').disabled = false;
+}
+
+function stopAnimation() {
+ if (!timer) return false;
+ clearInterval(timer);
+ timer = null;
+ document.getElementById('b-start').disabled = false;
+ document.getElementById('b-stop').disabled = true;
+}
+
+function mouseDown(e) {
+ e = e?e:event;
+ m_lastX = e.clientX;
+ m_lastY = e.clientY;
+ document.onmousemove = mouseMove;
+ document.onmouseup = mouseUp;
+ return false;
+}
+
+function mouseMove(e) {
+ e = e?e:event;
+ if (Math.abs(e.clientX-m_lastX)>M_SPACE || Math.abs(e.clientY-m_lastY)>M_SPACE) {
+ createBallAtMouse(e);
+ m_lastX = e.clientX;
+ m_lastY = e.clientY;
+ }
+ return false;
+}
+
+function mouseUp() {
+ document.onmousemove = null;
+ document.onmouseup = null;
+}
+
+function init() {
+ ballSound = soundManager.createSound({
+ id: 'ballSound',
+ url: '../animation/audio/fingerplop.mp3',
+ volume: 50,
+ multiShot: true,
+ autoLoad: true
+ });
+ ballPopSound = soundManager.createSound({
+ id: 'ballPopSound',
+ url: '../animation/audio/fingerplop2.mp3',
+ volume: 50,
+ multiShot: true,
+ autoLoad: true
+ });
+ balls = document.getElementById('ball-container').getElementsByTagName('img');
+ for (var i=balls.length; i--;) {
+ initBall(balls[i],i);
+ }
+ useMouse = document.getElementById('useMouse');
+ useMouse.checked = true;
+ getWindowCoords();
+ startAnimation();
+ document.onmousedown = mouseDown;
+}
+
+// I know this is kinda broken in Opera.
+getWindowCoords = (navigator.userAgent.toLowerCase().indexOf('opera')>0||navigator.appVersion.toLowerCase().indexOf('safari')!=-1)?function() {
+ canvasX = window.innerWidth;
+ canvasY = window.innerHeight;
+}:function() {
+ canvasX = document.documentElement.clientWidth||document.body.clientWidth||document.body.scrollWidth;
+ canvasY = document.documentElement.clientHeight||document.body.clientHeight||document.body.scrollHeight;
+}
+
+window.onresize = getWindowCoords;
+
+soundManager.flashVersion = 9;
+soundManager.url = '../../swf/';
+soundManager.useHighPerformance = true;
+soundManager.debugMode = false; // disable debug mode
+soundManager.defaultOptions.multiShot = true;
+
+soundManager.onload = function() {
+ // soundManager is ready to use (create sounds and so on)
+ init();
+}
diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/bg-land.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/bg-land.png Binary files differnew file mode 100755 index 0000000..e87b2d7 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/bg-land.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/bg-sky.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/bg-sky.png Binary files differnew file mode 100755 index 0000000..f05abde --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/bg-sky.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/cursor-10.cur b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/cursor-10.cur Binary files differnew file mode 100755 index 0000000..1f78e9e --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/cursor-10.cur diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/cursor-11.cur b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/cursor-11.cur Binary files differnew file mode 100755 index 0000000..c559d34 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/cursor-11.cur diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/cursor-3.cur b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/cursor-3.cur Binary files differnew file mode 100755 index 0000000..5864f78 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/cursor-3.cur diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/cursor-4.cur b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/cursor-4.cur Binary files differnew file mode 100755 index 0000000..668fba6 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/cursor-4.cur diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/cursor-5.cur b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/cursor-5.cur Binary files differnew file mode 100755 index 0000000..54de2c9 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/cursor-5.cur diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/cursor-6.cur b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/cursor-6.cur Binary files differnew file mode 100755 index 0000000..d6c536f --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/cursor-6.cur diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/cursor-7.cur b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/cursor-7.cur Binary files differnew file mode 100755 index 0000000..779af62 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/cursor-7.cur diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/cursor-8.cur b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/cursor-8.cur Binary files differnew file mode 100755 index 0000000..07c406e --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/cursor-8.cur diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/cursor-9.cur b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/cursor-9.cur Binary files differnew file mode 100755 index 0000000..98bf364 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/cursor-9.cur diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/cursor-shadow.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/cursor-shadow.png Binary files differnew file mode 100755 index 0000000..f200f35 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/cursor-shadow.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/dot.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/dot.png Binary files differnew file mode 100755 index 0000000..8d5592b --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/dot.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/index.html b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/index.html new file mode 100755 index 0000000..1d2201c --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2a/index.html @@ -0,0 +1,360 @@ +<html>
+<head>
+<title>SoundManager Demo</title> +<meta name="robots" content="noindex" />
+<style type="text/css">
+
+html, body {
+ margin:0px;
+ padding:0px;
+}
+
+body {
+ color:#fff;
+ font-size:75%;
+ text-shadow:0 0 0 #fff; /* Safari nonsense */
+ font-family:verdana,arial,tahoma,"sans serif";
+}
+
+h1, h2, h3 {
+ font:lighter 3em "Helvetica Neue Light","Helvetica Neue",georgia,"times new roman","Arial Rounded MT Bold",helvetica,verdana,tahoma,arial,"sans serif";
+ font-weight:normal;
+ margin-bottom:0px;
+}
+
+
+h1 {
+ margin-top:0px;
+}
+
+h1, h2 {
+ letter-spacing:-1px; /* zomg web x.0! ;) */
+}
+
+h2 {
+ font-size:2em;
+ margin-top:0px;
+ color:#fff;
+}
+
+h2 span {
+ text-indent:1em;
+ font-family:verdana,tahoma,arial;
+ font-size:small;
+}
+
+p {
+ position:absolute;
+ left:1em;
+ bottom:0px;
+ font-size:x-small;
+ opacity:0.5;
+}
+
+#instructions {
+ position:absolute;
+ left:1em;
+ top:0px;
+}
+
+#canvas {
+ position:absolute;
+ left:0px;
+ top:0px;
+ width:100%;
+ height:100%;
+ overflow:hidden;
+}
+
+#horizon {
+ position:relative;
+ height:50%;
+ background:transparent url(bg-sky.png) 0px 0px repeat-x;
+}
+
+#land {
+ position:absolute;
+ bottom:0px;
+ left:0px;
+ width:100%;
+ height:50%;
+ border-top:1px solid #339933;
+ margin-bottom:0px;
+ background:#669966 url(bg-land.png) 0px 0px repeat-x;
+}
+
+#content {
+ position:relative;
+ border-top:1px solid #ccc;
+}
+
+#cursor-shade {
+ position:absolute;
+ left:-100px;
+ top:-100px;
+ margin:0px 0px 0px -2px;
+ width:20px;
+ height:24px;
+ opacity:0.75;
+}
+
+#sun {
+ position:absolute;
+ top:50%;
+ width:100%;
+ height:128px;
+ margin-top:-66px;
+ background:transparent url(sun-test.png) 50% 0px no-repeat;
+ display:none;
+}
+
+.dot {
+ position:absolute;
+ width:32px;
+ height:32px;
+}
+
+#overlay {
+ position:absolute;
+ left:0px;
+ top:0px;
+ width:100%;
+ height:100%;
+ cursor:url(cursor-11.cur),default;
+}
+
+</style>
+<script type="text/javascript" src="../../script/soundmanager2-nodebug-jsmin.js"></script>
+<script type="text/javascript">
+
+function _id(sID) {return document.getElementById(sID);}
+
+function Cursor() {
+ var self = this;
+ this.o = null;
+ this.offX = 20;
+ this.offY = 40;
+ this.screenX = null;
+ this.screenY = null;
+ this.screenXHalf = null;
+ this.screenYHalf = null;
+ this.lastCursor = null;
+ this.cursorRange = 9;
+ this.oDots = _id('dots');
+
+ this.painting = 0;
+
+ this.sounds = [];
+ this.soundIndex = 0;
+ this.soundTimer = null;
+
+ this.oDot = document.createElement('img');
+ this.oDot.className = 'dot';
+ this.oDot.src = 'dot.png';
+
+ this.refreshCoords = function() {
+ self.screenX = (window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth);
+ self.screenY = (window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight);
+ self.screenXHalf = parseInt(self.screenX/2);
+ self.screenYHalf = parseInt(self.screenY/2);
+ }
+
+ this.mousedown = function(e) {
+ self.painting = true;
+ return false;
+ }
+
+ this.mouseup = function(e) {
+ self.painting = false;
+ return false;
+ }
+
+ this.mousemove = function(e) {
+ var evt = e?e:event;
+ var x = evt.clientX;
+ var y = evt.clientY;
+ var xHalf = self.screenXHalf;
+ var yHalf = self.screenYHalf;
+ var scaleX = (x>xHalf?(x-xHalf)/xHalf:-((xHalf-x)/xHalf));
+ var scaleY = (y>yHalf?(y-yHalf)/yHalf:0);
+ var xScale = (self.offX*scaleY)*scaleX;
+ var yScale = self.offY*scaleY;
+ var cursor = parseInt(self.cursorRange*scaleY);
+ if (cursor != self.lastCursor) {
+ var curString = 'cursor-'+(Math.min(11,cursor+3))+'.cur';
+ document.documentElement.style.cursor = 'url("'+curString+'"),default';
+ _id('overlay').style.cursor = 'url("'+curString+'"),default';
+ self.lastCursor = cursor;
+ }
+ var xDiff = (x+xScale);
+ self.o.style.left = (xDiff)+'px';
+ self.o.style.top = (y+yScale)+'px';
+ self.o.style.width = ((20*scaleY)+'px');
+ self.o.style.height = ((24*scaleY)+'px');
+ self.o.style.opacity = Math.max((scaleY-0.33),0.33);
+ if (self.painting && scaleY>0) self.paint(x,y,scaleX,scaleY);
+ return false;
+ }
+
+ this.paint = function(x,y,scaleX,scaleY) {
+ var oD = self.oDot.cloneNode(false);
+ var size = 32*scaleY;
+ oD.style.left = (x-size)+'px';
+ oD.style.top = (y-size)+'px';
+ oD.style.width = (size+'px');
+ oD.style.height = (size+'px');
+ oD.style.opacity = Math.min(1,Math.max(scaleY*1.5,0.1));
+ self.oDots.appendChild(oD);
+
+ // var sID = self.sounds[0].sID;
+ if (!self.soundTimer) {
+ // self.soundTimer = window.setTimeout(function(){soundManager.play(sID,{volume:100*scaleY,pan:100*scaleX});self.soundTimer=null;},20);
+ self.sounds[Math.random()>0.5?1:0].play({pan:100*scaleX,volume:100*scaleY});
+ }
+ // if (self.soundIndex++>=self.sounds.length-1) self.soundIndex = 0;
+ }
+
+ this.createSounds = function() {
+ self.sounds[0] = soundManager.createSound('paint','../animation/audio/fingerplop.mp3');
+ self.sounds[1] = soundManager.createSound('paint2','../animation/audio/fingerplop2.mp3');
+ }
+
+ this.createSounds();
+
+ this.o = _id('cursor-shade');
+ this.refreshCoords();
+
+ window.onresize = this.refreshCoords;
+ _id('overlay').onmousedown = this.mousedown;
+ _id('overlay').onmouseup = this.mouseup;
+ document.onmousemove = this.mousemove;
+
+}
+
+var cursor = null;
+
+var sounds = [];
+
+soundManager.allowPolling = false;
+
+function doEvil() {
+
+// HIGHLY EXPERIMENTAL (and dangerous) optimation testing - attempting to override Flash's ExternalInterface JS. :D - The below may have only been relevant to Flash 8.
+
+if (typeof window.__flash__argumentsToXML !== 'undefined') {
+
+ window.__flash__argumentsToXML = function(obj,index) {
+ var s = ["<arguments>"];
+ for (var i=index, j=obj.length; i<j; i++) {
+ s[s.length] = __flash__toXML(obj[i]);
+ }
+ s[s.length] = "</arguments>";
+ // console.log('argumentsToXML: '+s.length+' items');
+ return s.join('');
+ }
+
+ window.__flash__arrayToXML = function(obj) {
+ var s = ["<array>"];
+ for (var i=0,j=obj.length; i<j; i++) {
+ s[s.length] = "<property id=\"" + i + "\">" + __flash__toXML(obj[i]) + "</property>";
+ }
+ s[s.length] = "</array>";
+ // console.log('arrayToXML: '+s.length+' items');
+ return s.join('');
+ }
+
+ window.__flash__escapeXML = function(s) {
+ // console.log('escapeXML'); // '+s.length);
+ return s; // s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
+ }
+
+ window.__flash__objectToXML = function(obj) {
+ console.log('objectToXML');
+ var s = ["<object>"];
+ for (var prop in obj) {
+ s[s.length] = "<property id=\"" + prop + "\">" + __flash__toXML(obj[prop]) + "</property>";
+ }
+ s[s.length] = "</object>";
+ return s.join('');
+ }
+
+ window.__flash__toXML = function(value) {
+ // console.log('toXML');
+ var type = typeof(value);
+ if (type == "string") {
+ return "<string>" + __flash__escapeXML(value) + "</string>";
+ } else if (type == "undefined") {
+ return "<undefined/>";
+ } else if (type == "number") {
+ return "<number>" + value + "</number>";
+ } else if (value == null) {
+ return "<null/>";
+ } else if (type == "boolean") {
+ return value ? "<true/>" : "<false/>";
+ } else if (value instanceof Date) {
+ return "<date>" + value.getTime() + "</date>";
+ } else if (value instanceof Array) {
+ return __flash__arrayToXML(value);
+ } else if (type == "object") {
+ return __flash__objectToXML(value);
+ } else {
+ return "<null/>"; //???
+ }
+ }
+
+ // this one non-IE, only?
+
+ if (!navigator.userAgent.match(/MSIE/i)) {
+ window.__flash__request.prototype = function(name) {
+ return "<invoke name=\"" + name + "\" returntype=\"javascript\">" + __flash__argumentstoXML(arguments, 1) + "</invoke>";
+ }
+ }
+}
+
+}
+
+function doInit() {
+ doEvil(); // NOTE: highly experimental, only a performance test; probably doesn't apply to Flash 9, and/or does nothing, or bad things.
+ cursor = new Cursor();
+}
+
+soundManager.flashVersion = 9;
+soundManager.url = '../../swf/';
+soundManager.useHighPerformance = true;
+soundManager.wmode = 'transparent';
+soundManager.debugMode = false;
+soundManager.onload = doInit;
+
+</script>
+</head>
+
+<body>
+
+<div>
+
+<div id="canvas">
+
+ <div id="horizon"></div>
+ <div id="land">
+ <div id="content">
+ </div>
+ </div>
+
+ <div id="sun"></div>
+ <div id="dots"></div>
+ <img id="cursor-shade" src="cursor-shadow.png" alt="" />
+
+</div>
+
+<div id="instructions">
+ <h1>SoundManager 2: JS/DOM + Sound Demo</h1>
+ <h2>Heavy DOM manipulation + Javascript Sound <span>(see code for experimental ideas)</code></h2>
+</div>
+
+<p>Click and drag to draw.. Noisily.</p>
+<div id="overlay"></div>
+
+</div>
+
+</body>
+</html> diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2b/audio/bonk.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2b/audio/bonk.mp3 Binary files differnew file mode 100755 index 0000000..2bce046 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2b/audio/bonk.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2b/audio/fingerplop.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2b/audio/fingerplop.mp3 Binary files differnew file mode 100755 index 0000000..663155e --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2b/audio/fingerplop.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2b/audio/fingerplop2.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2b/audio/fingerplop2.mp3 Binary files differnew file mode 100755 index 0000000..10f8bb2 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2b/audio/fingerplop2.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2b/css/animation.css b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2b/css/animation.css new file mode 100755 index 0000000..2764bc2 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2b/css/animation.css @@ -0,0 +1,36 @@ +body {
+ font-size:75%;
+ background:#667788;
+ color:#fff;
+ text-shadow:0 0 0 #fff; /* Safari nonsense */
+}
+
+h1, h2, h3 {
+ font:normal 3em "Helvetica Neue",georgia,"times new roman","Arial Rounded MT Bold",helvetica,verdana,tahoma,arial,"sans serif";
+ font-weight:normal;
+ margin-bottom:0px;
+}
+
+
+h1 {
+ margin-top:0px;
+}
+
+h1, h2 {
+ letter-spacing:-1px; /* zomg web x.0! ;) */
+}
+
+h2 {
+ font-size:2em;
+ margin-top:0.25em;
+}
+
+p {
+ font:normal 1em verdana,tahoma,arial,"sans serif";
+}
+
+.point {
+ position:absolute;
+ width:32px;
+ height:32px;
+}
\ No newline at end of file diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2b/image/ball.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2b/image/ball.gif Binary files differnew file mode 100755 index 0000000..0f13534 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2b/image/ball.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2b/image/point.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2b/image/point.png Binary files differnew file mode 100755 index 0000000..043a88f --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2b/image/point.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2b/index.html b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2b/index.html new file mode 100755 index 0000000..e51dcf5 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2b/index.html @@ -0,0 +1,21 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+<link rel="stylesheet" href="css/animation.css" media="screen" />
+<script type="text/javascript" src="../../script/soundmanager2.js"></script>
+<script type="text/javascript" src="script/animation.js"></script>
+</head>
+<body>
+
+<div>
+
+ <h1>SoundManager 2 demo: A Noisy Page</h1>
+ <h2>Example of sound tied to javascript/DOM event handlers</h2>
+
+ <p>Click and drag for fun.</p>
+
+</div>
+
+</body>
+</html> diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2b/script/animation.js b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2b/script/animation.js new file mode 100755 index 0000000..61d2382 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation-2b/script/animation.js @@ -0,0 +1,94 @@ +soundManager.flashVersion = 9;
+soundManager.url = '../../swf/';
+soundManager.useHighPerformance = true;
+soundManager.wmode = 'transparent';
+soundManager.debugMode = false;
+
+var points = [];
+var o = null;
+var lastX = 0;
+var lastY = 0;
+var threshhold = 4;
+var threshMax = 32;
+var noise = null;
+var screenX = 0;
+
+function doPaint(e) {
+ var x = (e||event).clientX;
+ var y = (e||event).clientY;
+ var diff = Math.max(Math.abs(x-lastX),Math.abs(y-lastY));
+ if (diff>threshhold) {
+ lastX = x;
+ lastY = y;
+ points.push(new Point(x,y,Math.min(diff/(32),3)));
+ }
+ return false;
+}
+
+function stopPaint() {
+ document.onmousemove = null;
+ document.onmouseup = null;
+ // soundManager.play('up');
+}
+
+function startPaint(e) {
+ // soundManager.play('down');
+ document.onmousemove = doPaint;
+ document.onmouseup = stopPaint;
+ lastX = (e||event).clientX;
+ lastY = (e||event).clientY;
+ screenX = (window.innerWidth?window.innerWidth:document.documentElement.clientWidth||document.body.clientWidth);
+ e?e.stopPropagation():event.returnValue = false;
+ return false;
+}
+
+function initPoints() {
+ o = document.createElement('img');
+ o.src = 'image/point.png';
+ o.className = 'point';
+ document.onmousedown = startPaint;
+ document.onmouseup = stopPaint;
+}
+
+function Point(x,y,scale) {
+ var self = this;
+ this.data = {
+ x: x,
+ y: y,
+ scale: scale,
+ scalePX: parseInt(32*scale)
+ }
+ this.o = o.cloneNode(false);
+ this.o.style.left = (x-(this.data.scalePX/2))+'px';
+ this.o.style.top = (y-(this.data.scalePX/2))+'px';
+ this.o.style.width = this.o.style.height = this.data.scalePX+'px';
+ var screenX2 = parseInt(screenX/2);
+ noise.play({volume:parseInt(Math.min(1,scale/3)*100),pan:(x<screenX2?(screenX2-x)/screenX2*-100:(x-screenX2)/screenX2*100)});
+ document.body.appendChild(this.o);
+}
+
+soundManager.onload = function() {
+ noise = soundManager.createSound({
+ id:'noise',
+ url:'../animation/audio/fingerplop.mp3',
+ multiShot: true,
+ autoLoad: true
+ });
+ soundManager.createSound({
+ id:'down',
+ url:'../_mp3/click-low.mp3',
+ multiShot: true,
+ autoLoad: true
+ });
+ soundManager.createSound({
+ id:'up',
+ url:'../_mp3/click-high.mp3',
+ multiShot: true,
+ autoLoad: true
+ });
+ initPoints();
+}
+
+soundManager.onerror = function() {
+ alert('d\'oh, something didn\'t work - SM2 failed to start.');
+}
\ No newline at end of file diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/animation/audio/bonk.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation/audio/bonk.mp3 Binary files differnew file mode 100755 index 0000000..2bce046 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation/audio/bonk.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/animation/audio/fingerplop.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation/audio/fingerplop.mp3 Binary files differnew file mode 100755 index 0000000..0f956ee --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation/audio/fingerplop.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/animation/audio/fingerplop2.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation/audio/fingerplop2.mp3 Binary files differnew file mode 100755 index 0000000..fab2070 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation/audio/fingerplop2.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/animation/index.html b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation/index.html new file mode 100755 index 0000000..4290634 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/animation/index.html @@ -0,0 +1,55 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+<title>SoundManager 2: Animation + Sound Demos</title> +<meta name="robots" content="noindex" />
+<link rel="stylesheet" href="../index.css" media="screen" />
+</head>
+<body>
+
+<div style="margin:1em">
+
+<h1>Javascript Animation + Sound Demos using <a href="http://www.schillmania.com/projects/soundmanager2/">SoundManager 2</a></h1>
+
+<ol>
+ <li><a href="../animation-1/">Interval-based animation (with sound)</a></li>
+ <li><a href="../christmas-lights/">Smashable Christmas Lights</a></li>
+ <li><a href="../animation-2a/">JS-DOM "painting" + Sound, V1</a></li>
+ <li><a href="../animation-2b/">JS-DOM "painting" + Sound, V2</a></li>
+</ol>
+
+<p>External demo: <a href="http://www.schillmania.com/content/demos/yui-sm2/noisy-events/">A Noisy DOM</a> - part of a Yahoo! User Interface blog post, <a href="http://www.yuiblog.com/blog/2009/06/30/yui-soundmanager/">Enhancing YUI-based Apps with Audio</a>.</p>
+
+<script type="text/javascript">
+function fixLinks() {
+ if (document.location.protocol.match(/http/i)) {
+ return false;
+ }
+ // presumably offline - add index.html to local links, so offline browsing is seamless
+ var l = document.getElementsByTagName('a');
+ var s = null;
+ var tmp = null;
+ var cn = null;
+ for (var i=l.length; i--;) {
+ s = l[i].href.toString();
+ cn = l[i].className;
+ if (!s.match(/http/i) && !cn.match(/norewrite/i) && (s.match(/doc/i) || s.match(/demo/i) || s.match(/../))) {
+ // yep, local.
+ tmp = Math.max(s.lastIndexOf('?'),-1);
+ tmp = Math.max(s.lastIndexOf('#'),tmp);
+ tmp = Math.max(s.lastIndexOf('/')+1,tmp);
+ // console.log(s+' '+s.lastIndexOf('?')+', '+s.lastIndexOf('#')+', '+s.lastIndexOf('/')+' = '+tmp);
+ if (tmp == -1) {
+ tmp = s.length;
+ }
+ if (!s.match(/\.html/i)) {
+ l[i].setAttribute('href',s.substr(0,tmp)+'index.html'+s.substr(tmp));
+ }
+ }
+ }
+}
+fixLinks();
+</script>
+
+</div> diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/api/index.html b/docs/dymaxion/soundmanagerv297a-20101010/demo/api/index.html new file mode 100755 index 0000000..8ccd5b9 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/api/index.html @@ -0,0 +1,676 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+<title>SoundManager 2: Basic API Demo, Examples</title> +<meta name="robots" content="noindex" />
+<meta name="author" content="Scott Schiller" />
+<meta name="language" content="en-us" />
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<meta name="keywords" content="javascript sound library api" />
+<meta name="description" content="API demo and code examples for SoundManager 2, Javascript Sound method calls and functions etc." />
+<link rel="stylesheet" href="../index.css" media="screen" />
+<!-- soundManager.useFlashBlock: related CSS -->
+<link rel="stylesheet" type="text/css" href="../flashblock/flashblock.css" />
+<style type="text/css">
+
+h1 {
+ padding-top:0.2em;
+ padding-bottom:0.1em;
+ border-bottom:4px solid #000;
+ letter-spacing:-0.03em;
+}
+
+h2 {
+ margin-top:1em;
+ padding-bottom:0.1em;
+ border-bottom:2px solid #000;
+}
+
+pre,
+code,
+.code,
+dt,
+#soundmanager-debug {
+ color:#336699;
+ line-height:1.5em;
+}
+
+p {
+ line-height:1.5em;
+ margin-bottom:1em;
+}
+
+#soundmanager-debug {
+ position:fixed;
+ _position:absolute; /* IE <7 */
+ bottom:1em;
+ right:1em;
+ width:38em;
+ height:30em;
+ overflow:auto;
+ padding:0px;
+ margin:1em;
+ font-family:monaco,"VT-100",terminal,"lucida console",courier,system;
+ opacity:0.9;
+ color:#333;
+ border:1px solid #ccddee;
+ -moz-border-radius:3px;
+ -khtml-border-radius:3px;
+ -webkit-border-radius:3px;
+ background:#f3f9ff;
+}
+
+/*
+#soundmanager-debug code {
+ font-size:1.1em;
+ *font-size:1em;
+}
+*/
+
+#soundmanager-debug div {
+ font-size:x-small;
+ padding:0.2em;
+ margin:0px;
+}
+
+</style>
+<script type="text/javascript" src="../../script/soundmanager2.js"></script>
+<script type="text/javascript">
+
+// flash version URL switch (for this demo page)
+var winLoc = window.location.toString();
+if (winLoc.match(/flash9/i)) {
+ soundManager.flashVersion = 9;
+ if (winLoc.match(/highperformance/i)) {
+ soundManager.useHighPerformance = true;
+ soundManager.useFastPolling = true;
+ }
+} else if (winLoc.match(/flash8/i)) {
+ soundManager.flashVersion = 8;
+}
+
+soundManager.useFlashBlock = true;
+soundManager.url = '../../swf/'; // path to SoundManager2 SWF files (note trailing slash)
+soundManager.debugMode = true;
+soundManager.consoleOnly = false;
+
+soundManager.onready(function(oStatus) {
+ if (!oStatus.success) {
+ return false;
+ }
+ // soundManager is initialised, ready to use. Create a sound for this demo page.
+
+ if (soundManager.flashVersion > 8) {
+ t = window.setInterval(checkRAM,500);
+ document.getElementById('flash-ram-use').style.display = 'inline';
+ checkRAM();
+ }
+
+ soundManager.createSound({
+ id: 'aDrumSound',
+ url: '../mpc/audio/AMB_SN13.mp3'
+ });
+
+ soundManager.createSound({
+ id: 'aCymbalSound',
+ url: '../mpc/audio/SPLASH_1.mp3',
+ autoLoad: true
+ });
+
+ soundManager.createSound({
+ id: 'chinaCymbal',
+ url: '../mpc/audio/CHINA_1.mp3',
+ autoLoad: true
+ });
+
+ soundManager.createSound({
+ id: 's440hz',
+ url: '../_mp3/440hz.mp3',
+ autoLoad: true,
+ volume:50
+ });
+
+});
+
+function checkRAM() {
+ if (soundManager.supported()) {
+ var ram = (soundManager.getMemoryUse()/1024/1024).toFixed(2);
+ if (!isNaN(ram)) {
+ document.getElementById('flash-ram-use').innerHTML = ram+' MB';
+ } else {
+ document.getElementById('flash-ram-use').style.display = 'none';
+ }
+ }
+}
+
+var t = null;
+
+function doEval(sHTML) {
+ var html = sHTML.replace(/\<(span|code)\>/gi,'');
+ html = html.replace(/\<[\/](span|code)\>/gi,'');
+ html = html.replace(/>/gi,'>');
+ eval(html);
+ return false;
+}
+
+function getRandomMP3URL() {
+ return 'http://freshly-ground.com/data/audio/mpc/20060826%20-%20Armstrong.mp3?rnd='+parseInt(Math.random()*1048576);
+}
+
+</script>
+</head>
+
+<body>
+
+<div id="flash9" style="padding-left:1em;margin-right:38em">
+
+ <h1><a href="http://www.schillmania.com/projects/soundmanager2/" style="color:#000;text-decoration:none">SoundManager 2</a> / API Demo and Code Examples</h1>
+
+ <p class="note">You can run the API demos with <a href="#sm2-usehtml5audio=1" onclick="window.location.replace(this.href);window.location.reload()">HTML5</a> enabled, <a href="#flash8" onclick="window.location.replace(this.href);window.location.reload()">Flash 8</a> (API default), <a href="#flash9" onclick="window.location.replace(this.href);window.location.reload()">Flash 9</a> (normal) or <a href="#flash9-highperformance" onclick="window.location.replace(this.href);window.location.reload()">Flash 9 + highPerformance + fastPolling</a> modes (higher JS callback frequency).</p>
+
+ <p>Wondering where to start? This page has inline executable code examples using the SoundManager 2 API.</p>
+
+ <p>If you're wondering <em>"How to include SM2 in my page?"</em>, the <a href="../template/" title="SoundManager 2 bare-bones template" onclick="if (!document.domain) this.href=this.href+'index.html'">basic template</a> will get you started.</p>
+
+ <div id="sm2-container">
+ <!-- flash is appended here -->
+ </div>
+
+ <h2>The basics (old-skool style): onload() + onerror()</h2>
+
+ <p>Once you have SM2 included in your page, you merely need to hook into its <code>onload()</code>/<code>onerror()</code> events:</p>
+
+<pre class="block"><code>soundManager.onload = function() {
+ <span><span>// soundManager is ready to use.
+ // createSound() / play() etc. can now be called</span>
+</span>}
+soundManager.onerror = function() {
+ <span><span>// Oh no! No sound support.
+ // Maybe configure your app to ignore sound calls.
+ // (SM2 calls will silently return false after this point.)</span>
+</span>}
+</code></pre>
+
+ <h2>The modern method: Adding "onready" listeners</h2>
+
+ <p>You can register listeners by passing a function to <code>onready()</code>, and it will be called when SoundManager has finished starting up:</p>
+
+<pre class="block"><code>soundManager.onready(function() {<span>
+ if (soundManager.supported()) {
+ <span>// createSound() / play() etc. can now be called</span>
+ } else {
+ <span>// uh-oh, SM2 failed to start - error, unsupported etc.</span>
+ }
+</span>});
+</code></pre>
+
+ <p>An optional status object is actually passed to your onready() listener, which you can use instead of checking <code>soundManager.supported()</code>:</p>
+
+<pre class="block"><code>soundManager.onready(function(oStatus) {
+ <span><span>// oStatus: object containing "success" parameter</span>
+ if (oStatus.success) {
+ <span>// createSound() / play() etc. can now be called</span>
+ } else {
+ <span>// uh-oh, SM2 failed to start - error, unsupported etc.</span>
+ }
+</span>});
+</code></pre>
+
+<p>SoundManager first processes the <code>onready</code> queue in the order items were added, and then fires <code>soundManager.onload()</code> or <code>onerror()</code>. If you call <code>onready()</code> after SM2 has loaded, your callback will be fired immediately.</p>
+
+ <h2>A note about initialization</h2>
+
+ <p class="compact">Keep in mind SoundManager's core methods (createSound, etc.) will not be available until soundManager.onload() fires. The initialization time for SM2 can vary across browsers/platforms, and should effectively be assumed to be "asynchronous." Because of this, it is recommended you write your code to handle soundManager.onload() being called either before or after window.onload().</p>
+ <p class="compact">If you wish to have SM2 always wait for window.onload() before calling soundManager.onload()/onerror(), you can apply the following:</p>
+<pre>soundManager.waitForWindowLoad = true;</pre>
+
+ <h2>Debug Output, disabling and minified versions</h2>
+ <p class="compact">SoundManager 2 has debug mode enabled by default and will write to agents supporting <em>console.log</em>-style debugging, and/or a custom <div> element in the absence of a console.</p>
+ <p>To disable debug output, set <code>soundManager.debugMode = false;</code></p>
+ <p>Alternately, you may use the no-debug, minified version of the SM2 javascript library (which has internal debug code removed, and will silently return false.)</p>
+
+ <h2>Demo 1a: Create + play (simple method)</h2>
+<pre>soundManager.play('<span>mySound0</span>','<span>../mpc/audio/AMB_SN_5.mp3</span>');</pre>
+ <button onclick="soundManager._writeDebug('Demo 1a',1);soundManager.play('mySound0','../mpc/audio/AMB_SN_5.mp3')">Do this</button>
+ <p>Creates and plays a sound with ID "mySound0", at the specified URL. The sound can then be referenced by that ID later, eg. soundManager.play('mySound0');</p>
+ <p>Note that this method is only provided for convenience, and allows only ID and URL as parameters. If you want to specify other options (volume, loop, event handlers), you must use the object literal syntax as given below.</p>
+
+ <h2>Demo 1b: Create + play (better method)</h2>
+
+<pre class="block"><code>soundManager.createSound({
+ id:'<span>mySound1</span>',
+ url:'<span>../mpc/audio/CHINA_1.mp3</span>'
+});
+soundManager.play('<span>mySound1</span>');</code></pre>
+ <button onclick="soundManager._writeDebug('Demo 1b',1);soundManager.createSound({id:'mySound1',url:'../mpc/audio/CHINA_1.mp3'});soundManager.play('mySound1')">Do this</button>
+ <p>Creates, then plays a sound. This object literal method allows for other parameters to be used (see demo 2)</p>
+
+ <h3>Variant: Use object returned from createSound() (best method)</h3>
+
+<pre class="block"><code>var aSoundObject = soundManager.createSound({
+ id:'<span>mySound2</span>',
+ url:'<span>../mpc/audio/CHINA_1.mp3</span>'
+});
+aSoundObject.play();</code></pre>
+ <button onclick="soundManager._writeDebug('Demo 1b variant',1);var aSoundObject = soundManager.createSound({id:'mySound2',url:'../mpc/audio/CHINA_1.mp3'});aSoundObject.play()">Do this</button>
+ <p>Creates, then plays a sound. This object literal method allows for other parameters to be used (see demo 2)</p>
+
+ <h2>Demo 2: Create with onfinish event handler + play with volume argument</h2>
+<pre id="demo2" class="block"><code>var demo2Sound = soundManager.createSound({
+ id:'<span>mySound4</span>',
+ url:'<span>../mpc/audio/CHINA_1.mp3</span>',
+ onfinish:function() {
+ soundManager._writeDebug(this.sID+'<span> finished playing</span>');
+ }
+});
+demo2Sound.play({volume:50});
+</code></pre>
+<button onclick="return doEval(document.getElementById('demo2').innerHTML)">Do this</button>
+ <p>(creates, then plays a new sound - a function is called when the sound finishes playing)</p>
+
+ <h2>Demo 3: Play a pre-existing sound</h2>
+<pre>soundManager.play('<span>aDrumSound</span>');</pre>
+ <button onclick="soundManager._writeDebug('Demo 3',1);soundManager.play('aDrumSound')">Do this</button>
+ <p>This plays an existing sound which was created by soundManager.onload() (for reference, view source of this page.)</p>
+
+ <h2>Demo 4a: Play a sequence of sounds via "onfinish", with multiShot*</h2>
+<pre>soundManager.play('<span>aDrumSound</span>',{multiShotEvents:true,onfinish:function(){soundManager.play('<span>aCymbalSound</span>');}})</pre>
+<p>Differently formatted:</p>
+<pre class="block"><code>soundManager.play('<span>aDrumSound</span>',{
+ multiShotEvents: true, <span>// allow onfinish() to fire for each "shot" (default: only fire onfinish() for last shot.)</span>
+ onfinish:function() {
+ soundManager.play('<span>aCymbalSound</span>');
+ }
+});</code></pre>
+ <button onclick="soundManager._writeDebug('Demo 4a',1);soundManager.play('aDrumSound',{multiShotEvents:true,onfinish:function(){soundManager.play('aCymbalSound');}})">Do this</button>
+ <p>This will play an existing sound (created in-page), and uses the "onfinish" handler to make a call to play a second, pre-existing sound.</p>
+ <p>Also note that the button can be clicked multiple times, and the sound will be "layered" as multiShot is enabled for both of these sounds when using Flash 9. An onfinish event will also fire as each sound finishes.</p>
+ <p><strong>Bug/behaviour note:</strong> Whenever "play" is called on a SMSound object, any parameters passed in will apply to all currently-playing instances of the sound if multiShot is allowed. For example, the onfinish handler from demo 4a will apply to demo 3 if 4a is started while 3 is still playing.</p>
+ <p class="note">* Multishot is Flash 9+ only.</p>
+
+ <h2>Demo 4b: Create and play a sequence of new sounds via "onfinish"</h2>
+<pre class="block"><code>soundManager.createSound({
+ id:'<span>aBassDrum</span>',
+ url:'<span>../mpc/audio/AMB_BD_1.mp3</span>',
+ multiShot:false,
+ onfinish:function() {
+ soundManager.play('<span>aRimSound</span>','<span>AMB_RIM1.mp3</span>');
+ }
+});
+soundManager.play('<span>aRimSound</span>');</code></pre>
+ <button onclick="soundManager._writeDebug('Demo 4b',1);soundManager.createSound({id:'aBassDrum',url:'../mpc/audio/AMB_BD_1.mp3',multiShot:false,onfinish:function(){soundManager.play('aRimSound','../mpc/audio/AMB_RIM1.mp3');}});soundManager.play('aBassDrum')">Do this</button>
+ <p>This will crate and play a new sound, using the "onfinish" handler to create and play a second, new sound.</p>
+ <p>It is recommended to create sound objects first, to simplify troubleshooting.</p>
+
+<h2 id="looping-conventional">Demo 4c: Looping a sound (conventional, onfinish()-based)</h2>
+<pre id="demo4c" class="block"><code>var s = soundManager.createSound({
+ id:'<span>hhCymbal</span>',
+ url:'<span>../mpc/audio/AMB_HHOP.mp3</span>'
+});
+
+s.play({
+ onfinish: function() {
+ this.play();
+ <span><span>// or, soundManager.play('<span>hhCymbal</span>');</span></span>
+ }
+});
+</code></pre>
+
+<button onclick="return doEval(document.getElementById('demo4c').innerHTML);return false">Do this</button> | <button onclick="soundManager.stop('hhCymbal')">make it stop!</button>
+<p>Note that there are issues with seamlessly-looping sounds, it is "close, but not perfect" with Flash 8/9 at this point.</p>
+
+<h2 id="looping">Demo 4d: Looping a sound ("loops" parameter method)</h2>
+<pre id="demo4d" class="block"><code>var s = soundManager.createSound({
+ id:'<span>hhCymbal</span>',
+ url:'<span>../mpc/audio/AMB_HHOP.mp3</span>'
+});
+
+s.play({
+ loops: 3
+});
+</code></pre>
+
+<button onclick="return doEval(document.getElementById('demo4d').innerHTML);return false">Do this</button> | <button onclick="soundManager.stop('hhCymbal')">make it stop!</button>
+<p>Looping is possible as shown above using Flash 9. <b>With flash 8, the sound must be preloaded before looping can begin</b> - eg. <code>autoLoad: true, onload: function() { this.play{loops:3} }</code>. For tighter looping, see See <a href="http://www.flickr.com/photos/schill/4499319436/" title="Seamless looping MP3 sounds in Flash">Seamless Looping MP3 in Flash</a> for further details.</p>
+
+
+<h2 id="onposition">Demo 4e: Sound timing notifications using onposition()</h2>
+<pre id="demo4e" class="block"><code>var s = soundManager.getSoundById('<span>aCymbalSound</span>'); <span><span>// existing sound object</span></span>
+
+<span><span>// register some listeners (only do this once, they will work for subsequent plays)</span></span>
+
+if (typeof addedListeners === '<span>undefined</span>') {
+ addedListeners = true;
+
+ s.onposition(<span>500</span>, function(eventPosition) { <span><span>// fire at 0.5 seconds</span></span>
+ soundManager._writeDebug(<span>'Sound '+this.sID+' has reached position '+eventPosition</span>);
+ });
+
+ s.onposition(<span>1000</span>, function(eventPosition) {<span><span>// fire at 1 second</span></span>
+ soundManager._writeDebug(<span>'Sound '+this.sID+' has reached position '+eventPosition</span>);
+ });
+}
+
+s.play({
+ whileplaying:function() {
+ <span><span>// demo only: show sound position while playing, for context</span></span>
+ soundManager._writeDebug('position = ' + this.position);
+ }
+});
+</code></pre>
+
+<button onclick="return doEval(document.getElementById('demo4e').innerHTML);return false">Do this</button>
+<p>onposition() allows you to add an event listener for a given time (in miliseconds, watching the position property); the event fires when that time has been reached while a sound is playing.</p>
+<p>Note that for multiShot cases, the listeners will only fire for the original (first) shot because its position is the only one that is tracked within Flash.</p>
+
+<h2>Demo 5a: Set sound parameters, then play</h2>
+<pre class="block"><code>var sound = soundManager.getSoundById('<span>chinaCymbal</span>'); <span><span>// predefined/preloaded sound</span></span>
+sound.setPosition(<span>500</span>); <span><span>// 500 msec into sound</span></span>
+sound.setPan(<span>-75</span>); <span><span>// 75% left pan</span></span>
+sound.play();
+</code></pre>
+<button onclick="soundManager._writeDebug('Demo 5',1);var sound=soundManager.getSoundById('chinaCymbal');sound.setPosition(500);sound.setPan(-75);sound.play()">Do this</button> | <button onclick="soundManager._writeDebug('Demo 5: sound from position:0',1);var sound=soundManager.getSoundById('chinaCymbal');sound.setPosition(0);sound.setPan(-75);sound.play()">Play from position:0</button>
+<p>This will set the position of an existing, pre-loaded sound, then play it.</p>
+
+<h3>Variant: play()</h3>
+<pre class="block"><code>var sound = soundManager.getSoundById('<span>chinaCymbal</span>');
+sound.play({position:<span>500</span>,pan:<span>-75</span>});
+</code></pre>
+<button onclick="soundManager._writeDebug('Demo 5 variant',1);var sound=soundManager.getSoundById('chinaCymbal');sound.play({position:500,pan:-75})">Do this</button> | <button onclick="soundManager._writeDebug('Demo 5: variant: sound from position:0',1);var sound = soundManager.getSoundById('chinaCymbal');sound.play({position:0,pan:-75})">Play from position:0</button>
+<p>Note that if planning to layer sounds with multiShot (Flash 9 only), this variant method will give best results as each new "channel" is started with parameters.</p>
+
+<h2>Demo 5b: Global sound muting</h2>
+<p>If not passed a sound ID, soundManager.mute() will mute all existing and newly-created sounds. soundManager.unmute() can also be passed a sound ID, and performs the inverse either on a single sound or all sounds.</p>
+<p>In this demo, all sounds are globally muted and unmuted a few times. Different parameters are used to help audibly separate the sounds.</p>
+<pre id="demo5b-1" class="block"><code>soundManager.mute(); <span><span>// mute all sounds</span></span>
+
+soundManager.createSound({
+ id: '<span>880hz</span>',
+ url: '<span>../_mp3/880hz.mp3</span>',
+ autoLoad:true,
+ onload: function() {
+ <span><span>// soundManager.mute(); // mute all sounds</span></span>
+ <span><span>// play (muted) cymbal sound..</span></span>
+ this.play({
+ volume:75, <span><span>// volume for when un-muted</span></span>
+ pan:-75, <span><span>// mostly on left channel</span></span>
+ <span><span>// .. and clean-up afterwards</span></span>
+ onfinish:function() {
+ this.destruct();
+ }
+ });
+
+ this.setVolume(25); <span><span>// new volume for when un-muted..</span></span>
+
+ soundManager.play('<span>s440hz</span>',{
+ pan:<span>75</span>,
+ onfinish:function() {
+ document.getElementById('<span>btn-d5b</span>').disabled = false;
+ }
+ });
+
+ <span><span>// once playing, toggle all sounds some more</span></span>
+ setTimeout(soundManager.unmute,500);
+ setTimeout(soundManager.mute,1000);
+ setTimeout(soundManager.unmute,1500);
+ setTimeout(soundManager.mute,2000);
+ setTimeout(soundManager.unmute,2500);
+ }
+});</code></pre>
+<button id="btn-d5b" onclick="this.disabled=true;return doEval(document.getElementById('demo5b-1').innerHTML)">Do this</button>
+<script type="text/javascript">document.getElementById('btn-d5b').disabled = false;</script>
+
+<h2>Demo 5c: Per-object sound muting</h2>
+<pre id="demo5c-1" class="block"><code>soundManager.createSound({
+ id: '<span>880hz</span>',
+ url: '<span>../_mp3/880hz.mp3</span>',
+ autoLoad:true,
+ onload: function() {
+ soundManager.mute('<span>880hz</span>'); <span><span>// mute this - alternately, this.mute() would work here</span></span>
+ soundManager.play('<span>s440hz</span>',{ <span><span>// play another sound to demo muting</span></span>
+ onfinish: function() {
+ document.getElementById('<span>btn-d5c</span>').disabled = false;
+ }
+ });
+
+ <span><span>// play 880hz (muted)..</span></span>
+ this.play({
+ volume:75,
+ <span><span>// .. and clean-up afterwards</span></span>
+ onfinish:function() {
+ this.destruct();
+ }
+ });
+
+ this.setVolume(50); <span><span>// still muted, however..</span></span>
+
+ <span><span>// mute/unmute china cymbal some more</span></span>
+ <span><span>// mute sound calls: soundManager.mute('<span>880hz</span>'), or soundManager.getSoundById('<span>880hz</span>').mute();</span></span>
+ setTimeout(this.unmute,250);
+ setTimeout(this.mute,500);
+ setTimeout(this.unmute,750);
+ setTimeout(this.mute,1000);
+ setTimeout(this.unmute,1250);
+ }
+});</code></pre>
+<button id="btn-d5c" onclick="this.disabled=true;return doEval(document.getElementById('demo5c-1').innerHTML)">Do this</button>
+<script type="text/javascript">document.getElementById('btn-d5c').disabled = false;</script>
+
+<h2>Demo 6: Create, play, unload and destroy a sound</h2>
+<pre id="demo6" class="block"><code>var foo = soundManager.createSound({
+ id: '<span>fooSound</span>',
+ url: '<span>../mpc/audio/AMB_BD_1.mp3</span>'
+});
+
+<span><span>// soundManager.play('<span>fooSound</span>');
+
+// (Some time later on...)
+// soundManager.unload('<span>fooSound</span>'); - release the loaded MP3
+// soundManager.destroySound('<span>fooSound</span>'); - destroy the sound, freeing up memory etc. Also calls unload().
+
+// Alternate (demo) approach, call methods directly on sound object itself:</span></span>
+foo.play({
+ onfinish:function() {
+ <span><span>// once sound has loaded and played, unload and destroy it.</span></span>
+ this.destruct(); <span><span>// will also try to unload before destroying.</span></span>
+ }
+});</code></pre>
+<button onclick="return doEval(document.getElementById('demo6').innerHTML)">Do this</button>
+
+
+<h2>Demo 7: Create, manually pre-load and finally play a sound</h2>
+<pre id="demo7" class="block"><code>var preload = soundManager.createSound({
+ id: '<span>preloadSound</span>',
+ url: '<span>../mpc/audio/AMB_HHOP.mp3</span>'
+});
+
+preload.load(); <span><span>// load the sound ahead of time</span></span>
+setTimeout(preload.play,1500); <span><span>// and start playing it 1.5 seconds from now</span></span>
+</code></pre>
+<button onclick="return doEval(document.getElementById('demo7').innerHTML)">Do this</button>
+
+<h2>Demo 8: Create and play an invalid sound (404)</h2>
+<pre id="demo8" class="block"><code>var bad = soundManager.createSound({
+ id:'<span>badSound</span>',
+ url:'<span>badurl.mp3</span>',
+ onload: function(bSuccess) {
+ soundManager._writeDebug('<span>sound </span>'+(bSuccess?'<span>loaded!</span>':'<span>did NOT load.</span>'));
+ }
+});
+bad.play();
+</code></pre>
+<button onclick="return doEval(document.getElementById('demo8').innerHTML)">Do this</button>
+
+<h2>Demo 9: Create and destroy a sound at once (unusual crash testcase)</h2>
+<pre id="demo9" class="block"><code>var s = soundManager.createSound({
+ id:'<span>testcase</span>',
+ url:'<span>../mpc/audio/AMB_HHOP.mp3</span>'
+});
+s.play();
+s.destruct();
+</code></pre>
+<button onclick="return doEval(document.getElementById('demo9').innerHTML)">Do this</button>
+
+<h2>Demo 10: Sound timing (position accuracy testcase)</h2>
+<p>The Flash 9 version seems to resume the sound 1 msec earlier than it should, perhaps related to the timing/delay issue most noticeable on Windows.</p>
+<pre id="demo10" class="block"><code>var count = 0;
+var pos = -1;
+var s = soundManager.createSound({
+ id: '<span>s</span>',
+ url: '<span>../mpc/audio/CHINA_1.mp3</span>',
+ whileplaying: function() {
+ if (count == 0) {
+ if (this.position > 1000) {
+ this.pause();
+ pos = this.position;
+ count++;
+ this.resume();
+ }
+ } else if (count == 1) {
+ soundManager._writeDebug('<span>old position: </span>' + pos);
+ soundManager._writeDebug('<span>new position: </span>' + this.position);
+ <span><span>// See that this.position is less than pos!</span></span>
+ count++;
+ }
+ },
+ onfinish: function() {
+ this.destruct();
+ }
+});
+s.play();</code></pre>
+<button onclick="return doEval(document.getElementById('demo10').innerHTML)">Do this</button>
+
+<h2>Demo 11: Inline whileplaying() event assignment</h2>
+<p class="in">Note that when using the Flash 9 version of SM2 with Flash 9 and 10 plugins, flash/OS-related delay conditions may result in the <code>position</code> property being less than the <code>duration</code> property, even by the end of the sound.</p>
+<pre id="demo11" class="block"><code>var foo = soundManager.createSound({
+ id: '<span>bar</span>',
+ url: '<span>../mpc/audio/CRASH_1.mp3</span>'
+});
+foo.options.whileplaying = function() {
+ soundManager._writeDebug('<span>whileplaying(): </span>'+this.position+'<span> / </span>'+this.duration);
+}
+foo.play();
+
+<span><span>// note: assign .options before calling .play(), as that "bakes" the options into a play instance object.
+// the below "late" event handler assignment will have no effect on the already-playing instance.</span></span>
+foo.options.onfinish = function() { soundManager._writeDebug(this.sID+'<span> stopped.</span>'); }
+</code></pre>
+<button onclick="return doEval(document.getElementById('demo11').innerHTML)">Do this</button>
+
+<h2>Demo 12: 48 KHz MP3 sampling rate playback issue workaround</h2>
+<p>To work around a known "chipmunk" <a href="http://bugs.adobe.com/jira/browse/FP-862">sampling rate issue with 48 KHz MP3s</a> in Flash, one can apparently load a sound using Flash 9 with stream = false, and then call play() once the sound has fully-loaded. Exactly why this works is not known.</p>
+<pre id="demo12" class="block"><code>var fortyeight = soundManager.createSound({
+ id: '<span>s-48khz</span>',
+ url: '<span>http://freshly-ground.com/data/audio/48khz-test.mp3</span>'
+});
+
+if (!fortyeight.loaded) {
+ <span><span>// first time loading/playing</span></span>
+ fortyeight.load({
+ stream: false,
+ onload: function() {
+ <span><span>// sound has fully-loaded</span></span>
+ this.play();
+ }
+ });
+} else {
+ <span><span>// sound has already loaded</span></span>
+ fortyeight.play();
+}
+</code></pre>
+<button onclick="return doEval(document.getElementById('demo12').innerHTML)">Do this</button> <button onclick="soundManager.stop('s-48khz')">Make it stop!</button>
+
+<h2>Demo 13: onbeforefinish() testcase</h2>
+<p class="in">This event fires when the sound's position property is equal to or less than <code>onbeforefinishtime</code> msec from the end of the sound, as defined by <code>duration</code>. If unspecified, a default value is used (eg. 5000 msec.)</p>
+<pre id="demo13" class="block"><code>var d13 = soundManager.createSound({
+ id: '<span>demo13</span>',
+ url: '<span>../mpc/audio/CRASH_1.mp3</span>',
+ onbeforefinish: function() {
+ soundManager._writeDebug(this.sID+'<span>.onbeforefinish(): </span>'+this.position+'<span> of </span>'+this.duration);
+ },
+ onbeforefinishtime: 1000
+});
+d13.play();
+</code></pre>
+<button onclick="return doEval(document.getElementById('demo13').innerHTML)">Do this</button>
+
+<h2>Demo 14: autoLoad:true + play() testcase</h2>
+<p>Bug testcase (Flash 8 version-specific): creating a sound with autoLoad:true and immediately calling play() does not work.</p>
+<pre id="demo14" class="block"><code>var autoLoadTest = soundManager.createSound({
+ id: '<span>autoLoadTest</span>',
+ url: getRandomMP3URL(),
+ onload: function() {
+ soundManager._writeDebug(this.sID+'<span> loaded.</span>');
+ },
+ onplay: function() {
+ soundManager._writeDebug('<span>Starting sound: </span>'+this.sID);
+ },
+ autoPlay: false,
+ autoLoad: true,
+ stream: true
+ });
+ <span><span>// autoLoadTest.play(); // sound will not start</span></span>
+ setTimeout(autoLoadTest.play,1000); <span><span>// may work with a delay?</span></span>
+</code></pre>
+<p>Under Flash 8, this case does not work as expected. Even with the delay, the sound does not begin playing as soon as expected - sometimes it fires after the sound loads, in fact. For this reason, avoid using <code class="in">autoLoad:true</code> if you intend to play the sound shortly after creating it when using Flash 8.</p>
+<button onclick="return doEval(document.getElementById('demo14').innerHTML)">Do this</button> <button onclick="soundManager.stop('autoLoadTest')">Make it stop!</button>
+
+<h2>Demo 15: autoPlay + onfinish() testcase</h2>
+<p>Bug testcase (Flash 8 version-specific): onfinish() does not fire with autoPlay:true</p>
+<pre id="demo15" class="block"><code>var sound = soundManager.createSound({
+ id: '<span>demo15</span>',
+ url: '<span>../mpc/audio/AMB_SN13.mp3</span>',
+ onfinish: function() {
+ soundManager._writeDebug(this.sID+'<span> finished (now destroying)</span>');
+ <span><span>// destroy this sound</span></span>
+ this.destruct();
+ },
+ autoPlay: true,
+ multiShot: false
+});
+</code></pre>
+<button onclick="return doEval(document.getElementById('demo15').innerHTML)">Do this</button>
+
+<h2>Demo 16: onstop() -> unload() testcase</h2>
+<p>Bug testcase: unload() from onstop() does not work</p>
+<pre id="demo16" class="block"><code>var sound16 = soundManager.createSound({
+ id: '<span>demo16</span>',
+ url: getRandomMP3URL(),
+ onstop: function() {
+ soundManager.unload(this.sID);
+ },
+ onload: function() {
+ soundManager._writeDebug('<span>loaded</span>');
+ }
+});
+sound16.play();
+setTimeout(sound16.stop,1500);
+</code></pre>
+<button onclick="return doEval(document.getElementById('demo16').innerHTML)">Do this</button>
+
+<h2>Demo 17: Buffering event handler/property example (Flash 9 only)</h2>
+<p>Reporting the isBuffering property of a SMSound object</p>
+<pre id="demo17" class="block"><code>if (soundManager.flashVersion != 8) {
+ var sound17 = soundManager.createSound({
+ id: '<span>demo17</span>',
+ url: getRandomMP3URL(),
+ onbufferchange: function() {
+ soundManager._writeDebug('<span>Buffering </span>'+(this.isBuffering?'<span>started</span>':'<span>stopped</span>')+'<span>.</span>');
+ },
+ onload: function() {
+ soundManager._writeDebug(this.sID+'<span> loaded.</span>');
+ }
+ });
+ sound17.play();
+}
+</code></pre>
+<button onclick="return doEval(document.getElementById('demo17').innerHTML)">Do this</button> <button onclick="soundManager.stop('demo17')">Make it stop!</button>
+
+
+<span id="flash-ram-use" title="Flash plugin RAM use (across this browser)" style="position:fixed;_position:absolute;top:0.5em;right:0.5em;background:#666;color:#fff;font-weight:bold;padding:0.3em 0.4em;cursor:pointer;cursor:hand;display:none" onclick="this.style.display='none';window.clearTimeout(t)">N/A</span>
+
+</div>
+
+</body>
+</html> diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/christmaslights-home.js b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/christmaslights-home.js new file mode 100755 index 0000000..2ebc4fa --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/christmaslights-home.js @@ -0,0 +1,510 @@ +// Christmas Light Smashfest
+// Adapted from XLSF 2007 as originally used on http://schillmania.com/?theme=2007&christmas=1
+
+var Y = {
+ // shortcuts
+ A: YAHOO.util.Anim,
+ D: YAHOO.util.Dom,
+ E: YAHOO.util.Event,
+ UE: YAHOO.util.Easing,
+ CA: YAHOO.util.ColorAnim,
+ BG: YAHOO.util.BgPosAnim
+}
+
+function XLSF(oTarget,urlBase,lightClass) {
+ var writeDebug = soundManager._wD;
+ writeDebug('XLSF()');
+ var IS_MOON_COMPUTER = false;
+ var isIE = navigator.userAgent.match(/msie/i);
+ var self = this;
+ var xlsf = self;
+ var animDuration = 1;
+ this.oFrag = document.createDocumentFragment();
+ this.oTarget = (oTarget?oTarget:document.documentElement);
+ this.oExplosionBox = document.createElement('div');
+ this.oExplosionBox.className = 'xlsf-fragment-box';
+ this.oExplosionFrag = document.createElement('div');
+ this.oExplosionFrag.className = 'xlsf-fragment';
+ this.lights = [];
+ this.lightClasses = {
+ pico: 32,
+ tiny: 50,
+ small: 64,
+ medium: 72,
+ large: 96
+ }
+ this.urlBase = (typeof urlBase == 'undefined' || !urlBase?'demo/christmas-lights/':urlBase);
+
+ if (window.innerWidth || window.innerHeight) {
+ var screenX = window.innerWidth; // -(!isIE?24:2);
+ var screenY = window.innerHeight;
+ } else {
+ var screenX = (document.documentElement.clientWidth||document.body.clientWidth||document.body.scrollWidth); // -(!isIE?8:0);
+ var screenY = (document.documentElement.clientHeight||document.body.clientHeight||document.body.scrollHeight);
+ }
+
+ this.lightClass = (screenX>1280?'small':'pico'); // kind of light to show (32px to 96px square)
+
+ if (typeof lightClass != 'undefined') {
+ // hack: override
+ this.lightClass = lightClass;
+ }
+
+ if (window.location.href.match(/size=/i)) {
+ this.lightClass = window.location.href.substr(window.location.href.indexOf('size=')+5);
+ }
+
+ this.lightXY = this.lightClasses[this.lightClass]; // shortcut to w/h
+
+ this.lightGroups = {
+ left: [],
+ top: [],
+ right: [],
+ bottom: []
+ }
+ this.lightSmashCounter = 0;
+ this.lightIndex = 0;
+ this.lightInterval = 250;
+ this.timer = null;
+ this.bgBaseX = 0;
+ this.bgBaseY = 0;
+ this.soundIDs = 0;
+ this.soundPan = {
+ panValue: 75,
+ left: 0,
+ mid: 481,
+ right: 962
+ }
+
+ this.cover = document.createElement('div');
+ this.cover.className = 'xlsf-cover';
+ document.documentElement.appendChild(this.cover);
+
+ this.initSounds = function() {
+ for (var i=0; i<6; i++) {
+ soundManager.createSound({
+ id: 'smash'+i,
+ url: xlsf.urlBase+'sound/glass'+i+'.mp3',
+ autoLoad: true,
+ multiShot: true,
+ volume:50
+ });
+ }
+ self.initSounds = function() {} // safety net
+ }
+
+ this.appendLights = function() {
+ writeDebug('xlsf.appendLights()');
+ self.oTarget.appendChild(self.oFrag);
+ self.oFrag = document.createDocumentFragment();
+ }
+
+ function ExplosionFragment(nType,sClass,x,y,vX,vY) {
+ var self = this;
+ this.o = xlsf.oExplosionFrag.cloneNode(true);
+ this.nType = nType;
+ this.sClass = sClass;
+ this.x = x;
+ this.y = y;
+ this.w = 50;
+ this.h = 50;
+ this.bgBaseX = 0;
+ this.bgBaseY = this.h*this.nType;
+ this.vX = vX*(1.5+Math.random());
+ this.vY = vY*(1.5+Math.random());
+ this.oA = null;
+ this.oA2 = null;
+ this.burstPhase = 3; // starting background offset point
+ this.burstPhases = 4; // 1+offset (ignore large size)
+ this.o.style.backgroundPosition = ((this.w*-this.burstPhase)+'px '+(this.h*-nType)+'px');
+
+ // boundary checks
+ if (self.sClass == 'left') {
+ this.vX = Math.abs(this.vX);
+ } else if (self.sClass == 'right') {
+ this.vX = Math.abs(this.vX)*-1;
+ }
+
+ this.burstTween = function() {
+ // determine frame to show
+ var phase = 1+Math.floor((this.currentFrame/this.totalFrames)*self.burstPhases);
+ if (phase != self.burstPhase) {
+ self.burstPhase = phase;
+ self.o.style.backgroundPosition = ((self.w*-self.burstPhase)+'px '+(self.h*-nType)+'px');
+ }
+ }
+
+ this.burst = function() {
+ self.oA = new Y.A(self.o,{marginLeft:{to:(self.vX*8)},marginTop:{to:(self.vY*8)}},animDuration,Y.UE.easeOutStrong);
+ self.oA.onTween.subscribe(self.burstTween);
+ // self.oA.onComplete.subscribe(self.hide);
+ self.oA.animate();
+ }
+
+ this.hide = function() {
+ if (!isIE) self.o.style.opacity = 0;
+ }
+
+ this.reset = function() {
+ self.o.style.left = '0px';
+ self.o.style.top = '0px';
+ self.o.style.marginLeft = '0px';
+ self.o.style.marginTop = '0px';
+ if (!isIE) self.o.style.opacity = 1;
+ }
+
+ this.animate = function() {
+ self.reset();
+ self.burst();
+ }
+
+ }
+
+ function Explosion(nType,sClass,x,y) {
+ var oParent = this;
+ var self = this;
+ this.o = null;
+ this.nType = nType;
+ this.sClass = sClass;
+ this.x = x;
+ this.y = y;
+ this.boxVX = 0;
+ this.boxVY = 0;
+ this.o = xlsf.oExplosionBox.cloneNode(true);
+ this.o.style.left = x+'px';
+ this.o.style.top = y+'px';
+ // this.oFrag = document.createDocumentFragment();
+ this.fragments = [];
+
+ var mX = x;
+ var mY = y;
+
+ this.fragments.push(new ExplosionFragment(nType,sClass,mX,mY,-5,-5));
+ this.fragments.push(new ExplosionFragment(nType,sClass,mX,mY,0,-5));
+ this.fragments.push(new ExplosionFragment(nType,sClass,mX,mY,5,-5));
+
+ this.fragments.push(new ExplosionFragment(nType,sClass,mX,mY,-5,0));
+ this.fragments.push(new ExplosionFragment(nType,sClass,mX,mY,0,0));
+ this.fragments.push(new ExplosionFragment(nType,sClass,mX,mY,5,0));
+
+ this.fragments.push(new ExplosionFragment(nType,sClass,mX,mY,5,-5));
+ this.fragments.push(new ExplosionFragment(nType,sClass,mX,mY,5,0));
+ this.fragments.push(new ExplosionFragment(nType,sClass,mX,mY,5,5));
+
+ this.init = function() {
+ for (var i=self.fragments.length; i--;) {
+ self.o.appendChild(self.fragments[i].o);
+ }
+ // xlsf.oTarget.appendChild(self.o);
+ // self.oFrag = document.createDocumentFragment();
+ if (!IS_MOON_COMPUTER) {
+ // faster rendering, particles get cropped
+ xlsf.oFrag.appendChild(self.o);
+ } else {
+ // slower rendering, can overlay body
+ // _id('header').appendChild(self.o);
+ // (document.documentElement?document.documentElement:document.body).appendChild(o);
+ xlsf.oFrag.appendChild(self.o);
+ }
+ }
+
+ this.reset = function() {
+ // clean-up
+ // self.o.parentNode.removeChild(self.o);
+ self.o.style.display = 'none';
+ self.o.style.marginLeft = '0px';
+ self.o.style.marginTop = '0px';
+ self.o.style.left = self.x+'px';
+ self.o.style.top = self.y+'px';
+ if (!isIE) self.o.style.opacity = 1;
+ for (var i=self.fragments.length; i--;) {
+ self.fragments[i].reset();
+ }
+ }
+
+ this.trigger = function(boxVX,boxVY) {
+ self.o.style.display = 'block';
+ self.boxVX = boxVX;
+ self.boxVY = boxVY;
+ // boundary checks
+ if (self.sClass == 'right') {
+ self.boxVX = Math.abs(self.boxVX)*-1;
+ } else if (self.sClass == 'left') {
+ self.boxVX = Math.abs(self.boxVX);
+ }
+ for (var i=self.fragments.length; i--;) {
+ self.fragments[i].animate();
+ }
+ if (!isIE && (IS_MOON_COMPUTER)) {
+ var oAExplode = new Y.A(self.o,{marginLeft:{to:100*self.boxVX},marginTop:{to:150*self.boxVY},opacity:{to:0.01}},animDuration,Y.UE.easeInStrong);
+ } else {
+ // even IE 7 sucks w/alpha-transparent PNG + CSS opacity. Boo urns.
+ var oAExplode = new Y.A(self.o,{marginLeft:{to:100*self.boxVX},marginTop:{to:150*self.boxVY}},animDuration,Y.UE.easeInStrong);
+ }
+ oAExplode.onComplete.subscribe(self.reset);
+ oAExplode.animate();
+ // setTimeout(self.reset,animDuration*1000*1.5);
+ }
+
+ this.init();
+
+ // this.trigger(); // boooom!
+
+ }
+
+ function Light(sSizeClass,sClass,nType,x,y) {
+ var self = this;
+ this.o = document.createElement('div');
+ this.sClass = sClass;
+ this.sSizeClass = sSizeClass;
+ this.nType = (nType||0);
+ this.useY = (sClass == 'left' || sClass == 'right');
+ this.state = null;
+ this.broken = 0;
+ this.w = xlsf.lightClasses[sSizeClass];
+ this.h = xlsf.lightClasses[sSizeClass];
+ this.x = x;
+ this.y = y;
+ this.bg = xlsf.urlBase+'image/bulbs-'+this.w+'x'+this.h+'-'+this.sClass+'.png';
+ this.o.style.width = this.w+'px';
+ this.o.style.height = this.h+'px';
+ this.o.style.background = 'url('+this.bg+') no-repeat 0px 0px';
+ this.bgBaseX = (self.useY?-self.w*this.nType:0);
+ this.bgBaseY = (!self.useY?-self.h*this.nType:0);
+ this.glassType = parseInt(Math.random()*6);
+ this.oExplosion = null;
+ this.soundID = 'smash'+this.glassType;
+ var panValue = xlsf.soundPan.panValue; // eg. +/- 80%
+ this.pan = parseInt(this.x<=xlsf.soundPan.mid?-panValue+((this.x/xlsf.soundPan.mid)*panValue):(this.x-xlsf.soundPan.mid)/(xlsf.soundPan.right-xlsf.soundPan.mid)*panValue);
+
+ this.initSound = function() {
+ }
+
+ this.setBGPos = function(x,y) {
+ self.o.style.backgroundPosition = ((self.bgBaseX+x)+'px '+(self.bgBaseY+y)+'px');
+ }
+
+ this.setLight = function(bOn) {
+ if (self.broken || self.state == bOn) return false;
+ if (!self.w || !self.h) self.getDimensions();
+ self.state = bOn;
+ if (self.useY) {
+ self.setBGPos(0,-this.h*(bOn?0:1));
+ } else {
+ self.setBGPos(-this.w*(bOn?0:1),0);
+ }
+ }
+
+ this.getDimensions = function() {
+ self.w = self.o.offsetWidth;
+ self.h = self.o.offsetHeight;
+ self.bgBaseX = (self.useY?-self.w*self.nType:0);
+ self.bgBaseY = (!self.useY?-self.h*self.nType:0);
+ }
+
+ this.on = function() {
+ self.setLight(1);
+ }
+
+ this.off = function() {
+ self.setLight(0);
+ }
+
+ this.flickr = function() {
+ self.setLight(Math.random()>=0.5?1:0);
+ }
+
+ this.toggle = function() {
+ self.setLight(!self.state?1:0);
+ }
+
+ this.explode = function(e) {
+ // self.oExplosion = new Explosion(self.nType,self.sClass,self.x,self.y);
+ self.oExplosion.trigger(0,1); // boooom!
+ }
+
+ this.smash = function(e) {
+ if (self.broken) return false;
+ self.broken = true;
+ if (soundManager && soundManager.supported()) {
+ soundManager.play(self.soundID,{pan:self.pan});
+ // soundManager.sounds[self.soundID].play({pan:self.pan});
+ // if (self.bonusSound != null) window.setTimeout(self.smashBonus,1000);
+ }
+ self.explode(e);
+ var rndFrame = 2; // +parseInt(Math.random()*3);
+ if (self.useY) {
+ self.setBGPos(0,self.h*-rndFrame);
+ } else {
+ self.setBGPos(self.w*-rndFrame,0);
+ }
+ xlsf.lightSmashCounter++;
+ }
+
+ this.smashBonus = function() {
+ // soundManager.play(self.bonusSounds[self.bonusSound],urlBase+'sound/'+self.bonusSounds[self.bonusSound]+'.mp3');
+ }
+
+ this.reset = function() {
+ if (!self.broken) return false;
+ self.broken = false;
+ self.state = null;
+ xlsf.lightSmashCounter--;
+ self.flickr();
+ }
+
+ this.init = function() {
+ self.o.className = 'xlsf-light '+this.sizeClass+' '+this.sClass;
+ self.o.style.left = self.x+'px';
+ self.o.style.top = self.y+'px';
+ self.o.style.width = self.w+'px';
+ self.o.style.height = self.h+'px';
+ self.o.onmouseover = self.smash;
+ self.o.onclick = self.smash;
+ self.flickr();
+ xlsf.oFrag.appendChild(self.o);
+ self.oExplosion = new Explosion(self.nType,self.sClass,self.x,self.y);
+ }
+
+ this.init();
+
+ } // Light()
+
+ this.createLight = function(sClass,nType,x,y) {
+ var oLight = new Light(self.lightClass,sClass,nType,x,y);
+ self.lightGroups[sClass].push(oLight);
+ self.lights.push(oLight);
+ return oLight;
+ }
+
+ this.rotateLights = function() {
+ self.lights[self.lightIndex==self.lights.length?self.lights.length-1:self.lightIndex].off();
+ self.lightIndex++;
+ if (self.lightIndex == self.lights.length) {
+ self.lightIndex = 0;
+ }
+ self.lights[self.lightIndex].on();
+ }
+
+ this.randomLights = function() {
+ self.lights[parseInt(Math.random()*self.lights.length)].toggle();
+ }
+
+
+ this.destroyLights = function() {
+ self.startSequence(self.destroyLight,20);
+ }
+
+ this.destroyLight = function() {
+ var groupSize = 2; // # to smash at a time
+ if (self.lightSmashCounter<self.lights.length) {
+ var limit = Math.min(self.lightSmashCounter+groupSize,self.lights.length);
+ for (var i=self.lightSmashCounter; i<limit; i++) {
+ self.lights[self.lightSmashCounter].smash();
+ }
+ } else {
+ self.stopSequence();
+ }
+
+ }
+
+ this.uberSmash = function() {
+ // make everything explode - including your CPU.
+ self.stopSequence();
+/*
+ for (var i=0; i<self.lights.length; i++) {
+ if (!self.lights[i].broken) {
+ setTimeout(self.lights[i].smash,parseInt(Math.random()*1000));
+ }
+ }
+*/
+
+ function getRandomLight() {
+ return parseInt(Math.random()*self.lights.length);
+ }
+
+ function smashItUp() {
+ var smashed = 0;
+ var rnd = getRandomLight();
+ if (self.lights[rnd].broken) {
+ for (var i=self.lights.length; i--;) {
+ if (self.lights[i].broken) {
+ smashed++;
+ }
+ }
+ if (smashed < self.lights.length-1) {
+ // missed - do it again
+ smashItUp();
+ } else {
+ // all are done
+ window.clearInterval(t);
+ }
+ } else {
+ // we've got a live one
+ self.lights[rnd].smash();
+ // do some more, too
+ for (var j=parseInt(Math.random()*8); j--;) {
+ self.lights[getRandomLight()].smash();
+ }
+ }
+ }
+ var t = window.setInterval(smashItUp,20);
+ }
+
+ this.smashGroup = function(oGroup) {
+ for (var i=oGroup.length; i--;) {
+ oGroup[i].smash();
+ }
+ }
+
+ this.startSequence = function(fSequence,nInterval) {
+ if (self.timer) self.stopSequence();
+ self.timer = window.setInterval(fSequence,(typeof nInterval != 'undefined'?nInterval:self.lightInterval));
+ }
+
+ this.stopSequence = function() {
+ if (self.timer) {
+ window.clearInterval(self.timer);
+ self.timer = null;
+ }
+ }
+
+ var i=0;
+ var j=0;
+
+ _id('lights').style.display = 'block';
+
+ // start lights to the right of <h1>
+ var offset = parseInt(document.getElementsByTagName('h1')[0].offsetWidth)+16;
+
+ var jMax = Math.floor((screenX-offset-16)/self.lightXY);
+ var iMax = Math.floor((screenY-offset-16)/self.lightXY);
+
+ for (j=0; j<jMax; j++) {
+ this.createLight('top',j%3,offset+j*self.lightXY,0);
+ // this.createLight('bottom',j%3,offset+j*self.lightXY,screenY-offset-offset+1);
+ }
+
+ if (typeof isFun != 'undefined') {
+ for (i=0; i<iMax; i++) {
+ this.createLight('left',i%3,0,offset+i*self.lightXY);
+ // this.createLight('right',i%3,screenX-offset-offset,offset+i*self.lightXY);
+ }
+ }
+
+ this.appendLights();
+
+ this.startSequence(self.randomLights);
+
+ // setTimeout(this.destroyLights,10000);
+ // setTimeout(this.uberSmash,10000);
+
+} // --- XLSF2007()
+
+var xlsf = null;
+
+function smashInit(urlBase,lightClass) {
+ xlsf = new XLSF(document.getElementById('lights'),urlBase,lightClass);
+ xlsf.initSounds();
+ // document.getElementById('loading').style.display = 'none';
+}
\ No newline at end of file diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/christmaslights.css b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/christmaslights.css new file mode 100755 index 0000000..f857e60 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/christmaslights.css @@ -0,0 +1,111 @@ +/* XLSF 2007 */
+
+body {
+ background:#333 url(image/bg-strip-dark.png) 0px 0px;
+ font-family:lighter "Helvetica Neue Light","Helvetica Neue",georgia,"times new roman","Arial Rounded MT Bold",helvetica,verdana,tahoma,arial,"sans serif";
+ font-size:75%;
+ color:#666;
+}
+
+h1, h1 a {
+ color:#999;
+ text-decoration:none;
+}
+
+h1 {
+ color:#999;
+ margin-bottom:0;
+ margin-left:-5px;
+ margin-top:0;
+ padding-left:5px;
+ padding-right:5px;
+}
+
+h1, h2, h3 {
+ clear:both;
+ float:left;
+ font-family:lighter "Helvetica Neue Light","Helvetica Neue",georgia,"times new roman","Arial Rounded MT Bold",helvetica,verdana,tahoma,arial,"sans serif";
+ font-size:3em;
+ font-size-adjust:none;
+ margin-bottom:0.25em;
+ padding-bottom:1px;
+}
+
+h1, h2 {
+ letter-spacing:-1px;
+ margin-bottom:0;
+ margin-left:-5px;
+ margin-top:0;
+ padding-left:5px;
+ padding-right:5px;
+}
+
+a {
+ color:#6699cc;
+ padding:0px 2px;
+ text-decoration:none;
+}
+
+a:hover {
+ background:#6699cc;
+ color:#fff;
+}
+
+#lights {
+ position:absolute;
+ left:0px;
+ top:0px;
+ width:100%;
+ height:100%;
+ overflow:hidden;
+}
+
+.xlsf-light {
+ position:absolute;
+}
+
+body.fast .xlsf-light {
+ opacity:0.9;
+}
+
+.xlsf-fragment {
+ position:absolute;
+ background:transparent url(image/bulbs-50x50-fragments.png) no-repeat 0px 0px;
+ width:50px;
+ height:50px;
+}
+
+.xlsf-fragment-box {
+ position:absolute;
+ left:0px;
+ top:0px;
+ width:50px;
+ height:50px;
+ *width:100%;
+ *height:100%;
+ display:none;
+}
+
+.xlsf-cover {
+ position:fixed;
+ left:0px;
+ top:0px;
+ width:100%;
+ height:100%;
+ background:#fff;
+ opacity:1;
+ z-index:999;
+ display:none;
+}
+
+/*
+.xlsf-light.bottom {
+ height:49px;
+ border-bottom:1px solid #006600;
+}
+
+.xlsf-light.top {
+ height:49px;
+ border-top:1px solid #009900;
+}
+*/
\ No newline at end of file diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/christmaslights.js b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/christmaslights.js new file mode 100755 index 0000000..9916d90 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/christmaslights.js @@ -0,0 +1,519 @@ +// Christmas Light Smashfest
+// Adapted from XLSF 2007 as originally used on http://schillmania.com/?theme=2007&christmas=1
+
+var Y = {
+ // shortcuts
+ A: YAHOO.util.Anim,
+ D: YAHOO.util.Dom,
+ E: YAHOO.util.Event,
+ UE: YAHOO.util.Easing,
+ CA: YAHOO.util.ColorAnim,
+ BG: YAHOO.util.BgPosAnim
+}
+
+function XLSF(oTarget) {
+ var writeDebug = soundManager._wD;
+ writeDebug('XLSF()');
+ var IS_MOON_COMPUTER = false;
+ var isIE = navigator.userAgent.match(/msie/i);
+ var self = this;
+ var xlsf = self;
+ var animDuration = 1;
+ this.oFrag = document.createDocumentFragment();
+ this.oTarget = (oTarget?oTarget:document.documentElement);
+ this.oExplosionBox = document.createElement('div');
+ this.oExplosionBox.className = 'xlsf-fragment-box';
+ this.oExplosionFrag = document.createElement('div');
+ this.oExplosionFrag.className = 'xlsf-fragment';
+ this.lights = [];
+ this.lightClasses = {
+ pico: 32,
+ tiny: 50,
+ small: 64,
+ medium: 72,
+ large: 96
+ }
+
+ this.lightClass = 'tiny'; // kind of light to show (32px to 96px square)
+
+ if (window.location.href.match(/size=/i)) {
+ this.lightClass = window.location.href.substr(window.location.href.indexOf('size=')+5);
+ }
+
+ this.lightXY = this.lightClasses[this.lightClass]; // shortcut to w/h
+
+ this.lightGroups = {
+ left: [],
+ top: [],
+ right: [],
+ bottom: []
+ }
+ this.lightSmashCounter = 0;
+ this.lightIndex = 0;
+ this.lightInterval = 250;
+ this.timer = null;
+ this.bgBaseX = 0;
+ this.bgBaseY = 0;
+ this.soundIDs = 0;
+ this.soundPan = {
+ panValue: 75,
+ left: 0,
+ mid: 481,
+ right: 962
+ }
+
+ // this.beavis = null;
+ this.cover = document.createElement('div');
+ this.cover.className = 'xlsf-cover';
+ document.documentElement.appendChild(this.cover);
+
+ this.initSounds = function() {
+ for (var i=0; i<6; i++) {
+ soundManager.createSound({
+ id: 'smash'+i,
+ url: 'sound/glass'+i+'.mp3',
+ autoLoad: true,
+ multiShot: true
+ });
+ }
+ /*
+ for (var i=self.lights.length; i--;) {
+ self.lights[i].initSound();
+ }
+ */
+ self.initSounds = function() {} // safety net
+ }
+
+ this.appendLights = function() {
+ writeDebug('xlsf.appendLights()');
+ self.oTarget.appendChild(self.oFrag);
+ self.oFrag = document.createDocumentFragment();
+ }
+
+ function ExplosionFragment(nType,sClass,x,y,vX,vY) {
+ var self = this;
+ this.o = xlsf.oExplosionFrag.cloneNode(true);
+ this.nType = nType;
+ this.sClass = sClass;
+ this.x = x;
+ this.y = y;
+ this.w = 50;
+ this.h = 50;
+ this.bgBaseX = 0;
+ this.bgBaseY = this.h*this.nType;
+ this.vX = vX*(1.5+Math.random());
+ this.vY = vY*(1.5+Math.random());
+ this.oA = null;
+ this.oA2 = null;
+ this.burstPhase = 1; // starting background offset point
+ this.burstPhases = 4; // 1+offset (ignore large size)
+ this.o.style.backgroundPosition = ((this.w*-this.burstPhase)+'px '+(this.h*-nType)+'px');
+
+ // boundary checks
+ if (self.sClass == 'left') {
+ this.vX = Math.abs(this.vX);
+ } else if (self.sClass == 'right') {
+ this.vX = Math.abs(this.vX)*-1;
+ }
+// */
+
+ this.burstTween = function() {
+ // determine frame to show
+ var phase = 1+Math.floor((this.currentFrame/this.totalFrames)*self.burstPhases);
+ if (phase != self.burstPhase) {
+ self.burstPhase = phase;
+ self.o.style.backgroundPosition = ((self.w*-self.burstPhase)+'px '+(self.h*-nType)+'px');
+ }
+ }
+
+ this.burst = function() {
+ self.oA = new Y.A(self.o,{marginLeft:{to:(self.vX*8)},marginTop:{to:(self.vY*8)}},animDuration,Y.UE.easeOutStrong);
+ self.oA.onTween.subscribe(self.burstTween);
+ // self.oA.onComplete.subscribe(self.hide);
+ self.oA.animate();
+ }
+
+ this.hide = function() {
+ if (!isIE) self.o.style.opacity = 0;
+ }
+
+ this.reset = function() {
+ self.o.style.left = '0px';
+ self.o.style.top = '0px';
+ self.o.style.marginLeft = '0px';
+ self.o.style.marginTop = '0px';
+ if (!isIE) self.o.style.opacity = 1;
+ }
+
+ this.animate = function() {
+ self.reset();
+ self.burst();
+ }
+
+ }
+
+ function Explosion(nType,sClass,x,y) {
+ var oParent = this;
+ var self = this;
+ this.o = null;
+ this.nType = nType;
+ this.sClass = sClass;
+ this.x = x;
+ this.y = y;
+ this.boxVX = 0;
+ this.boxVY = 0;
+ this.o = xlsf.oExplosionBox.cloneNode(true);
+ this.o.style.left = x+'px';
+ this.o.style.top = y+'px';
+ // this.oFrag = document.createDocumentFragment();
+ this.fragments = [];
+
+ var mX = x;
+ var mY = y;
+
+ this.fragments.push(new ExplosionFragment(nType,sClass,mX,mY,-5,-5));
+ this.fragments.push(new ExplosionFragment(nType,sClass,mX,mY,0,-5));
+ this.fragments.push(new ExplosionFragment(nType,sClass,mX,mY,5,-5));
+
+ this.fragments.push(new ExplosionFragment(nType,sClass,mX,mY,-5,0));
+ this.fragments.push(new ExplosionFragment(nType,sClass,mX,mY,0,0));
+ this.fragments.push(new ExplosionFragment(nType,sClass,mX,mY,5,0));
+
+ this.fragments.push(new ExplosionFragment(nType,sClass,mX,mY,5,-5));
+ this.fragments.push(new ExplosionFragment(nType,sClass,mX,mY,5,0));
+ this.fragments.push(new ExplosionFragment(nType,sClass,mX,mY,5,5));
+
+ this.init = function() {
+ for (var i=self.fragments.length; i--;) {
+ self.o.appendChild(self.fragments[i].o);
+ }
+ // xlsf.oTarget.appendChild(self.o);
+ // self.oFrag = document.createDocumentFragment();
+ if (!IS_MOON_COMPUTER) {
+ // faster rendering, particles get cropped
+ xlsf.oFrag.appendChild(self.o);
+ } else {
+ // slower rendering, can overlay body
+ // _id('header').appendChild(self.o);
+ // (document.documentElement?document.documentElement:document.body).appendChild(o);
+ xlsf.oFrag.appendChild(self.o);
+ }
+ }
+
+ this.reset = function() {
+ // clean-up
+ // self.o.parentNode.removeChild(self.o);
+ self.o.style.display = 'none';
+ self.o.style.marginLeft = '0px';
+ self.o.style.marginTop = '0px';
+ self.o.style.left = self.x+'px';
+ self.o.style.top = self.y+'px';
+ if (!isIE) self.o.style.opacity = 1;
+ for (var i=self.fragments.length; i--;) {
+ self.fragments[i].reset();
+ }
+ }
+
+ this.trigger = function(boxVX,boxVY) {
+ self.o.style.display = 'block';
+ self.boxVX = boxVX;
+ self.boxVY = boxVY;
+ // boundary checks
+// /*
+ if (self.sClass == 'right') {
+ self.boxVX = Math.abs(self.boxVX)*-1;
+ } else if (self.sClass == 'left') {
+ self.boxVX = Math.abs(self.boxVX);
+ }
+// */
+ for (var i=self.fragments.length; i--;) {
+ self.fragments[i].animate();
+ }
+ if (!isIE && (IS_MOON_COMPUTER)) {
+ var oAExplode = new Y.A(self.o,{marginLeft:{to:100*self.boxVX},marginTop:{to:150*self.boxVY},opacity:{to:0.01}},animDuration,Y.UE.easeInStrong);
+ } else {
+ // even IE 7 sucks w/alpha-transparent PNG + CSS opacity. Boo urns.
+ var oAExplode = new Y.A(self.o,{marginLeft:{to:100*self.boxVX},marginTop:{to:150*self.boxVY}},animDuration,Y.UE.easeInStrong);
+ }
+ oAExplode.onComplete.subscribe(self.reset);
+ oAExplode.animate();
+ // setTimeout(self.reset,animDuration*1000*1.5);
+ }
+
+ this.init();
+
+ // this.trigger(); // boooom!
+
+ }
+
+ function Light(sSizeClass,sClass,nType,x,y) {
+ var self = this;
+ this.o = document.createElement('div');
+// this.o.src = 'image/empty.gif';
+ this.sClass = sClass;
+ this.sSizeClass = sSizeClass;
+ this.nType = (nType||0);
+ this.useY = (sClass == 'left' || sClass == 'right');
+ this.state = null;
+ this.broken = 0;
+ this.w = xlsf.lightClasses[sSizeClass];
+ this.h = xlsf.lightClasses[sSizeClass];
+ this.x = x;
+ this.y = y;
+ this.bg = 'image/bulbs-'+this.w+'x'+this.h+'-'+this.sClass+'.png';
+ this.o.style.width = this.w+'px';
+ this.o.style.height = this.h+'px';
+ this.o.style.background = 'url('+this.bg+') no-repeat 0px 0px';
+ this.bgBaseX = (self.useY?-self.w*this.nType:0);
+ this.bgBaseY = (!self.useY?-self.h*this.nType:0);
+ this.glassType = parseInt(Math.random()*6);
+ // this.bonusSounds = ['griffin-laugh','bblaff','bblaff2'];
+ // this.bonusSound = null;
+ this.oExplosion = null;
+ this.soundID = 'smash'+this.glassType;
+ var panValue = xlsf.soundPan.panValue; // eg. +/- 80%
+ this.pan = parseInt(this.x<=xlsf.soundPan.mid?-panValue+((this.x/xlsf.soundPan.mid)*panValue):(this.x-xlsf.soundPan.mid)/(xlsf.soundPan.right-xlsf.soundPan.mid)*panValue);
+
+ this.initSound = function() {
+ // soundManager.createSound({id:self.soundID,url:urlBase+'sound/glass'+this.glassType+'.mp3',autoLoad:true,pan:self.pan});
+ }
+
+ this.setBGPos = function(x,y) {
+ self.o.style.backgroundPosition = ((self.bgBaseX+x)+'px '+(self.bgBaseY+y)+'px');
+ }
+
+ this.setLight = function(bOn) {
+ if (self.broken || self.state == bOn) return false;
+ if (!self.w || !self.h) self.getDimensions();
+ self.state = bOn;
+ if (self.useY) {
+ self.setBGPos(0,-this.h*(bOn?0:1));
+ } else {
+ self.setBGPos(-this.w*(bOn?0:1),0);
+ }
+ }
+
+ this.getDimensions = function() {
+ self.w = self.o.offsetWidth;
+ self.h = self.o.offsetHeight;
+ self.bgBaseX = (self.useY?-self.w*self.nType:0);
+ self.bgBaseY = (!self.useY?-self.h*self.nType:0);
+ }
+
+ this.on = function() {
+ self.setLight(1);
+ }
+
+ this.off = function() {
+ self.setLight(0);
+ }
+
+ this.flickr = function() {
+ self.setLight(Math.random()>=0.5?1:0);
+ }
+
+ this.toggle = function() {
+ self.setLight(!self.state?1:0);
+ }
+
+ this.explode = function(e) {
+ // self.oExplosion = new Explosion(self.nType,self.sClass,self.x,self.y);
+ self.oExplosion.trigger(0,1); // boooom!
+ }
+
+ this.smash = function(e) {
+ if (self.broken) return false;
+ self.broken = true;
+ if (soundManager && soundManager.supported()) {
+ soundManager.play(self.soundID,{pan:self.pan});
+ // soundManager.sounds[self.soundID].play({pan:self.pan});
+ // if (self.bonusSound != null) window.setTimeout(self.smashBonus,1000);
+ }
+ self.explode(e);
+ var rndFrame = 2; // +parseInt(Math.random()*3);
+ if (self.useY) {
+ self.setBGPos(0,self.h*-rndFrame);
+ } else {
+ self.setBGPos(self.w*-rndFrame,0);
+ }
+ xlsf.lightSmashCounter++;
+ // xlsf.doNukeCheck();
+ // window.setTimeout(self.reset,3000); // respawn
+ }
+
+ this.smashBonus = function() {
+ // soundManager.play(self.bonusSounds[self.bonusSound],urlBase+'sound/'+self.bonusSounds[self.bonusSound]+'.mp3');
+ }
+
+ this.reset = function() {
+ if (!self.broken) return false;
+ self.broken = false;
+ self.state = null;
+ xlsf.lightSmashCounter--;
+ // self.oExplosion.reset(); // may not be necessary
+ self.flickr();
+ }
+
+ this.init = function() {
+ self.o.className = 'xlsf-light '+this.sizeClass+' '+this.sClass;
+ self.o.style.left = self.x+'px';
+ self.o.style.top = self.y+'px';
+ self.o.style.width = self.w+'px';
+ self.o.style.height = self.h+'px';
+ // self.o.onmouseover = self.toggle;
+ // self.o.onmouseout = self.toggle;
+ self.o.onmouseover = self.smash;
+ self.o.onclick = self.smash;
+ self.flickr();
+ xlsf.oFrag.appendChild(self.o);
+ self.oExplosion = new Explosion(self.nType,self.sClass,self.x,self.y);
+ }
+
+ this.init();
+
+ } // Light()
+
+ this.createLight = function(sClass,nType,x,y) {
+ var oLight = new Light(self.lightClass,sClass,nType,x,y);
+ self.lightGroups[sClass].push(oLight);
+ self.lights.push(oLight);
+ return oLight;
+ }
+
+ this.rotateLights = function() {
+ self.lights[self.lightIndex==self.lights.length?self.lights.length-1:self.lightIndex].off();
+ self.lightIndex++;
+ if (self.lightIndex == self.lights.length) {
+ self.lightIndex = 0;
+ }
+ self.lights[self.lightIndex].on();
+ }
+
+ this.randomLights = function() {
+ self.lights[parseInt(Math.random()*self.lights.length)].toggle();
+ }
+
+
+ this.destroyLights = function() {
+ self.startSequence(self.destroyLight,20);
+ }
+
+ this.destroyLight = function() {
+ var groupSize = 2; // # to smash at a time
+ if (self.lightSmashCounter<self.lights.length) {
+ var limit = Math.min(self.lightSmashCounter+groupSize,self.lights.length);
+ for (var i=self.lightSmashCounter; i<limit; i++) {
+ self.lights[self.lightSmashCounter].smash();
+ }
+ } else {
+ self.stopSequence();
+ }
+
+ }
+
+ this.uberSmash = function() {
+ // make everything explode - including your CPU.
+ self.stopSequence();
+ var ebCN = Y.D.getElementsByClassName;
+/*
+ window.setTimeout(function(){self.smashGroup(self.lightGroups.left)},500);
+ window.setTimeout(function(){self.smashGroup(self.lightGroups.right)},2000);
+ window.setTimeout(function(){self.smashGroup(self.lightGroups.bottom)},4000);
+ window.setTimeout(function(){self.smashGroup(self.lightGroups.top)},6000);
+*/
+ window.setTimeout(function(){self.smashGroup(self.lightGroups.bottom)},500);
+ window.setTimeout(function(){self.smashGroup(self.lightGroups.top)},3500);
+
+ }
+
+ this.smashGroup = function(oGroup) {
+ for (var i=oGroup.length; i--;) {
+ oGroup[i].smash();
+ }
+ }
+
+ this.startSequence = function(fSequence,nInterval) {
+ if (self.timer) self.stopSequence();
+ self.timer = window.setInterval(fSequence,(typeof nInterval != 'undefined'?nInterval:self.lightInterval));
+ }
+
+ this.stopSequence = function() {
+ if (self.timer) {
+ window.clearInterval(self.timer);
+ self.timer = null;
+ }
+ }
+
+ var i=0;
+
+/*
+ for (i=0; i<6; i++) {
+ this.createLight('left',parseInt(Math.random()*4),-2,50+i*(self.lightXY*0.7));
+ this.createLight('right',parseInt(Math.random()*4),962,50+i*(self.lightXY*0.7));
+ }
+
+ for (i=0; i<27; i++) {
+ this.createLight('top',parseInt(Math.random()*4),20+i*(self.lightXY*0.7),23);
+ this.createLight('bottom',parseInt(Math.random()*4),20+i*(self.lightXY*0.7),253);
+ }
+*/
+
+ var j=0;
+
+ if (window.innerWidth || window.innerHeight) {
+ var screenX = window.innerWidth; // -(!isIE?24:2);
+ var screenY = window.innerHeight;
+ } else {
+ var screenX = (document.documentElement.clientWidth||document.body.clientWidth||document.body.scrollWidth); // -(!isIE?8:0);
+ var screenY = (document.documentElement.clientHeight||document.body.clientHeight||document.body.scrollHeight);
+ }
+
+ var jMax = Math.floor((screenX-16)/self.lightXY);
+ var iMax = Math.floor((screenY-16)/self.lightXY);
+
+ for (i=0; i<iMax; i++) {
+ for (j=0; j<jMax; j++) {
+ this.createLight((i+1)%2==0?'bottom':'top',i%3,j*self.lightXY,i*self.lightXY);
+ }
+ }
+
+/*
+ var bsCounter = 0;
+ for (i=0; i<8; i++) {
+ // plant a few random seeds.. er, sounds.
+ self.lights[parseInt(Math.random()*self.lights.length)].bonusSound = bsCounter++;
+ if (bsCounter>2) bsCounter = 0; // hack - loop through sounds
+ }
+*/
+
+ this.appendLights();
+
+ // post-load/init case in the event this object is created late
+ // if (soundManager && soundManager._didInit && !soundManager._disabled) this.initSounds();
+
+ this.startSequence(self.randomLights);
+
+ // setTimeout(this.destroyLights,10000);
+ // setTimeout(this.uberSmash,10000);
+
+} // --- XLSF2007()
+
+var xlsf = null;
+
+function smashInit() {
+ xlsf = new XLSF(document.getElementById('lights'));
+ xlsf.initSounds();
+ document.getElementById('loading').style.display = 'none';
+}
+
+soundManager.url = '../../swf/';
+soundManager.flashVersion = 9;
+soundManager.debugMode = false;
+
+soundManager.onload = function() {
+ setTimeout(smashInit,500);
+}
+
+soundManager.onerror = function() {
+ setTimeout(smashInit,500);
+}
\ No newline at end of file diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bg-strip-dark.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bg-strip-dark.png Binary files differnew file mode 100755 index 0000000..80e07d9 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bg-strip-dark.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/blank.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/blank.png Binary files differnew file mode 100755 index 0000000..85af9fd --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/blank.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-32x32-bottom.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-32x32-bottom.png Binary files differnew file mode 100755 index 0000000..7246c01 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-32x32-bottom.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-32x32-left.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-32x32-left.png Binary files differnew file mode 100755 index 0000000..1cf077f --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-32x32-left.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-32x32-right.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-32x32-right.png Binary files differnew file mode 100755 index 0000000..8e68ec1 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-32x32-right.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-32x32-top.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-32x32-top.png Binary files differnew file mode 100755 index 0000000..0156c25 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-32x32-top.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-50x50-bottom.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-50x50-bottom.png Binary files differnew file mode 100755 index 0000000..79d3b07 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-50x50-bottom.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-50x50-fragments.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-50x50-fragments.png Binary files differnew file mode 100755 index 0000000..f963a89 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-50x50-fragments.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-50x50-left.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-50x50-left.png Binary files differnew file mode 100755 index 0000000..6aa0965 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-50x50-left.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-50x50-right.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-50x50-right.png Binary files differnew file mode 100755 index 0000000..c095739 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-50x50-right.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-50x50-top.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-50x50-top.png Binary files differnew file mode 100755 index 0000000..780fe75 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-50x50-top.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-50x50.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-50x50.png Binary files differnew file mode 100755 index 0000000..eb31135 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-50x50.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-64x64-bottom.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-64x64-bottom.png Binary files differnew file mode 100755 index 0000000..49341a1 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-64x64-bottom.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-64x64-left.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-64x64-left.png Binary files differnew file mode 100755 index 0000000..cb581e4 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-64x64-left.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-64x64-right.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-64x64-right.png Binary files differnew file mode 100755 index 0000000..fdd54ee --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-64x64-right.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-64x64-top.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-64x64-top.png Binary files differnew file mode 100755 index 0000000..09b098b --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-64x64-top.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-72x72-bottom.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-72x72-bottom.png Binary files differnew file mode 100755 index 0000000..4e5cae3 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-72x72-bottom.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-72x72-left.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-72x72-left.png Binary files differnew file mode 100755 index 0000000..c8bfa43 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-72x72-left.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-72x72-right.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-72x72-right.png Binary files differnew file mode 100755 index 0000000..20a614b --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-72x72-right.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-72x72-top.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-72x72-top.png Binary files differnew file mode 100755 index 0000000..76fd676 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-72x72-top.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-96x96-bottom.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-96x96-bottom.png Binary files differnew file mode 100755 index 0000000..3506236 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-96x96-bottom.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-96x96-left.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-96x96-left.png Binary files differnew file mode 100755 index 0000000..6f727e5 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-96x96-left.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-96x96-right.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-96x96-right.png Binary files differnew file mode 100755 index 0000000..f4456d6 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-96x96-right.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-96x96-top.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-96x96-top.png Binary files differnew file mode 100755 index 0000000..5c2ba64 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/image/bulbs-96x96-top.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/index.html b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/index.html new file mode 100755 index 0000000..ff9c6fe --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/index.html @@ -0,0 +1,33 @@ +<html>
+<head>
+<title>Smashable Christmas Lights</title> +<meta name="robots" content="noindex" />
+<link rel="stylesheet" media="screen" href="christmaslights.css" />
+<script type="text/javascript" src="../../script/soundmanager2.js"></script>
+<script type="text/javascript" src="yahoo-dom-event-animation-260.js"></script>
+<script type="text/javascript" src="christmaslights.js"></script>
+</head>
+
+<body>
+
+<div>
+
+ <div id="loading">
+ <h1>Christmas Light Smashfest 2008: Prototype</h1>
+ <h2>Rendering...</h2>
+ </div>
+
+ <div id="lights">
+ <!-- lights go here -->
+ </div>
+
+ <div style="position:absolute;bottom:3px;left:3px">
+ <a href="?size=pico">pico</a> | <a href="?size=tiny">tiny</a> | <a href="?size=small">small</a> | <a href="?size=medium">medium</a> | <a href="?size=large">large</a>
+ </div>
+
+</div>
+
+
+
+</body>
+</html> diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/sound/glass0.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/sound/glass0.mp3 Binary files differnew file mode 100755 index 0000000..c161c69 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/sound/glass0.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/sound/glass1.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/sound/glass1.mp3 Binary files differnew file mode 100755 index 0000000..8d7d6b5 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/sound/glass1.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/sound/glass2.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/sound/glass2.mp3 Binary files differnew file mode 100755 index 0000000..ef5f556 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/sound/glass2.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/sound/glass3.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/sound/glass3.mp3 Binary files differnew file mode 100755 index 0000000..be7886e --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/sound/glass3.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/sound/glass4.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/sound/glass4.mp3 Binary files differnew file mode 100755 index 0000000..0f328f6 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/sound/glass4.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/sound/glass5.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/sound/glass5.mp3 Binary files differnew file mode 100755 index 0000000..b54513e --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/sound/glass5.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/yahoo-dom-event-animation-260.js b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/yahoo-dom-event-animation-260.js new file mode 100755 index 0000000..c38fd9f --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/christmas-lights/yahoo-dom-event-animation-260.js @@ -0,0 +1,35 @@ +/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.6.0
+*/
+if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C<A.length;C=C+1){D=A[C].split(".");E=YAHOO;for(B=(D[0]=="YAHOO")?1:0;B<D.length;B=B+1){E[D[B]]=E[D[B]]||{};E=E[D[B]];}}return E;};YAHOO.log=function(D,A,C){var B=YAHOO.widget.Logger;if(B&&B.log){return B.log(D,A,C);}else{return false;}};YAHOO.register=function(A,E,D){var I=YAHOO.env.modules;if(!I[A]){I[A]={versions:[],builds:[]};}var B=I[A],H=D.version,G=D.build,F=YAHOO.env.listeners;B.name=A;B.version=H;B.build=G;B.versions.push(H);B.builds.push(G);B.mainClass=E;for(var C=0;C<F.length;C=C+1){F[C](B);}if(E){E.VERSION=H;E.BUILD=G;}else{YAHOO.log("mainClass is undefined for module "+A,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(A){return YAHOO.env.modules[A]||null;};YAHOO.env.ua=function(){var C={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0};var B=navigator.userAgent,A;if((/KHTML/).test(B)){C.webkit=1;}A=B.match(/AppleWebKit\/([^\s]*)/);if(A&&A[1]){C.webkit=parseFloat(A[1]);if(/ Mobile\//.test(B)){C.mobile="Apple";}else{A=B.match(/NokiaN[^\/]*/);if(A){C.mobile=A[0];}}A=B.match(/AdobeAIR\/([^\s]*)/);if(A){C.air=A[0];}}if(!C.webkit){A=B.match(/Opera[\s\/]([^\s]*)/);if(A&&A[1]){C.opera=parseFloat(A[1]);A=B.match(/Opera Mini[^;]*/);if(A){C.mobile=A[0];}}else{A=B.match(/MSIE\s([^;]*)/);if(A&&A[1]){C.ie=parseFloat(A[1]);}else{A=B.match(/Gecko\/([^\s]*)/);if(A){C.gecko=1;A=B.match(/rv:([^\s\)]*)/);if(A&&A[1]){C.gecko=parseFloat(A[1]);}}}}}return C;}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var B=YAHOO_config.listener,A=YAHOO.env.listeners,D=true,C;if(B){for(C=0;C<A.length;C=C+1){if(A[C]==B){D=false;break;}}if(D){A.push(B);}}}})();YAHOO.lang=YAHOO.lang||{};(function(){var A=YAHOO.lang,C=["toString","valueOf"],B={isArray:function(D){if(D){return A.isNumber(D.length)&&A.isFunction(D.splice);}return false;},isBoolean:function(D){return typeof D==="boolean";},isFunction:function(D){return typeof D==="function";},isNull:function(D){return D===null;},isNumber:function(D){return typeof D==="number"&&isFinite(D);},isObject:function(D){return(D&&(typeof D==="object"||A.isFunction(D)))||false;},isString:function(D){return typeof D==="string";},isUndefined:function(D){return typeof D==="undefined";},_IEEnumFix:(YAHOO.env.ua.ie)?function(F,E){for(var D=0;D<C.length;D=D+1){var H=C[D],G=E[H];if(A.isFunction(G)&&G!=Object.prototype[H]){F[H]=G;}}}:function(){},extend:function(H,I,G){if(!I||!H){throw new Error("extend failed, please check that "+"all dependencies are included.");}var E=function(){};E.prototype=I.prototype;H.prototype=new E();H.prototype.constructor=H;H.superclass=I.prototype;if(I.prototype.constructor==Object.prototype.constructor){I.prototype.constructor=I;}if(G){for(var D in G){if(A.hasOwnProperty(G,D)){H.prototype[D]=G[D];}}A._IEEnumFix(H.prototype,G);}},augmentObject:function(H,G){if(!G||!H){throw new Error("Absorb failed, verify dependencies.");}var D=arguments,F,I,E=D[2];if(E&&E!==true){for(F=2;F<D.length;F=F+1){H[D[F]]=G[D[F]];}}else{for(I in G){if(E||!(I in H)){H[I]=G[I];}}A._IEEnumFix(H,G);}},augmentProto:function(G,F){if(!F||!G){throw new Error("Augment failed, verify dependencies.");}var D=[G.prototype,F.prototype];for(var E=2;E<arguments.length;E=E+1){D.push(arguments[E]);}A.augmentObject.apply(this,D);},dump:function(D,I){var F,H,K=[],L="{...}",E="f(){...}",J=", ",G=" => ";if(!A.isObject(D)){return D+"";}else{if(D instanceof Date||("nodeType" in D&&"tagName" in D)){return D;}else{if(A.isFunction(D)){return E;}}}I=(A.isNumber(I))?I:3;if(A.isArray(D)){K.push("[");for(F=0,H=D.length;F<H;F=F+1){if(A.isObject(D[F])){K.push((I>0)?A.dump(D[F],I-1):L);}else{K.push(D[F]);}K.push(J);}if(K.length>1){K.pop();}K.push("]");}else{K.push("{");for(F in D){if(A.hasOwnProperty(D,F)){K.push(F+G);if(A.isObject(D[F])){K.push((I>0)?A.dump(D[F],I-1):L);}else{K.push(D[F]);}K.push(J);}}if(K.length>1){K.pop();}K.push("}");}return K.join("");},substitute:function(S,E,L){var I,H,G,O,P,R,N=[],F,J="dump",M=" ",D="{",Q="}";for(;;){I=S.lastIndexOf(D);if(I<0){break;}H=S.indexOf(Q,I);if(I+1>=H){break;}F=S.substring(I+1,H);O=F;R=null;G=O.indexOf(M);if(G>-1){R=O.substring(G+1);O=O.substring(0,G);}P=E[O];if(L){P=L(O,P,R);}if(A.isObject(P)){if(A.isArray(P)){P=A.dump(P,parseInt(R,10));}else{R=R||"";var K=R.indexOf(J);if(K>-1){R=R.substring(4);}if(P.toString===Object.prototype.toString||K>-1){P=A.dump(P,parseInt(R,10));}else{P=P.toString();}}}else{if(!A.isString(P)&&!A.isNumber(P)){P="~-"+N.length+"-~";N[N.length]=F;}}S=S.substring(0,I)+P+S.substring(H+1);}for(I=N.length-1;I>=0;I=I-1){S=S.replace(new RegExp("~-"+I+"-~"),"{"+N[I]+"}","g");}return S;},trim:function(D){try{return D.replace(/^\s+|\s+$/g,"");}catch(E){return D;}},merge:function(){var G={},E=arguments;for(var F=0,D=E.length;F<D;F=F+1){A.augmentObject(G,E[F],true);}return G;},later:function(K,E,L,G,H){K=K||0;E=E||{};var F=L,J=G,I,D;if(A.isString(L)){F=E[L];}if(!F){throw new TypeError("method undefined");}if(!A.isArray(J)){J=[G];}I=function(){F.apply(E,J);};D=(H)?setInterval(I,K):setTimeout(I,K);return{interval:H,cancel:function(){if(this.interval){clearInterval(D);}else{clearTimeout(D);}}};},isValue:function(D){return(A.isObject(D)||A.isString(D)||A.isNumber(D)||A.isBoolean(D));}};A.hasOwnProperty=(Object.prototype.hasOwnProperty)?function(D,E){return D&&D.hasOwnProperty(E);}:function(D,E){return !A.isUndefined(D[E])&&D.constructor.prototype[E]!==D[E];};B.augmentObject(A,B,true);YAHOO.util.Lang=A;A.augment=A.augmentProto;YAHOO.augment=A.augmentProto;YAHOO.extend=A.extend;})();YAHOO.register("yahoo",YAHOO,{version:"2.6.0",build:"1321"});(function(){var B=YAHOO.util,F=YAHOO.lang,L,J,K={},G={},N=window.document;YAHOO.env._id_counter=YAHOO.env._id_counter||0;var C=YAHOO.env.ua.opera,M=YAHOO.env.ua.webkit,A=YAHOO.env.ua.gecko,H=YAHOO.env.ua.ie;var E={HYPHEN:/(-[a-z])/i,ROOT_TAG:/^body|html$/i,OP_SCROLL:/^(?:inline|table-row)$/i};var O=function(Q){if(!E.HYPHEN.test(Q)){return Q;}if(K[Q]){return K[Q];}var R=Q;while(E.HYPHEN.exec(R)){R=R.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}K[Q]=R;return R;};var P=function(R){var Q=G[R];if(!Q){Q=new RegExp("(?:^|\\s+)"+R+"(?:\\s+|$)");G[R]=Q;}return Q;};if(N.defaultView&&N.defaultView.getComputedStyle){L=function(Q,T){var S=null;if(T=="float"){T="cssFloat";}var R=Q.ownerDocument.defaultView.getComputedStyle(Q,"");if(R){S=R[O(T)];}return Q.style[T]||S;};}else{if(N.documentElement.currentStyle&&H){L=function(Q,S){switch(O(S)){case"opacity":var U=100;try{U=Q.filters["DXImageTransform.Microsoft.Alpha"].opacity;}catch(T){try{U=Q.filters("alpha").opacity;}catch(T){}}return U/100;case"float":S="styleFloat";default:var R=Q.currentStyle?Q.currentStyle[S]:null;return(Q.style[S]||R);}};}else{L=function(Q,R){return Q.style[R];};}}if(H){J=function(Q,R,S){switch(R){case"opacity":if(F.isString(Q.style.filter)){Q.style.filter="alpha(opacity="+S*100+")";if(!Q.currentStyle||!Q.currentStyle.hasLayout){Q.style.zoom=1;}}break;case"float":R="styleFloat";default:Q.style[R]=S;}};}else{J=function(Q,R,S){if(R=="float"){R="cssFloat";}Q.style[R]=S;};}var D=function(Q,R){return Q&&Q.nodeType==1&&(!R||R(Q));};YAHOO.util.Dom={get:function(S){if(S){if(S.nodeType||S.item){return S;}if(typeof S==="string"){return N.getElementById(S);}if("length" in S){var T=[];for(var R=0,Q=S.length;R<Q;++R){T[T.length]=B.Dom.get(S[R]);}return T;}return S;}return null;},getStyle:function(Q,S){S=O(S);var R=function(T){return L(T,S);};return B.Dom.batch(Q,R,B.Dom,true);},setStyle:function(Q,S,T){S=O(S);var R=function(U){J(U,S,T);};B.Dom.batch(Q,R,B.Dom,true);},getXY:function(Q){var R=function(S){if((S.parentNode===null||S.offsetParent===null||this.getStyle(S,"display")=="none")&&S!=S.ownerDocument.body){return false;}return I(S);};return B.Dom.batch(Q,R,B.Dom,true);},getX:function(Q){var R=function(S){return B.Dom.getXY(S)[0];};return B.Dom.batch(Q,R,B.Dom,true);},getY:function(Q){var R=function(S){return B.Dom.getXY(S)[1];};return B.Dom.batch(Q,R,B.Dom,true);},setXY:function(Q,T,S){var R=function(W){var V=this.getStyle(W,"position");if(V=="static"){this.setStyle(W,"position","relative");V="relative";}var Y=this.getXY(W);if(Y===false){return false;}var X=[parseInt(this.getStyle(W,"left"),10),parseInt(this.getStyle(W,"top"),10)];if(isNaN(X[0])){X[0]=(V=="relative")?0:W.offsetLeft;}if(isNaN(X[1])){X[1]=(V=="relative")?0:W.offsetTop;}if(T[0]!==null){W.style.left=T[0]-Y[0]+X[0]+"px";}if(T[1]!==null){W.style.top=T[1]-Y[1]+X[1]+"px";}if(!S){var U=this.getXY(W);if((T[0]!==null&&U[0]!=T[0])||(T[1]!==null&&U[1]!=T[1])){this.setXY(W,T,true);}}};B.Dom.batch(Q,R,B.Dom,true);},setX:function(R,Q){B.Dom.setXY(R,[Q,null]);},setY:function(Q,R){B.Dom.setXY(Q,[null,R]);},getRegion:function(Q){var R=function(S){if((S.parentNode===null||S.offsetParent===null||this.getStyle(S,"display")=="none")&&S!=S.ownerDocument.body){return false;}var T=B.Region.getRegion(S);return T;};return B.Dom.batch(Q,R,B.Dom,true);},getClientWidth:function(){return B.Dom.getViewportWidth();},getClientHeight:function(){return B.Dom.getViewportHeight();},getElementsByClassName:function(U,Y,V,W){U=F.trim(U);Y=Y||"*";V=(V)?B.Dom.get(V):null||N;if(!V){return[];}var R=[],Q=V.getElementsByTagName(Y),X=P(U);for(var S=0,T=Q.length;S<T;++S){if(X.test(Q[S].className)){R[R.length]=Q[S];if(W){W.call(Q[S],Q[S]);}}}return R;},hasClass:function(S,R){var Q=P(R);var T=function(U){return Q.test(U.className);};return B.Dom.batch(S,T,B.Dom,true);},addClass:function(R,Q){var S=function(T){if(this.hasClass(T,Q)){return false;}T.className=F.trim([T.className,Q].join(" "));return true;};return B.Dom.batch(R,S,B.Dom,true);},removeClass:function(S,R){var Q=P(R);var T=function(W){var V=false,X=W.className;if(R&&X&&this.hasClass(W,R)){W.className=X.replace(Q," ");if(this.hasClass(W,R)){this.removeClass(W,R);}W.className=F.trim(W.className);if(W.className===""){var U=(W.hasAttribute)?"class":"className";W.removeAttribute(U);}V=true;}return V;};return B.Dom.batch(S,T,B.Dom,true);},replaceClass:function(T,R,Q){if(!Q||R===Q){return false;}var S=P(R);var U=function(V){if(!this.hasClass(V,R)){this.addClass(V,Q);return true;}V.className=V.className.replace(S," "+Q+" ");if(this.hasClass(V,R)){this.removeClass(V,R);}V.className=F.trim(V.className);return true;};return B.Dom.batch(T,U,B.Dom,true);},generateId:function(Q,S){S=S||"yui-gen";var R=function(T){if(T&&T.id){return T.id;}var U=S+YAHOO.env._id_counter++;if(T){T.id=U;}return U;};return B.Dom.batch(Q,R,B.Dom,true)||R.apply(B.Dom,arguments);},isAncestor:function(R,S){R=B.Dom.get(R);S=B.Dom.get(S);var Q=false;if((R&&S)&&(R.nodeType&&S.nodeType)){if(R.contains&&R!==S){Q=R.contains(S);}else{if(R.compareDocumentPosition){Q=!!(R.compareDocumentPosition(S)&16);}}}else{}return Q;},inDocument:function(Q){return this.isAncestor(N.documentElement,Q);},getElementsBy:function(X,R,S,U){R=R||"*";S=(S)?B.Dom.get(S):null||N;if(!S){return[];}var T=[],W=S.getElementsByTagName(R);for(var V=0,Q=W.length;V<Q;++V){if(X(W[V])){T[T.length]=W[V];if(U){U(W[V]);}}}return T;},batch:function(U,X,W,S){U=(U&&(U.tagName||U.item))?U:B.Dom.get(U);if(!U||!X){return false;}var T=(S)?W:window;if(U.tagName||U.length===undefined){return X.call(T,U,W);}var V=[];for(var R=0,Q=U.length;R<Q;++R){V[V.length]=X.call(T,U[R],W);}return V;},getDocumentHeight:function(){var R=(N.compatMode!="CSS1Compat")?N.body.scrollHeight:N.documentElement.scrollHeight;var Q=Math.max(R,B.Dom.getViewportHeight());return Q;},getDocumentWidth:function(){var R=(N.compatMode!="CSS1Compat")?N.body.scrollWidth:N.documentElement.scrollWidth;var Q=Math.max(R,B.Dom.getViewportWidth());return Q;},getViewportHeight:function(){var Q=self.innerHeight;
+var R=N.compatMode;if((R||H)&&!C){Q=(R=="CSS1Compat")?N.documentElement.clientHeight:N.body.clientHeight;}return Q;},getViewportWidth:function(){var Q=self.innerWidth;var R=N.compatMode;if(R||H){Q=(R=="CSS1Compat")?N.documentElement.clientWidth:N.body.clientWidth;}return Q;},getAncestorBy:function(Q,R){while((Q=Q.parentNode)){if(D(Q,R)){return Q;}}return null;},getAncestorByClassName:function(R,Q){R=B.Dom.get(R);if(!R){return null;}var S=function(T){return B.Dom.hasClass(T,Q);};return B.Dom.getAncestorBy(R,S);},getAncestorByTagName:function(R,Q){R=B.Dom.get(R);if(!R){return null;}var S=function(T){return T.tagName&&T.tagName.toUpperCase()==Q.toUpperCase();};return B.Dom.getAncestorBy(R,S);},getPreviousSiblingBy:function(Q,R){while(Q){Q=Q.previousSibling;if(D(Q,R)){return Q;}}return null;},getPreviousSibling:function(Q){Q=B.Dom.get(Q);if(!Q){return null;}return B.Dom.getPreviousSiblingBy(Q);},getNextSiblingBy:function(Q,R){while(Q){Q=Q.nextSibling;if(D(Q,R)){return Q;}}return null;},getNextSibling:function(Q){Q=B.Dom.get(Q);if(!Q){return null;}return B.Dom.getNextSiblingBy(Q);},getFirstChildBy:function(Q,S){var R=(D(Q.firstChild,S))?Q.firstChild:null;return R||B.Dom.getNextSiblingBy(Q.firstChild,S);},getFirstChild:function(Q,R){Q=B.Dom.get(Q);if(!Q){return null;}return B.Dom.getFirstChildBy(Q);},getLastChildBy:function(Q,S){if(!Q){return null;}var R=(D(Q.lastChild,S))?Q.lastChild:null;return R||B.Dom.getPreviousSiblingBy(Q.lastChild,S);},getLastChild:function(Q){Q=B.Dom.get(Q);return B.Dom.getLastChildBy(Q);},getChildrenBy:function(R,T){var S=B.Dom.getFirstChildBy(R,T);var Q=S?[S]:[];B.Dom.getNextSiblingBy(S,function(U){if(!T||T(U)){Q[Q.length]=U;}return false;});return Q;},getChildren:function(Q){Q=B.Dom.get(Q);if(!Q){}return B.Dom.getChildrenBy(Q);},getDocumentScrollLeft:function(Q){Q=Q||N;return Math.max(Q.documentElement.scrollLeft,Q.body.scrollLeft);},getDocumentScrollTop:function(Q){Q=Q||N;return Math.max(Q.documentElement.scrollTop,Q.body.scrollTop);},insertBefore:function(R,Q){R=B.Dom.get(R);Q=B.Dom.get(Q);if(!R||!Q||!Q.parentNode){return null;}return Q.parentNode.insertBefore(R,Q);},insertAfter:function(R,Q){R=B.Dom.get(R);Q=B.Dom.get(Q);if(!R||!Q||!Q.parentNode){return null;}if(Q.nextSibling){return Q.parentNode.insertBefore(R,Q.nextSibling);}else{return Q.parentNode.appendChild(R);}},getClientRegion:function(){var S=B.Dom.getDocumentScrollTop(),R=B.Dom.getDocumentScrollLeft(),T=B.Dom.getViewportWidth()+R,Q=B.Dom.getViewportHeight()+S;return new B.Region(S,T,Q,R);}};var I=function(){if(N.documentElement.getBoundingClientRect){return function(S){var T=S.getBoundingClientRect(),R=Math.round;var Q=S.ownerDocument;return[R(T.left+B.Dom.getDocumentScrollLeft(Q)),R(T.top+B.Dom.getDocumentScrollTop(Q))];};}else{return function(S){var T=[S.offsetLeft,S.offsetTop];var R=S.offsetParent;var Q=(M&&B.Dom.getStyle(S,"position")=="absolute"&&S.offsetParent==S.ownerDocument.body);if(R!=S){while(R){T[0]+=R.offsetLeft;T[1]+=R.offsetTop;if(!Q&&M&&B.Dom.getStyle(R,"position")=="absolute"){Q=true;}R=R.offsetParent;}}if(Q){T[0]-=S.ownerDocument.body.offsetLeft;T[1]-=S.ownerDocument.body.offsetTop;}R=S.parentNode;while(R.tagName&&!E.ROOT_TAG.test(R.tagName)){if(R.scrollTop||R.scrollLeft){T[0]-=R.scrollLeft;T[1]-=R.scrollTop;}R=R.parentNode;}return T;};}}();})();YAHOO.util.Region=function(C,D,A,B){this.top=C;this[1]=C;this.right=D;this.bottom=A;this.left=B;this[0]=B;};YAHOO.util.Region.prototype.contains=function(A){return(A.left>=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top);var D=Math.min(this.right,E.right);var A=Math.min(this.bottom,E.bottom);var B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B);}else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top);var D=Math.max(this.right,E.right);var A=Math.max(this.bottom,E.bottom);var B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D);var C=F[1];var E=F[0]+D.offsetWidth;var A=F[1]+D.offsetHeight;var B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}this.x=this.right=this.left=this[0]=A;this.y=this.top=this.bottom=this[1]=B;};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.register("dom",YAHOO.util.Dom,{version:"2.6.0",build:"1321"});YAHOO.util.CustomEvent=function(D,B,C,A){this.type=D;this.scope=B||window;this.silent=C;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var E="_YUICEOnSubscribe";if(D!==E){this.subscribeEvent=new YAHOO.util.CustomEvent(E,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(B,C,A){if(!B){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(B,C,A);}this.subscribers.push(new YAHOO.util.Subscriber(B,C,A));},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B<A;++B){var C=this.subscribers[B];if(C&&C.contains(D,F)){this._delete(B);E=true;}}return E;},fire:function(){this.lastError=null;var K=[],E=this.subscribers.length;if(!E&&this.silent){return true;}var I=[].slice.call(arguments,0),G=true,D,J=false;if(!this.silent){}var C=this.subscribers.slice(),A=YAHOO.util.Event.throwErrors;for(D=0;D<E;++D){var M=C[D];if(!M){J=true;}else{if(!this.silent){}var L=M.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var B=null;if(I.length>0){B=I[0];}try{G=M.fn.call(L,B,M.obj);}catch(F){this.lastError=F;if(A){throw F;}}}else{try{G=M.fn.call(L,this.type,I,M.obj);}catch(H){this.lastError=H;if(A){throw H;}}}if(false===G){if(!this.silent){}break;}}}return(G!==false);},unsubscribeAll:function(){for(var A=this.subscribers.length-1;A>-1;A--){this._delete(A);}this.subscribers=[];return A;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers.splice(A,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(B,C,A){this.fn=B;this.obj=YAHOO.lang.isUndefined(C)?null:C;this.override=A;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var H=false;var I=[];var J=[];var G=[];var E=[];var C=0;var F=[];var B=[];var A=0;var D={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};var K=YAHOO.env.ua.ie?"focusin":"focus";var L=YAHOO.env.ua.ie?"focusout":"blur";return{POLL_RETRYS:2000,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,CAPTURE:7,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,_dri:null,DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){var M=this;var N=function(){M._tryPreloadAttach();};this._interval=setInterval(N,this.POLL_INTERVAL);}},onAvailable:function(R,O,S,Q,P){var M=(YAHOO.lang.isString(R))?[R]:R;for(var N=0;N<M.length;N=N+1){F.push({id:M[N],fn:O,obj:S,override:Q,checkReady:P});}C=this.POLL_RETRYS;this.startInterval();},onContentReady:function(O,M,P,N){this.onAvailable(O,M,P,N,true);},onDOMReady:function(M,O,N){if(this.DOMReady){setTimeout(function(){var P=window;if(N){if(N===true){P=O;}else{P=N;}}M.call(P,"DOMReady",[],O);},0);}else{this.DOMReadyEvent.subscribe(M,O,N);}},_addListener:function(O,M,X,S,N,a){if(!X||!X.call){return false;}if(this._isValidCollection(O)){var Y=true;for(var T=0,V=O.length;T<V;++T){Y=this._addListener(O[T],M,X,S,N,a)&&Y;}return Y;}else{if(YAHOO.lang.isString(O)){var R=this.getEl(O);if(R){O=R;}else{this.onAvailable(O,function(){YAHOO.util.Event._addListener(O,M,X,S,N,a);});return true;}}}if(!O){return false;}if("unload"==M&&S!==this){J[J.length]=[O,M,X,S,N,a];return true;}var b=O;if(N){if(N===true){b=S;}else{b=N;}}var P=function(c){return X.call(b,YAHOO.util.Event.getEvent(c,O),S);};var Z=[O,M,X,P,b,S,N,a];var U=I.length;I[U]=Z;if(this.useLegacyEvent(O,M)){var Q=this.getLegacyIndex(O,M);if(Q==-1||O!=G[Q][0]){Q=G.length;B[O.id+M]=Q;G[Q]=[O,M,O["on"+M]];E[Q]=[];O["on"+M]=function(c){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(c),Q);};}E[Q].push(Z);}else{try{this._simpleAdd(O,M,P,a);}catch(W){this.lastError=W;this._removeListener(O,M,X,a);return false;}}return true;},addListener:function(O,Q,N,P,M){return this._addListener(O,Q,N,P,M,false);},addFocusListener:function(O,N,P,M){return this._addListener(O,K,N,P,M,true);},removeFocusListener:function(N,M){return this._removeListener(N,K,M,true);},addBlurListener:function(O,N,P,M){return this._addListener(O,L,N,P,M,true);},removeBlurListener:function(N,M){return this._removeListener(N,L,M,true);},fireLegacyEvent:function(Q,O){var S=true,M,U,T,V,R;U=E[O].slice();for(var N=0,P=U.length;N<P;++N){T=U[N];if(T&&T[this.WFN]){V=T[this.ADJ_SCOPE];R=T[this.WFN].call(V,Q);S=(S&&R);}}M=G[O];if(M&&M[2]){M[2](Q);}return S;},getLegacyIndex:function(N,O){var M=this.generateId(N)+O;if(typeof B[M]=="undefined"){return -1;}else{return B[M];}},useLegacyEvent:function(M,N){return(this.webkit&&this.webkit<419&&("click"==N||"dblclick"==N));},_removeListener:function(N,M,V,Y){var Q,T,X;if(typeof N=="string"){N=this.getEl(N);}else{if(this._isValidCollection(N)){var W=true;for(Q=N.length-1;Q>-1;Q--){W=(this._removeListener(N[Q],M,V,Y)&&W);}return W;}}if(!V||!V.call){return this.purgeElement(N,false,M);}if("unload"==M){for(Q=J.length-1;Q>-1;Q--){X=J[Q];if(X&&X[0]==N&&X[1]==M&&X[2]==V){J.splice(Q,1);return true;}}return false;}var R=null;var S=arguments[4];if("undefined"===typeof S){S=this._getCacheIndex(N,M,V);}if(S>=0){R=I[S];}if(!N||!R){return false;}if(this.useLegacyEvent(N,M)){var P=this.getLegacyIndex(N,M);var O=E[P];if(O){for(Q=0,T=O.length;Q<T;++Q){X=O[Q];if(X&&X[this.EL]==N&&X[this.TYPE]==M&&X[this.FN]==V){O.splice(Q,1);break;}}}}else{try{this._simpleRemove(N,M,R[this.WFN],Y);}catch(U){this.lastError=U;return false;}}delete I[S][this.WFN];delete I[S][this.FN];
+I.splice(S,1);return true;},removeListener:function(N,O,M){return this._removeListener(N,O,M,false);},getTarget:function(O,N){var M=O.target||O.srcElement;return this.resolveTextNode(M);},resolveTextNode:function(N){try{if(N&&3==N.nodeType){return N.parentNode;}}catch(M){}return N;},getPageX:function(N){var M=N.pageX;if(!M&&0!==M){M=N.clientX||0;if(this.isIE){M+=this._getScrollLeft();}}return M;},getPageY:function(M){var N=M.pageY;if(!N&&0!==N){N=M.clientY||0;if(this.isIE){N+=this._getScrollTop();}}return N;},getXY:function(M){return[this.getPageX(M),this.getPageY(M)];},getRelatedTarget:function(N){var M=N.relatedTarget;if(!M){if(N.type=="mouseout"){M=N.toElement;}else{if(N.type=="mouseover"){M=N.fromElement;}}}return this.resolveTextNode(M);},getTime:function(O){if(!O.time){var N=new Date().getTime();try{O.time=N;}catch(M){this.lastError=M;return N;}}return O.time;},stopEvent:function(M){this.stopPropagation(M);this.preventDefault(M);},stopPropagation:function(M){if(M.stopPropagation){M.stopPropagation();}else{M.cancelBubble=true;}},preventDefault:function(M){if(M.preventDefault){M.preventDefault();}else{M.returnValue=false;}},getEvent:function(O,M){var N=O||window.event;if(!N){var P=this.getEvent.caller;while(P){N=P.arguments[0];if(N&&Event==N.constructor){break;}P=P.caller;}}return N;},getCharCode:function(N){var M=N.keyCode||N.charCode||0;if(YAHOO.env.ua.webkit&&(M in D)){M=D[M];}return M;},_getCacheIndex:function(Q,R,P){for(var O=0,N=I.length;O<N;O=O+1){var M=I[O];if(M&&M[this.FN]==P&&M[this.EL]==Q&&M[this.TYPE]==R){return O;}}return -1;},generateId:function(M){var N=M.id;if(!N){N="yuievtautoid-"+A;++A;M.id=N;}return N;},_isValidCollection:function(N){try{return(N&&typeof N!=="string"&&N.length&&!N.tagName&&!N.alert&&typeof N[0]!=="undefined");}catch(M){return false;}},elCache:{},getEl:function(M){return(typeof M==="string")?document.getElementById(M):M;},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(N){if(!H){H=true;var M=YAHOO.util.Event;M._ready();M._tryPreloadAttach();}},_ready:function(N){var M=YAHOO.util.Event;if(!M.DOMReady){M.DOMReady=true;M.DOMReadyEvent.fire();M._simpleRemove(document,"DOMContentLoaded",M._ready);}},_tryPreloadAttach:function(){if(F.length===0){C=0;clearInterval(this._interval);this._interval=null;return ;}if(this.locked){return ;}if(this.isIE){if(!this.DOMReady){this.startInterval();return ;}}this.locked=true;var S=!H;if(!S){S=(C>0&&F.length>0);}var R=[];var T=function(V,W){var U=V;if(W.override){if(W.override===true){U=W.obj;}else{U=W.override;}}W.fn.call(U,W.obj);};var N,M,Q,P,O=[];for(N=0,M=F.length;N<M;N=N+1){Q=F[N];if(Q){P=this.getEl(Q.id);if(P){if(Q.checkReady){if(H||P.nextSibling||!S){O.push(Q);F[N]=null;}}else{T(P,Q);F[N]=null;}}else{R.push(Q);}}}for(N=0,M=O.length;N<M;N=N+1){Q=O[N];T(this.getEl(Q.id),Q);}C--;if(S){for(N=F.length-1;N>-1;N--){Q=F[N];if(!Q||!Q.id){F.splice(N,1);}}this.startInterval();}else{clearInterval(this._interval);this._interval=null;}this.locked=false;},purgeElement:function(Q,R,T){var O=(YAHOO.lang.isString(Q))?this.getEl(Q):Q;var S=this.getListeners(O,T),P,M;if(S){for(P=S.length-1;P>-1;P--){var N=S[P];this._removeListener(O,N.type,N.fn,N.capture);}}if(R&&O&&O.childNodes){for(P=0,M=O.childNodes.length;P<M;++P){this.purgeElement(O.childNodes[P],R,T);}}},getListeners:function(O,M){var R=[],N;if(!M){N=[I,J];}else{if(M==="unload"){N=[J];}else{N=[I];}}var T=(YAHOO.lang.isString(O))?this.getEl(O):O;for(var Q=0;Q<N.length;Q=Q+1){var V=N[Q];if(V){for(var S=0,U=V.length;S<U;++S){var P=V[S];if(P&&P[this.EL]===T&&(!M||M===P[this.TYPE])){R.push({type:P[this.TYPE],fn:P[this.FN],obj:P[this.OBJ],adjust:P[this.OVERRIDE],scope:P[this.ADJ_SCOPE],capture:P[this.CAPTURE],index:S});}}}}return(R.length)?R:null;},_unload:function(S){var M=YAHOO.util.Event,P,O,N,R,Q,T=J.slice();for(P=0,R=J.length;P<R;++P){N=T[P];if(N){var U=window;if(N[M.ADJ_SCOPE]){if(N[M.ADJ_SCOPE]===true){U=N[M.UNLOAD_OBJ];}else{U=N[M.ADJ_SCOPE];}}N[M.FN].call(U,M.getEvent(S,N[M.EL]),N[M.UNLOAD_OBJ]);T[P]=null;N=null;U=null;}}J=null;if(I){for(O=I.length-1;O>-1;O--){N=I[O];if(N){M._removeListener(N[M.EL],N[M.TYPE],N[M.FN],N[M.CAPTURE],O);}}N=null;}G=null;M._simpleRemove(window,"unload",M._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var M=document.documentElement,N=document.body;if(M&&(M.scrollTop||M.scrollLeft)){return[M.scrollTop,M.scrollLeft];}else{if(N){return[N.scrollTop,N.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(O,P,N,M){O.addEventListener(P,N,(M));};}else{if(window.attachEvent){return function(O,P,N,M){O.attachEvent("on"+P,N);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(O,P,N,M){O.removeEventListener(P,N,(M));};}else{if(window.detachEvent){return function(N,O,M){N.detachEvent("on"+O,M);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;EU.onFocus=EU.addFocusListener;EU.onBlur=EU.addBlurListener;
+/* DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller */
+if(EU.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var n=document.createElement("p");EU._dri=setInterval(function(){try{n.doScroll("left");clearInterval(EU._dri);EU._dri=null;EU._ready();n=null;}catch(ex){}},EU.POLL_INTERVAL);}else{if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}}EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{};
+var D=this.__yui_events[A];if(D){D.subscribe(C,F,E);}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,override:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A);},createEvent:function(G,D){this.__yui_events=this.__yui_events||{};var A=D||{};var I=this.__yui_events;if(I[G]){}else{var H=A.scope||this;var E=(A.silent);var B=new YAHOO.util.CustomEvent(G,H,E,YAHOO.util.CustomEvent.FLAT);I[G]=B;if(A.onSubscribeCallback){B.subscribeEvent.subscribe(A.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var F=this.__yui_subscribers[G];if(F){for(var C=0;C<F.length;++C){B.subscribe(F[C].fn,F[C].obj,F[C].override);}}}return I[G];},fireEvent:function(E,D,A,C){this.__yui_events=this.__yui_events||{};var G=this.__yui_events[E];if(!G){return null;}var B=[];for(var F=1;F<arguments.length;++F){B.push(arguments[F]);}return G.fire.apply(G,B);},hasEvent:function(A){if(this.__yui_events){if(this.__yui_events[A]){return true;}}return false;}};YAHOO.util.KeyListener=function(A,F,B,C){if(!A){}else{if(!F){}else{if(!B){}}}if(!C){C=YAHOO.util.KeyListener.KEYDOWN;}var D=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(typeof A=="string"){A=document.getElementById(A);}if(typeof B=="function"){D.subscribe(B);}else{D.subscribe(B.fn,B.scope,B.correctScope);}function E(J,I){if(!F.shift){F.shift=false;}if(!F.alt){F.alt=false;}if(!F.ctrl){F.ctrl=false;}if(J.shiftKey==F.shift&&J.altKey==F.alt&&J.ctrlKey==F.ctrl){var G;if(F.keys instanceof Array){for(var H=0;H<F.keys.length;H++){G=F.keys[H];if(G==J.charCode){D.fire(J.charCode,J);break;}else{if(G==J.keyCode){D.fire(J.keyCode,J);break;}}}}else{G=F.keys;if(G==J.charCode){D.fire(J.charCode,J);}else{if(G==J.keyCode){D.fire(J.keyCode,J);}}}}}this.enable=function(){if(!this.enabled){YAHOO.util.Event.addListener(A,C,E);this.enabledEvent.fire(F);}this.enabled=true;};this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(A,C,E);this.disabledEvent.fire(F);}this.enabled=false;};this.toString=function(){return"KeyListener ["+F.keys+"] "+A.tagName+(A.id?"["+A.id+"]":"");};};YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.util.KeyListener.KEY={ALT:18,BACK_SPACE:8,CAPS_LOCK:20,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,META:224,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PRINTSCREEN:44,RIGHT:39,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,UP:38};YAHOO.register("event",YAHOO.util.Event,{version:"2.6.0",build:"1321"});YAHOO.register("yahoo-dom-event", YAHOO, {version: "2.6.0", build: "1321"});
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.6.0
+*/
+(function(){var B=YAHOO.util;var A=function(D,C,E,F){if(!D){}this.init(D,C,E,F);};A.NAME="Anim";A.prototype={toString:function(){var C=this.getEl()||{};var D=C.id||C.tagName;return(this.constructor.NAME+": "+D);},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(C,E,D){return this.method(this.currentFrame,E,D-E,this.totalFrames);},setAttribute:function(C,E,D){if(this.patterns.noNegatives.test(C)){E=(E>0)?E:0;}B.Dom.setStyle(this.getEl(),C,E+D);},getAttribute:function(C){var E=this.getEl();var G=B.Dom.getStyle(E,C);if(G!=="auto"&&!this.patterns.offsetUnit.test(G)){return parseFloat(G);}var D=this.patterns.offsetAttribute.exec(C)||[];var H=!!(D[3]);var F=!!(D[2]);if(F||(B.Dom.getStyle(E,"position")=="absolute"&&H)){G=E["offset"+D[0].charAt(0).toUpperCase()+D[0].substr(1)];}else{G=0;}return G;},getDefaultUnit:function(C){if(this.patterns.defaultUnit.test(C)){return"px";}return"";},setRuntimeAttribute:function(D){var I;var E;var F=this.attributes;this.runtimeAttributes[D]={};var H=function(J){return(typeof J!=="undefined");};if(!H(F[D]["to"])&&!H(F[D]["by"])){return false;}I=(H(F[D]["from"]))?F[D]["from"]:this.getAttribute(D);if(H(F[D]["to"])){E=F[D]["to"];}else{if(H(F[D]["by"])){if(I.constructor==Array){E=[];for(var G=0,C=I.length;G<C;++G){E[G]=I[G]+F[D]["by"][G]*1;}}else{E=I+F[D]["by"]*1;}}}this.runtimeAttributes[D].start=I;this.runtimeAttributes[D].end=E;this.runtimeAttributes[D].unit=(H(F[D].unit))?F[D]["unit"]:this.getDefaultUnit(D);return true;},init:function(E,J,I,C){var D=false;var F=null;var H=0;E=B.Dom.get(E);this.attributes=J||{};this.duration=!YAHOO.lang.isUndefined(I)?I:1;this.method=C||B.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=B.AnimMgr.fps;this.setEl=function(M){E=B.Dom.get(M);};this.getEl=function(){return E;};this.isAnimated=function(){return D;};this.getStartTime=function(){return F;};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false;}this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(B.AnimMgr.fps*this.duration):this.duration;if(this.duration===0&&this.useSeconds){this.totalFrames=1;}B.AnimMgr.registerElement(this);return true;};this.stop=function(M){if(!this.isAnimated()){return false;}if(M){this.currentFrame=this.totalFrames;this._onTween.fire();}B.AnimMgr.stop(this);};var L=function(){this.onStart.fire();this.runtimeAttributes={};for(var M in this.attributes){this.setRuntimeAttribute(M);}D=true;H=0;F=new Date();};var K=function(){var O={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};O.toString=function(){return("duration: "+O.duration+", currentFrame: "+O.currentFrame);};this.onTween.fire(O);var N=this.runtimeAttributes;for(var M in N){this.setAttribute(M,this.doMethod(M,N[M].start,N[M].end),N[M].unit);}H+=1;};var G=function(){var M=(new Date()-F)/1000;var N={duration:M,frames:H,fps:H/M};N.toString=function(){return("duration: "+N.duration+", frames: "+N.frames+", fps: "+N.fps);};D=false;H=0;this.onComplete.fire(N);};this._onStart=new B.CustomEvent("_start",this,true);this.onStart=new B.CustomEvent("start",this);this.onTween=new B.CustomEvent("tween",this);this._onTween=new B.CustomEvent("_tween",this,true);this.onComplete=new B.CustomEvent("complete",this);this._onComplete=new B.CustomEvent("_complete",this,true);this._onStart.subscribe(L);this._onTween.subscribe(K);this._onComplete.subscribe(G);}};B.Anim=A;})();YAHOO.util.AnimMgr=new function(){var C=null;var B=[];var A=0;this.fps=1000;this.delay=1;this.registerElement=function(F){B[B.length]=F;A+=1;F._onStart.fire();this.start();};this.unRegister=function(G,F){F=F||E(G);if(!G.isAnimated()||F==-1){return false;}G._onComplete.fire();B.splice(F,1);A-=1;if(A<=0){this.stop();}return true;};this.start=function(){if(C===null){C=setInterval(this.run,this.delay);}};this.stop=function(H){if(!H){clearInterval(C);for(var G=0,F=B.length;G<F;++G){this.unRegister(B[0],0);}B=[];C=null;A=0;}else{this.unRegister(H);}};this.run=function(){for(var H=0,F=B.length;H<F;++H){var G=B[H];if(!G||!G.isAnimated()){continue;}if(G.currentFrame<G.totalFrames||G.totalFrames===null){G.currentFrame+=1;if(G.useSeconds){D(G);}G._onTween.fire();}else{YAHOO.util.AnimMgr.stop(G,H);}}};var E=function(H){for(var G=0,F=B.length;G<F;++G){if(B[G]==H){return G;}}return -1;};var D=function(G){var J=G.totalFrames;var I=G.currentFrame;var H=(G.currentFrame*G.duration*1000/G.totalFrames);var F=(new Date()-G.getStartTime());var K=0;if(F<G.duration*1000){K=Math.round((F/H-1)*G.currentFrame);}else{K=J-(I+1);}if(K>0&&isFinite(K)){if(G.currentFrame+K>=J){K=J-(I+1);}G.currentFrame+=K;}};};YAHOO.util.Bezier=new function(){this.getPosition=function(E,D){var F=E.length;var C=[];for(var B=0;B<F;++B){C[B]=[E[B][0],E[B][1]];}for(var A=1;A<F;++A){for(B=0;B<F-A;++B){C[B][0]=(1-D)*C[B][0]+D*C[parseInt(B+1,10)][0];C[B][1]=(1-D)*C[B][1]+D*C[parseInt(B+1,10)][1];}}return[C[0][0],C[0][1]];};};(function(){var A=function(F,E,G,H){A.superclass.constructor.call(this,F,E,G,H);};A.NAME="ColorAnim";A.DEFAULT_BGCOLOR="#fff";var C=YAHOO.util;YAHOO.extend(A,C.Anim);var D=A.superclass;var B=A.prototype;B.patterns.color=/color$/i;B.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;B.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;B.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;B.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;B.parseColor=function(E){if(E.length==3){return E;}var F=this.patterns.hex.exec(E);if(F&&F.length==4){return[parseInt(F[1],16),parseInt(F[2],16),parseInt(F[3],16)];}F=this.patterns.rgb.exec(E);if(F&&F.length==4){return[parseInt(F[1],10),parseInt(F[2],10),parseInt(F[3],10)];}F=this.patterns.hex3.exec(E);if(F&&F.length==4){return[parseInt(F[1]+F[1],16),parseInt(F[2]+F[2],16),parseInt(F[3]+F[3],16)];}return null;};B.getAttribute=function(E){var G=this.getEl();
+if(this.patterns.color.test(E)){var I=YAHOO.util.Dom.getStyle(G,E);var H=this;if(this.patterns.transparent.test(I)){var F=YAHOO.util.Dom.getAncestorBy(G,function(J){return !H.patterns.transparent.test(I);});if(F){I=C.Dom.getStyle(F,E);}else{I=A.DEFAULT_BGCOLOR;}}}else{I=D.getAttribute.call(this,E);}return I;};B.doMethod=function(F,J,G){var I;if(this.patterns.color.test(F)){I=[];for(var H=0,E=J.length;H<E;++H){I[H]=D.doMethod.call(this,F,J[H],G[H]);}I="rgb("+Math.floor(I[0])+","+Math.floor(I[1])+","+Math.floor(I[2])+")";}else{I=D.doMethod.call(this,F,J,G);}return I;};B.setRuntimeAttribute=function(F){D.setRuntimeAttribute.call(this,F);if(this.patterns.color.test(F)){var H=this.attributes;var J=this.parseColor(this.runtimeAttributes[F].start);var G=this.parseColor(this.runtimeAttributes[F].end);if(typeof H[F]["to"]==="undefined"&&typeof H[F]["by"]!=="undefined"){G=this.parseColor(H[F].by);for(var I=0,E=J.length;I<E;++I){G[I]=J[I]+G[I];}}this.runtimeAttributes[F].start=J;this.runtimeAttributes[F].end=G;}};C.ColorAnim=A;})();
+/*
+TERMS OF USE - EASING EQUATIONS
+Open source under the BSD License.
+Copyright 2001 Robert Penner All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+ * Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+YAHOO.util.Easing={easeNone:function(B,A,D,C){return D*B/C+A;},easeIn:function(B,A,D,C){return D*(B/=C)*B+A;},easeOut:function(B,A,D,C){return -D*(B/=C)*(B-2)+A;},easeBoth:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B+A;}return -D/2*((--B)*(B-2)-1)+A;},easeInStrong:function(B,A,D,C){return D*(B/=C)*B*B*B+A;},easeOutStrong:function(B,A,D,C){return -D*((B=B/C-1)*B*B*B-1)+A;},easeBothStrong:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B*B*B+A;}return -D/2*((B-=2)*B*B*B-2)+A;},elasticIn:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F)==1){return A+G;}if(!E){E=F*0.3;}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}return -(B*Math.pow(2,10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E))+A;},elasticOut:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F)==1){return A+G;}if(!E){E=F*0.3;}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}return B*Math.pow(2,-10*C)*Math.sin((C*F-D)*(2*Math.PI)/E)+G+A;},elasticBoth:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F/2)==2){return A+G;}if(!E){E=F*(0.3*1.5);}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}if(C<1){return -0.5*(B*Math.pow(2,10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E))+A;}return B*Math.pow(2,-10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E)*0.5+G+A;},backIn:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}return E*(B/=D)*B*((C+1)*B-C)+A;},backOut:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}return E*((B=B/D-1)*B*((C+1)*B+C)+1)+A;},backBoth:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}if((B/=D/2)<1){return E/2*(B*B*(((C*=(1.525))+1)*B-C))+A;}return E/2*((B-=2)*B*(((C*=(1.525))+1)*B+C)+2)+A;},bounceIn:function(B,A,D,C){return D-YAHOO.util.Easing.bounceOut(C-B,0,D,C)+A;},bounceOut:function(B,A,D,C){if((B/=C)<(1/2.75)){return D*(7.5625*B*B)+A;}else{if(B<(2/2.75)){return D*(7.5625*(B-=(1.5/2.75))*B+0.75)+A;}else{if(B<(2.5/2.75)){return D*(7.5625*(B-=(2.25/2.75))*B+0.9375)+A;}}}return D*(7.5625*(B-=(2.625/2.75))*B+0.984375)+A;},bounceBoth:function(B,A,D,C){if(B<C/2){return YAHOO.util.Easing.bounceIn(B*2,0,D,C)*0.5+A;}return YAHOO.util.Easing.bounceOut(B*2-C,0,D,C)*0.5+D*0.5+A;}};(function(){var A=function(H,G,I,J){if(H){A.superclass.constructor.call(this,H,G,I,J);}};A.NAME="Motion";var E=YAHOO.util;YAHOO.extend(A,E.ColorAnim);var F=A.superclass;var C=A.prototype;C.patterns.points=/^points$/i;C.setAttribute=function(G,I,H){if(this.patterns.points.test(G)){H=H||"px";F.setAttribute.call(this,"left",I[0],H);F.setAttribute.call(this,"top",I[1],H);}else{F.setAttribute.call(this,G,I,H);}};C.getAttribute=function(G){if(this.patterns.points.test(G)){var H=[F.getAttribute.call(this,"left"),F.getAttribute.call(this,"top")];}else{H=F.getAttribute.call(this,G);}return H;};C.doMethod=function(G,K,H){var J=null;if(this.patterns.points.test(G)){var I=this.method(this.currentFrame,0,100,this.totalFrames)/100;J=E.Bezier.getPosition(this.runtimeAttributes[G],I);}else{J=F.doMethod.call(this,G,K,H);}return J;};C.setRuntimeAttribute=function(P){if(this.patterns.points.test(P)){var H=this.getEl();var J=this.attributes;var G;var L=J["points"]["control"]||[];var I;var M,O;if(L.length>0&&!(L[0] instanceof Array)){L=[L];}else{var K=[];for(M=0,O=L.length;M<O;++M){K[M]=L[M];}L=K;}if(E.Dom.getStyle(H,"position")=="static"){E.Dom.setStyle(H,"position","relative");}if(D(J["points"]["from"])){E.Dom.setXY(H,J["points"]["from"]);}else{E.Dom.setXY(H,E.Dom.getXY(H));
+}G=this.getAttribute("points");if(D(J["points"]["to"])){I=B.call(this,J["points"]["to"],G);var N=E.Dom.getXY(this.getEl());for(M=0,O=L.length;M<O;++M){L[M]=B.call(this,L[M],G);}}else{if(D(J["points"]["by"])){I=[G[0]+J["points"]["by"][0],G[1]+J["points"]["by"][1]];for(M=0,O=L.length;M<O;++M){L[M]=[G[0]+L[M][0],G[1]+L[M][1]];}}}this.runtimeAttributes[P]=[G];if(L.length>0){this.runtimeAttributes[P]=this.runtimeAttributes[P].concat(L);}this.runtimeAttributes[P][this.runtimeAttributes[P].length]=I;}else{F.setRuntimeAttribute.call(this,P);}};var B=function(G,I){var H=E.Dom.getXY(this.getEl());G=[G[0]-H[0]+I[0],G[1]-H[1]+I[1]];return G;};var D=function(G){return(typeof G!=="undefined");};E.Motion=A;})();(function(){var D=function(F,E,G,H){if(F){D.superclass.constructor.call(this,F,E,G,H);}};D.NAME="Scroll";var B=YAHOO.util;YAHOO.extend(D,B.ColorAnim);var C=D.superclass;var A=D.prototype;A.doMethod=function(E,H,F){var G=null;if(E=="scroll"){G=[this.method(this.currentFrame,H[0],F[0]-H[0],this.totalFrames),this.method(this.currentFrame,H[1],F[1]-H[1],this.totalFrames)];}else{G=C.doMethod.call(this,E,H,F);}return G;};A.getAttribute=function(E){var G=null;var F=this.getEl();if(E=="scroll"){G=[F.scrollLeft,F.scrollTop];}else{G=C.getAttribute.call(this,E);}return G;};A.setAttribute=function(E,H,G){var F=this.getEl();if(E=="scroll"){F.scrollLeft=H[0];F.scrollTop=H[1];}else{C.setAttribute.call(this,E,H,G);}};B.Scroll=D;})();YAHOO.register("animation",YAHOO.util.Anim,{version:"2.6.0",build:"1321"});
\ No newline at end of file diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/debug.css b/docs/dymaxion/soundmanagerv297a-20101010/demo/debug.css new file mode 100755 index 0000000..728fd4b --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/debug.css @@ -0,0 +1,25 @@ +#soundmanager-debug {
+ position:fixed;
+ _position:absolute; /* IE <7 */
+ bottom:1em;
+ right:1em;
+ width:38em;
+ height:30em;
+ overflow:auto;
+ padding:0px;
+ margin:1em;
+ font-family:monaco,"VT-100",terminal,"lucida console",courier,system;
+ opacity:0.9;
+ color:#333;
+ border:1px solid #ccddee;
+ -moz-border-radius:3px;
+ -khtml-border-radius:3px;
+ -webkit-border-radius:3px;
+ background:#f3f9ff;
+}
+
+#soundmanager-debug div {
+ font-size:x-small;
+ padding:0.2em;
+ margin:0px;
+}
\ No newline at end of file diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/flashblock/basic.html b/docs/dymaxion/soundmanagerv297a-20101010/demo/flashblock/basic.html new file mode 100755 index 0000000..39b768b --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/flashblock/basic.html @@ -0,0 +1,36 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<title>SoundManager 2: Flash blocker handling - basic example</title> +<meta name="description" content="Demo of SoundManager 2 handling flashblock / "click to flash" blockers gracefully" /> +<meta name="keywords" content="javascript sound, javascript audio, DHTML sound, flashblock, flash blocker, handling flashblock, click to flash, click2flash" /> +<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" /> + +<!-- actual flashblock demo stuff, this is for you --> +<link rel="stylesheet" type="text/css" href="flashblock.css" /> +<script type="text/javascript" src="../../script/soundmanager2.js"></script> + +<script type="text/javascript"> +// enable flash block handling +soundManager.useFlashBlock = true; + +// custom demo options, not for your needs +soundManager.debugMode = true; +soundManager.url = '../../swf/'; + +</script> +</head> +<body> + +<div> + + <h1><a href="http://www.schillmania.com/projects/soundmanager2/">SoundManager 2</a>: Flashblock / "click to flash" handling: Basic Demo</h1> + + <div id="sm2-container"> + <!-- flash movie will be placed here --> + </div> + + <p>See <a href="flashblock.css">flashblock.css</a> as a template for making your own SM2 + flash block implementations.</p> + +</div>
\ No newline at end of file diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/flashblock/flashblock.css b/docs/dymaxion/soundmanagerv297a-20101010/demo/flashblock/flashblock.css new file mode 100755 index 0000000..6733a08 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/flashblock/flashblock.css @@ -0,0 +1,99 @@ +/*
+ SoundManager 2 + useFlashBlock
+ Flash positioning and flashblock / clicktoflash handling
+*/
+
+#sm2-container {
+ /*
+ where the SM2 flash movie goes. by default, relative container.
+ set relative or absolute here, and don't touch it later or bad things will happen (see below comments.)
+ */
+ position:relative;
+ width:1px;
+ height:1px;
+ _overflow:hidden; /* screw IE 6, just make it display nice */
+}
+
+#sm2-container object,
+#sm2-container embed {
+ /*
+ the actual movie bit.
+ SWF needs to be able to be moved off-screen without display: or position: changes. important.
+ changing display: or position: or overflow: here or on parent can cause SFW reload or other weird issues after unblock,
+ eg. SM2 starts but strange errors, no whileplaying() etc.
+ */
+ position:absolute;
+}
+
+#sm2-container object,
+#sm2-container embed,
+#sm2-container.swf_timedout,
+#sm2-container.swf_timedout object,
+#sm2-container.swf_timedout embed {
+ /*
+ when SM2 didn't start normally, time-out case. flash blocked, missing SWF, no flash?
+ 48px square flash placeholder is typically used by blockers.
+ */
+ left:auto;
+ top:auto;
+ width:48px;
+ height:48px;
+}
+
+#sm2-container.swf_unblocked {
+ /* SWF unblocked, or was never blocked to begin with; try to collapse container as much as possible. */
+ width:1px;
+ height:1px;
+}
+
+#sm2-container.swf_unblocked object,
+#sm2-container.swf_unblocked embed {
+ /* hide flash off-screen (relative to container) when it has loaded OK */
+ left:-9999em;
+ top:-9999em;
+}
+
+#sm2-container.swf_error {
+ /* when there is a fatal error (flash loaded, but SM2 failed) */
+ display:none;
+}
+
+#sm2-container.high_performance {
+ /* "high performance" case: keep on-screen at all times */
+ position:absolute;
+ position:fixed;
+ _top:-9999px; /* IE 6 hax, no position:fixed */
+ _left:-9999px;
+ bottom:0px;
+ left:0px;
+ /*
+ special case: show at first with w/h, hide when unblocked.
+ might be bad/annoying.
+ */
+ width:48px;
+ height:48px;
+ z-index:99; /* try to stay on top */
+}
+
+#sm2-container.high_performance.swf_unblocked {
+ z-index:auto;
+}
+
+#sm2-container.high_performance.swf_unblocked,
+#sm2-container.high_performance.swf_unblocked object,
+#sm2-container.high_performance.swf_unblocked embed {
+ /* 8x8px is required minimum to load in fx/win32 in some cases(?), 6x6+ good for fast performance, even better when on-screen via position:fixed */
+ width:8px;
+ height:8px;
+}
+
+#sm2-container.high_performance.swf_unblocked object,
+#sm2-container.high_performance.swf_unblocked embed {
+ /* high-performance case must stay on-screen */
+ left:auto;
+ top:auto;
+}
+
+#sm2-container.high_performance.swf_timedout {
+ z-index:99; /* try to stay on top */
+}
\ No newline at end of file diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/flashblock/index.html b/docs/dymaxion/soundmanagerv297a-20101010/demo/flashblock/index.html new file mode 100755 index 0000000..796308e --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/flashblock/index.html @@ -0,0 +1,125 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+<title>SoundManager 2: Flash Block handling examples</title> +<meta name="robots" content="noindex" />
+<meta name="description" content="Demo of SoundManager 2 handling flashblock / "click to flash" blockers gracefully" />
+<meta name="keywords" content="javascript sound, javascript audio, DHTML sound, flashblock, flash blocker, handling flashblock, click to flash, click2flash" />
+<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
+<!-- design template, you don't need this -->
+<link rel="stylesheet" type="text/css" href="../index.css" />
+<link rel="stylesheet" type="text/css" href="../debug.css" />
+
+<!-- actual flashblock demo stuff, this is for you -->
+<link rel="stylesheet" type="text/css" href="flashblock.css" />
+<script type="text/javascript" src="../../script/soundmanager2.js"></script>
+
+<script type="text/javascript">
+// enable flash block handling
+soundManager.useFlashBlock = true; // make sure you check and use flashblock.css too, as that is used to position the SWF with this feature on!
+
+// custom demo options, not for your needs
+soundManager.debugMode = true;
+soundManager.url = '../../swf/';
+
+// flash version URL switch (for this demo page)
+var winLoc = window.location.toString();
+if (winLoc.match(/flash9/i)) {
+ soundManager.flashVersion = 9;
+ if (winLoc.match(/highperformance/i)) {
+ soundManager.useHighPerformance = true;
+ }
+} else if (winLoc.match(/flash8/i)) {
+ soundManager.flashVersion = 8;
+}
+
+soundManager.onready(function(){
+ var ok = soundManager.supported();
+ var loaded = soundManager.getMoviePercent();
+ var msg = null;
+ if (!ok) {
+ // loaded, or no?
+ msg = 'No response (yet), flash movie '+(loaded?'loaded OK (likely security/error case)':'has not loaded (likely flash-blocked.)')+' Waiting indefinitely ...';
+ } else {
+ msg = 'SoundManager load OK';
+ }
+ document.getElementById('sm2-status').innerHTML = msg;
+});
+
+</script>
+</head>
+<body>
+
+<div style="margin:1em;max-width:60em;font-size:110%">
+
+ <h1><a href="http://www.schillmania.com/projects/soundmanager2/">SoundManager 2</a>: Flashblock / "click to flash" handling demos</h1>
+
+ <h3>Show SWF inline, wait indefinitely for load (click-to-run or whitelist)</h3>
+
+ <p class="note">You can run this demo with <a href="#flash8" onclick="window.location.replace(this.href);window.location.reload()">Flash 8</a> (default), <a href="#flash9" onclick="window.location.replace(this.href);window.location.reload()">Flash 9</a> (normal mode) or <a href="#flash9-highperformance" onclick="window.location.replace(this.href);window.location.reload()">Flash 9 + highPerformance mode</a> (higher JS callback frequency).</p>
+
+ <h4>Where (and when) to show the SWF</h4>
+
+ <p>To handle potential flash block cases, put <code><div id="sm2-container"></div></code> in your markup where you'd like the SWF to appear in those cases. If not specified, SM2 will create and append the <code>#sm2-container</code> node to the document when it starts.</p>
+
+ <p>When <code>soundManager.useFlashBlock</code> is true, SM2 will not apply styles (eg. <code>style.position.left</code>) directly to the flash; rather, it will assign CSS classes and you can handle it as you choose. Take a look at <a href="#flashblock-css">the related CSS</a> file you will also need if you turn this feature on.</p>
+
+ <h4>Handling failed start-up cases</h4>
+
+ <p>In the blocked/failed start-up case, <code>#sm2-container</code> will have a class name of <code>swf_timedout</code> applied to it.</p>
+
+ <p>SM2 will start its init process, and will fire <code>onready()</code>, <code>onload()</code> and <code>onerror()</code> handlers accordingly. Keep in mind that while <code>onerror()</code> may fire at first, it may be preceded by a successful <code>onload()</code> if the user first loads the page and then later unblocks the flash movie.</p>
+
+ <p>Note that flash blockers may not run when viewing offline (via <code>file://</code>) content, so try viewing this demo online. For FlashBlock (under Firefox), you can also go to <code>about:config</code> using your address bar and change the value of <code>flashblock.blockLocal</code> to test while offline.</p>
+
+ <h3>Flash Block Example</h3>
+
+ <p>Here, Flash is appended by SM2 to the <code>#sm2-container</code> DIV and after a failed start attempt (if you have a blocker active), will have a <code>swf_timedout</code> class appended.</p>
+
+ <p>The SWF uses <code>position:absolute</code> and negative left/top values so as not to affect the normal page layout, but shifts to <code>left:auto;top:auto</code> (effectively left/top:0) in the blocked case, and becomes visible to the user. On a successful unblock, the movie goes back to left/top:-9999em and is hidden from view.</p>
+
+ <p>SoundManager 2 load status: <b id="sm2-status">Loading...</b></p>
+
+ <!-- here is where the SWF is shown in the blocked / failed start-up case. -->
+
+ <div id="sm2-container">
+ <!-- flash is appended here -->
+ </div>
+
+ <h3 id="flashblock-css">Flash Block-related CSS</h3>
+
+ <p>When <code>soundManager.useFlashBlock</code> is enabled, CSS is applied to <code>#sm2-container</code> depending on the progress of SM2's start-up.</p>
+ <p>This page + demos use the rules below, fully-defined and commented in <a href="flashblock.css">flashblock.css</a>. Use it as a base for your own SM2 + flash block implementations.</p>
+
+<pre class="block"><code>#sm2-container {
+ <span><span>/* Initial state: position:absolute/off-screen, or left/top:0 */</span></span>
+}
+#sm2-container.swf_timedout {
+ <span><span>/* Didn't load before time-out, show to user.
+ Maybe highlight on-screen, red border, etc..? */</span></span>
+}
+#sm2-container.swf_unblocked {
+ <span><span>/* Applied if movie loads successfully
+ (flash started, so move off-screen etc.) */</span></span>
+}
+#sm2-container.swf_error {
+ <span><span>/* "Fatal" error case: SWF loaded,
+ but SM2 was unable to start for some reason.
+ (Flash security or other error case.) */</span></span>
+}
+#sm2-container.high_performance {
+ <span><span>/* Additional modifier for "high performance" mode
+ should apply position:fixed and left/bottom 0 to stay on-screen
+ at all times (better flash performance) */</span></span>
+}
+#sm2-container.flash_debug {
+ <span><span>/* Additional modifier for flash debug output mode
+ should use width/height 100% so you can read debug messages */</span></span>
+}</code></pre>
+
+ <h3>Basic Demo</h3>
+
+ <p>For a more minimal example, see the <a href="basic.html" title="SoundManager 2: Basic Flashblock handling demo">basic flashblock demo</a>.</p>
+
+</div> diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/flashblock/method1/flashblock.css b/docs/dymaxion/soundmanagerv297a-20101010/demo/flashblock/method1/flashblock.css new file mode 100755 index 0000000..d8a9e69 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/flashblock/method1/flashblock.css @@ -0,0 +1,61 @@ +#sm2-container {
+ /* where the SM2 flash movie goes. */
+ position:relative;
+}
+
+#sm2-container,
+#sm2-container embed,
+#sm2-container.swf_timedout {
+ /* 48px square flash placeholder is typically used by blockers */
+ width:48px;
+ height:48px;
+}
+
+#sm2-container.swf_timedout {
+ /* likely a flash block situation. Maybe make it more bold, red, show descriptive nested elements? */
+ border:1px solid red;
+}
+
+#sm2-container object,
+#sm2-container embed {
+ /* hide flash off-screen by default */
+ position:absolute;
+ left:-9999em;
+ top:-9999em;
+}
+
+#sm2-container.swf_timedout object,
+#sm2-container.swf_timedout embed {
+ /* when blocked, make visible inside container */
+ left:auto;
+ top:auto;
+}
+
+#sm2-container object,
+#sm2-container embed {
+ /* 6x6 is small enough to be "invisible" and not blocked by click2flash if allowed, also enough to be really fast/performant on-screen */
+ width:48px;
+ height:48px;
+}
+
+#sm2-container.swf_unblocked,
+#sm2-container.swf_unblocked object,
+#sm2-container.swf_unblocked embed {
+ width:6px;
+ height:6px;
+}
+
+#sm2-container.high_performance {
+ position:absolute;
+ position:fixed;
+ _top:0px; /* IE 6 hax */
+ bottom:0px;
+ left:0px;
+}
+
+#sm2-container.high_performance object,
+#sm2-container.high_performance embed {
+ position:absolute;
+ left:0px;
+ top:0px;
+}
\ No newline at end of file diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/flashblock/method1/flashblock.js b/docs/dymaxion/soundmanagerv297a-20101010/demo/flashblock/method1/flashblock.js new file mode 100755 index 0000000..f96cf46 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/flashblock/method1/flashblock.js @@ -0,0 +1,90 @@ +/*
+
+ FlashBlock handler for SoundManager 2
+ -------------------------------------------------------------------
+ Attempt to handle and gracefully recover from flashblock conditions
+ Requires SoundManger v2.95a.20090717+
+
+ http://schillmania.com/projects/soundmanager2/
+
+*/
+soundManager._flashBlock = new function() {
+
+ var _s = this;
+ this.name = 'soundManager._flashblock';
+ this.didTimeout = false; // did initial attempt fail?
+ this.timer = null; // for setTimeout call
+
+ this.startTimer = function(nMsec) {
+ // soundManager._wD(_s.name+'_.starttimer()');
+ _s.timer = window.setTimeout(_s.checkFlashStatus,nMsec);
+ };
+
+ this.stopTimer = function() {
+ // soundManager._wD(_s.name+'.stoptimer()');
+ if (_s.timer) {
+ window.clearTimeout(_s.timer);
+ _s.timer = null;
+ }
+ };
+
+ this.checkFlashStatus = function() {
+ // soundManager._wD(_s.name+'.checkflashstatus()');
+ var _sm = soundManager;
+ var oMC = _sm.oMC; // DIV (default: #sm2-container) for .SWF
+ var oStatus = document.getElementById('sm2-status'); // demo-only
+
+ if (!_sm.supported()) {
+ // make the movie more visible, so user can fix
+ oMC.className = 'swf-timedout';
+ _s.didTimeout = true;
+ var msg = 'No flash response, applying .swf-timedout CSS..';
+ _sm._wD(_s.name+': '+msg);
+ if (oStatus) {
+ oStatus.innerHTML = '<span style="color:#996633">'+msg+'</span>';
+ }
+ } else {
+ // SM2 loaded OK
+ // move the movie container to its proper place
+ oMC.className = 'swf-loaded';
+ if (!_s.didTimeout) {
+ // SM2 didn't previously fail, no blocker active
+ var msg = 'SM2 loaded OK (before timeout), fast unblock or no blocker.';
+ _sm._writeDebug(_s.name+'.checkFlashStatus: '+msg,1);
+ if (oStatus) {
+ oStatus.innerHTML = '<span style="color:green">'+msg+'</span>';
+ }
+ } else {
+ var msg = 'SM2 recovered after block (or timeout), loaded OK.';
+ _sm._wD(_s.name+': '+msg);
+ if (oStatus) {
+ oStatus.innerHTML = '<span style="color:#996633">'+msg+'</span>';
+ }
+ }
+ // stop timer, if applicable
+ _s.stopTimer();
+ return false;
+ }
+ };
+
+ soundManager.flashLoadTimeout = 0; // wait forever for flash to load - we'll set our own timeout via oninitmovie()
+
+ soundManager.oninitmovie = function() {
+ // when SWF is written (or ready to start), wait and make SWF visible (time-out case)
+ soundManager._flashBlock.startTimer(750);
+ };
+
+ soundManager.onready(function(oStatus) {
+ // SM2 has now initialized, either no blocking OR blocked movie was allowed/whitelisted
+ var fb = soundManager._flashBlock;
+ if (oStatus.success) {
+ // Yay! recovered OK.
+ fb.checkFlashStatus();
+ } else {
+ // Blocking was passed (or no blocking), but then something *else* went wrong.
+ }
+ // stop timer, if applicable
+ fb.stopTimer();
+ });
+
+}();
diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/flashblock/method1/index.html b/docs/dymaxion/soundmanagerv297a-20101010/demo/flashblock/method1/index.html new file mode 100755 index 0000000..c8acee7 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/flashblock/method1/index.html @@ -0,0 +1,79 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+<title>SoundManager 2: Flash blocker handling examples</title> +<meta name="robots" content="noindex" />
+<meta name="description" content="Demo of SoundManager 2 handling flashblock / "click to flash" blockers gracefully" />
+<meta name="keywords" content="javascript sound, javascript audio, DHTML sound, flashblock, flash blocker, handling flashblock, click to flash" />
+<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
+<!-- design template, you don't need this -->
+<link rel="stylesheet" type="text/css" href="../../index.css" />
+<link rel="stylesheet" type="text/css" href="../../debug.css" />
+
+<!-- actual flashblock demo stuff, this is for you -->
+<link rel="stylesheet" type="text/css" href="flashblock.css" />
+<script type="text/javascript" src="../../../script/soundmanager2.js"></script>
+
+<script type="text/javascript">
+// custom demo options, not for your needs
+soundManager.debugMode = true;
+soundManager.url = '../../../swf/';
+
+// flash version URL switch (for this demo page)
+var winLoc = window.location.toString();
+if (winLoc.match(/flash9/i)) {
+ soundManager.flashVersion = 9;
+ if (winLoc.match(/highperformance/i)) {
+ soundManager.useHighPerformance = true;
+ }
+} else if (winLoc.match(/flash8/i)) {
+ soundManager.flashVersion = 8;
+}
+
+soundManager.onready(function(){
+ var ok = soundManager.supported();
+ var loaded = soundManager.getMoviePercent();
+ var msg = null;
+ if (!ok) {
+ // loaded, or no?
+ msg = 'No response (yet), flash movie '+(loaded?'loaded OK (likely security/error case)':'has not loaded (likely flash-blocked.)')+' Waiting indefinitely ...';
+ } else {
+ msg = 'SoundManager load OK';
+ }
+ document.getElementById('sm2-status').innerHTML = msg;
+});
+
+</script>
+</head>
+<body>
+
+<div style="margin:1em;max-width:60em;font-size:110%">
+
+ <h1><a href="http://www.schillmania.com/projects/soundmanager2/">SoundManager 2</a>: Flashblock / "click to flash" handling demos</h1>
+
+ <h3>Show SWF inline, wait indefinitely for load</h3>
+
+ <p class="note">You can run this demo with <a href="#flash8" onclick="window.location.replace(this.href);window.location.reload()">Flash 8</a> (default), <a href="#flash9" onclick="window.location.replace(this.href);window.location.reload()">Flash 9</a> (normal mode) or <a href="#flash9-highperformance" onclick="window.location.replace(this.href);window.location.reload()">Flash 9 + highPerformance mode</a> (higher JS callback frequency).</p>
+
+ <p>Typically SM2 appends a DIV and hides the SWF off-screen. To handle potential flash block cases, a flash container DIV with an ID of "sm2-container" is placed in the HTML. SM2 will find and append the flash movie to this element. In this case, the SWF can be targeted with CSS and is not positioned off-screen as it normally would be.</p>
+ <p>SM2 will start its init process, and will fire <code>onready()</code>, <code>onload()</code> and <code>onerror()</code> handlers accordingly. Keep in mind that while <code>onerror()</code> may fire at first, it may be preceded by a successful <code>onload()</code> if the user first loads the page and then later unblocks the flash movie.</p>
+ <p>Note that flash blockers may not run when viewing offline (via <code>file://</code>) content, so try viewing this demo online. For FlashBlock (under Firefox), you can also adjust <code>flashblock.blockLocal</code> under <code>about:config</code> in the address bar to test while offline.</p>
+
+ <p>CSS applied to <code>#sm2-container</code>, depending on state:</p>
+<pre class="block"><code>#sm2-container.movieContainer {<span><span>/* Initial state: position:absolute/off-screen, or inline/relative */</span></span>}
+#sm2-container.swf_timedout {<span><span>/* Didn't load before time-out, show to user: On-screen, red border, etc..? */</span></span>}
+#sm2-container.swf_unblocked {<span><span>/* Applied if a timeout followed by an unblock (flash started.) Move off-screen. */</span></span>}
+#sm2-container.high_performance {<span><span>/* Additional modifier for "high performance" mode, should apply position:fixed and left/bottom 0 to stay on-screen at all times (better flash performance) */</span></span>}
+#sm2-container.flash_debug {<span><span>/* Additional modifier for flash debug output mode, should use width/height 100% so you can read debug messages */</span></span>}
+#sm2-container.swf_error {<span><span>/* Additional modifier, "something really broke" (fatal: security, missing SWF etc.) */</span></span>}</code></pre>
+
+ <p>SoundManager 2 load status: <b id="sm2-status">Loading...</b></p>
+
+ <p>Take a look at <a href="flashblock.css">flashblock.css</a> for implementation details.</p>
+
+ <div id="sm2-container">
+ <!-- flash is appended here -->
+ </div>
+
+</div> diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/index.css b/docs/dymaxion/soundmanagerv297a-20101010/demo/index.css new file mode 100755 index 0000000..b2493a6 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/index.css @@ -0,0 +1,1715 @@ +body {
+ background:#fff;
+ margin:0px;
+ padding:0px;
+ font:75% "helvetica neue",helvetica,arial,verdana,tahoma,"sans serif";
+}
+
+h1,
+h2.special {
+ letter-spacing:-0.025em;
+}
+
+h1, h2, h3, h4 {
+ font-size:1em;
+ margin:0px;
+ padding:0px;
+ vertical-align:middle;
+}
+
+h4.new,
+h4.recent,
+h4.flash9 {
+ min-height:24px;
+}
+
+h1 {
+ font-size:2em;
+}
+
+h2 {
+ font-family:helvetica,arial,verdana,tahoma,"sans serif";
+ font-size:1.5em;
+}
+
+h3 {
+ font-size:1.17em;
+ border-bottom:1px solid #ccc;
+ padding-bottom:0.25em;
+ margin-top:1.5em;
+}
+
+h4 {
+ margin:1.5em 0px 0.5em 0px;
+ font-size:1.15em;
+}
+
+h5 {
+ font-size:1em;
+ color:#666;
+}
+
+.c2 h5 {
+ border-bottom:1px solid #ccc;
+ padding-bottom:0.25em;
+}
+
+body.home h4 {
+ border-bottom: 1px solid #e9e9e9;
+ padding-bottom: 0.33em;
+ margin-bottom: 0.75em;
+}
+
+em em {
+ /* special highlight */
+ color:#003366;
+ background:#e9f3ff;
+ font-weight:bold;
+ margin-top:-0.3em;
+ padding:0.2em 0.25em;
+}
+
+pre {
+ border-left:2px solid #f3f3f3;
+ padding-left:0.5em;
+}
+
+dl pre {
+ border-color:#e9f3ff;
+ margin-left:-0.5em;
+}
+
+dl.alt pre {
+ border-color:#f3f3f3;
+}
+
+pre,
+code,
+pre code,
+.code,
+dt,
+#soundmanager-debug {
+ font-family:monaco,"Andale Mono","VT-100","Lucida Console","Courier New",monospace,courier,system,sans-serif;
+}
+
+pre,
+code,
+.code,
+dt,
+#soundmanager-debug {
+ font-size:11px;
+ font-weight:normal;
+ line-height:1.5em;
+ color:#006699;
+ background:#f6fcff;
+}
+
+pre {
+ font-size:11px; /* x-small */
+ line-height:1.75em;
+}
+
+pre.specialcommentblock span span {
+ *line-height:1.75em;
+}
+
+pre span span {
+ /* font-size:x-small; */
+}
+
+pre.small {
+ font-size:90%;
+}
+
+p pre,
+p.in pre {
+ font-size:0.97em;
+}
+
+#soundmanager-debug {
+ background:#fff;
+ padding-left:0.75em;
+ border:2px solid #ddeeff;
+ font-size:11px;
+ line-height:1.7em;
+}
+
+body.home #soundmanager-debug {
+ position:fixed;
+ _position:absolute; /* IE <7 */
+ bottom:1em;
+ right:1em;
+ height:12em;
+ width:auto;
+ overflow:auto;
+ padding:0px;
+ margin:1em 6px 6px 1em;
+ opacity:0.95;
+ color:#333;
+ border:1px solid #ccddee;
+ -moz-border-radius:3px;
+ -khtml-border-radius:3px;
+ -webkit-border-radius:3px;
+ background:#f3f9ff;
+ z-index:10;
+ font-size:small;
+ line-height:1.2em;
+}
+
+body.home #soundmanager-debug div {
+ padding-left:0.5em;
+}
+
+#soundmanager-debug div {
+ margin:0px;
+ padding:0.25em 0px;
+ font-size:11px;
+ color:#333;
+}
+
+#soundmanager-debug div.sm2-alt {
+ background-color:#fff;
+ color:#556677;
+}
+
+#live-debug {
+ display:table;
+ *display:block;
+}
+
+#live-debug #soundmanager-debug .sm2-alt {
+ background-color:#f3f9ff;
+ color:#336699;
+}
+
+dd pre,
+dd code {
+ background:transparent;
+/*
+ font-size:1.15em;
+ *font-size:1em;
+*/
+}
+
+pre code {
+ font-size:1em;
+}
+
+pre {
+ white-space:-moz-pre-wrap;
+ white-space:pre-wrap;
+ word-wrap:break-word; /* IE */
+}
+
+pre span,
+code span,
+dt span {
+ color:#339933;
+}
+
+pre span span,
+code span span,
+dt span span {
+ color:#667788;
+}
+
+pre.block,
+pre.block code,
+div.block div.code {
+ position:relative;
+ display:table;
+ *display:block;
+ border:1px solid #ccc;
+ -moz-border-radius:3px;
+ -khtml-border-radius:3px;
+ -webkit-border-radius:3px;
+}
+
+div.block,
+pre.block {
+ background:#e9f3ff;
+ border-color:#eee;
+ padding:3px;
+}
+
+pre.block code,
+div.block div.code {
+ background:#fff;
+ border:1px solid #ccddee;
+ padding:0.5em;
+ font-size:11px;
+ line-height:1.75em;
+}
+
+dl {
+ background:#f9fcff;
+ padding-bottom:1px;
+}
+
+dd {
+ margin:1em 0px;
+ padding:0px 0.5em;
+ line-height:1.5em;
+}
+
+dt {
+ margin:0px;
+ padding:0px;
+ margin:0.5em 0px 1em 0px;
+ border-bottom:1px solid #ddeeff;
+ padding:0.3em 0.3em 0.4em 0.3em;
+ padding-top:0.5em;
+ text-indent:0.25em;
+ background:#eef6ff;
+ font-size:1.15em;
+}
+
+dt.alt {
+ background:#f3f3f3;
+ border-bottom-color:#e6e6e6;
+}
+
+dl.alt {
+ background:#fcfcfc;
+ padding:0px 0px 1px 0px;
+}
+
+h2 {
+ padding-top:0.5em;
+}
+
+#top {
+ position:relative;
+ padding:1em 1em 0px 1em;
+ background:#222;
+ color:#fff;
+ z-index:1;
+}
+
+#top,
+#top div {
+ *zoom:1;
+}
+
+#top h1 {
+ /* special christmas light case */
+ display:inline;
+}
+
+#top h2 {
+ /* tagline */
+ font-size:1.25em;
+ font-weight:lighter;
+ padding-top:2px;
+ letter-spacing:-1px;
+}
+
+#main {
+ position:relative;
+ padding:0px 0px 2em 0px;
+ padding-top:1px;
+ margin:0px auto;
+ max-width:110em;
+ *padding:0px 1em 2em 1em;
+ zoom:1;
+}
+
+.columnar {
+ position:relative;
+ margin:0px;
+ padding:0px;
+ margin:2em 0.5em 0.5em 0.5em;
+}
+
+.columnar .c1 {
+ position:absolute;
+ left:0px;
+ top:0px;
+ width:20em;
+ height:30px;
+ _position:relative; /* IE 6 hackery */
+ _height:auto;
+}
+
+#doc .columnar .c1 {
+ left:auto;
+ right:1em;
+ _right:auto;
+}
+
+.columnar .c1 h2 {
+ position:relative;
+ font-size:1.2em;
+ padding:0.46em 0.5em;
+ vertical-align:middle;
+ background:#333;
+ color:#fff;
+}
+
+.columnar .c1 p {
+ margin:0.5em 0px 1em 0px;
+ padding-left:0.5em;
+ padding-right:0.5em;
+ font-size:0.95em;
+ line-height:1.35em;
+ color:#666;
+}
+
+.columnar .c1 p code {
+ font-size:xx-small;
+ color:#336699;
+}
+
+.columnar .c2 {
+ position:relative;
+ margin-top:2.33em;
+ margin-top:1px;
+ border-top:0.25em solid #333;
+ margin-left:22em;
+ margin-bottom:1.5em;
+}
+
+.triple .columnar .c2 {
+ margin-right:21.25em;
+ min-width:20em;
+}
+
+#doc .triple .columnar .c2 {
+ margin-left:21.5em;
+ margin-right:23em;
+ _margin-right:0px; /* not you, IE 6. */
+}
+
+#doc .triple .columnar .c1 {
+ margin-right:0px;
+ margin-left:21.25em;
+}
+
+.columnar .c2 p:first-child {
+ margin-top:0.2em;
+}
+
+.columnar .c2 h3:first-child {
+ margin-top:0.2em;
+ padding-bottom:0.3em;
+}
+
+.columnar .c2 > .f-block:first-child > h4 {
+ margin-top:0.5em;
+}
+
+.columnar .c2 strong strong {
+ display:block;
+ padding:0.5em;
+ border-bottom:1px solid #999;
+ background:#f0f6ff;
+ color:#336699;
+}
+
+.columnar .c2 p {
+ line-height:1.5em;
+}
+
+.three .columnar {
+ position:relative;
+}
+
+.three .columnar .c1 {
+ position:relative;
+ width:20em;
+}
+
+.three .columnar .c2 {
+ position:relative;
+ margin-right:16em;
+}
+
+.c3 {
+ position:absolute;
+ right:1em;
+ margin-right:16px;
+ top:2em;
+ width:16em;
+ margin-top:-0.5em;
+}
+
+#doc .c3 {
+ right:auto;
+ margin-right:0px;
+ margin-left:16px;
+ left:1.25em;
+}
+
+#nav {
+ position:relative;
+ margin-top:0.75em;
+ margin-left:-0.5em;
+}
+
+ul {
+ line-height:1.5em;
+}
+
+#nav ul {
+ margin:0px;
+ padding:0px;
+ line-height:1em;
+ list-style-type:none;
+}
+
+#nav>ul {
+/*
+ border-top:1px solid #333;
+*/
+}
+
+#nav ul li {
+ position:relative;
+ margin:0px;
+ padding:0px;
+ float:left;
+ display:inline;
+ padding-right:1px;
+}
+
+#nav ul li ul {
+ position:absolute;
+ z-index:1;
+ display:none;
+ min-width:17em;
+ max-width:20em;
+ background:#3399cc;
+ opacity:0.95;
+ _width:17em;
+ *opacity:1;
+ *top:1.5em;
+ *left:0px;
+}
+
+#nav ul li:last-child ul {
+ right:1px;
+}
+
+
+#nav ul li:hover ul,
+#nav ul li ul:hover {
+ display:block;
+}
+
+#nav ul li ul li {
+ float:none;
+ display:block;
+ width:100%;
+}
+
+#nav ul li ul li a {
+ display:block;
+ width:auto;
+ border:none;
+ padding:0.4em;
+ padding-left:1em;
+ color:#fff;
+}
+
+#nav ul li a {
+ display:inline-block;
+ padding:0.3em 0.5em;
+ padding-left:0.75em;
+ padding-right:0.75em;
+ text-decoration:none;
+ font-weight:bold;
+ color:#ccc;
+}
+
+#nav ul li strong a {
+ background:#336699;
+ background:#;
+ background:#fff;
+ color:#333;
+}
+
+#nav ul li strong a:hover,
+#nav ul li a:hover,
+#nav ul>li:hover strong a,
+#nav ul>li:hover>a {
+ background:#3399cc;
+ color:#fff;
+}
+
+#nav ul li ul li a:hover {
+ background:#336699;
+}
+
+#version {
+ position:relative;
+ float:right;
+ display:inline;
+ margin-left:1em;
+ font-size:x-small;
+ margin-bottom:0px;
+ margin-top:0.25em;
+ color:#999;
+}
+
+div.clear {
+ clear:both;
+ font-size:1px;
+ line-height:1px;
+}
+
+.note {
+ margin-top:0.5em;
+ font-size:0.95em;
+ color:#999;
+}
+
+.note a {
+ color:#666;
+ padding:1px;
+ margin:-1px;
+}
+
+.note a:hover {
+ color:#fff;
+ background:#666;
+}
+
+ul.standard {
+ line-height:1.5em;
+ padding-left:1.2em;
+ *padding-left:0px;
+ color:#333;
+ margin-top:0.5em;
+ margin-bottom:0.5em;
+ list-style-type:square;
+}
+
+ul.standard li {
+ margin-bottom:0.5em;
+}
+
+ul.standard ul {
+ margin-top:0.5em;
+ margin-bottom:1em;
+ padding-left:1.2em;
+}
+
+.c3 {
+ background:#fcfcfc;
+}
+
+.c3 ul {
+ list-style-type:none;
+}
+
+.c3 ul,
+.c3 ul li {
+ margin:0px;
+ padding:0px;
+}
+
+.c3 h2 {
+ font-size:1.1em;
+ text-indent:0.4em;
+}
+
+.c3 ul li a {
+ text-decoration:none;
+ color:#000;
+}
+
+.c3 ul li a:hover {
+ color:#000;
+ _color:#000;
+}
+
+.c3 ul li a:focus {
+ color:#000;
+ outline:none;
+}
+
+.c3 ul li.active a {
+ color:#fff;
+}
+
+.c3 ul li.active a:hover {
+ _color:#fff;
+}
+
+.c3 .box {
+ margin-top:6px;
+}
+
+.wedge,
+.c3 h2 {
+ position:relative;
+ background:#333;
+ color:#fff;
+ margin:0px;
+ padding:0px;
+ height:2.101em;
+ line-height:1.65em;
+}
+
+.c3 h2 {
+ height:1.75em;
+ line-height:1.75em;
+}
+
+.wedge {
+ background-color:#3399cc;
+}
+
+.wedge-dark {
+ background:#333;
+}
+
+.wedge .l,
+.wedge .r {
+ border-top:1.75em solid #333;
+}
+
+.c3 h2 .l,
+.c3 h2 .r {
+ border-top:1.66em solid #333;
+}
+
+.wedge .l,
+.c3 h2 .l {
+ background:transparent url(../demo/_image/wedge.png) no-repeat -64px 0px;
+ position:absolute;
+ left:0px;
+ top:0px;
+ width:16px;
+ height:100%;
+ margin-left:-16px;
+ border-top:1.7em solid #333;
+}
+
+.wedge .r,
+.wedge-dark .r,
+.c3 h2 .r {
+ background:transparent url(../demo/_image/wedge.png) no-repeat -48px 0px;
+ position:absolute;
+ right:0px;
+ top:0px;
+ width:16px;
+ height:100%;
+ margin-right:-16px;
+}
+
+.wedge .l,
+.wedge .r {
+ border-color:#3399cc;
+}
+
+.wedge .l {
+ background-position:-64px -64px;
+}
+
+.wedge .r {
+ margin-top:-16px;
+ border-top:none;
+ height:16px;
+ border-bottom:1.7em solid #3399cc;
+ background-position:0px -192px;
+}
+
+.wedge-dark .l,
+.wedge-dark .r {
+ border-color:#333;
+}
+
+.wedge-dark .l {
+ background-position:-64px 0px;
+}
+
+.wedge-dark .r {
+ background-position:0px -128px;
+}
+
+.c3 h2 .r.up {
+ margin-top:-16px;
+ border-top:none;
+ height:16px;
+ border-bottom:1.66em solid #333;
+ background-position:0px -128px;
+}
+
+.c3 h2 .l.flat,
+.wedge .l.flat,
+.c3 h2 .r.flat,
+.wedge .r.flat {
+ background-image:none;
+}
+
+.c3 ul {
+ margin:0px;
+ padding:0px;
+ margin-top:0.125em;
+ margin-bottom:0.25em;
+ list-style-type:none;
+}
+
+.c3 ul li {
+ border:1px solid #f3f3f3;
+ border-top:none;
+ border-bottom:none;
+}
+
+.c3 ul ul li {
+ border:none;
+}
+
+.c3 ul li {
+ margin:0px;
+ padding:0px;
+}
+
+.c3 ul li ul li {
+ font-family:monaco,"Andale Mono","VT-100","Lucida Console","Courier New",monospace,courier,system,sans-serif;
+ font-size:11px;
+ line-height:1.5em;
+ text-indent:0.5em;
+ padding:0.25em 0.25em 0.25em 0.25em;
+ cursor:hand;
+/*
+ font-smooth:never;
+*/
+}
+
+.c3 ul li ul li.alt {
+ background-color:#f8f8f8;
+}
+
+.c3 ul li ul li:hover {
+ background-color:#ccddff;
+ cursor:pointer;
+ cursor:hand;
+}
+
+.c3 ul li ul li.active {
+ background-color:#3399cc;
+ color:#fff;
+}
+
+.c3 h3 {
+ margin:0px;
+ padding:0px;
+ background:#3399cc;
+ border:none;
+ color:#fff;
+ font-size:1.3em;
+ text-indent:0.5em;
+ font-size:1em;
+ height:1.67em;
+ padding:0.25em 0.5em;
+ padding:0px;
+
+}
+
+.c3 h4 {
+ font-size:1em;
+ margin:1em 0.25em 0.25em 0.25em;
+ padding:0px 0.25em;
+ padding:0.2em 0.2em 0.2em 0.5em;
+ vertical-align:middle;
+ margin:0px;
+ color:#333;
+ background:#eef6ff;
+ border-top:1px solid #fff;
+ border-bottom:1px solid #ddeeff;
+}
+
+#get-satisfaction h2 a {
+ color:#fff;
+}
+
+#get-satisfaction a {
+ color:#333;
+}
+
+#get-satisfaction a:hover {
+ color:#fff;
+}
+
+.c3 h2 a {
+ color:#fff;
+}
+
+.c3 h2 a:hover {
+ color:#fff;
+ text-decoration:underline;
+}
+
+.flash9 {
+ background-image:url(../demo/_image/flash9.png);
+ background-repeat:no-repeat;
+ background-position:bottom right;
+ _background-image:none;
+}
+
+li.flash9 {
+ background-position:bottom right;
+}
+
+.flash9.active {
+ background-image:url(../demo/_image/flash9-dark.png);
+ _background-image:none;
+}
+
+.new {
+ background-image:url(../demo/_image/new.png);
+ background-repeat:no-repeat;
+ background-position:bottom right;
+ _background-image:none;
+}
+
+.recent {
+ background-image:url(../demo/_image/new-bw.png);
+ background-repeat:no-repeat;
+ background-position:bottom right;
+ _background-image:none;
+}
+
+.new.active,
+.recent.active {
+ background-image:url(../demo/_image/new-dark.png);
+ _background-image:none;
+}
+
+li.new {
+ background-position:top right;
+}
+
+span.nevermind,
+.removed {
+ text-decoration:line-through;
+ opacity:0.75;
+}
+
+.padded {
+ padding:0.5em;
+}
+
+.c3 p {
+ font-size:0.9em;
+ padding-left:0.5em;
+ padding-right:0.5em;
+}
+
+.c1 pre code {
+ margin-top:0px;
+ font-size:xx-small;
+ color:#336699;
+ margin-left:0px;
+}
+
+.c1 pre {
+ margin-top:0px;
+ padding-top:0px;
+ margin-left:0.5em;
+}
+
+#reset-filter {
+ position:relative;
+ font-family:"Helvetica Neue Light","Helvetica Neue","Helvetica",helvetica,arial,verdana,sans-serif;
+ font-weight:lighter;
+ font-size:2.5em;
+ letter-spacing:-1px;
+}
+
+.c2 .option {
+ font-size:small;
+ float:right;
+ display:inline;
+ margin-left:1em;
+ margin-right:0.5em;
+ margin-top:3px;
+ line-height:1em;
+ white-space:nowrap;
+}
+
+.c2 .option a {
+ padding:0.1em 0.35em 0.1em 0.35em;
+ color:#3399cc;
+}
+
+/*
+.c2 .option a:hover {
+ background-color:#3399cc;
+ color:#fff;
+}
+*/
+
+#filter-box {
+ position:relative;
+ display:none;
+}
+
+#get-satisfaction {
+ position:relative;
+}
+
+#gsfn_content {
+ padding:0.5em 0px 0px 0px;
+}
+
+#gsfn_content ul {
+ margin-bottom:0.5em;
+}
+
+#gsfn_content ul li {
+ border:none;
+}
+
+div#gsfn_list_widget img {
+ border: none;
+}
+
+div#gsfn_list_widget a {
+ text-decoration:none;
+}
+
+div#gsfn_list_widget a.widget_title {
+ display: block;
+ margin-bottom: 10px;
+ font-weight: bold;
+}
+
+div#gsfn_list_widget .powered_by {
+ font-family:verdana,arial;
+ margin:0px 1em 0px 1em;
+ padding:0.25em 0px 0px 0px;
+ border-top: 1px solid #ccc;
+ font-size:xx-small;
+ opacity:0.5;
+}
+
+div#gsfn_list_widget .powered_by:hover {
+ opacity:1;
+}
+
+div#gsfn_list_widget .powered_by a:hover {
+ color:#666;
+}
+
+div#gsfn_list_widget div#gsfn_content {
+ font-size:x-small;
+ font-size:0.9em;
+ padding-left:0.5em;
+ padding-right:0.5em;
+}
+
+div#gsfn_list_widget div#gsfn_content li {
+ text-align:left;
+ position: relative;
+ clear:right;
+ *zoom:1;
+}
+
+div#gsfn_list_widget div#gsfn_content li:hover,
+div#gsfn_list_widget div#gsfn_content li:hover a {
+ background:#3399cc;
+ color:#fff;
+}
+
+div#gsfn_list_widget div#gsfn_content a.gsfn_link {
+ display:block;
+ line-height:1.2em;
+ padding:5px 0px 5px 5px;
+}
+
+div#gsfn_list_widget div#gsfn_content a.gsfn_link:hover {
+ _color:#fff;
+ _background-color:#3399cc;
+}
+
+div#gsfn_list_widget div#gsfn_content span.time {
+ font-size: xx-small;
+ color:#999;
+ padding-left:3px;
+ padding-right:3px;
+ text-align:right;
+ float:right;
+ display:inline;
+ margin-top:1px;
+}
+
+div#gsfn_list_widget div#gsfn_content li:hover span.time {
+ color:#fff;
+}
+
+div#gsfn_list_widget div#gsfn_content p.gsfn_summary {
+ margin-top: 2px;
+ position:relative;
+ z-index:2;
+}
+
+.tight {
+ margin-top:0px;
+}
+
+.compact {
+ margin-bottom:0.25em;
+}
+
+.c2 a,
+a.cta {
+ margin-top:-0.3em;
+ padding:0.2em 0.25em;
+ text-decoration:none;
+ color:#3399cc;
+ -khtml-border-radius:0.25em;
+ -moz-border-radius:0.25em;
+ border-radius:0.25em;
+ zoom:1;
+}
+
+/* redefine for simple mp3 button demo */
+.c2 a.sm2_button {
+ -moz-border-radius:6px;
+ -webkit-border-radius:6px;
+ -o-border-radius:6px;
+ border-radius:6px;
+}
+
+.c2 a.sm2_button.type-2 {
+ -moz-border-radius:9px;
+ -webkit-border-radius:9px;
+ -o-border-radius:9px;
+ border-radius:9px;
+}
+
+
+.c2 a {
+ margin-left:-0.2em;
+ margin-right:-0.2em;
+ color:#3399cc;
+ font-weight:bold;
+ text-decoration:none;
+}
+
+.c2 a.cta {
+ text-decoration:none;
+}
+
+a.cta span {
+ font-size:1.5em;
+ line-height:1em;
+}
+
+a.cta:hover,
+.c2 a:hover {
+ background-color:#3399cc;
+ border-color:#3399cc;
+ color:#fff;
+ text-decoration:none;
+}
+
+.c2 a.sm2_button:hover {
+ /* arg. not specific enough, redefine here. */
+ background-color:#cc3333;
+}
+
+a.cta-more {
+ color:#ddeeff;
+ font-size:0.8em;
+ position:absolute;
+ right:0px;
+ margin:0px;
+ padding:1px;
+ bottom:0.9em;
+ line-height:1em;
+}
+
+a.cta-more:hover {
+ background:#fff;
+ color:#3399cc;
+}
+
+li.html5support span {
+ padding:0px 5px;
+ display:inline-block;
+ text-align:center;
+ font-weight:bold;
+ background:#ccc;
+ color:#fff;
+ -moz-border-radius:5px;
+ -webkit-border-radius:5px;
+ border-radius:5px;
+ margin-left:0.5em;
+ margin-bottom:0.25em;
+}
+
+li.html5support em {
+ font-weight:bold;
+}
+
+li.html5support span.true {
+ background:#669966;
+}
+
+li.html5support span.partial {
+ background:#993333;
+}
+
+li.html5support em.partial {
+ color:#993333;
+}
+
+li.html5support em.true {
+ color:#669966;
+}
+
+#nav ul li ul {
+ /* eh, why not. */
+ -moz-box-shadow:2px 2px 2px rgba(51,153,204,0.2);
+ -khtml-box-shadow:2px 2px 2px rgba(51,153,204,0.2);
+ -webkit-box-shadow:2px 2px 2px rgba(51,153,204,0.2);
+ box-shadow:2px 2px 2px rgba(51,153,204,0.2);
+}
+
+.newer {
+ vertical-align:middle;
+}
+
+.newer a,
+a.feature,
+.c2 .feature-hot {
+ display:block;
+ background:#3399ff;
+ padding:0.3em 0.5em;
+ margin:-0.3em 0px 0px -0.5em;
+ color:#fff;
+ font-weight:bold;
+ border:3px solid #ccc;
+ border:3px solid rgba(255,255,255,0.66);
+ -moz-border-radius:8px;
+ -webkit-border-radius:8px;
+ border-radius:8px;
+ line-height:1em;
+ text-decoration:none;
+ font-size:small;
+ vertical-align:middle;
+}
+
+a.feature {
+ display:inline;
+ margin-left:0px;
+}
+
+.newer a,
+.c2 .feature-hot {
+ background:#ff0000;
+ border-color:#ff6666;
+ color:#fff;
+ line-height:1em;
+}
+
+.newer a:hover,
+.c2 .feature-hot:hover {
+ background:#990000;
+ border-color:#cc0000;
+}
+
+a.feature:focus,
+a.feature:hover {
+ background:#ff0000;
+ border-color:#ff6666;
+ color:#fff;
+}
+
+.newer p {
+ margin:0px;
+ padding:0px;
+}
+
+h4 .scratched-out {
+ text-decoration:line-through;
+ color:#999;
+ /*
+ font-size:xx-small;
+ */
+ font-size:0.9em;
+ margin-top:-0.75em;
+ -webkit-transform:rotate(-15deg);
+ -moz-transform:rotate(-15deg);
+}
+
+.inthewild {
+ margin-top:1em;
+}
+
+.inthewild a,
+.inthewild a img {
+ border:none;
+}
+
+.inthewild a {
+ margin-right:1em;
+}
+
+.inthewild a:last-child {
+ margin-right:0px;
+}
+
+.inthewild a,
+.inthewild a img {
+ vertical-align:middle;
+}
+
+.inthewild a {
+ display:inline-block;
+ display:-moz-inline-box;
+ overflow:hidden;
+ margin:1em 1em 0.5em 1em;
+ padding:0px;
+}
+
+.inthewild a:first-child {
+ margin-left:0.5em;
+}
+
+.inthewild a span {
+ position:absolute;
+ text-indent:-9999em;
+}
+
+#favtape:hover {
+ background:#ff0066;
+ border-color:#ff0066;
+ color:#fff;
+}
+
+#soundcloud {
+ width:83px;
+ height:58px;
+ background:transparent url(../demo/_image/soundcloud-thecloudplayer-logo.png) no-repeat 0px -59px;
+ margin-right:3px;
+}
+
+#soundcloud:hover {
+ background-position:0px 0px;
+}
+
+#lastfm {
+ width:80px;
+ height:28px;
+ background:transparent url(../demo/_image/lastfm.png) no-repeat 0px -28px;
+}
+
+#lastfm:hover {
+ background-position:0px 0px;
+}
+
+#mixcrate {
+ width:80px;
+ height:16px;
+ background:transparent url(../demo/_image/mixcrate.png) no-repeat 0px 0px;
+}
+
+#mixcrate:hover {
+ background-position:0px -16px;
+}
+
+#opera {
+ width:79px;
+ height:32px;
+ background:transparent url(../demo/_image/opera.png) no-repeat 0px 0px;
+}
+
+#opera:hover {
+ background-position:0px -32px;
+}
+
+/* homepage-specific demo shiz */
+
+.sidenote {
+ font-size:x-small;
+ opacity:0.75;
+}
+
+ul.playlist {
+ font-size:xx-small;
+}
+
+ul.playlist li a {
+ font-size:1em;
+}
+
+ul.playlist li a,
+ul.playlist li a:hover {
+ background:transparent;
+ -khtml-border-radius:0px;
+ -moz-border-radius:0px;
+ border-radius:0px;
+ line-height:1em;
+}
+
+ul.playlist li .timing {
+ top:0.6em;
+ font-size:xx-small;
+}
+
+ul.playlist.use-peak li .peak {
+ /* overrides */
+ height:0.61em;
+ margin-top:-5px;
+ width:0.92em;
+}
+
+html.isSafari ul.playlist.use-peak li .peak {
+ margin-top:-4px; /* dumb tweak */
+}
+
+ul.playlist.use-peak li .timing {
+ right:4em;
+}
+
+ul.playlist.use-peak li .peak-box {
+ height:0.66em;
+}
+
+ul.playlist li .peak .l {
+ margin-right:0px;
+}
+
+ul.playlist li .peak .l,
+ul.playlist li .peak .r {
+ width:6px;
+}
+
+ul.playlist li .peak .r {
+ left:9px;
+}
+
+ul.playlist li a.not-supported {
+ /* give user a hint that the format doesn't work */
+ text-decoration:line-through;
+ color:#666;
+ opacity:0.5;
+}
+
+ul.graphic li {
+ line-height:1.5em;
+}
+
+ul.graphic li a,
+ul.graphic li a.sm2_link {
+ min-width:17.75em;
+ width:auto;
+}
+
+ul.graphic li a,
+ul.graphic li a.sm2_link {
+ background-color:#ddd;
+ border-color:#ddd;
+ color:#333;
+ vertical-align:middle;
+}
+
+ul.graphic li a {
+ background:#ddd url(../demo/play-mp3-links/image/icon_play.png) no-repeat 3px 50%;
+ _background-image:url(../demo/play-mp3-links/image/icon_play.gif);
+}
+
+
+ul.graphic li a:hover,
+ul.graphic li a.sm2_paused:hover,
+ul.graphic li a.sm2_link:hover,
+ul.graphic li a.sm2_playing,
+ul.graphic li a.sm2_playing:hover {
+ background-color:#336699;
+ border-color:#336699;
+ color:#fff;
+}
+
+ul.graphic li a.sm2_link {
+ /* Doesn't work on this page. */
+ -webkit-transition-property: none;
+ -webkit-transition: none;
+}
+
+.c2 ul.playlist li a {
+ margin:0px;
+ padding:0px;
+ letter-spacing: -0.02em;
+}
+
+/* Flash positioning and flashblock / clicktoflash handling */
+
+/* special-case for the SM2 homepage only */
+
+body.home #sm2-container {
+ position:absolute;
+ width:48px;
+ height:48px;
+ margin:1px 0px 0px 1px;
+}
+
+body.home #sm2-container.high_performance {
+ bottom:auto;
+ left:auto;
+ top:auto;
+}
+
+body.home #sm2-container.swf_timedout {
+ border:1px solid #ff3333;
+ border-bottom:none;
+ margin:0px;
+ z-index:2;
+}
+
+body.home #sm2-container.swf_unblocked {
+ width:1px;
+ height:1px;
+}
+
+#sm2-support {
+ display:none;
+ font-size:1em;
+ border:1px solid #ff3333;
+ background:#fff6f0;
+ margin-top:48px;
+}
+
+#demo-box {
+ position:relative;
+ float:right;
+ display:inline;
+ background: #fff; /* hide borders behind this box */
+ padding-left:32px;
+ padding-right:16px;
+ margin-top:-1em;
+ width:21.25em;
+ /* hide from IE 6 */
+ _position:absolute;
+ _left:-9999em;
+ _top:-9999em;
+}
+
+#demo-box #without-html5 {
+ display:none;
+}
+
+#demo-box #with-debug,
+#demo-box #without-html5,
+#demo-box #without-html5 a {
+ display:inline;
+ margin-top:-0.75em;
+ font-weight:normal;
+ font-size:x-small;
+ text-decoration:none;
+ font-weight:normal;
+ color:#666;
+}
+
+#demo-box #with-debug {
+ margin-right:1.5em;
+}
+
+#demo-box #without-html5 a:hover,
+#demo-box #with-debug:hover {
+ color:#fff;
+}
+
+#demo-box a.feature-hot {
+ display:inline;
+}
+
+hr {
+ visibility:hidden;
+ margin:0px;
+ padding:0px;
+}
+
+.demo-block {
+ position:relative;
+ background:#f9f9f9;
+ border:1px solid #e6e6e6;
+ padding:4px;
+ padding-top:0.5em;
+ margin-top:-0.55em;
+ border-top:none;
+}
+
+#demo-header {
+ color:#333;
+ background:#f9f9f9;
+ border:1px solid #e6e6e6;
+ border-bottom:0px;
+ margin-bottom:0px;
+ padding:0.5em;
+}
+
+#demos h3 {
+ padding-bottom:0px;
+ text-indent:0.5em;
+ font-weight:normal;
+}
+
+#demos h3 a {
+ font-weight:normal;
+}
+
+#revision-list > li {
+ margin-bottom:2em;
+}
+
+/* seasonal decorations */
+
+#lights {
+ position:absolute;
+ border-top:1px solid #006600;
+ left:0px;
+ top:0px;
+ width:100%;
+ height:100%;
+ overflow:hidden;
+ display:none;
+}
+
+.xlsf-light {
+ position:absolute;
+ margin-top:-1px;
+}
+
+body.fast .xlsf-light {
+ opacity:0.9;
+}
+
+.xlsf-light {
+ opacity:0.9;
+}
+
+.xlsf-fragment {
+ position:absolute;
+ background:transparent url(christmas-lights/image/bulbs-50x50-fragments.png) no-repeat 0px 0px;
+ width:50px;
+ height:50px;
+}
+
+.xlsf-fragment-box {
+ position:absolute;
+ left:0px;
+ top:0px;
+ width:50px;
+ height:50px;
+ *width:100%;
+ *height:100%;
+ display:none;
+}
+
+.xlsf-cover {
+ position:fixed;
+ left:0px;
+ top:0px;
+ width:100%;
+ height:100%;
+ background:#fff;
+ opacity:1;
+ z-index:999;
+ display:none;
+}
+
+.figure {
+ display:inline;
+ display:inline-block;
+ border:1px solid #ddeeff;
+ padding:0.5em;
+ margin:0.5em 0px 0.5em 0px;
+}
+
+.figure .code {
+}
+
+.figure .code span {
+ padding:0.25em;
+ border:1px solid #f0f9ff;
+ background:#fff;
+}
+
+.figure .code span.mid {
+ color:#666;
+}
+
+#sm2-container.flash_debug {
+ /* flash movie, when soundManager.debugFlash = true */
+ position:relative;
+ width:auto;
+ height:300px;
+ width:100%;
+ background:#f6f6f6;
+ border:1px solid #ccc;
+}
+
+#sm2-container.flash_debug object,
+#sm2-container.flash_debug embed {
+ width:100%;
+ height:100%;
+ left:auto;
+ top:auto;
+}
+
+ul.file-structure ul {
+ padding-left:1.5em;
+}
+
+ul.file-structure li {
+ list-style-type:square;
+ margin-top:0.25em;
+ margin-left:0px;
+}
+
+ul.file-structure li span {
+ color:#999;
+}
+
+#sm2-filesizes {
+ border:1px solid #ddd;
+}
+
+#sm2-filesizes tr:nth-child(2n+1) {
+ background:#f9f9f9;
+}
+
+#sm2-filesizes th {
+ background:#eee;
+ font-weight:bold;
+ text-align:left;
+}
+
+#sm2-filesizes th {
+ padding:4px 6px;
+}
+
+#sm2-filesizes td {
+ padding:0px 6px;
+ border:1px solid #eee;
+}
+
+#sm2-filesizes p {
+ margin-top:0.5em;
+ margin-bottom:0px;
+}
+
+#sm2-filesizes pre {
+ border-left:none;
+ margin-top:0.5em;
+ margin-bottom:0.5em;
+}
+
+#sm2-filesizes .nw {
+ white-space:nowrap;
+}
+
+#sm2-filesizes .booyaa {
+ /* in the words of Paris Hilton, "that's hot." (in the nerdy sense, I suppose.) */
+ background:#fff9f9;
+ color:#990000;
+}
+
+#history li.in > p.compact {
+ font-weight:bold;
+}
\ No newline at end of file diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/index.html b/docs/dymaxion/soundmanagerv297a-20101010/demo/index.html new file mode 100755 index 0000000..31133af --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/index.html @@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+<title>MP3 player demo</title> +<meta name="robots" content="noindex" />
+<meta name="author" content="Scott Schiller" />
+<meta name="language" content="en-us" />
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<meta name="keywords" content="javascript sound library api" />
+<meta name="description" content="Demo page for soundmanager mp3 player" />
+<script type="text/javascript" src="../script/soundmanager2.js"></script>
+<script type="text/javascript" src="script/default.js"></script>
+</head>
+
+<body>
+
+<div>
+
+ <h1>SoundManager 2 Demos</h1>
+
+ <p>
+ <a href="http://www.schillmania.com/projects/soundmanager2/">SoundManager 2 project page</a>
+ </p>
+
+</div>
+
+</body>
diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/index.js b/docs/dymaxion/soundmanagerv297a-20101010/demo/index.js new file mode 100755 index 0000000..97140ee --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/index.js @@ -0,0 +1,368 @@ +/* SoundManager 2 - project home utility JS */
+
+function _id(sID) {
+ return document.getElementById(sID);
+}
+
+getSoundByURL = function(sURL) {
+ return (typeof self.soundsByURL[sURL] != 'undefined'?self.soundsByURL[sURL]:null);
+}
+
+function init() {
+ var o = document.getElementById('main');
+ var el = o.getElementsByTagName('dt');
+ for (var i=el.length; i--;) {
+ if ((i+1)%2==0) {
+ utils.addClass(el[i],'alt');
+ }
+ }
+ var el = o.getElementsByTagName('dl');
+ for (var i=el.length; i--;) {
+ if ((i+1)%2==0) {
+ utils.addClass(el[i],'alt');
+ }
+ }
+}
+
+function Utils() {
+ var self = this;
+
+ this.hasClass = function(o,cStr) {
+ return (typeof(o.className)!='undefined'?new RegExp('(^|\\s)'+cStr+'(\\s|$)').test(o.className):false);
+ }
+
+ this.addClass = function(o,cStr) {
+ if (!o || !cStr) return false; // safety net
+ if (self.hasClass(o,cStr)) return false;
+ o.className = (o.className?o.className+' ':'')+cStr;
+ }
+
+ this.removeClass = function(o,cStr) {
+ if (!o || !cStr) return false; // safety net
+ if (!self.hasClass(o,cStr)) return false;
+ o.className = o.className.replace(new RegExp('( '+cStr+')|('+cStr+')','g'),'');
+ }
+
+ this.toggleClass = function(o,cStr) {
+ var m = (self.hasClass(o,cStr)?self.removeClass:self.addClass);
+ m(o,cStr);
+ }
+
+ this.getElementsByClassName = function(className,tagNames,oParent) {
+ var doc = (oParent||document);
+ var matches = [];
+ var i,j;
+ var nodes = [];
+ if (typeof(tagNames)!='undefined' && typeof(tagNames)!='string') {
+ for (i=tagNames.length; i--;) {
+ if (!nodes || !nodes[tagNames[i]]) {
+ nodes[tagNames[i]] = doc.getElementsByTagName(tagNames[i]);
+ }
+ }
+ } else if (tagNames) {
+ nodes = doc.getElementsByTagName(tagNames);
+ } else {
+ nodes = doc.all||doc.getElementsByTagName('*');
+ }
+ if (typeof(tagNames)!='string') {
+ for (i=tagNames.length; i--;) {
+ for (j=nodes[tagNames[i]].length; j--;) {
+ if (self.hasClass(nodes[tagNames[i]][j],className)) {
+ matches[matches.length] = nodes[tagNames[i]][j];
+ }
+ }
+ }
+ } else {
+ for (i=0; i<nodes.length; i++) {
+ if (self.hasClass(nodes[i],className)) {
+ matches[matches.length] = nodes[i];
+ }
+ }
+ }
+ return matches;
+ }
+
+ this.findParent = function(o) {
+ if (!o || !o.parentNode) return false;
+ o = o.parentNode;
+ if (o.nodeType == 2) {
+ while (o && o.parentNode && o.parentNode.nodeType == 2) {
+ o = o.parentNode;
+ }
+ }
+ return o;
+ }
+
+ this.getOffY = function(o) {
+ // http://www.xs4all.nl/~ppk/js/findpos.html
+ var curtop = 0;
+ if (o.offsetParent) {
+ while (o.offsetParent) {
+ curtop += o.offsetTop;
+ o = o.offsetParent;
+ }
+ }
+ else if (o.y) curtop += o.y;
+ return curtop;
+ }
+
+ this.isChildOfClass = function(oChild,oClass) {
+ if (!oChild || !oClass) return false;
+ while (oChild.parentNode && !self.hasClass(oChild,oClass)) {
+ oChild = self.findParent(oChild);
+ }
+ return (self.hasClass(oChild,oClass));
+ }
+
+ this.getParentByClassName = function(oChild,sParentClassName) {
+ if (!oChild || !sParentClassName) return false;
+ sParentClassName = sParentClassName.toLowerCase();
+ while (oChild.parentNode && !self.hasClass(oChild.parentNode,sParentClassName)) {
+ oChild = self.findParent(oChild);
+ }
+ return (oChild.parentNode && self.hasClass(oChild.parentNode,sParentClassName)?oChild.parentNode:null);
+ }
+
+}
+
+var utils = new Utils();
+
+var lastSelected = null;
+
+function resetFilter(o) {
+ // reset everything
+ var oParent = null;
+ _id('filter-box').style.display = 'none';
+ utils.removeClass(_id('main'),'filtered');
+ var blocks = utils.getElementsByClassName('f-block',['div','dl'],_id('main'));
+ for (var i=blocks.length; i--;) {
+ blocks[i].style.display = 'block';
+ oParent = utils.getParentByClassName(blocks[i],'columnar',_id('main'));
+ if (oParent) oParent.style.display = 'block';
+ }
+ if (lastSelected) utils.removeClass(lastSelected,'active');
+ if (o) lastSelected = o;
+ return false;
+}
+
+function setFilter(e,sFilterPrefix) {
+ var o = e?e.target||e.srcElement:event.srcElement;
+ utils.addClass(_id('main'),'filtered');
+ var oName = o.nodeName.toLowerCase();
+ if (oName == 'a') {
+ var parent = utils.findParent(o);
+ if (parent && parent.nodeName.toLowerCase() == 'li') {
+ // normalize to LI instead.
+ o = parent;
+ oName = o.nodeName.toLowerCase();
+ }
+ }
+ var sClass = '';
+ var blocks = utils.getElementsByClassName('f-block',['div','dl'],_id('main'));
+ var oParents = utils.getElementsByClassName('columnar','div',_id('main'));
+ var oParent = null;
+ var matchingParents = [];
+ if (oName != 'li' || o.className == 'ignore') {
+ return true;
+ }
+ var isClear = (lastSelected && lastSelected == o && utils.hasClass(lastSelected,'active'));
+ if (oName == 'li' && isClear) {
+ return resetFilter();
+ }
+ if (oName == 'li') {
+ // from shortcuts/filter menu
+ var innerText = (o.getElementsByTagName('a').length?o.getElementsByTagName('a')[0].innerHTML:o.innerHTML); // get inner text (minus link, if one is there)
+ sClass = sFilterPrefix+innerText.substr(0,innerText.indexOf('()')!=-1?innerText.indexOf('()'):999).toLowerCase().replace(/\s+/i,'-');
+ var last = sClass.substr(sClass.length-1);
+ if (last == '-' || last == ' ') {
+ sClass = sClass.substr(0,sClass.length-1); // IE innerHTML trailing whitespace hack (?)
+ }
+ for (var i=blocks.length; i--;) {
+ oParent = utils.getParentByClassName(blocks[i],'columnar',_id('main'));
+ if (utils.hasClass(blocks[i],sClass)) {
+ blocks[i].style.display = 'block';
+ if (oParent) {
+ matchingParents.push(oParent);
+ }
+ } else {
+ blocks[i].style.display = 'none';
+ }
+ }
+ for (i=oParents.length; i--;) {
+ oParents[i].style.display = 'none';
+ }
+ for (i=matchingParents.length; i--;) {
+ matchingParents[i].style.display = 'block';
+ }
+ _id('search-results').innerHTML = '<h3><span class="option"><a href="#" title="Restore full content" onclick="resetFilter();return false" style="text-decoration:none"> clear filter </a></span>Content filter: '+(sFilterPrefix=='f-'?'soundManager.':(sFilterPrefix=='s-'?'[SMSound object].':''))+'<b style="font-weight:bold">'+o.innerHTML+'</b></h3>';
+ _id('search-results').style.display = 'block';
+ _id('filter-box').style.display = 'block';
+ if (isClear) {
+ _id('filter-box').style.paddingBottom = '0px';
+ _id('filter-box').style.display = 'none';
+ } else {
+ _id('filter-box').style.paddingBottom = '0px';
+ if (!navigator.userAgent.match(/msie/i)) {
+ _id('filter-box').style.paddingBottom = Math.max(0,(document.documentElement.scrollTop || window.scrollY)-utils.getOffY(_id('filter-box'))-parseInt(_id('filter-box').offsetHeight)-20)+'px';
+ }
+ _id('filter-box').style.display = 'block';
+ // if ((!document.documentElement.scrollTop && !window.scrollY)) _id('filter-box').style.display = 'none';
+ }
+ if (lastSelected) {
+ if (lastSelected == o) {
+ utils.toggleClass(lastSelected,'active');
+ } else {
+ utils.removeClass(lastSelected,'active');
+ utils.addClass(o,'active');
+ }
+ } else {
+ utils.addClass(o,'active');
+ }
+ lastSelected = o;
+ // cancel bubble, too?
+ return false;
+ }
+}
+
+function getLiveData() {
+ getDynamicData();
+ // reinvigorate.net is a handy (and free!) stats tracking service thingy. you should check it out.
+ var is_live = (document.domain && document.domain.match(/schillmania.com/i) && typeof re_ != 'undefined');
+ loadScript('http://include.reinvigorate.net/re_.js');
+ setTimeout(function(){
+ if (typeof re_ != 'undefined') re_(is_live?'f6795-v062d0xv4u':'u8v2l-jvr8058c6n');
+ },3000);
+}
+
+function getDynamicData() {
+ // Attempt to fetch data from schillmania.com: "Get Satisfaction" topics, version updates etc.
+ loadScript('http://www.schillmania.com/services/soundmanager2/info/?version='+soundManager.versionNumber+'&rnd='+parseInt(Math.random()*1048576));
+}
+
+function loadScript(sURL,onLoad) {
+ var loadScriptHandler = function() {
+ var rs = this.readyState;
+ if (rs == 'loaded' || rs == 'complete') {
+ this.onreadystatechange = null;
+ this.onload = null;
+ window.setTimeout(onLoad,20);
+ }
+ }
+ function scriptOnload() {
+ this.onreadystatechange = null;
+ this.onload = null;
+ window.setTimeout(onLoad,20);
+ }
+ var oS = document.createElement('script');
+ oS.type = 'text/javascript';
+ if (onLoad) {
+ oS.onreadystatechange = loadScriptHandler;
+ oS.onload = scriptOnload;
+ }
+ oS.src = sURL;
+ document.getElementsByTagName('head')[0].appendChild(oS);
+}
+
+function doAltShortcuts() {
+ var o = _id('shortcuts-list');
+ if (!o) {
+ return false;
+ }
+ var oParents = [];
+ var oLIs = o.getElementsByTagName('li');
+ var isIgnore = null;
+ var offset = 0;
+ for (var i=0; i<oLIs.length; i++) {
+ isIgnore = utils.hasClass(oLIs[i],'ignore');
+ if (isIgnore) {
+ offset = 0;
+ }
+ offset++;
+ if ((offset)%2 == 0 && !isIgnore) {
+ utils.addClass(oLIs[i],'alt');
+ }
+ }
+}
+
+function fixLinks() {
+ if (document.location.protocol.match(/http/i)) {
+ return false;
+ }
+ // presumably offline - add index.html to local links, so offline browsing is seamless
+ var l = document.getElementsByTagName('a');
+ var s = null;
+ var tmp = null;
+ for (var i=l.length; i--;) {
+ s = l[i].href.toString();
+ if (!s.match(/http/i) && !utils.hasClass(l[i],'norewrite') && (s.match(/doc/i) || s.match(/demo/i) || s.match(/../))) {
+ // yep, local.
+ tmp = Math.max(s.lastIndexOf('?'),-1);
+ tmp = Math.max(s.lastIndexOf('#'),tmp);
+ tmp = Math.max(s.lastIndexOf('/')+1,tmp);
+ // console.log(s+' '+s.lastIndexOf('?')+', '+s.lastIndexOf('#')+', '+s.lastIndexOf('/')+' = '+tmp);
+ if (tmp == -1) {
+ tmp = s.length;
+ }
+ if (!s.match(/\.html/i)) {
+ l[i].setAttribute('href',s.substr(0,tmp)+'index.html'+s.substr(tmp));
+ }
+ }
+ }
+}
+
+function doChristmasLights() {
+ if ((document.domain.match(/schillmania.com/i) && new Date().getMonth() == 11) || window.location.toString().match(/christmas/i)) {
+ loadScript('http://yui.yahooapis.com/combo?2.6.0/build/yahoo-dom-event/yahoo-dom-event.js&2.6.0/build/animation/animation-min.js',function(){
+ loadScript('demo/christmas-lights/christmaslights-home.js',function(){
+ if (typeof smashInit != 'undefined') {
+ setTimeout(smashInit,20);
+ }
+ });
+ });
+ }
+}
+
+function ie6Sucks() {
+ // no :hover, generally-broken layout etc.
+ if (!navigator.userAgent.match(/msie 6/i)) {
+ return false;
+ }
+ var o = _id('nav').getElementsByTagName('li')[1];
+ var oA = o.getElementsByTagName('a')[0];
+ var oUL = o.getElementsByTagName('ul')[0];
+ oA.onclick = function() {
+ oUL.style.display = 'block';
+ setTimeout(function(){
+ document.onclick = function() {
+ oUL.style.display = 'none';
+ document.onclick = null;
+ }
+ },20);
+ return false;
+ }
+}
+
+function doVersion() {
+ var o = _id('version');
+ if (!o) {
+ return false;
+ }
+ o.innerHTML = soundManager.versionNumber;
+}
+
+function startStuff() {
+ if (navigator.userAgent.match(/safari/i)) {
+ document.getElementsByTagName('html')[0].className = 'isSafari';
+ }
+ doVersion();
+ ie6Sucks();
+ fixLinks();
+ getLiveData();
+ doAltShortcuts();
+}
+
+if (document.addEventListener) {
+ document.addEventListener("DOMContentLoaded", startStuff, false);
+} else {
+ window.onload = startStuff;
+}
\ No newline at end of file diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/audio/going_outside.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/audio/going_outside.mp3 Binary files differnew file mode 100755 index 0000000..7555831 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/audio/going_outside.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/audio/office_lobby.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/audio/office_lobby.mp3 Binary files differnew file mode 100755 index 0000000..8432fa7 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/audio/office_lobby.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/audio/rain.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/audio/rain.mp3 Binary files differnew file mode 100755 index 0000000..86050cb --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/audio/rain.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/audio/walking.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/audio/walking.mp3 Binary files differnew file mode 100755 index 0000000..45f660e --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/audio/walking.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/backgrounds/bg1.jpg b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/backgrounds/bg1.jpg Binary files differnew file mode 100755 index 0000000..cb09da9 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/backgrounds/bg1.jpg diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/backgrounds/bg2.jpg b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/backgrounds/bg2.jpg Binary files differnew file mode 100755 index 0000000..ef7392f --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/backgrounds/bg2.jpg diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/backgrounds/bg3.jpg b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/backgrounds/bg3.jpg Binary files differnew file mode 100755 index 0000000..da1ec4b --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/backgrounds/bg3.jpg diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/css/player-light.css b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/css/player-light.css new file mode 100755 index 0000000..099a6de --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/css/player-light.css @@ -0,0 +1,543 @@ +body {
+ font:normal 75% verdana,tahoma,arial,"sans serif";
+ background:#000;
+ color:#fff;
+}
+
+/*
+
+ GENERAL RANT AWARENESS NOTICE
+ -----------------------------
+ You may see some complaining about Internet Explorer, PNG and opacity-related hacks.
+ Even the new (at time of writing, 12/2006) IE 7 has issues and other quirks. Too bad.
+
+*/
+
+.sm2player {
+ position:absolute;
+ left:1.75em;
+ top:5.5em;
+ z-index:3;
+ padding:1px;
+ height:20px;
+ font:normal x-small/19px arial,verdana,tahoma,"sans serif";
+ *line-height:19px;
+ color:#4f4f4f;
+ zoom:1;
+}
+
+.sm2player.altFont {
+ /* font tweaks for mac which has tighter spacing */
+ letter-spacing:0px;
+}
+
+.sm2player,
+.sm2player .sm2playlist-box {
+ /*width:284px;*/
+}
+
+/*.sm2player .ui,*/
+.sm2player .sm2playlist {
+ opacity:0.9;
+}
+
+.sm2player .ui {
+ _filter:none; /* IE <7 sucks */
+}
+
+.sm2player.noOpacity .ui {
+ /* Safari (1.3.2 at least?) has render bugs with UI display + animated PNG progress bar when applying opacity */
+ opacity:1;
+}
+
+.sm2player .ui:hover {
+ opacity:1;
+ filter:none;
+}
+
+.sm2player a:focus {
+ outline:none;
+}
+
+.sm2player .left,
+.sm2player .mid,
+.sm2player .right {
+ position:relative;
+ float:left;
+ display:inline;
+ height:20px;
+ color:#4f4f4f;
+}
+
+.sm2player .left {
+ width:15px;
+ background:transparent url(../image/skin-3-ui.png) 0px 0px no-repeat;
+ _background-image:url(../image/skin-3-ui.gif); /* IE <7 */
+}
+
+.sm2player .left .trigger,
+.sm2player .left .trigger span {
+ display:block;
+ width:15px;
+ height:20px;
+}
+
+.sm2player .left .trigger.pauseplay span {
+ background:transparent url(../image/sec-left-arr1.png) 5px 6px no-repeat;
+ _background-image:url(../.sm2player .left {
+ width:15px;
+ background:transparent url(../image/skin-0-ui.png) 0px 0px no-repeat;
+ _background-image:url(../image/skin-0-ui.gif); /* IE <7 */
+}
+image/sec-left-arr1.gif);
+}
+
+.sm2player .left .trigger.pauseplay span.playing {
+ /* class applied while playing */
+ background-image:url(../image/sec-left-pause-1.gif);
+ background-position:6px 7px;
+}
+
+.sm2player .left .trigger:hover {
+ background:transparent url(../image/ui-highlight-1.png) 2px 0px no-repeat;
+ _background-image:url(../image/ui-highlight-1.gif);
+ _background-position:2px 0px;
+}
+
+.sm2player .left .trigger.pauseplay:hover span {
+ background:transparent url(../image/sec-left-arr0.png) 5px 6px no-repeat;
+ _background-image:url(../image/sec-left-arr2.gif);
+}
+
+.sm2player .left .trigger.pauseplay:hover span.playing {
+ background-image:url(../image/sec-left-pause.gif);
+ background-position:6px 7px;
+}
+
+.sm2player .mid {
+ position:relative;
+ width:223px;
+ _width:224px;
+ background:transparent url(../image/skin-3-ui.png) -14px 0px no-repeat;
+ _background-image:url(../image/skin-3-ui.gif);
+}
+
+.sm2player .mid .info {
+ position:absolute;
+ left:0px;
+ top:0px;
+ width:100%;
+ height:20px;
+ overflow:hidden;
+ text-indent:2px;
+ z-index:2;
+ cursor:default;
+}
+
+.sm2player .mid .progress {
+ position:relative;
+ display:block;
+ width:1px;
+ height:12px;
+ margin:4px 0px 0px 0px;
+ background:transparent url(../image/sec-mid-loaded-light.png) 0px 0px repeat-x;
+ _background-image:url(../image/sec-mid-loaded-light.gif);
+ background-color:#eee;
+}
+
+.sm2player .mid .progress.loading {
+ position:relative;
+ display:block;
+ width:1px;
+ border-right:1px solid #eee;
+}
+
+.sm2player .mid .slider {
+ position:absolute;
+ display:block;
+ width:12px;
+ height:12px;
+ left:0px;
+ top:0px;
+ margin-top:4px;
+ background:transparent url(../image/slider-light.png) 0px 0px no-repeat;
+ _background-image:url(../image/slider-light.gif);
+ z-index:1; /* swap between 1 and 2 to position on top */
+ z-index:2;
+ opacity:0.95;
+ /* filter:alpha(opacity=95); IE7 still messes up alpha transparency with PNGs when applying filters. Boo urns. */
+}
+
+.sm2player .mid.hover .slider,
+.sm2player .mid:hover .slider {
+/*
+ z-index:2;
+ opacity:0.95;
+ filter:filter:alpha(opacity=95);
+*/
+}
+
+.sm2player .mid .slider.active {
+/*
+ -moz-opacity:0.85;
+ filter:alpha(opacity=85);
+*/
+}
+
+.sm2player .mid .text,
+.sm2player .mid .default,
+.sm2player .mid .seek,
+.sm2player .mid .divider {
+ display:none;
+}
+
+.sm2player .mid .caption {
+ *position:absolute; /* required for scroll positioning to work under IE */
+ display:inline;
+ white-space:nowrap;
+ visibility:hidden; /* hidden by default */
+}
+
+.sm2player .mid .seek {
+ position:absolute;
+ left:0px;
+ top:0px;
+ text-indent:2px;
+}
+
+.sm2player .right {
+/*
+ width:18px;
+ width:45px;
+*/
+ background:transparent url(../image/skin-3-ui.png) 100% 0px no-repeat;
+ _background-image:url(../image/skin-3-ui.gif);
+ margin-left:1px;
+ _margin-left:0px; /* IE <7 sucks. */
+}
+
+.sm2player .right .divider {
+ /* one-pixel visual divider between bar / cap (yep, this is a UI nit-pick.) */
+ float:left;
+ display:inline;
+ width:1px;
+ height:20px;
+ overflow:hidden;
+ background:transparent url(../image/skin-3-ui.png) -1006px 0px no-repeat;
+ _background-image:url(../image/skin-3-ui.gif);
+ margin-left:-1px;
+ _display:none; /* IE <7 sucks. */
+}
+
+.sm2player .right .time {
+ float:left;
+ display:inline;
+ width:3em;
+ text-align:center;
+ line-height:19px;
+ margin:0px 1px 0px 3px;
+}
+
+.sm2player .right .trigger {
+ float:left;
+ display:inline;
+ width:14px;
+ height:20px;
+}
+
+.sm2player .right .trigger span {
+ display:block;
+ height:20px;
+}
+
+.sm2player .right .trigger.prev {
+ margin-left:1px;
+}
+
+.sm2player .right .trigger.s0 {
+ width:16px;
+}
+
+.sm2player .right .trigger.s1 {
+ width:18px;
+}
+
+.sm2player .right .trigger.s2 {
+ width:20px;
+}
+
+.sm2player .right .trigger.s3 {
+ width:12px;
+}
+
+.sm2player .right .trigger.s4 {
+ width:13px;
+}
+
+.sm2player .right .trigger {
+ background:transparent;
+}
+
+.sm2player .right .trigger.prev {
+}
+
+.sm2player .right .trigger.dropdown {
+ width:14px;
+ margin-right:2px;
+}
+
+.sm2player .right .trigger span {
+ background:transparent url(../image/sec-right-arr1.png) 3px 7px no-repeat;
+ /*
+ _background-image:url(../image/sec-right-arr1.gif);
+ _background-position:0px 0px;
+ */
+}
+
+.sm2player .right .trigger.prev span {
+ background:transparent url(../image/btn-prev-1.png) 4px 6px no-repeat;
+ /* _background-image:url(../image/btn-prev-1.gif); */
+}
+
+.sm2player .right .trigger.next span {
+ background:transparent url(../image/btn-next-1.png) 3px 6px no-repeat;
+ /* _background-image:url(../image/btn-next-1.gif); */
+}
+
+.sm2player .right .trigger.loop span {
+ background:transparent url(../image/loop-light.png) 3px 5px no-repeat;
+ opacity:0.5;
+ filter:alpha(opacity=50);
+}
+
+.sm2player .right .trigger.loop.active span {
+ opacity:1;
+ filter:none;
+}
+
+.sm2player .right .trigger.shuffle span {
+ background:transparent url(../image/shuffle-1-light.png) 2px 5px no-repeat;
+ opacity:0.5;
+ filter:alpha(opacity=50);
+ _background-image:none;
+ _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop src='image/shuffle-1-light.png');
+ _margin:5px 0px 0px 2px;
+}
+
+.sm2player .right .trigger.shuffle:hover span {
+ background-image:url(../image/shuffle.png);
+}
+
+.sm2player .right .trigger.shuffle.active span {
+ opacity:1;
+ filter:none;
+}
+
+.sm2player .right .trigger.mute span {
+ background:transparent url(../image/speaker-light.png) 3px 5px no-repeat;
+}
+
+.sm2player .right .trigger.mute:hover span {
+ background-image:url(../image/speaker.png);
+ opacity:0.75;
+}
+
+.sm2player .right .trigger.mute.active span {
+ opacity:0.5;
+}
+
+.sm2player .right .trigger.volume span {
+ background:transparent url(../image/volume-light.png) 0px 4px no-repeat;
+}
+
+.sm2player .right .trigger:hover {
+ background:transparent url(../image/ui-highlight-1.png) -2px 0px no-repeat;
+ _background-image:url(../image/ui-highlight-1.gif);
+ /*_background-position:2px 2px;*/
+}
+
+.sm2player .right .trigger.dropdown:hover>span {
+ background-image:url(../image/sec-right-arr0.png);
+}
+
+.sm2player .right .trigger.prev:hover>span {
+ background-image:url(../image/btn-prev.png);
+}
+
+.sm2player .right .trigger.next:hover>span {
+ background-image:url(../image/btn-next.png);
+}
+
+.sm2player .right .trigger.loop:hover>span {
+ background-image:url(../image/loop.png);
+}
+
+.sm2player .right .trigger.shuffle:hover>span {
+ background-image:url(../image/shuffle-1.png);
+}
+
+.sm2player .right .trigger.mute:hover>span {
+ background-image:url(../image/speaker.png);
+}
+
+.sm2player .right .trigger.volume:hover>span {
+ background-image:url(../image/volume.png);
+}
+
+.sm2player .right .dropdown:hover {
+ background-position:right 0px;
+}
+
+.sm2playlist-box {
+ position:absolute;
+ /*width:256px;*/
+ /*overflow:hidden;*/
+ /*max-height:33.1em;*/
+ left:1px;
+ top:26px;
+ overflow:auto;
+ margin-top:-4px;
+}
+
+.sm2playlist {
+ position:relative;
+ /* zoom:1; stupid IE. */
+ margin-top:-999em; /* hidden by default */
+}
+
+.sm2playlist .hd,
+.sm2playlist .c {
+ position:relative;
+ height:3px;
+}
+
+.sm2playlist .hd {
+ background:transparent url(../image/skin-3-ui.png) no-repeat 0px 0px;
+ _background-image:url(../image/skin-3.ui.gif);
+ margin-right:3px;
+}
+
+.sm2playlist .hd .c {
+ position:absolute;
+ right:0px;
+ top:0px;
+ background:transparent url(../image/skin-3-ui.png) no-repeat 100% 0px;
+ _background-image:url(../image/skin-3-ui.gif);
+ margin-right:-3px;
+ width:3px;
+}
+
+.sm2playlist .bd {
+ background:transparent url(../image/shade-left.png) repeat-y 0px 0px;
+ _background-image:none;
+ margin-right:2px;
+}
+
+.sm2playlist ul {
+ list-style-type:none;
+ margin:0px;
+ padding:0px;
+ padding-right:4px; /* space for background */
+ margin-right:-2px;
+ background:transparent url(../image/shade-right.png) repeat-y 100% 0px;
+ _background-image:none;
+ zoom:1; /* Even IE 7 needs this (!?) */
+}
+
+.sm2playlist ul li {
+ line-height:1.5em;
+}
+
+.sm2playlist ul li a {
+ display:block;
+ background:transparent;
+ margin-left:2px;
+ margin-right:-2px;
+ color:#666;
+ text-indent:0.25em;
+ text-decoration:none;
+ width:100%; /* stupid IE 7. */
+}
+
+.sm2playlist ul li a span {
+ display:block;
+ background:#eee;
+ padding:0.1em 0.5em;
+ border-top:1px solid #fff;
+ border-bottom:1px solid #ccc;
+}
+
+.sm2playlist ul li.alt a span {
+ background:#e0e0e0;
+}
+
+.sm2playlist ul li:first-child a span {
+ border-top:none;
+}
+
+.sm2playlist ul li:last-child a span {
+ border-bottom:none;
+}
+
+.sm2playlist ul li a:hover span {
+ background-color:#999;
+ color:#fff;
+}
+
+.sm2playlist ul li a:hover span {
+ border-color:transparent;
+ _border-color:#ccc;
+}
+
+.sm2playlist ul li.highlight a {
+ color:#fff;
+}
+
+.sm2playlist ul li.highlight a span {
+ background:#fff url(../image/notreallyajaxandyouknowit-light.gif) no-repeat right 50%;
+ color:#333;
+ border-color:#fff;
+}
+
+.sm2playlist ul li.highlight a:hover {
+ background-color:#999;
+ color:#9999ff;
+}
+
+.sm2playlist ul li a:focus {
+ outline:none;
+}
+
+.sm2playlist .ft {
+ background:transparent url(../image/skin-3-ui.png) no-repeat 0px 100%;
+ _background-image:url(../image/skin-3-ui.gif);
+ margin-right:3px;
+ height:2px;
+}
+
+.sm2playlist .ft .c {
+ position:absolute;
+ right:0px;
+ bottom:0px;
+ background:transparent url(../image/skin-3-ui.png) no-repeat 100% 100%;
+ _background-image:url(../image/skin-3-ui.gif);
+ width:3px;
+ height:2px;
+}
+
+#soundmanager-debug {
+ position:absolute;
+ position:fixed;
+ right:20px;
+ bottom:20px;
+ display:none;
+ font-size:xx-small;
+ height:20em;
+ overflow:auto;
+ /* background:transparent url(../image/whiteout.png); */
+ padding:1em;
+ background:#000;
+ color:#fff;
+ filter:alpha(opacity=90);
+ opacity:0.9;
+}
diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/css/player.css b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/css/player.css new file mode 100755 index 0000000..5c5907e --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/css/player.css @@ -0,0 +1,525 @@ +body {
+ font:normal 75% verdana,tahoma,arial,"sans serif";
+ background:#000;
+ color:#ccc;
+}
+
+/*
+
+ GENERAL RANT AWARENESS NOTICE
+ -----------------------------
+ You may see some complaining about Internet Explorer, PNG and opacity-related hacks.
+ Even the new (at time of writing, 12/2006) IE 7 has issues and other quirks. Too bad.
+
+*/
+
+.sm2player {
+ position:absolute;
+ left:1.75em;
+ top:5.5em;
+ z-index:3;
+ padding:1px;
+ height:20px;
+ font:normal x-small/19px arial,verdana,tahoma,"sans serif";
+ *line-height:18px;
+ color:#000;
+ zoom:1;
+}
+
+.sm2player.altFont {
+ /* font tweaks for mac which has tighter spacing */
+ letter-spacing:0px;
+}
+
+.sm2player,
+.sm2player .sm2playlist-box {
+/*
+ width:302px;
+ width:360px;
+*/
+}
+
+.sm2player .ui,
+.sm2player .sm2playlist {
+xfilter:alpha(opacity=90); /* Even IE 7 (still) sucks! */
+ opacity:0.9;
+}
+
+.sm2player .ui {
+ _filter:none; /* IE <7 sucks */
+}
+
+.sm2player.noOpacity .ui {
+ /* Safari (1.3.2 at least?) has render bugs with UI display + animated PNG progress bar when applying opacity */
+ opacity:1;
+}
+
+.sm2player .ui:hover {
+ opacity:1;
+ filter:alpha(opacity=100);
+}
+
+.sm2player a:focus {
+ outline:none;
+}
+
+.sm2player .left,
+.sm2player .mid,
+.sm2player .right {
+ position:relative;
+ float:left;
+ display:inline;
+ height:20px;
+ color:#fff;
+}
+
+.sm2player .left {
+ width:15px;
+ background:transparent url(../image/skin-0-ui.png) 0px 0px no-repeat;
+ _background-image:url(../image/skin-0-ui.gif); /* IE <7 */
+}
+
+.sm2player .left .trigger,
+.sm2player .left .trigger span {
+ display:block;
+ width:15px;
+ height:20px;
+}
+
+.sm2player .left .trigger.pauseplay span {
+ background:transparent url(../image/sec-left-arr0.png) 5px 6px no-repeat;
+ _background-image:url(../image/sec-left-arr0.gif);
+ _background-position:0px 0px;
+}
+
+.sm2player .left .trigger.pauseplay span.playing {
+ /* class applied while playing */
+ background-image:url(../image/sec-left-pause.gif);
+ background-position:6px 7px;
+}
+
+.sm2player .left .trigger:hover {
+ background:transparent url(../image/ui-highlight-2.png) 2px 0px no-repeat;
+ _background-image:url(../image/ui-highlight-2.gif);
+ /*_background-position:2px 2px;*/
+}
+
+.sm2player .mid {
+ position:relative;
+ width:223px;
+ _width:224px;
+ background:transparent url(../image/skin-0-ui.png) -14px 0px no-repeat;
+ _background-image:url(../image/skin-0-ui.gif);
+}
+
+.sm2player .mid .info {
+ position:absolute;
+ left:0px;
+ top:0px;
+ width:100%;
+ height:20px;
+ overflow:hidden;
+ text-indent:2px;
+ z-index:2;
+ cursor:default;
+}
+
+.sm2player .mid .progress {
+ position:relative;
+ display:block;
+ width:1px;
+ height:12px;
+ margin:4px 0px 0px 0px;
+ background:transparent url(../image/sec-mid-loaded.png) 0px 0px repeat-x;
+ _background-image:url(../image/sec-mid-loaded.gif);
+ background-color:#333;
+}
+
+.sm2player .mid .progress.loading {
+ position:relative;
+ display:block;
+ width:1px;
+ border-right:1px solid #333;
+}
+
+.sm2player .mid .slider {
+ position:absolute;
+ display:block;
+ width:12px;
+ height:12px;
+ left:0px;
+ top:0px;
+ margin-top:4px;
+ background:transparent url(../image/slider-1.png) 0px 0px no-repeat;
+ _background-image:url(../image/slider.gif);
+ z-index:1; /* swap between 1 and 2 to position on top */
+ z-index:2;
+ opacity:0.90;
+ /* filter:alpha(opacity=90); IE7 can't apply opacity to PNGs without messing up alpha transparency. Boo urns. */
+ _background-image:none;
+ _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop src='image/slider-1.png');
+}
+
+.sm2player .mid:hover .slider {
+ opacity:0.95;
+ filter:alpha(opacity=95);
+}
+
+.sm2player .mid>.slider.active {
+ -moz-opacity:0.85;
+ filter:alpha(opacity=85);
+}
+
+.sm2player .mid .text,
+.sm2player .mid .default,
+.sm2player .mid .seek,
+.sm2player .mid .divider {
+ display:none;
+}
+
+.sm2player .mid .caption {
+ *position:absolute; /* required for scroll positioning to work under IE */
+ display:inline;
+ white-space:nowrap;
+ visibility:hidden; /* hidden by default */
+}
+
+.sm2player .mid .seek {
+ position:absolute;
+ left:0px;
+ top:0px;
+ text-indent:2px;
+}
+
+.sm2player .right {
+ background:transparent url(../image/skin-0-ui.png) 100% 0px no-repeat;
+ _background-image:url(../image/skin-0-ui.gif);
+ margin-left:1px;
+ _margin-left:0px; /* IE <7 sucks. */
+}
+
+.sm2player .right .divider {
+ /* one-pixel visual divider between bar / cap (yep, this is a UI nit-pick.) */
+ float:left;
+ display:inline;
+ width:1px;
+ height:20px;
+ overflow:hidden;
+ background:transparent url(../image/skin-0-ui.png) -1006px 0px no-repeat;
+ _background-image:url(../image/skin-0-ui.gif);
+ margin-left:-1px;
+ _display:none; /* IE <7 sucks. */
+}
+
+.sm2player .right .time {
+ float:left;
+ display:inline;
+ width:3em;
+ text-align:center;
+ margin:0px 1px 0px 3px;
+}
+
+.sm2player .right .trigger {
+ float:left;
+ display:inline;
+ width:14px;
+ height:20px;
+}
+
+.sm2player .right .trigger span {
+ display:block;
+ height:20px;
+}
+
+.sm2player .right .trigger.prev {
+ margin-left:1px;
+}
+
+.sm2player .right .trigger.s0 {
+ width:16px;
+}
+
+.sm2player .right .trigger.s1 {
+ width:18px;
+}
+
+.sm2player .right .trigger.s2 {
+ width:20px;
+}
+
+.sm2player .right .trigger.s3 {
+ width:12px;
+}
+
+.sm2player .right .trigger.s4 {
+ width:13px;
+}
+
+.sm2player .right .trigger {
+ background:transparent;
+}
+
+.sm2player .right .trigger.prev {
+}
+
+.sm2player .right .trigger.dropdown {
+ width:14px;
+ margin-right:2px;
+}
+
+.sm2player .right .trigger.dropdown span {
+ xwidth:14px;
+}
+
+.sm2player .right .trigger span {
+ background:transparent url(../image/sec-right-arr0.png) 3px 7px no-repeat;
+ _background-image:url(../image/sec-right-arr0.gif);
+ _background-position:0px 0px;
+ _background-image:none;
+}
+
+.sm2player .right .trigger.dropdown span {
+ _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop src='image/sec-right-arr0.png');
+ _margin:7px 0px 0px 3px;
+ _height:13px;
+}
+
+.sm2player .right .trigger.prev span {
+ background:transparent url(../image/btn-prev.png) 4px 6px no-repeat;
+ _background-image:url(../image/btn-prev.gif);
+}
+
+.sm2player .right .trigger.next span {
+ background:transparent url(../image/btn-next.png) 3px 6px no-repeat;
+ _background-image:url(../image/btn-next.gif);
+}
+
+.sm2player .right .trigger.loop span {
+ background:transparent url(../image/loop.png) 3px 5px no-repeat;
+ opacity:0.5;
+ filter:alpha(opacity=50);
+ _background-image:none;
+ _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop src='image/loop.png');
+ _margin:5px 0px 0px 3px;
+ _height:15px;
+}
+
+.sm2player .right .trigger.loop:hover>span {
+ opacity:0.75;
+ filter:alpha(opacity=75);
+}
+
+.sm2player .right .trigger.loop.active>span {
+ /*background-image:url(../image/loop-light.png);*/
+ opacity:1;
+ filter:none;
+}
+
+.sm2player .right .trigger.shuffle span {
+ background:transparent url(../image/shuffle-1.png) 2px 5px no-repeat;
+ opacity:0.5;
+ filter:alpha(opacity=50);
+ _background-image:none;
+ _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop src='image/shuffle-1.png');
+ _margin:5px 0px 0px 2px;
+ _height:15px;
+}
+
+.sm2player .right .trigger.shuffle:hover>span {
+ opacity:0.75;
+ filter:alpha(opacity=75);
+}
+
+.sm2player .right .trigger.shuffle.active>span {
+ opacity:1;
+ filter:none;
+}
+
+.sm2player .right .trigger.mute span {
+ background:transparent url(../image/speaker.png) 3px 5px no-repeat;
+ _background-image:none;
+ _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop src='image/speaker.png');
+ _margin:5px 0px 0px 3px;
+ _height:15px;
+}
+
+.sm2player .right .trigger.mute:hover>span {
+ opacity:0.75;
+ filter:alpha(opacity=75);
+}
+
+.sm2player .right .trigger.mute.active>span {
+ opacity:0.5;
+ filter:alpha(opacity=50);
+}
+
+.sm2player .right .trigger.volume span {
+ background:transparent url(../image/volume.png) 0px 4px no-repeat;
+ _background-image:none;
+ _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop src='image/volume.png');
+ _margin:4px 0px 0px 0px;
+ _height:16px;
+}
+
+.sm2player .right .trigger:hover {
+ background:transparent url(../image/ui-highlight-2.png) -2px 0px no-repeat;
+ _background-image:url(../image/ui-highlight-2.gif);
+ /*_background-position:2px 2px;*/
+}
+
+.sm2playlist-box {
+ position:absolute;
+ /*width:256px;*/
+ /*overflow:hidden;*/
+ /*max-height:33.1em;*/
+ left:1px;
+ top:22px;
+ overflow:auto;
+ margin-top:-4px;
+}
+
+.sm2playlist {
+ position:relative;
+ /* zoom:1; stupid IE. */
+ margin-top:-999em; /* hidden by default */
+}
+
+.sm2playlist .hd,
+.sm2playlist .c {
+ position:relative;
+ height:3px;
+}
+
+.sm2playlist .hd {
+ background:transparent url(../image/skin-0-ui.png) no-repeat 0px 0px;
+ _background-image:url(../image/skin-0.ui.gif);
+ margin-right:2px;
+}
+
+.sm2playlist .hd .c {
+ /* not used? */
+}
+
+.sm2playlist .bd {
+ background:transparent url(../image/shade-left.png) repeat-y 0px 0px;
+ _background-image:none;
+ margin-right:2px;
+}
+
+.sm2playlist ul {
+ list-style-type:none;
+ margin:0px;
+ padding:0px;
+ padding-right:4px; /* space for background */
+ margin-right:-2px;
+ background:transparent url(../image/shade-right.png) repeat-y 100% 0px;
+ _background-image:none;
+ zoom:1; /* Even IE 7 needs this (!?) */
+}
+
+.sm2playlist ul li {
+ line-height:1.5em;
+}
+
+.sm2playlist ul li a {
+ display:block;
+ background:transparent;
+ margin-left:2px;
+ margin-right:-2px;
+ color:#999;
+ text-indent:0.25em;
+ text-decoration:none;
+ width:100%; /* stupid IE 7. */
+}
+
+.sm2playlist ul li a span {
+ display:block;
+ background:#222;
+ padding:0.1em 0.5em;
+ border-top:1px solid #333;
+ border-bottom:1px solid #000;
+ /* genie animation test */
+/*
+ white-space:nowrap;
+ overflow:hidden;
+*/
+}
+
+.sm2playlist ul li.alt a span {
+ background:#303030;
+ color:#c3c3c3;
+}
+
+.sm2playlist ul li:first-child a span {
+ border-top:none;
+}
+
+.sm2playlist ul li:last-child a span {
+ /*border-bottom:none;*/
+}
+
+.sm2playlist ul li a:hover span {
+ background-color:#444;
+ color:#fff;
+}
+
+.sm2playlist ul li a:hover span {
+ border-color:transparent;
+ _border-color:#333;
+}
+
+.sm2playlist ul li.highlight a {
+ background-color:#660000;
+}
+
+.sm2playlist ul li.highlight a span {
+ background:#161616 url(../image/notreallyajaxandyouknowit-dark.gif) no-repeat right 50%;
+ border-color:#000;
+ color:#ff9999;
+}
+
+.sm2playlist ul li.highlight a:hover {
+ background-color:#880000;
+ color:#fff;
+}
+
+.sm2playlist ul li a:focus {
+ outline:none;
+}
+
+.sm2playlist .ft {
+ background:transparent url(../image/skin-0-ui.png) no-repeat 0px 100%;
+ _background-image:url(../image/skin-0-ui.gif);
+ margin-right:2px;
+ height:2px;
+}
+
+.sm2playlist .ft .c {
+ position:absolute;
+ right:0px;
+ bottom:0px;
+ background:transparent url(../image/skin-0-ui.png) no-repeat 100% 100%;
+ _background-image:url(../image/skin-0-ui.gif);
+ margin-left:3px; /* leave room for left cap */
+ margin-right:-1px;
+ /* not needed */
+ display:none;
+
+}
+
+#soundmanager-debug {
+ position:absolute;
+ position:fixed;
+ right:20px;
+ bottom:20px;
+ display:none;
+ font-size:xx-small;
+ height:20em;
+ overflow:auto;
+ /* background:transparent url(../image/whiteout.png); */
+ background:#000;
+ padding:1em;
+ color:#fff;
+ filter:alpha(opacity=90);
+ opacity:0.9;
+}
diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/btn-next-1.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/btn-next-1.gif Binary files differnew file mode 100755 index 0000000..e43cafe --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/btn-next-1.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/btn-next-1.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/btn-next-1.png Binary files differnew file mode 100755 index 0000000..9db8019 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/btn-next-1.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/btn-next.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/btn-next.gif Binary files differnew file mode 100755 index 0000000..98ff850 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/btn-next.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/btn-next.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/btn-next.png Binary files differnew file mode 100755 index 0000000..e253f28 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/btn-next.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/btn-prev-1.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/btn-prev-1.gif Binary files differnew file mode 100755 index 0000000..9cff3d0 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/btn-prev-1.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/btn-prev-1.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/btn-prev-1.png Binary files differnew file mode 100755 index 0000000..842c917 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/btn-prev-1.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/btn-prev.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/btn-prev.gif Binary files differnew file mode 100755 index 0000000..d2c1257 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/btn-prev.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/btn-prev.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/btn-prev.png Binary files differnew file mode 100755 index 0000000..252f854 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/btn-prev.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/loop-light.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/loop-light.png Binary files differnew file mode 100755 index 0000000..70d41b7 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/loop-light.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/loop.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/loop.png Binary files differnew file mode 100755 index 0000000..82d61be --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/loop.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/notreallyajaxandyouknowit-dark.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/notreallyajaxandyouknowit-dark.gif Binary files differnew file mode 100755 index 0000000..42fd2b7 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/notreallyajaxandyouknowit-dark.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/notreallyajaxandyouknowit-light.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/notreallyajaxandyouknowit-light.gif Binary files differnew file mode 100755 index 0000000..9cf0467 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/notreallyajaxandyouknowit-light.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-left-arr0.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-left-arr0.gif Binary files differnew file mode 100755 index 0000000..7de9b71 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-left-arr0.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-left-arr0.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-left-arr0.png Binary files differnew file mode 100755 index 0000000..9057d52 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-left-arr0.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-left-arr1.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-left-arr1.gif Binary files differnew file mode 100755 index 0000000..d4e3026 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-left-arr1.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-left-arr1.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-left-arr1.png Binary files differnew file mode 100755 index 0000000..fc2f6e1 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-left-arr1.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-left-arr2.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-left-arr2.gif Binary files differnew file mode 100755 index 0000000..50c496c --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-left-arr2.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-left-pause-1.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-left-pause-1.gif Binary files differnew file mode 100755 index 0000000..df8f5d3 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-left-pause-1.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-left-pause.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-left-pause.gif Binary files differnew file mode 100755 index 0000000..41c517f --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-left-pause.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-mid-loaded-dark.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-mid-loaded-dark.png Binary files differnew file mode 100755 index 0000000..dac90dc --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-mid-loaded-dark.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-mid-loaded-light.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-mid-loaded-light.gif Binary files differnew file mode 100755 index 0000000..cf0c9c0 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-mid-loaded-light.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-mid-loaded-light.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-mid-loaded-light.png Binary files differnew file mode 100755 index 0000000..f9c3d57 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-mid-loaded-light.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-mid-loaded.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-mid-loaded.gif Binary files differnew file mode 100755 index 0000000..e630272 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-mid-loaded.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-mid-loaded.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-mid-loaded.png Binary files differnew file mode 100755 index 0000000..cc0d8ca --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-mid-loaded.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-right-arr0.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-right-arr0.gif Binary files differnew file mode 100755 index 0000000..5d7f471 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-right-arr0.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-right-arr0.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-right-arr0.png Binary files differnew file mode 100755 index 0000000..d3a6eb8 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-right-arr0.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-right-arr1.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-right-arr1.png Binary files differnew file mode 100755 index 0000000..d53d90c --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/sec-right-arr1.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/shade-left.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/shade-left.png Binary files differnew file mode 100755 index 0000000..28cdb31 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/shade-left.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/shade-right.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/shade-right.png Binary files differnew file mode 100755 index 0000000..a11c057 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/shade-right.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/shuffle-0-light.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/shuffle-0-light.png Binary files differnew file mode 100755 index 0000000..770d471 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/shuffle-0-light.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/shuffle-0.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/shuffle-0.png Binary files differnew file mode 100755 index 0000000..13b3e56 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/shuffle-0.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/shuffle-1-light.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/shuffle-1-light.png Binary files differnew file mode 100755 index 0000000..0fc7174 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/shuffle-1-light.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/shuffle-1.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/shuffle-1.png Binary files differnew file mode 100755 index 0000000..bca4642 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/shuffle-1.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/skin-0-ui.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/skin-0-ui.gif Binary files differnew file mode 100755 index 0000000..e209f57 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/skin-0-ui.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/skin-0-ui.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/skin-0-ui.png Binary files differnew file mode 100755 index 0000000..6bd2821 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/skin-0-ui.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/skin-0-ui__.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/skin-0-ui__.gif Binary files differnew file mode 100755 index 0000000..dc742e0 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/skin-0-ui__.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/skin-1-ui.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/skin-1-ui.png Binary files differnew file mode 100755 index 0000000..22d3830 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/skin-1-ui.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/skin-2-ui.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/skin-2-ui.png Binary files differnew file mode 100755 index 0000000..d1eee4e --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/skin-2-ui.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/skin-3-ui.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/skin-3-ui.gif Binary files differnew file mode 100755 index 0000000..c715a9c --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/skin-3-ui.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/skin-3-ui.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/skin-3-ui.png Binary files differnew file mode 100755 index 0000000..161e19d --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/skin-3-ui.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/skin-4-ui.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/skin-4-ui.png Binary files differnew file mode 100755 index 0000000..087b43e --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/skin-4-ui.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/slider-1.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/slider-1.png Binary files differnew file mode 100755 index 0000000..be28d4a --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/slider-1.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/slider-light.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/slider-light.gif Binary files differnew file mode 100755 index 0000000..63a20ac --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/slider-light.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/slider-light.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/slider-light.png Binary files differnew file mode 100755 index 0000000..4984ea2 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/slider-light.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/slider.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/slider.gif Binary files differnew file mode 100755 index 0000000..2c86492 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/slider.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/slider.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/slider.png Binary files differnew file mode 100755 index 0000000..dc4b1a4 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/slider.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/speaker-light.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/speaker-light.png Binary files differnew file mode 100755 index 0000000..de681e4 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/speaker-light.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/speaker.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/speaker.png Binary files differnew file mode 100755 index 0000000..c61a5bd --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/speaker.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/ui-highlight-0.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/ui-highlight-0.gif Binary files differnew file mode 100755 index 0000000..2709854 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/ui-highlight-0.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/ui-highlight-0.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/ui-highlight-0.png Binary files differnew file mode 100755 index 0000000..a211562 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/ui-highlight-0.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/ui-highlight-1.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/ui-highlight-1.gif Binary files differnew file mode 100755 index 0000000..d6828cf --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/ui-highlight-1.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/ui-highlight-1.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/ui-highlight-1.png Binary files differnew file mode 100755 index 0000000..fc007f9 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/ui-highlight-1.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/ui-highlight-2.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/ui-highlight-2.gif Binary files differnew file mode 100755 index 0000000..6f91eb9 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/ui-highlight-2.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/ui-highlight-2.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/ui-highlight-2.png Binary files differnew file mode 100755 index 0000000..68fc7ff --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/ui-highlight-2.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/volume-light.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/volume-light.png Binary files differnew file mode 100755 index 0000000..426e3d5 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/volume-light.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/volume.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/volume.png Binary files differnew file mode 100755 index 0000000..27967eb --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/volume.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/whiteout.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/whiteout.png Binary files differnew file mode 100755 index 0000000..679f8e8 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/image/whiteout.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/index.html b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/index.html new file mode 100755 index 0000000..b1ccdc4 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/index.html @@ -0,0 +1,241 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+<title>jsAMP MP3 Player v0.99a.20071010 - Technology Preview Demo</title> +<meta name="robots" content="noindex" />
+<meta name="author" content="Scott Schiller" />
+<meta name="language" content="en-us" />
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<meta name="keywords" content="javascript sound library api" />
+<meta name="description" content="Demo page for soundmanager mp3 player" />
+<link rel="stylesheet" type="text/css" href="css/player.css" title="dark" media="screen" />
+<link rel="alternate stylesheet" type="text/css" href="css/player-light.css" title="light" media="screen" />
+<style type="text/css">
+
+#demo-info {
+ position:relative;
+ padding:1em;
+ background:#000;
+ opacity:0.75;
+ filter:alpha(opacity=75);
+ color:#fff;
+ max-width:51em;
+}
+
+#demo-info h1 {
+ margin:0px 0px 2em 0px;
+ font-size:1.5em;
+ color:#99ccff;
+}
+
+#demo-info p {
+ line-height:1.5em;
+}
+
+#demo-info a {
+ color:#99ccff;
+}
+
+#demo-info a:hover {
+ color:#fff;
+}
+
+#close {
+ position:absolute;
+ right:0px;
+ top:0px;
+ display:block;
+ width:1em;
+ line-height:1em;
+ padding:0.1em;
+ margin:0.5em;
+ height:1em;
+ text-decoration:none;
+ color:#fff;
+ border:1px solid #666;
+ text-align:center;
+ overflow:hidden;
+}
+
+#close:hover {
+ background:#333;
+}
+
+#demo-info.closed * {
+ display:none;
+}
+
+#demo-info.closed .minimal {
+ display:block;
+ margin:0px;
+ padding:0px;
+}
+
+#demo-info.closed .minimal * {
+ display:inline;
+}
+
+</style>
+<script type="text/javascript">
+function setActiveStyleSheet(title) {
+ var i, a, main;
+ for (i=0; (a = document.getElementsByTagName("link")[i]); i++) {
+ if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
+ a.disabled = true;
+ if(a.getAttribute("title") == title) a.disabled = false;
+ }
+ }
+}
+</script>
+<script type="text/javascript" src="../../script/soundmanager2-nodebug-jsmin.js"></script>
+<script type="text/javascript" src="script/jsamp-preview.js"></script>
+
+</head>
+
+<body>
+
+<div>
+
+ <!-- skin / control stuff -->
+ <div id="demo-info">
+
+ <h1>jsAMP: Example SoundManager 2 Application</h1>
+<pre style="font-size:1.25em">
+ ---------------------------------------------------------
+
+ * GENERAL DISCLAIMER: jsAMP is UNSUPPORTED DEMO CODE. *
+
+ jsAMP is provided "as-is" and as an example application
+ using the API functionality provided by SoundManager 2.
+ (It's also a dev. sanity QA check / API test suite.)
+
+ I don't recommend throwing it on your band/label's site
+ expecting it to "just work" - you have been warned. ;)
+
+ You are welcome to use this in your own projects, but
+ be aware jsAMP may be buggy, use at your own risk etc.
+
+ If you are looking for a JS/DHTML/Flash MP3 player,
+ check the related projects section of the SM2 project
+ page for other resources.
+
+ ---------------------------------------------------------
+</pre>
+ <p>jsAMP is a JavaScript MP3 player which uses the <a href="http://www.schillmania.com/projects/soundmanager2/" title="SoundManager 2 project home">SoundManager 2 API</a> to provide JS-driven audio. It's an example of the kind of stuff you could build using SoundManager. All player logic is handled via Javascript, but SoundManager 2 (JS + Flash) provide the actual sound layer. It's also convenient in that no Flash knowledge is needed, it's all handled by SM2.</p>
+ <p>jsAMP picks up all <a> elements linking to MP3 files in the page, and creates a playlist (view source for details.) It gets ID3 information when loading local/same-domain files or as permissions allow, as well.</p>
+ <p>To see the playlist, click the "down arrow" <img src="image/sec-right-arr0.png" alt="Playlist toggle" title="Playlist toggle" /> at right on the UI.</p>
+ <p>Click and drag the title bar to move the player around. When a track is loaded, click to seek or drag and drop the slider to a given position. (Safari seems to have a few minor UI issues in this version, FYI.) IE 6 also receives a somewhat-degraded, GIF-based experience.</p>
+
+ <p><a href="http://www.schillmania.com/projects/soundmanager2/">SoundManager 2 Project Home</a></p>
+
+ <p class="minimal">Skin: <a href="#" onclick="setActiveStyleSheet('light');return false">light</a> | <a href="#" onclick="setActiveStyleSheet('dark');return false">dark</a> || <a href="#" onclick="bg.getRandom();return false">this background sucks</a></p>
+
+ <a id="close" href="#" title="close" onclick="document.getElementById('demo-info').className='closed';return false">-</a>
+
+ </div>
+
+
+ <div id="player-template" class="sm2player">
+
+ <!-- player UI (bar) -->
+
+ <div class="ui">
+
+ <div class="left">
+ <a href="#" title="Pause/Play" onclick="soundPlayer.togglePause();return false" class="trigger pauseplay"><span></span></a>
+ </div>
+
+ <div class="mid">
+
+ <div class="progress"></div>
+ <div class="info"><span class="caption text">%{artist} - %{title} [%{album}], (%{year}) (%{time})</span></div>
+ <div class="default">jsAMP Technology Preview v0.99a.20071010 (Seriously alpha - use at own risk! :))</div>
+ <div class="seek">Seek to %{time1} of %{time2} (%{percent}%)</div>
+ <div class="divider"> --- </div>
+ <a href="#" title="" class="slider"></a>
+ </div>
+
+ <div class="right">
+ <div class="divider"></div>
+ <div class="time" title="Time">0:00</div>
+ <a href="#" title="Previous" class="trigger prev" onclick="soundPlayer.oPlaylist.playPreviousItem();return false"><span></span></a>
+ <a href="#" title="Next" class="trigger next" onclick="soundPlayer.oPlaylist.playNextItem();return false"><span></span></a>
+ <a href="#" title="Shuffle" class="trigger s1 shuffle" onclick="soundPlayer.toggleShuffle();return false"><span></span></a>
+ <a href="#" title="Repeat" class="trigger s2 loop" onclick="soundPlayer.toggleRepeat();return false"><span></span></a>
+ <a href="#" title="Mute" class="trigger s3 mute" onclick="soundPlayer.toggleMute();return false"><span></span></a>
+ <a href="#" title="Volume" onmousedown="soundPlayer.volumeDown(event);return false" onclick="return false" class="trigger s4 volume"><span></span></a>
+ <a href="#" title="Playlist" class="trigger dropdown" onclick="soundPlayer.togglePlaylist();return false"><span></span></a>
+ </div>
+
+ </div>
+
+ <div class="sm2playlist-box">
+
+ <!-- playlist / controls -->
+ <div id="playlist-template" class="sm2playlist">
+
+ <div class="hd"><div class="c"></div></div>
+ <div class="bd">
+ <ul>
+ <!-- playlist items created, inserted here
+ <li><a href="/path/to/some.mp3"><span>Artist - Song Name, etc.</span></a></li>
+ -->
+ </ul>
+ </div>
+ <div class="ft"><div class="c"></div></div>
+ </div>
+
+ <!-- close container -->
+ </div>
+
+ </div>
+
+ <div style="position:absolute;left:0px;top:-9999px;width:30em">
+
+ <p>This is a normal list of HTML links to MP3 files, which jsAMP picks up and turns into a playlist.</p>
+
+ <ul>
+
+ <li><a href="audio/going_outside.mp3">Going Outside</a></li>
+ <li><a href="audio/office_lobby.mp3">Office Lobby Entrance</a></li>
+ <li><a href="../_mp3/mak.mp3">Angry cow sound?</a></li>
+ <li><a href="audio/walking.mp3">Walking</a></li>
+
+ <!-- files from the web (note that ID3 information will *not* load from remote domains without permission, Flash restriction) -->
+
+ <li><a href="http://www.freshly-ground.com/data/audio/binaural/Rain 3.mp3">Rain 3</a></li>
+ <li><a href="http://www.freshly-ground.com/data/audio/binaural/Frogs @ Yahoo!.mp3">Frogs @ Yahoo!</a></li>
+ <li><a href="http://www.freshly-ground.com/data/audio/binaural/Walking past sprinklers, mailbox.mp3">Walking past sprinklers, mailbox</a></li>
+ <li><a href="http://www.freshly-ground.com/data/audio/binaural/Cup of Coffee.mp3">Cup of Coffee</a></li>
+ <li><a href="http://www.freshly-ground.com/misc/music/carl-3-barlp.mp3">Barrlping with Carl (featureblend.com)</a></li>
+ <li><a href="http://www.freshly-ground.com/data/audio/binaural/Mak.mp3">Angry cow sound?</a></li>
+ <li><a href="http://www.freshly-ground.com/data/audio/binaural/Things that open, close and roll.mp3">Things that open, close and roll</a></li>
+ <li><a href="http://www.freshly-ground.com/misc/music/20060826%20-%20Armstrong.mp3">20060826 - Armstrong</a></li>
+
+ </ul>
+
+ </div>
+
+</div>
+
+<script type="text/javascript">
+var bg = {
+ images: ['bg1','bg2','bg3'],
+ i: 0,
+ getRandom: function(n) {
+ this.i = (typeof n != 'undefined'?n:(++this.i>=this.images.length?0:this.i));
+ document.body.style.background = "#000 url(backgrounds/"+this.images[this.i]+".jpg) no-repeat 0px 0px";
+ }
+}
+
+bg.getRandom(parseInt(Math.random()*bg.images.length));
+</script>
+
+<script type="text/javascript">
+if (window.location.toString().match(/flash9/)) soundManager.flashVersion = 9;
+soundManager.url = '../../swf/';
+</script>
+
+</body>
+</html>
diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/php notes.txt b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/php notes.txt new file mode 100755 index 0000000..25f8e88 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/php notes.txt @@ -0,0 +1,25 @@ +<?php
+
+// print out MP3s in a given directory
+// format:
+// <li><a href="/my/music/20060411 - Code 3825.mp3">Code 3825</a></li>
+
+function listMP3s($path) {
+ $dir = $_SERVER['DOCUMENT_ROOT'].$path;
+ $dirlength = strlen($dir);
+ $dh = opendir($dir);
+ while (false !== ($filename = readdir($dh))) {
+ // print "filename: $filename<br />";
+ if (stristr($filename,'.mp3')) $files[] = $path."/".basename($filename);
+ if ($filename != "." && $filename != ".." && is_dir($dir."/".$filename)) listMP3s($path."/".$filename); // recurse through subdirectories
+ // print ("is dir: ".(($filename != "." && $filename != ".." && is_dir($dir."/".$filename))?"Yes":"No")."<br />");
+ }
+ rsort($files);
+ for ($i=0; $i<sizeof($files); $i++) {
+ print " <li><a href=\"".dirname($files[$i])."/".rawurlencode(basename($files[$i]))."\">".basename($files[$i])."</a></li>\n";
+ }
+}
+
+listMP3s('/my/music');
+
+?>
\ No newline at end of file diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/script/jsamp-preview.js b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/script/jsamp-preview.js new file mode 100755 index 0000000..8b1b872 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/jsAMP-preview/script/jsamp-preview.js @@ -0,0 +1,1605 @@ +/*
+
+ jsAMP - V0.9a.20080331 - "Technology Preview" - DEMO ONLY
+ ---------------------------------------------------------
+ An MP3 player implementation using the SoundManager 2 API
+
+ (And a sanity QA / test suite for the core API calls. :D)
+ http://www.schillmania.com/projects/soundmanager2/
+
+ ---------------------------------------------------------
+
+ * GENERAL DISCLAIMER: jsAMP is UNSUPPORTED DEMO CODE. *
+
+ jsAMP is provided "as-is" and as an example application
+ using the API functionality provided by SoundManager 2.
+ (It's also a dev. sanity QA check / API test suite.)
+
+ I don't recommend throwing it on your band/label's site
+ expecting it to "just work" - you have been warned. ;)
+
+ You are welcome to use this in your own projects, but
+ be aware jsAMP may be buggy, use at your own risk etc.
+
+ If you are looking for a JS/DHTML/Flash MP3 player,
+ check the related projects section of the SM2 project
+ page for other resources.
+
+ ---------------------------------------------------------
+
+*/
+
+function SMUtils() {
+ var self = this;
+ this.isSafari = navigator.userAgent.match(/safari/);
+ this.isMac = navigator.platform.match(/mac/);
+ this.isIE = (navigator.appVersion.match(/MSIE/) && !navigator.userAgent.match(/Opera/));
+ this.isNewIE = (this.isIE && !this.isMac && (!navigator.userAgent.match(/MSIE (5|6)/)));
+ this.isOldIE = (this.isIE && !this.isNewIE);
+
+ this.$ = function(sID) {
+ return document.getElementById(sID);
+ }
+
+ this.isChildOf = function(oChild,oParent) {
+ while (oChild.parentNode && oChild != oParent) {
+ oChild = oChild.parentNode;
+ }
+ return (oChild == oParent);
+ }
+
+ this.addEventHandler = function(o,evtName,evtHandler) {
+ typeof(attachEvent)=='undefined'?o.addEventListener(evtName,evtHandler,false):o.attachEvent('on'+evtName,evtHandler);
+ }
+
+ this.removeEventHandler = function(o,evtName,evtHandler) {
+ typeof(attachEvent)=='undefined'?o.removeEventListener(evtName,evtHandler,false):o.detachEvent('on'+evtName,evtHandler);
+ }
+
+ this.classContains = function(o,cStr) {
+ return (typeof(o.className)!='undefined'?o.className.indexOf(cStr)+1:false);
+ }
+
+ this.addClass = function(o,cStr) {
+ if (!o) return false; // safety net
+ if (self.classContains(o,cStr)) return false;
+ o.className = (o.className?o.className+' ':'')+cStr;
+ }
+
+ this.removeClass = function(o,cStr) {
+ if (!o) return false; // safety net
+ if (!self.classContains(o,cStr)) return false;
+ o.className = o.className.replace(new RegExp('( '+cStr+')|('+cStr+')','g'),'');
+ }
+
+ this.getElementsByClassName = function(className,tagNames,oParent) {
+ var doc = (oParent||document);
+ var matches = [];
+ var i,j;
+ var nodes = [];
+ if (typeof(tagNames)!='undefined' && typeof(tagNames)!='string') {
+ for (i=tagNames.length; i--;) {
+ if (!nodes || !nodes[tagNames[i]]) {
+ nodes[tagNames[i]] = doc.getElementsByTagName(tagNames[i]);
+ }
+ }
+ } else if (tagNames) {
+ nodes = doc.getElementsByTagName(tagNames);
+ } else {
+ nodes = doc.all||doc.getElementsByTagName('*');
+ }
+ if (typeof(tagNames)!='string') {
+ for (i=tagNames.length; i--;) {
+ for (j=nodes[tagNames[i]].length; j--;) {
+ if (self.classContains(nodes[tagNames[i]][j],className)) {
+ matches[matches.length] = nodes[tagNames[i]][j];
+ }
+ }
+ }
+ } else {
+ for (i=0; i<nodes.length; i++) {
+ if (self.classContains(nodes[i],className)) {
+ matches[matches.length] = nodes[i];
+ }
+ }
+ }
+ return matches;
+ }
+
+ this.getOffX = function(o) {
+ // http://www.xs4all.nl/~ppk/js/findpos.html
+ var curleft = 0;
+ if (o.offsetParent) {
+ while (o.offsetParent) {
+ curleft += o.offsetLeft;
+ o = o.offsetParent;
+ }
+ }
+ else if (o.x) curleft += o.x;
+ return curleft;
+ }
+
+ this.getOffY = function(o) {
+ // http://www.xs4all.nl/~ppk/js/findpos.html
+ var curtop = 0;
+ if (!o) return false;
+ if (o.offsetParent) {
+ while (o.offsetParent) {
+ curtop += o.offsetTop;
+ o = o.offsetParent;
+ }
+ }
+ else if (o.y) curtop += o.y;
+ return curtop;
+ }
+
+ this.setOpacity = this.isIE?function(o,nOpacity) {
+ o.style.filter = 'alpha(opacity='+nOpacity+')';
+ }:function(o,nOpacity) {
+ o.style.opacity = nOpacity/100;
+ }
+
+ this.copy = function(oArray) {
+ // there *must* be a cleaner way to do this..
+ var o2 = [];
+ for (var i=0,j=oArray.length; i<j; i++) {
+ o2[i] = oArray[i];
+ }
+ return o2;
+ }
+
+};
+
+var smUtils = new SMUtils();
+
+function SMPlayer(oSoundPlayer) {
+ var self = this;
+ this.oParent = oSoundPlayer;
+ var u = smUtils; // alias
+ var getEBCN = u.getElementsByClassName;
+ this.oMain = document.getElementById('player-template');
+ this.o = this.oMain.getElementsByTagName('div')[0];
+ this.oLeft = getEBCN('left','div',this.o)[0];
+ this.oBar = getEBCN('mid','div',this.o)[0];
+ this.oSlider = getEBCN('slider','a',this.o)[0];
+ this.oTitle = getEBCN('caption','span',this.oBar)[0];
+ this.oSeek = getEBCN('seek','div',this.oBar)[0];
+ this.oDivider = getEBCN('divider','div',this.oBar)[0];
+ this.sFormat = (this.oTitle.innerHTML||'%artist - %title');
+ this.sFormatSeek = (this.oSeek.innerHTML||'%{time1}/%{time2} (%{percent}%)');
+ this.oProgress = getEBCN('progress','div',this.oBar)[0];
+ this.oRight = getEBCN('right','div',this.o)[0];
+ this.oTime = getEBCN('time','div',this.o)[0];
+ this.oShuffle = getEBCN('shuffle','a',this.o)[0];
+ this.oRepeat = getEBCN('loop','a',this.o)[0];
+ this.oMute = getEBCN('mute','a',this.o)[0];
+ this.oVolume = getEBCN('volume','a',this.o)[0];
+ this.lastTime = 0;
+ this.scale = 100;
+ this.percentLoaded = 0;
+ this.gotTimeEstimate = 0;
+ this.offX = 0;
+ this.x = 0;
+ this.xMin = 0;
+ this.barWidth = self.oBar.offsetWidth;
+ this.xMax = self.barWidth-self.oSlider.offsetWidth;
+ this.xMaxLoaded = 0;
+ // this.value = 0;
+ this.timer = null;
+ this._className = this.oBar.className;
+ this.tween = [];
+ this.frame = 0;
+ this.playState = 0;
+ this.busy = false; // when being dragged/animated/moved by user
+ this.maxOpacity = 100; // barber pole opacity (when animating in)
+ this.didDrag = false;
+ this.coords = {
+ 'x': 0,
+ 'y': 0,
+ 'offX':0,
+ 'offY':0,
+ 'titleWidth': 0
+ }
+ this.muted = false;
+ this.volume = soundManager.defaultOptions.volume;
+
+ var useAltFont = u.isMac; // specific letter-spacing CSS tweak (OSX has better-kerned/tighter spacing)
+
+ // set default caption
+ this.oTitle.innerHTML = getEBCN('default','div',this.oBar)[0].innerHTML;
+ this.oTitle.style.visibility = 'visible';
+
+ this.over = function() {
+ this.className = self._className+' hover';
+ event.cancelBubble=true;
+ return false;
+ }
+
+ this.out = function() {
+ this.className = self._className;
+ event.cancelBubble=true;
+ return false;
+ }
+
+ this.down = function(e) {
+ if (!self.oParent.currentSound) return false;
+ self.didDrag = false;
+ var e = e?e:event;
+ self.offX = e.clientX-(u.getOffX(self.oSlider)-u.getOffX(self.oBar));
+ self.busy = true;
+ u.addClass(self.oSlider,'active');
+ self.refreshSeek();
+ self.setSeekVisibility(1);
+ u.addEventHandler(document,'mousemove',self.move);
+ u.addEventHandler(document,'mouseup',self.up);
+ e.stopPropgation?e.stopPropagation():e.cancelBubble=true;
+ return false;
+ }
+
+ this.barDown = function(e) {
+ var e=e?e:event;
+ self.didDrag = false;
+ self.coords.x = e.clientX;
+ self.coords.y = e.clientY;
+ self.coords.offX = e.clientX-u.getOffX(self.oMain);
+ self.coords.offY = e.clientY-u.getOffY(self.oMain);
+ u.addEventHandler(document,'mousemove',self.barMove);
+ u.addEventHandler(document,'mouseup',self.barUp);
+ return false;
+ }
+
+ this.barMove = function(e) {
+ var e=e?e:event;
+ if (!self.didDrag) {
+ if (Math.abs(e.clientX-self.coords.x)<3 && Math.abs(e.clientY-self.coords.y)<3) {
+ // drag threshold
+ return false;
+ } else {
+ self.didDrag = true;
+ }
+ }
+ self.oMain.style.left = (e.clientX-self.coords.offX)+'px';
+ self.oMain.style.top = (e.clientY-self.coords.offY)+'px';
+ e.stopPropgation?e.stopPropagation():e.cancelBubble=true;
+ return false;
+ }
+
+ this.barUp = function(e) {
+ u.removeEventHandler(document,'mousemove',self.barMove);
+ u.removeEventHandler(document,'mouseup',self.barUp);
+ }
+
+ this.barClick = function(e) {
+ if (!self.oParent.currentSound) return false;
+ if (self.didDrag) return false;
+ var tgt = (e?e.target:event.srcElement);
+ var e=e?e:event;
+ if (tgt.tagName.toLowerCase()=='a') return false; // ignore clicks on links (eg. dragging slider)
+ var xNew = Math.min(e.clientX-u.getOffX(self.oBar),self.xMaxLoaded);
+ self.slide(self.x,xNew);
+ }
+
+ // volume x/y offsets
+ this.volumeX = 0;
+ this.volumeWidth = 0;
+
+ this.volumeDown = function(e) {
+ // set initial volume based on offset?
+ self.volumeX = u.getOffX(self.oVolume);
+ self.volumeWidth = parseInt(self.oVolume.offsetWidth);
+ soundManager._writeDebug('offsets: '+self.volumeX+', '+self.volumeWidth);
+ document.onmousemove = self.volumeMove;
+ document.onmouseup = self.volumeUp;
+ self.volumeMove(e);
+ return false;
+ }
+
+ this.volumeMove = function(e) {
+ // set volume based on position
+ var e = e?e:event;
+ var vol = ((e.clientX-self.volumeX)/(self.volumeWidth));
+ vol = Math.min(1,Math.max(0,vol));
+ self.setVolume(vol*100);
+ return false;
+ }
+
+ this.volumeUp = function(e) {
+ var e = e?e:event;
+ document.onmousemove = null;
+ document.onmouseup = null;
+ return false;
+ }
+
+ this.setVolume = function(nVol) {
+ if (!self.oParent.currentSound || self.volume == nVol) return false;
+ soundManager.defaultOptions.volume = nVol;
+ soundManager._writeDebug('soundManager.setVolume('+nVol+')');
+ self.volume = nVol;
+ if (!self.muted) soundManager.setVolume(self.oParent.currentSound,nVol);
+ u.setOpacity(self.oVolume,nVol);
+ }
+
+ this.move = function(e) {
+ var e=e?e:event;
+ var x = e.clientX-self.offX;
+ if (x>self.xMaxLoaded) {
+ x = self.xMaxLoaded;
+ } else if (x<self.xMin) {
+ x = self.xMin;
+ }
+ if (x != self.x) {
+ self.moveTo(x);
+ if (self.oParent.options.allowScrub) self.doScrub();
+ self.refreshSeek();
+ }
+ e.stopPropgation?e.stopPropagation():e.cancelBubble=true;
+ return false;
+ }
+
+ this.up = function(e) {
+ u.removeEventHandler(document,'mousemove',self.move);
+ u.removeEventHandler(document,'mouseup',self.up);
+ u.removeClass(self.oSlider,'active');
+ self.busy = false;
+ if (!self.oParent.options.allowScrub || self.oParent.paused) self.oParent.onUserSetSlideValue(self.x); // notify parent of update
+ self.setSeekVisibility();
+ return false;
+ }
+
+ this.slide = function(x0,x1) {
+ self.tween = animator.createTween(x0,x1);
+ self.busy = true;
+ self.slideLastExec = new Date();
+ animator.addMethod(self.animate,self.animateComplete);
+ animator.start();
+ }
+
+ this.refreshSeek = function() {
+ var sData = self.sFormatSeek;
+ var oSound = soundManager.getSoundById(self.oParent.currentSound);
+// soundManager._writeDebug('oSound.duration: '+oSound.duration);
+// soundManager._writeDebug(self.x+','+self.xMaxLoaded+','+oSound.duration+','+oSound.durationEstimate);
+ var sliderMSec = self.x/self.xMaxLoaded*oSound.duration;
+ var attrs = {
+ 'time1': self.getTime(sliderMSec,true),
+ 'time2': (!oSound.loaded?'~':'')+self.getTime(oSound.durationEstimate,true),
+ 'percent': Math.floor(sliderMSec/oSound.durationEstimate*100)
+ }
+ // soundManager._writeDebug(attrs.time1+' / '+attrs.time2+' / '+attrs.percent);
+ for (var attr in attrs) {
+ data = attrs[attr];
+ if (self.isEmpty(data)) data = '!null!';
+ sData = sData.replace('\%\{'+attr+'\}',data);
+ }
+ // remove any empty/null fields
+ var aData = sData.split(' ');
+ for (var i=aData.length; i--;) {
+ if (aData[i].indexOf('!null!')+1) aData[i] = null;
+ }
+ self.oSeek.innerHTML = aData.join(' ');
+ }
+
+ this.setSeekVisibility = function(bVisible) {
+ self.oTitle.style.visibility = bVisible?'hidden':'visible';
+ self.oSeek.style.display = bVisible?'block':'none';
+ }
+
+ this.animateComplete = function() {
+ self.busy = false;
+ // set sound position, if needed
+ if (self.oParent) self.oParent.onUserSetSlideValue(self.x);
+ }
+
+ this.moveTo = function(x) {
+ self.x = x;
+ self.oSlider.style.marginLeft = (Math.floor(x)+1)+'px'; // 1 offset
+ }
+
+ this.moveToEnd = function() {
+ self.moveTo(self.xMax);
+ }
+
+ this.slideLastExec = new Date();
+
+ this.animate = function() {
+ self.moveTo(self.tween[self.frame]);
+ self.frame = Math.max(++self.frame,animator.determineFrame(self.slideLastExec,40));
+ // if (self.frame++>=self.tween.length-1) {
+ if (self.frame>=self.tween.length-1) {
+ self.active = false;
+ self.frame = 0;
+ if (self._oncomplete) self._oncomplete();
+ return false;
+ }
+ return true;
+ }
+
+ this.doScrub = function(t) {
+ if (self.oParent.paused) return false;
+ if (self.oParent.options.scrubThrottle) {
+ if (!self.timer) self.timer = setTimeout(self.scrub,t||20);
+ } else {
+ self.scrub();
+ }
+ }
+
+ this.scrub = function() {
+ self.timer = null;
+ self.oParent.onUserSetSlideValue(self.x)
+ }
+
+ this.randomize = function() {
+ self.slide(self.x,parseInt(Math.random()*self.xMax));
+ }
+
+ this.getTimeEstimate = function(oSound) {
+ // try to estimate song length within first 128 KB (or total bytes), updating n times
+ var byteCeiling = Math.min(1048576||oSound.bytes);
+ var samples = (byteCeiling==oSound.bytes?2:4);
+ var milestone = Math.floor(oSound.bytesLoaded/byteCeiling*samples);
+ if (oSound.bytesLoaded>byteCeiling && self.gotTimeEstimate>0) return false;
+ if (self.gotTimeEstimate == milestone) return false;
+ self.gotTimeEstimate = milestone;
+ self.setMetaData(oSound);
+ }
+
+ this.getTime = function(nMSec,bAsString) {
+ // convert milliseconds to mm:ss, return as object literal or string
+ var nSec = Math.floor(nMSec/1000);
+ var min = Math.floor(nSec/60);
+ var sec = nSec-(min*60);
+ if (min == 0 && sec == 0) return null; // return 0:00 as null
+ return (bAsString?(min+':'+(sec<10?'0'+sec:sec)):{'min':min,'sec':sec});
+ }
+
+ this.updateTime = function(nMSec) {
+ // update "current playing" time
+ self.lastTime = nMSec;
+ self.oTime.innerHTML = (self.getTime(nMSec,true)||'0:00');
+ }
+
+ this.setTitle= function(sTitle) {
+ // used in the absence of ID3 info
+ self.oTitle.innerHTML = unescape(sTitle);
+ self.titleString = unescape(sTitle);
+ self.refreshScroll();
+ }
+
+ this.isEmpty = function(o) {
+ return (typeof o == 'undefined' || o == null || o == 'null' || (typeof o == 'string' && o.toLowerCase() == 'n/a' || o.toLowerCase == 'undefined'));
+ }
+
+ self.setMetaData = function(oSound) {
+ // get id3 data and populate according to formatting string (%artist - %title [%album] etc.)
+ var friendlyAttrs = {
+ // ID3V1 inherits from ID3V2 if populated
+ 'title': 'songname', // songname/TIT2
+ 'artist': 'artist', // artist/TPE1
+ 'album': 'album', // album/TALB
+ 'track': 'track', // track/TRCK
+ 'year': 'year', // year/TYER
+ 'genre': 'genre', // genre/TCON
+ 'comment': 'comment', // comment/COMM
+ 'url': 'WXXX'
+ }
+ var sTime = self.getTime(oSound.durationEstimate,true);
+ sTime = (sTime && !oSound.loaded?'~':'')+sTime;
+ var metaAttrs = {
+ // custom attributes taken directly from sound data
+ 'time': sTime // get time as mm:ss
+ }
+ // get normalised data, build string, replace
+ var sData = self.sFormat; // eg. %{artist} - %{title}
+ var data = null;
+ var useID3 = (!self.isEmpty(oSound.id3.songname) && !self.isEmpty(oSound.id3.artist)); // artist & title must be present to consider using ID3
+ for (var attr in friendlyAttrs) {
+ data = oSound.id3[friendlyAttrs[attr]];
+ if (self.isEmpty(data)) data = '!null!';
+ sData = sData.replace('\%\{'+attr+'\}',data);
+ }
+ for (var attr in metaAttrs) {
+ data = metaAttrs[attr];
+ if (self.isEmpty(data)) data = '!null!';
+ sData = sData.replace('\%\{'+attr+'\}',data);
+ }
+ // remove any empty/null fields
+ var aData = sData.split(' ');
+ for (var i=aData.length; i--;) {
+ if (aData[i].indexOf('!null!')+1) aData[i] = null;
+ }
+ var sMetaData = (useID3?unescape(aData.join(' ')):unescape(self.oParent.oPlaylist.getCurrentItem().userTitle)+(!self.isEmpty(metaAttrs.time)?' ('+metaAttrs.time+')':'')).replace(/\s+/g,' ');
+ self.oTitle.innerHTML = sMetaData;
+ self.titleString = sMetaData;
+ self.oParent.oPlaylist.getCurrentItem().setTooltip(sMetaData);
+ self.refreshScroll();
+ }
+
+ this.setLoadingProgress = function(nPercentage) {
+// soundManager._writeDebug('setLoadingProgress(): '+nPercentage);
+ self.percentLoaded = nPercentage;
+ self.xMaxLoaded = self.percentLoaded*self.xMax;
+ self.oProgress.style.width = parseInt(nPercentage*self.barWidth)+'px';
+ }
+
+ this.setLoading = function(bLoading) {
+ if (self.isLoading == bLoading) return false;
+ self.isLoading = bLoading;
+ var f = bLoading?u.addClass:u.removeClass;
+ f(self.oProgress,'loading');
+ self.setLoadingAnimation(bLoading);
+ }
+
+ this.setLoadingAnimation = function(bLoading) {
+ soundManager._writeDebug('setLoadingAnimation(): '+bLoading);
+ if (bLoading) {
+ self.loadingTween = self.loadingTweens[0];
+ animator.addMethod(self.loadingAnimate);
+ animator.addMethod(self.loadingAnimateSlide,self.loadingAnimateSlideComplete);
+ animator.start();
+ } else {
+ self.loadingTween = self.loadingTweens[1];
+ if (self.loadingAnimateFrame>0) {
+ // reverse animation while active
+ // self.loadingTween.reverse();
+ self.loadingAnimateFrame = (self.loadingTween.length-self.loadingAnimateFrame);
+ } else {
+ self.loadingTween = self.loadingTweens[1];
+ animator.addMethod(self.loadingAnimateSlide,self.loadingAnimateSlideComplete);
+ }
+ }
+ }
+
+ this.loadingAnimate = function() {
+ var d = new Date();
+ if (d-self.loadingLastExec<50) return true; // throttle fps
+ self.loadingLastExec = d;
+ self.loadingX--;
+ self.oProgress.style.backgroundPosition = self.loadingX+'px '+self.loadingY+'px';
+ return self.isLoading;
+ }
+
+ this.loadingLastExec = new Date();
+ this.loadingTweens = [animator.createTween(0,self.maxOpacity),animator.createTween(self.maxOpacity,0)];
+ this.loadingDirection = 0;
+ this.loadingTween = this.loadingTweens[this.loadingDirection];
+ this.loadingAnimateFrame = 0;
+
+ this.loadingAnimateSlide = function() {
+ var d = new Date();
+ if (d-self.loadingLastExec<50) return true; // throttle to 20fps
+ u.setOpacity(self.oProgress,self.loadingTween[self.loadingAnimateFrame++]);
+ if (!self.isLoading) self.loadingAnimate(); // show update if not actively loading
+ self.loadingLastExec = d; // updates time, prevents loadingAnimate()
+ return (++self.loadingAnimateFrame<self.loadingTweens[0].length);
+ }
+
+ this.loadingAnimateSlideComplete = function() {
+ soundManager._writeDebug('loadingAnimateSlideComplete()');
+ self.loadingAnimateFrame = 0;
+ // self.loadingDirection = !self.loadingDirection;
+ self.loadingX = 0;
+ }
+
+ this.isLoading = false;
+ this.loadingTimer = null;
+ this.loadingX = 0;
+ this.loadingY = 0;
+
+ this.setPlayState = function(bPlayState) {
+ soundManager._writeDebug('SMPlayer.setPlayState('+bPlayState+')');
+ self.playState = bPlayState;
+ self.oLeft.getElementsByTagName('span')[0].className = (self.playState?'playing':'');
+ }
+
+ this.togglePause = function() {
+ soundManager._writeDebug('togglePause()');
+ if (self.oParent.currentSound) {
+ soundManager.togglePause(self.oParent.currentSound);
+ } else {
+ self.oParent.oPlaylist.playNextItem();
+ }
+ var isPaused = soundManager.getSoundById(self.oParent.currentSound).paused;
+ self.oParent.paused = isPaused;
+ self.setPlayState(!isPaused);
+ }
+
+ this.toggleShuffle = function() {
+ soundManager._writeDebug('SMPlayer.toggleShuffle()');
+ self.oParent.oPlaylist.toggleShuffle();
+ self.setShuffle(self.oParent.oPlaylist.doShuffle);
+ }
+
+ this.toggleRepeat = function() {
+ soundManager._writeDebug('SMPlayer.toggleRepeat()');
+ self.oParent.oPlaylist.toggleRepeat();
+ self.setRepeat(self.oParent.oPlaylist.doRepeat);
+ }
+
+ this.toggleMute = function() {
+ soundManager._writeDebug('SMPlayer.toggleMute()');
+ self.muted = !self.muted;
+ // var nVol = self.muted?0:self.volume;
+ // if (self.oParent.currentSound) soundManager.setVolume(self.oParent.currentSound,nVol);
+ // soundManager.defaultOptions.volume = nVol; // update global volume
+ if (self.muted) {
+ soundManager.mute();
+ } else {
+ soundManager.unmute();
+ }
+ self.setMute(self.muted);
+ }
+
+ this.togglePlaylist = function() {
+ // show UI changes here in main player?
+ soundManager._writeDebug('SMPlayer.togglePlaylist()');
+ }
+
+ this.setShuffle = function(bShuffle) {
+ var f = (bShuffle?u.addClass:u.removeClass);
+ f(self.oShuffle,'active');
+ }
+
+ this.setRepeat = function(bRepeat) {
+ var f = (bRepeat?u.addClass:u.removeClass);
+ f(self.oRepeat,'active');
+ }
+
+ this.setMute = function(bMute) {
+ var f = (bMute?u.addClass:u.removeClass);
+ f(self.oMute,'active');
+ }
+
+ this.scrollOffset = 0;
+ this.scrollOffsetMax = self.oBar.offsetWidth;
+ this.scrollInterval = 100;
+ this.scrollAmount = 2; // pixels
+ this.scrollLastExec = new Date();
+ this.scrollTimer = null;
+ this.isScrolling = null;
+
+ this.scrollTo = function(nOffset) {
+ self.oTitle.style.marginLeft = (nOffset*-1)+'px';
+ // soundManager._writeDebug('scrollTo(): '+nOffset);
+ self.refreshDocumentTitle();
+ }
+
+ var tmp = document.createElement('p');
+ tmp.innerHTML = ' ';
+ var nbsp = tmp.innerHTML;
+
+ this.refreshDocumentTitle = function(nOffset) {
+ var offset = (typeof nOffset != 'undefined'?nOffset:null);
+ var str = (self.titleString).substr(nOffset != null?nOffset:Math.max(self.scrollOffset-self.scrollAmount,0));
+ str = str.replace(/ /i,' ');
+ if (self.oParent.options.usePageTitle) {
+ try {
+ document.title = str; // str.replace(/ /i,' ');
+ } catch(e) {
+ // oh well
+ }
+ }
+ }
+
+ this.doScroll = function() {
+ var d = new Date();
+ if (d-self.scrollLastExec<self.scrollInterval) return true; // throttle
+ self.scrollLastExec = d;
+ self.scrollOffset += self.scrollAmount;
+ if (self.scrollOffset>self.coords.titleWidth) {
+ // soundManager._writeDebug('wrapping around');
+ self.scrollOffset = (smUtils.isIE?5:1);
+ }
+ self.scrollTo(self.scrollOffset);
+ return self.isScrolling;
+ }
+
+ this.resetScroll = function() {
+ soundManager._writeDebug('resetScroll()');
+ self.scrollOffset = 0;
+ self.scrollTo(self.scrollOffset);
+ self.refreshDocumentTitle(0);
+ }
+
+ this.setScroll = function(bScroll) {
+ soundManager._writeDebug('setScroll('+bScroll+')');
+ if (bScroll && !self.isScrolling) {
+ soundManager._writeDebug('starting scroll');
+ self.isScrolling = true;
+ animator.addMethod(self.doScroll,self.resetScroll);
+ animator.start();
+ }
+ if (!bScroll && self.isScrolling) {
+ soundManager._writeDebug('stopping scroll');
+ self.isScrolling = false;
+ }
+ }
+
+ this.titleString = ''; // for document title
+
+ this.refreshScroll = function() {
+ // self.scrollOffsetMax = 25; // self.oTitle.innerHTML.length;
+ // soundManager._writeDebug('refreshScroll(): '+self.scrollOffsetMax);
+ self.coords.titleWidth = self.oTitle.offsetWidth;
+ var doScroll = (self.coords.titleWidth>self.scrollOffsetMax);
+ if (doScroll) {
+ var sHTML = self.oTitle.innerHTML;
+ var dHTML = self.oDivider.innerHTML; // heh
+ self.oTitle.innerHTML = sHTML+dHTML;
+ self.coords.titleWidth = self.oTitle.offsetWidth;
+ self.setScroll(doScroll);
+ self.titleString = sHTML;
+ self.oTitle.innerHTML = sHTML+dHTML+sHTML;
+ } else {
+ self.setScroll(doScroll);
+ self.titleString = self.oTitle.innerHTML;
+ }
+ // if (doScroll) self.oTitle.innerHTML = (self.oTitle.innerHTML+' *** '+self.oTitle.innerHTML); // fake the "repeat"
+ }
+
+ this.reset = function() {
+ soundManager._writeDebug('SMPlayer.reset()');
+ if (self.x != 0) self.moveTo(0);
+ self.setLoadingProgress(0);
+ self.gotTimeEstimate = 0;
+ self.updateTime(0);
+ self.resetScroll();
+ }
+
+ this.destructor = function() {
+ self.oBar.onmouseover = null;
+ self.oBar.onmouseout = null;
+ self.o.onmousedown = null;
+ self.o = null;
+ self.oV = null;
+ self.oB.onclick = null;
+ self.oB = null;
+ }
+
+ if (u.isIE) {
+ // IE is lame, no :hover
+ this.oBar.onmouseover = this.over;
+ this.oBar.onmouseout = this.out;
+ }
+
+ if (u.isSafari) u.addClass(this.oMain,'noOpacity'); // stupid transparency tweak
+ if (useAltFont) u.addClass(this.oMain,'altFont');
+
+ // this.setScroll(true); // test
+
+ this.oSlider.onmousedown = this.down;
+ this.oBar.onmousedown = this.barDown;
+ this.oBar.onclick = this.barClick;
+// self.update();
+
+ // start scrolling, if needed
+ self.refreshScroll();
+
+}
+
+function Animator() {
+ var self = this;
+ this.timer = null;
+ this.active = null;
+ this.methods = [];
+ this.tweenStep = [1,2,3,4,5,6,7,8,9,10,9,8,7,6,5,4,3,2];
+ this.frameCount = this.tweenStep.length;
+ // this.lastExec = new Date();
+
+ this.start = function() {
+ if (self.active==true) return false;
+ self.active = true;
+ self.timer = window.setInterval(self.animate,20);
+ }
+
+ this.stop = function() {
+ if (self.timer) {
+ window.clearInterval(self.timer);
+ self.timer = null;
+ self.active = false;
+ }
+ }
+
+ this.reset = function() {
+ self.methods = [];
+ }
+
+ this.addMethod = function(oMethod,oncomplete) {
+ for (var i=self.methods.length; i--;) {
+ if (self.methods[i] == oMethod) {
+ if (oncomplete) {
+ self.methods[i]._oncomplete = oncomplete;
+ }
+ return false;
+ }
+ }
+ self.methods[self.methods.length] = oMethod;
+ self.methods[self.methods.length-1]._oncomplete = oncomplete||null;
+ }
+
+ this.createTween = function(start,end) {
+ var start = parseInt(start);
+ var end = parseInt(end);
+ var tweenStepData = self.tweenStep;
+ var tween = [start];
+ var tmp = start;
+ var diff = end-start;
+ var j = tweenStepData.length;
+ var isAscending = end>start;
+ for (var i=0; i<j; i++) {
+ tmp += diff*tweenStepData[i]*0.01;
+ tween[i] = parseInt(tmp);
+ // floor/ceiling checks (rounding errors?)
+ if (isAscending) {
+ if (tween[i]>end) tween[i] = end;
+ } else {
+ if (tween[i]<end) tween[i] = end;
+ }
+ }
+ if (tween[i] != end) tween[i] = end;
+ return tween;
+ }
+
+ this.determineFrame = function(tStart,nInterval) {
+ var d = new Date();
+ // var tElapsed = (new Date()-tStart);
+ // determine current frame, including lag
+ return Math.min(self.frameCount,Math.floor(self.frameCount*((new Date()-tStart)/(nInterval*self.frameCount))));
+ }
+
+ this.animate = function(e) {
+ if (!self.active) return false;
+ /*
+ var now = new Date();
+ if (now-self.lastExec<50) return false; // no more than 20 fps
+ self.lastExec = now;
+ */
+ var active = false;
+ for (var i=self.methods.length; i--;) {
+ if (self.methods[i]) {
+ if (self.methods[i]()) {
+ active = true;
+ } else {
+ if (self.methods[i]._oncomplete) {
+ self.methods[i]._oncomplete();
+ self.methods[i]._oncomplete = null;
+ }
+ self.methods[i] = null;
+ }
+ }
+ }
+ if (!active) {
+ self.stop();
+ self.reset();
+ }
+ }
+
+}
+
+var animator = new Animator();
+
+function SPPlaylist(oSoundPlayer,oPlaylist) {
+ var self = this;
+ var oParent = oSoundPlayer;
+ this.o = null;
+ this.links = [];
+ this.items = [];
+ this.playlistItems = []; // pointer
+ this.playlistItemsUnsorted = [];
+ this.playlistItemsShuffled = [];
+ this.index = -1;
+ this.lastIndex = null;
+ this.o = oPlaylist; // containing element
+ this.history = [];
+ this.isVisible = false;
+ this.doShuffle = false;
+ this.doRepeat = false;
+ this._ignoreCurrentSound = false;
+
+ var seamlessDelay = 0; // offset for justBeforeFinish
+
+ this.findURL = function(sURL) {
+ for (var i=self.items.length; i--;) {
+ if (self.items[i].url == sURL) return true;
+ }
+ return false;
+ }
+
+ this.addItem = function(oOptions) {
+ // oOptions = {url:string,name:string}
+ var sURL = oOptions.url||null;
+ var sName = oOptions.name||null;
+ if (!sURL || self.findURL(sURL)) return false;
+ self.items[self.items.length] = {
+ url: sURL,
+ name: (sName||sURL.substr(sURL.lastIndexOf('/')+1))
+ }
+ soundManager._writeDebug('SPPlaylist().addItem('+self.items[self.items.length-1].url+')');
+ }
+
+ this.getItem = function(sURL) {
+ for (var i=self.items.length; i--;) {
+ if (self.items[i].url == sURL) return self.items[i];
+ }
+ return null;
+ }
+
+ this.getCurrentItem = function() {
+ return self.playlistItems[self.index];
+ }
+
+ this.getRandomItem = function() {
+ return parseInt(Math.random()*self.items.length);
+ }
+
+ this.calcNextItem = function() {
+ var nextItem = self.index+1;
+ if (nextItem >= self.items.length) nextItem = -1;
+ return nextItem;
+ }
+
+ this.getNextItem = function() {
+ self.index++;
+ if (self.index>=self.items.length) {
+ self.index = -1; // reset
+ return false;
+ }
+ return true;
+ }
+
+ this.calcPreviousItem = function() {
+ var prevItem = self.index-1;
+ if (prevItem <0) prevItem = self.items.length-1;
+ return prevItem;
+ }
+
+ this.getPreviousItem = function() {
+ // self.index--;
+ if (--self.index<0) {
+ self.index = self.items.length-1;
+ return false;
+ }
+ return true;
+ }
+
+ this.playNextItem = function() {
+ // call getNextItem, decide what to do based on repeat/random state etc.
+ soundManager._writeDebug('SPPlaylist.playNextItem()');
+
+ if (self.getNextItem() || self.doRepeat) {
+ if (self.doRepeat && self.index == -1) {
+ // did loop
+ soundManager._writeDebug('did loop - restarting playlist');
+ self.index = 0;
+ }
+ self.play(self.index);
+ self.setHighlight(self.index);
+ } else {
+ soundManager._writeDebug('SPPlaylist.playNextItem(): finished?');
+ // finished
+ self.index = self.items.length-1;
+ if (!oParent.playState) {
+ self.play(self.index); // only start playing if currently stopped
+ }
+ // self.setHighlight(self.index);
+ }
+ }
+
+ this.playPreviousItem = function() {
+ // call getPreviousItem, decide what to do
+ soundManager._writeDebug('SPPlaylist.playPreviousItem()');
+ if (self.getPreviousItem() || self.doRepeat) {
+ // self.play(self.playlistItems[self.index].index);
+ self.play(self.index);
+ self.setHighlight(self.index);
+ } else {
+ // soundManager._writeDebug('SPPlaylist.playPreviousItem(): finished?');
+ self.index = 0;
+ // if (!oParent.playState) self.play(self.playlistItems[self.index].index); // only start playing if currently stopped
+ if (!oParent.playState) self.play(self.index); // only start playing if currently stopped
+ self.setHighlight(self.index);
+ }
+ }
+
+ this.setHighlight = function(i) {
+ if (self.playlistItems[i]) self.playlistItems[i].setHighlight();
+ // self.index = i;
+ if (self.lastIndex != null && self.lastIndex != i) self.removeHighlight(self.lastIndex);
+ self.lastIndex = i;
+ }
+
+ this.removeHighlight = function(i) {
+ if (self.playlistItems[i]) self.playlistItems[i].removeHighlight();
+ }
+
+ this.selectItem = function(i) {
+ self.index = i;
+ self.setHighlight(i);
+ }
+
+ this.onItemBeforeFinish = function() {
+ // NOTE: This could be inconsistent across systems and is not guaranteed (it's JS-based timing.)
+ if (oParent.oSMPlayer.busy) return false; // ignore if user is scrubbing
+ // setTimeout(self.onItemJustBeforeFinish,4800);
+ soundManager._writeDebug('SPPlaylist.onItemBeforeFinish()');
+ // start preloading next track
+ var nextItem = self.calcNextItem();
+ self.load(self.playlistItems[nextItem].index);
+ }
+
+ this.onItemJustBeforeFinish = function() {
+ // compensate for JS/Flash lag to attempt seamless audio. (woah.)
+ soundManager._writeDebug('SPPlaylist.onItemJustBeforeFinish()');
+ // soundManager.getSoundById(oParent.currentSound)._ignoreOnFinish = true; // prevent this sound's onfinish() from triggering next load, etc.
+ soundManager.getSoundById(this.sID)._ignoreOnFinish = true; // prevent this sound's onfinish() from triggering next load, etc.
+ if (this.sID == oParent.currentSound) { // just in case this method fires too late (next song already playing..)
+ self._ignoreCurrentSound = true; // prevent current track from stopping
+ self.playNextItem();
+ }
+ }
+
+ this.onItemBeforeFinishComplete = function() {
+ // TODO: Make getting SID reference cleaner (scope to playlist item)
+ soundManager._writeDebug('onItemBeforeFinishComplete()');
+ // soundManager.stop(oParent.lastSound);
+ // soundManager.unload(oParent.lastSound);
+ }
+
+ this.onItemFinish = function() {
+ soundManager._writeDebug('SPPlaylist.onItemFinish()');
+ if (this._ignoreOnFinish) {
+ // special case for seamless playback - don't trigger next track, already done
+ soundManager._writeDebug('sound '+this.sID+' ended with ._ignoreOnFinish=true');
+ this._ignoreOnFinish = false; // reset for next use
+ return false;
+ }
+ oParent.setPlayState(false); // stop
+ if (!self.getNextItem()) {
+ self.onfinish();
+ } else {
+ // self.play(self.playlistItems[self.index].index); // not needed?
+ self.play(self.index); // not needed?
+ self.setHighlight(self.index);
+ }
+ }
+
+ this.onfinish = function() {
+ // end of playlist
+ soundManager._writeDebug('SPPlaylist.onfinish()');
+ oParent.onfinish();
+ // hacks: reset scroll and index
+ oParent.x = 0; // haaack
+ oParent.lastSound = oParent.currentSound;
+ oParent.currentSound = null;
+ self.removeHighlight(self.index); // reset highlight
+ self.index = -1; // haaack
+// self.reset();
+
+ // if repeat mode, start playing next song
+ if (self.doRepeat) self.playNextItem();
+
+ }
+
+ this.show = function() {
+ self.setDisplay(true);
+ }
+
+ this.hide = function() {
+ self.setDisplay();
+ }
+
+ this.toggleShuffle = function() {
+ soundManager._writeDebug('SPPlaylist.toggleShuffle()');
+ self.doShuffle = !self.doShuffle;
+ soundManager._writeDebug('shuffle: '+self.doShuffle);
+ if (self.doShuffle) {
+ // undo current highlight
+ self.removeHighlight(self.index);
+ self.shufflePlaylist();
+ self.playlistItems = self.playlistItemsShuffled;
+ self.index = 0; // self.playlistItems[0].index;
+ self.setHighlight(0);
+ self.play(0);
+ } else {
+ self.index = self.playlistItems[self.index].origIndex; // restore to last unsorted position
+ self.lastIndex = self.playlistItems[self.lastIndex].origIndex; // map new lastIndex
+ self.playlistItems = self.playlistItemsUnsorted;
+ }
+ }
+
+ this.toggleRepeat = function() {
+ soundManager._writeDebug('SPPlaylist.toggleRepeat()');
+ self.doRepeat = !self.doRepeat;
+ soundManager._writeDebug('repeat: '+self.doRepeat);
+ }
+
+ this.shufflePlaylist = function() {
+ soundManager._writeDebug('SPPlaylist.shufflePlaylist()');
+ var p = self.playlistItemsShuffled, j = null, tmp = null, newIndex = null;
+ for (var i=p.length; i--;) {
+ j = parseInt(Math.random()*p.length);
+ tmp = p[j];
+ p[j] = p[i];
+ p[i] = tmp;
+ }
+ }
+
+ this.displayTweens = null;
+ this.opacityTweens = [animator.createTween(90,0),animator.createTween(0,90)];
+ this.displayTween = null;
+ this.opacityTween = null;
+ this.widthTweens = null;
+ this.widthTween = null;
+
+ this.frame = 0;
+
+ this.setOpacity = function(nOpacity) {
+ // soundManager._writeDebug('spPlaylist.setOpacity('+nOpacity+')');
+ // u.setOpacity(self.o,nOpacity);
+ }
+
+ this.createTweens = function() {
+ // calculate tweens
+ var base = (smUtils.isOldIE?16:0); // IE<7 needs vertical offset for playlist.
+ self.displayTweens = [animator.createTween(base,self.o.offsetHeight),animator.createTween(self.o.offsetHeight,base)];
+ self.widthTweens = [animator.createTween(self.o.offsetWidth,1),animator.createTween(1,self.o.offsetWidth)];
+ }
+
+ this.setCoords = function(nHeight,nOpacity,nWidth) {
+ self.o.style.marginTop = -nHeight+'px';
+ if (!smUtils.isIE) smUtils.setOpacity(self.o,nOpacity);
+ // self.o.style.width = nWidth+'px';
+ // self.o.style.marginLeft = (parseInt((self.widthTweens[0][0]-nWidth)/2)+1)+'px';
+ }
+
+ this.animate = function() {
+ self.frame = Math.max(++self.frame,animator.determineFrame(self.displayLastExec,35));
+ // self.frame++;
+ self.setCoords(self.displayTween[self.frame],self.opacityTween[self.frame],self.widthTween[self.frame]);
+ // self.playlistItems[self.frame].doAnimate(1);
+ if (self.frame>=self.displayTween.length-1) {
+ // self.active = false;
+ self.frame = 0;
+ return false;
+ }
+ return true;
+ }
+
+ this.displayLastExec = new Date();
+
+ this.setDisplay = function(bDisplay) {
+ soundManager._writeDebug('setDisplay()');
+ self.displayTween = self.displayTweens[self.isVisible?1:0];
+ self.opacityTween = self.opacityTweens[self.isVisible?1:0];
+ self.widthTween = self.widthTweens[self.isVisible?1:0];
+ if (self.frame>0) self.frame = self.displayTweens[0].length-self.frame;
+ self.displayLastExec = new Date();
+ animator.addMethod(self.animate,self.animateComplete);
+ animator.start();
+ }
+
+ this.animateComplete = function() {
+ // soundManager._writeDebug('spPlaylist.animateComplete()');
+ // if (self.isVisible) self.o.style.display = 'none';
+ }
+
+ this.toggleDisplay = function() {
+ self.isVisible = !self.isVisible;
+ if (!self.isVisible) self.o.style.display = 'block';
+ self.setDisplay(self.isVisible);
+ }
+
+ this.createPlaylist = function() {
+ for (var i=0,j=self.items.length; i<j; i++) {
+ self.playlistItems[i] = new SPPLaylistItem(self.links[i],self,i);
+ }
+ // assign copies
+ self.playlistItemsUnsorted = smUtils.copy(self.playlistItems);
+ self.playlistItemsShuffled = smUtils.copy(self.playlistItems);
+ }
+
+ this.searchForSoundLinks = function(oContainer) {
+ soundManager._writeDebug('SPPlaylist.searchForSoundLinks()');
+ var o = oContainer||document.body;
+ if (!o) return false;
+ self.links = [];
+ var items = o.getElementsByTagName('a');
+ for (var i=0,j=items.length; i<j; i++) {
+ try {
+ // if [object], then ignore??
+ if (items[i].href.toString().indexOf('.mp3')+1) {
+ self.links[self.links.length] = items[i];
+ self.addItem({url:items[i].href.toString()});
+ }
+ } catch(e) {
+ // error may be thrown by funny characters in URL such as % for some reason under IE 7 (eg. "100% pure love" seemed to fail - odd.)
+ soundManager._writeDebug('<b>SPPlaylist.searchForSoundLinks(): Error at link index '+i+'</b> - may be caused by funny characters in URL');
+ // return false;
+ }
+ }
+ }
+
+ this.load = function(i) {
+ soundManager._writeDebug('SPPlaylist.load('+i+')');
+ // start preloading a sound
+ var sID = 'spsound'+i;
+ var s = soundManager.getSoundById(sID,true);
+ if (s) {
+ // reload (preload) existing sound
+ soundManager._writeDebug('reloading existing sound');
+ var thisOptions = {
+ 'autoPlay': false,
+ 'url': s.url, // reload original URL (assuming currently "unloaded" state)
+ 'stream': true
+ }
+ s.load(thisOptions);
+ } else {
+ soundManager._writeDebug('preloading new sound');
+ soundManager.createSound({
+ 'id': sID,
+ 'url': self.items[i].url,
+ // 'onload': self.onload,
+ 'onload': oParent.onload,
+ 'stream': true,
+ 'autoLoad': true,
+ 'autoPlay': false,
+ 'onid3': oParent.onid3,
+ 'onplay': oParent.onplay,
+ 'whileloading': oParent.whileloading,
+ 'whileplaying': oParent.whileplaying,
+ 'onbeforefinish': self.onItemBeforeFinish,
+ 'onbeforefinishcomplete': self.onItemBeforeFinishComplete,
+ 'onbeforefinishtime': 5000,
+ 'onjustbeforefinish': self.onItemJustBeforeFinish,
+ 'onjustbeforefinishtime':seamlessDelay , // 0 = do not call
+ 'onfinish': self.onItemFinish,
+ 'multiShot': false
+ });
+ // s = soundManager.getSoundById(sID);
+ // soundManager._writeDebug('<b>preloaded sound load state: '+s.loaded+'</b>');
+ // soundManager.getSoundById(sID).disableEvents(); // prevent UI calls etc., just preload
+ // self.setMetaData(soundManager.getSoundById(sID));
+ }
+ }
+
+ this.play = function(i) {
+ // scoped to playlistItem instance
+ if (!self.items[i]) return false;
+ soundManager._writeDebug('SPPlaylist.play()');
+ // var sID = 'spsound'+self.index;
+ // if (i==-1) i=0; // safeguard
+ if (self.doShuffle) i = self.playlistItems[i].index; // if shuffle enabled, map to proper sound
+ var sID = 'spsound'+i;
+ var exists = false;
+ if (oParent.currentSound) {
+ if (!self._ignoreCurrentSound) {
+ soundManager._writeDebug('stopping current sound');
+ soundManager.stop(oParent.currentSound);
+ soundManager.unload(oParent.currentSound);
+ } else {
+ soundManager._writeDebug('allowing current sound to finish');
+ self._ignoreCurrentSound = false;
+ }
+ }
+ if (!soundManager.getSoundById(sID,true)) {
+ soundManager._writeDebug('creating sound '+sID);
+ soundManager.createSound({
+ 'id': sID,
+ 'url': self.items[i].url,
+ // 'onload': self.onload,
+ 'onload': oParent.onload,
+ 'stream': true,
+ 'autoPlay': false,
+ 'onid3': oParent.onid3,
+ 'onplay': oParent.onplay,
+ 'whileloading': oParent.whileloading,
+ 'whileplaying': oParent.whileplaying,
+ 'onbeforefinish': self.onItemBeforeFinish,
+ 'onbeforefinishcomplete': self.onItemBeforeFinishComplete,
+ 'onbeforefinishtime': 5000,
+ 'onjustbeforefinish': self.onItemJustBeforeFinish,
+ 'onjustbeforefinishtime':seamlessDelay,
+ 'onfinish': self.onItemFinish,
+ 'multiShot': false
+ });
+ } else {
+ // sound already exists - preload or replay use cases
+ exists = true;
+ soundManager._writeDebug('sound id '+sID+' already exists (preload/reuse case)');
+ }
+
+ soundManager._writeDebug('Refreshing sound details');
+ oParent.refreshDetails(sID);
+ oParent.lastSound = oParent.currentSound;
+ oParent.currentSound = sID;
+ oParent.reset(); // ensure slider starts at 0
+ oParent.setLoading(true);
+ soundManager.play(sID);
+ oParent.setPlayState(true);
+
+ // apply URL hash
+ if (oParent.options.allowBookmarking) window.location.hash = 'track='+encodeURI(self.items[i].url.substr(self.items[i].url.lastIndexOf('/')+1));
+
+ if (exists) {
+ var s = soundManager.getSoundById(sID);
+ oParent.setMetaData(s);
+ if (s.loaded) {
+ // already loaded before playing started - calculate time estimates, re-call onload() now
+ oParent.onload.apply(s);
+ }
+ }
+
+ }
+
+ this.init = function() {
+ self.o = document.getElementById('playlist-template');
+ // set width to parent
+ self.o.style.width = (parseInt(oParent.oSMPlayer.oMain.offsetWidth)-2)+'px';
+ // smUtils.getElementsByClassName('sm2playlist-box','div',self.o)[0].style.width = '100px';
+ }
+
+ this.loadFromHash = function() {
+ // given a hash, match an MP3 URL and play it.
+ if (!oParent.options.allowBookmarking) return false;
+ var hash = oParent.options.hashPrefix;
+ var hashOffset = hash.length+1;
+ var i = (window.location.hash.indexOf(hash));
+ if (i==-1) return false;
+ var url = decodeURI(window.location.hash.substr(hashOffset));
+ soundManager._writeDebug('loadFromHasn(): searching for '+url);
+ var index = self.findItemByURL(encodeURI(url));
+ if (index == -1) {
+ soundManager._writeDebug('trying alternate search..');
+ index = self.findItemByURL(escape(url));
+ }
+ if (index != -1) {
+ soundManager._writeDebug('loadFromHash(): found index '+index+' ('+url+')');
+ self.selectItem(index);
+ self.play(index);
+ smUtils.addEventHandler(window,'beforeunload',self.removeHash);
+ } else {
+ soundManager._writeDebug('loadFromHash(): no match found');
+ }
+ }
+
+ this.removeHash = function() {
+ // experimental - probably won't work in any good browsers (eg. Firefox)
+ try {
+ window.location.hash = ''; // prevent reload from maintaining current state
+ } catch(e) {
+ // oh well
+ }
+ }
+
+ this.findItemByURL = function(sURL) {
+ for (var i=self.items.length; i--;) {
+ if (self.items[i].url.indexOf(sURL)!=-1) {
+ return i;
+ }
+ }
+ return -1;
+ }
+
+ this.init();
+
+}
+
+function SPPLaylistItem(oLink,oPlaylist,nIndex) {
+ var self = this;
+ var oParent = oPlaylist;
+ this.index = nIndex;
+ this.origIndex = nIndex;
+ this.userTitle = oLink.innerHTML;
+ var sURL = oParent.items[this.index].url;
+ this.o = document.createElement('li');
+ if (nIndex%2==0) this.o.className = 'alt'; // striping
+ this.o.innerHTML = '<a href="'+sURL+'"><span></span></a>';
+ this.o.getElementsByTagName('span')[0].innerHTML = this.userTitle;
+
+ this.setHighlight = function() {
+ smUtils.addClass(self.o,'highlight');
+ }
+
+ this.removeHighlight = function() {
+ smUtils.removeClass(self.o,'highlight');
+ }
+
+ this.setTooltip = function(sHTML) {
+ self.o.title = sHTML;
+ }
+
+ this.onclick = function() {
+ if (oParent.doShuffle) soundPlayer.toggleShuffle(); // disable shuffle, if on (should be oParent.oParent too, ideally)
+ oParent.selectItem(self.index);
+ oParent.play(self.index);
+ return false;
+ }
+
+ this.init = function() {
+ // append self.o somewhere
+ // oParent.o.appendChild(self.o);
+ document.getElementById('playlist-template').getElementsByTagName('ul')[0].appendChild(self.o);
+ self.o.onclick = self.onclick;
+ }
+
+ this.init();
+
+}
+
+
+function SoundPlayer() {
+ var self = this;
+ this.urls = []; // will get from somewhere..
+ this.currentSound = null; // current sound ID (offset/count)
+ this.lastSound = null;
+ this.oPlaylist = null;
+ this.oSMPlayer = null;
+ this.playState = 0;
+ this.paused = false;
+ this.options = {
+ allowScrub: true, // let sound play when possible while user is dragging the slider (seeking)
+ scrubThrottle: false, // prevent scrub update call on every mouse move while dragging - "true" may be nicer on CPU, but track will update less
+ allowBookmarking: false, // change URL to reflect currently-playing MP3
+ usePageTitle: true, // change document.title (window title) to reflect track data
+ hashPrefix: 'track=' // eg. #track=foo%20bar.mp3
+ }
+ var u = smUtils; // alias
+
+ this.reset = function() {
+ // this.sliderPosition = 0;
+ self.oSMPlayer.reset();
+ }
+
+ this.whileloading = function() {
+ if (this.sID != self.currentSound) return false;
+ // "this" scoped to soundManager SMSound object instance
+ // this.sID, this.bytesLoaded, this.bytesTotal
+ // soundManager._writeDebug('whileLoading: '+parseInt(this.bytesLoaded/this.bytesTotal*100)+' %');
+ self.oSMPlayer.setLoadingProgress(Math.max(0,this.bytesLoaded/this.bytesTotal));
+ self.oSMPlayer.getTimeEstimate(this);
+ }
+
+ this.onload = function() {
+ if (this.sID != self.currentSound) return false;
+ // force slider calculation (position) update?
+ // soundManager._writeDebug('<b>time, estimate: '+this.duration+', '+this.durationEstimate+'</b>');
+ soundManager._writeDebug('soundPlayer.onload()');
+ self.oSMPlayer.setLoadingProgress(1); // ensure complete
+ self.setMetaData(this);
+ self.oSMPlayer.setLoading(false);
+
+ }
+
+ this.onid3 = function() {
+ if (this.sID != self.currentSound) return false;
+ soundManager._writeDebug('SoundPlayer.onid3()');
+ // update with received ID3 data
+ self.setMetaData(this);
+ }
+
+ this.onfinish = function() {
+ // sound reached end - reset controls, stop?
+ // document.getElementById('controls').getElementsByTagName('dd')[0].innerHTML = 'Finished playing.';
+ soundManager._writeDebug('SoundPlayer.onfinish()');
+ self.oSMPlayer.moveToEnd();
+ self.setPlayState(false);
+ }
+
+ this.onplay = function() {
+ // started playing?
+ soundManager._writeDebug('.onplay!');
+ }
+
+ this.whileplaying = function() {
+ if (this.sID != self.currentSound) return false;
+ // this.sID, this.position, this.duration
+ // with short MP3s when loading for >1st time, this.duration can be null??
+ var duration = (!this.loaded?this.durationEstimate:this.duration); // use estimated duration until completely loaded
+ if (this.position>duration) return false; // can happen when resuming from an unloaded state?
+ var newPos = Math.floor(this.position/duration*self.oSMPlayer.xMax);
+ if (newPos != self.oSMPlayer.x) { // newPos > self.oSMPlayer.x
+ if (!self.oSMPlayer.busy) {
+ self.oSMPlayer.moveTo(newPos);
+ self.oSMPlayer.update();
+ }
+ }
+ if (Math.abs(this.position-self.oSMPlayer.lastTime)>1000) self.oSMPlayer.updateTime(this.position);
+ }
+
+ this.onUserSetSlideValue = function(nX) {
+ // called from slider control
+ var x = parseInt(nX);
+ // soundManager._writeDebug('onUserSetSlideValue('+x+')');
+ // play sound at this position
+ var s = soundManager.sounds[self.currentSound];
+ if (!s) return false;
+ var nMsecOffset = Math.floor(x/self.oSMPlayer.xMax*s.durationEstimate);
+ soundManager.setPosition(self.currentSound,nMsecOffset);
+ }
+
+ this.setTitle = function(sTitle) {
+ var title = (typeof sTitle == 'undefined'?'Untitled':sTitle);
+ self.oSMPlayer.setTitle(title);
+ self.oSMPlayer.refreshScroll();
+ }
+
+ this.setMetaData = function(oSound) {
+ // pass sound to oSMPlayer
+ self.oSMPlayer.setMetaData(oSound);
+ }
+
+ this.setLoading = function(bLoading) {
+ self.oSMPlayer.setLoading(bLoading);
+ }
+
+ this.setPlayState = function(bPlaying) {
+ self.playState = bPlaying;
+ self.oSMPlayer.setPlayState(bPlaying);
+ }
+
+ this.refreshDetails = function(sID) {
+ var id = (sID||self.currentSound);
+ if (!id) return false;
+ var s = soundManager.getSoundById(id);
+ if (!s) return false;
+ soundManager._writeDebug('refreshDetails(): got sound: '+s);
+ // in absence of ID3, use user-provided data (URL or link text?)
+ self.setTitle(self.oPlaylist.getCurrentItem().userTitle);
+ }
+
+ this.volumeDown = function(e) {
+ self.oSMPlayer.volumeDown(e);
+ }
+
+ this.togglePause = function() {
+ self.oSMPlayer.togglePause();
+ }
+
+ this.toggleShuffle = function() {
+ self.oSMPlayer.toggleShuffle();
+ }
+
+ this.toggleRepeat = function() {
+ self.oSMPlayer.toggleRepeat();
+ }
+
+ this.toggleMute = function() {
+ // soundManager._writeDebug('soundPlayer.toggleMute()');
+ self.oSMPlayer.toggleMute();
+ }
+
+ this.togglePlaylist = function() {
+ soundManager._writeDebug('soundPlayer.togglePlaylist()');
+ self.oPlaylist.toggleDisplay();
+ self.oSMPlayer.togglePlaylist();
+ }
+
+ this.init = function() {
+ self.oSMPlayer = new SMPlayer(self);
+ }
+
+}
+
+var soundPlayer = new SoundPlayer();
+
+function initStuff() {
+ soundPlayer.init(); // load mp3, etc.
+ setTimeout(initOtherStuff,20);
+}
+
+function initOtherStuff() {
+ soundPlayer.oPlaylist = new SPPlaylist(soundPlayer,null);
+ soundPlayer.oPlaylist.searchForSoundLinks();
+ soundPlayer.oPlaylist.createPlaylist();
+ soundPlayer.oPlaylist.createTweens(); // make tweens for playlist
+ soundPlayer.oPlaylist.loadFromHash();
+}
+
+soundManager.debugMode = (window.location.toString().match(/debug=1/)?true:false); // set debug mode
+soundManager.defaultOptions.multiShot = false;
+
+soundManager.onload = function() {
+ // called after window.onload() + SoundManager is loaded
+ soundManager._writeDebug('<b><a href="http://www.schillmania.com/projects/soundmanager2/">www.schillmania.com/projects/soundmanager2/</a></b>');
+ soundManager._writeDebug('<b>-- jsAMP v0.99a.20080331 --</b>',1);
+ initStuff();
+}
diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/mp3-player-button/basic.html b/docs/dymaxion/soundmanagerv297a-20101010/demo/mp3-player-button/basic.html new file mode 100755 index 0000000..9a4b151 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/mp3-player-button/basic.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+<title>SoundManager 2 Demo: Basic MP3 Play Button (Simple Demo)</title>
+<style type="text/css">
+
+/*
+
+ -------------------------------------------------------------
+
+ In-page demo CSS - see external CSS for actual relevant stuff.
+
+ --------------------------------------------------------------
+
+ */
+
+#soundmanager-debug {
+ /* SM2 debug container (optional, makes debug more useable) */
+ position:absolute;position:fixed;*position:absolute;bottom:10px;right:10px;width:50em;height:18em;overflow:auto;background:#fff;margin:1em;padding:1em;border:1px solid #999;font-family:"lucida console",verdana,tahoma,"sans serif";font-size:x-small;line-height:1.5em;opacity:0.9;filter:alpha(opacity=90);
+}
+
+body {
+ font:75% normal verdana,arial,tahoma,"sans serif";
+}
+
+</style>
+<link rel="stylesheet" type="text/css" href="css/mp3-player-button.css" />
+<script type="text/javascript" src="../../script/soundmanager2.js"></script>
+<script type="text/javascript" src="script/mp3-player-button.js"></script>
+</head>
+
+<body>
+
+ <h1><a href="http://www.schillmania.com/projects/soundmanager2/" title="Play MP3s inline with javascript using SoundManager 2">SoundManager 2</a> / Basic MP3 Play Button: Template</h1>
+
+ <p>View the source code of this page for detail. Don't forget to set <b>soundManager.debugMode = false;</b> to disable debug output.</p>
+
+ <p>Walking <a href="../jsAMP-preview/audio/walking.mp3" class="sm2_button">Walking</a></p>
+
+ <p>Armstrong Beat <a href="http://www.freshly-ground.com/misc/music/20060826%20-%20Armstrong.mp3" class="sm2_button">Armstrong Beat</a></p>
+
+ <p><a href="http://www.schillmania.com/projects/soundmanager2/" title="SoundManager 2 project page">SoundManager 2 project home</a></p>
+
+</div>
+
+</body>
+</html>
diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/mp3-player-button/css/mp3-player-button.css b/docs/dymaxion/soundmanagerv297a-20101010/demo/mp3-player-button/css/mp3-player-button.css new file mode 100755 index 0000000..e5e1ce6 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/mp3-player-button/css/mp3-player-button.css @@ -0,0 +1,114 @@ +/* + + SoundManager 2: Basic MP3 player CSS + ------------------------------------ + + Clicks on links to MP3s are intercepted via JS, calls are + made to SoundManager to load/play sounds. CSS classes are + appended to the link, which are used to highlight the + current play state and so on. + + Class names are applied in addition to "sm2_button" base. + + Default: + + sm2_button + + Additional states: + + sm2_playing + sm2_paused + + eg. + + <!-- default --> + <a href="some.mp3" class="sm2_button">some.mp3</a> + + <!-- playing --> + <a href="some.mp3" class="sm2_button sm2_playing">some.mp3</a> + + + Note you don't require ul.graphic / ul.flat etc. for your use + if only using one style on a page. You can just use .sm2_button{} + and so on, but isolate the CSS you want. + + Side note: Would do multiple class definitions eg. + + a.sm2_default.sm2_playing{} + + .. except IE 6 has a parsing bug which may break behaviour, + applying sm2_playing {} even when the class is set to sm2_default. + + + If you want to make your own UI from scratch, here is the base: + + Default + hover state, "click to play": + + a.sm2_button {} + a.sm2_button:hover {} + + Playing + hover state, "click to pause": + + a.sm2_playing {} + a.sm2_playing:hover {} + + Paused + hover state, "click to resume": + + a.sm2_paused {} + a.sm2_paused:hover {} + +*/ + +a.sm2_button { + position:relative; + display:inline-block; /* If you worry about old browser bugs, Firefox 2 might not like this and may need -moz-inline-box instead. :D */ + width:18px; + height:18px; + text-indent:-9999px; /* don't show link text */ + overflow:hidden; /* don't draw inner link text */ + vertical-align:middle; + /* and, a bit of round-ness for the cool browsers. */ + -moz-border-radius:6px; + -webkit-border-radius:6px; + -o-border-radius:6px; + border-radius:6px; + margin-top:-1px; /* vertical align tweak */ + /* safari 3.1+ fun (/W3 working draft extension, TBD.) */ + -webkit-transition-property: hover; + -webkit-transition: all 0.2s ease-in-out; + -moz-transition: all 0.2s ease-in-out 0s; /* firefox 4 (couldn't sort out -moz-transform vs. MozTransform, so, "all" for now) */ + -o-transition-property: background-color; /* opera 10.5 */ + -o-transition-duration: 0.15s; +} + +a.sm2_button:focus { + outline:none; /* maybe evil, but don't show the slight border outline on focus. */ +} + +a.sm2_button, +a.sm2_button.sm2_paused:hover { + background-color:#3399cc; + background-image:url(../image/arrow-right-white.png); + /* where possible, use data: and skip the HTTP request. Fancy-pants. Would use short-hand background: for above, but IE 8 doesn't override background-image. */ + background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAKCAYAAABmBXS+AAAAbklEQVQY02NgQAL//v1jZMAF/v//vwuIs9HEUBUBTbj4HwIeA3EGVsVAxtn/qOAVUGM8uknIiv4hsV8A5ZKxKfoLVvnvHwifAzLtMKwDSQLBVSBti27dJajkcSD2RJODO3wtkOOMz/tMSJJYAxMA5dmsL0IfubQAAAAASUVORK5CYII=); + *background-image:url(../image/arrow-right-white.gif); /* IE 6+7 don't do DATA: URIs */ + background-repeat:no-repeat; + background-position:5px 50%; +} + +a.sm2_button:hover, +a.sm2_button.sm2_playing, +a.sm2_button.sm2_playing:hover { + background-color:#cc3333; +} + +a.sm2_button.sm2_playing, +a.sm2_button.sm2_playing:hover { + -moz-transform:rotate(90deg); + -webkit-transform:rotate(90deg); +} + +a.sm2_button.sm2_paused, +a.sm2_button.sm2_paused:hover { + background-color:#666; +}
\ No newline at end of file diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/mp3-player-button/image/arrow-right-black.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/mp3-player-button/image/arrow-right-black.gif Binary files differnew file mode 100755 index 0000000..3b4900e --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/mp3-player-button/image/arrow-right-black.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/mp3-player-button/image/arrow-right-black.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/mp3-player-button/image/arrow-right-black.png Binary files differnew file mode 100755 index 0000000..fc55124 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/mp3-player-button/image/arrow-right-black.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/mp3-player-button/image/arrow-right-white.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/mp3-player-button/image/arrow-right-white.gif Binary files differnew file mode 100755 index 0000000..9e760e1 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/mp3-player-button/image/arrow-right-white.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/mp3-player-button/image/arrow-right-white.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/mp3-player-button/image/arrow-right-white.png Binary files differnew file mode 100755 index 0000000..4189094 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/mp3-player-button/image/arrow-right-white.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/mp3-player-button/index.html b/docs/dymaxion/soundmanagerv297a-20101010/demo/mp3-player-button/index.html new file mode 100755 index 0000000..6cc1ff5 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/mp3-player-button/index.html @@ -0,0 +1,188 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+<title>SoundManager 2 Demo: Basic MP3 Play Button</title> +<meta name="robots" content="noindex" />
+<style type="text/css">
+
+/*
+
+ -------------------------------------------------------------
+
+ In-page demo CSS - see external CSS for actual relevant stuff.
+
+ --------------------------------------------------------------
+
+ */
+
+#soundmanager-debug {
+ /* SM2 debug container (optional, makes debug more useable) */
+ position:absolute;position:fixed;*position:absolute;bottom:10px;right:10px;width:50em;height:18em;overflow:auto;background:#fff;margin:1em;padding:1em;border:1px solid #999;font-family:"lucida console",verdana,tahoma,"sans serif";font-size:x-small;line-height:1.5em;opacity:0.9;filter:alpha(opacity=90);
+}
+
+body {
+ font:75% normal verdana,arial,tahoma,"sans serif";
+}
+
+h1, h2, h3 {
+ font:2.5em arial,tahoma,verdana;
+ font-weight:normal;
+ margin-bottom:0px;
+}
+
+h1, h2 {
+ letter-spacing:-1px; /* zomg web x.0! ;) */
+ margin-top:0.5em;
+}
+
+h2, h3 {
+ color:#333;
+}
+
+h2 {
+ font-size:2em;
+}
+
+h3 {
+ font-size:1.5em;
+}
+
+h1 a,
+h1 a:hover {
+ color:#000;
+ text-decoration:none;
+}
+
+h1 a:hover {
+ text-decoration:underline;
+}
+
+ul li {
+ margin-bottom:0.5em;
+}
+
+ul.notes {
+ margin-left:0px;
+ padding-left:1.5em;
+}
+
+.note {
+ margin-top:0px;
+ font-style:italic;
+ color:#666;
+}
+
+pre {
+ font-weight:bold;
+ font-size:1.2em;
+ _font-size:1em;
+}
+
+pre code {
+ color:#228822;
+}
+
+#left {
+ max-width:56em;
+}
+
+</style>
+<link rel="stylesheet" type="text/css" href="css/mp3-player-button.css" />
+<!-- soundManager.useFlashBlock: related CSS -->
+<link rel="stylesheet" type="text/css" href="../flashblock/flashblock.css" />
+<script type="text/javascript" src="../../script/soundmanager2.js"></script>
+<script type="text/javascript" src="script/mp3-player-button.js"></script>
+</head>
+
+<body>
+
+<div id="left">
+
+ <h1><a href="http://www.schillmania.com/projects/soundmanager2/" title="Play MP3s inline with javascript using SoundManager 2">SoundManager 2</a> / Inline MP3 Player Button</h1>
+
+ <h2 style="display:inline">Basic MP3 Play Button Examples</h2> (also see <a title="MP3 Play Button, Basic Example demo" href="basic.html">basic demo</a>.)
+
+ <hr />
+
+ <div id="sm2-container">
+ <!-- flash movie ends up here -->
+ </div>
+
+ <h3>Inline text, with "play" button</h3>
+
+ <p>Example code (link with a <b>sm2_button</b> CSS class):</p>
+<pre><p> Spare change <code><a href="/path/to/coins.mp3" title="Play &quot;coins&quot;" class="sm2_button">coins.mp3</a></code> </p></pre>
+ <p>Renders as:</p>
+<div>
+ <p>Spare change <a href="../../demo/_mp3/coins.mp3" class="sm2_button" title="Play "coins"">coins.mp3</a></p>
+ <p class="note">Note that the text inside the link is hidden and replaced with an image, but should be descriptive - or at least should say something generic, like "play".</p>
+</div>
+ <h3>Basic MP3 play button, no text</h3>
+
+ <p>Code:</p>
+
+ <pre><code><a href="../jsAMP-preview/audio/office_lobby.mp3" title="Play &quot;Office Lobby&quot;" class="sm2_button">Office Lobby</a></code></pre>
+
+ <p>Renders as:</p>
+ <p>
+ <a href="../jsAMP-preview/audio/office_lobby.mp3" title="Play "Office Lobby"" class="sm2_button">Office Lobby</a>
+ </p>
+ <h2>How It Works</h2>
+
+ <p><a href="http://www.schillmania.com/projects/soundmanager2/" title="SoundManager 2 Javascript Sound API">SoundManager 2</a> intercepts clicks to MP3 links and plays them inline. The script assigns additional CSS classes to the links to indicate their state (playing/paused, etc.)</p>
+
+ <h3>Static Examples</h3>
+
+ <p>CSS classes are dynamically applied as follows:</p>
+
+ <ul>
+ <li><a href="#" class="sm2_button" title=""Click to play" state">Default: class="sm2_button"</a> Default: class="sm2_button"</li>
+ <li><a href="#" class="sm2_button sm2_playing" title=""Click to pause" state">Playing: class="sm2_button sm2_playing"</a> Playing: class="sm2_button sm2_playing"</li>
+ <li><a href="#" class="sm2_button sm2_paused" title=""Click to resume" state">Paused: class="sm2_button sm2_paused"</a> Paused: class="sm2_button sm2_paused"</li>
+ </ul>
+
+ <h3>Basic CSS</h3>
+
+ <p>If you want to make your own UI from scratch, here is the base:</p>
+
+<pre>
+ Default + hover state, "click to play":
+<code>
+ a.sm2_button {}
+ a.sm2_button:hover {}
+</code>
+ Playing + hover state, "click to pause":
+<code>
+ a.sm2_button.sm2_playing {}
+ a.sm2_button.sm2_playing:hover {}
+</code>
+ Paused + hover state, "click to resume":
+<code>
+ a.sm2_button.sm2_paused {}
+ a.sm2_button.sm2_paused:hover {}
+</code></pre>
+
+ <h3>Other Options</h3>
+
+ <p>By default, one sound will be played at a time; you can easily change a "config" object value to turn on playlist-like behaviour (i.e., play the next MP3 when the current one finishes.)</p>
+
+<pre>
+<code>
+// (within mp3-player-button.js)
+this.config = {
+ playNext: false // stop after one sound, or play through list until end
+}
+</code></pre>
+
+ <h3>I'd like to use this.</h3>
+ <p>See this <a href="basic.html" title="basic template: inline mp3 player">basic demo</a> for reference.</p>
+
+ <p>
+ <a href="http://www.schillmania.com/projects/soundmanager2/" title="SoundManager 2 home">SoundManager 2 project page</a> (not an MP3 link)
+ </p>
+
+</div>
+
+</body>
+</html>
diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/mp3-player-button/script/mp3-player-button.js b/docs/dymaxion/soundmanagerv297a-20101010/demo/mp3-player-button/script/mp3-player-button.js new file mode 100755 index 0000000..96e0346 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/mp3-player-button/script/mp3-player-button.js @@ -0,0 +1,247 @@ +/*
+
+ SoundManager 2 Demo: Play MP3 links via button
+ ----------------------------------------------
+
+ http://schillmania.com/projects/soundmanager2/
+
+ A simple demo making MP3s playable "inline"
+ and easily styled/customizable via CSS.
+
+ A variation of the "play mp3 links" demo.
+
+ Requires SoundManager 2 Javascript API.
+
+*/
+
+function BasicMP3Player() {
+ var self = this;
+ var pl = this;
+ var sm = soundManager; // soundManager instance
+ this.excludeClass = 'button-exclude'; // CSS class for ignoring MP3 links
+ this.links = [];
+ this.sounds = [];
+ this.soundsByURL = [];
+ this.indexByURL = [];
+ this.lastSound = null;
+ this.soundCount = 0;
+ var isIE = (navigator.userAgent.match(/msie/i));
+
+ this.config = {
+ playNext: false, // stop after one sound, or play through list until end
+ autoPlay: false // start playing the first sound right away
+ }
+
+ this.css = {
+ // CSS class names appended to link during various states
+ sDefault: 'sm2_button', // default state
+ sLoading: 'sm2_loading',
+ sPlaying: 'sm2_playing',
+ sPaused: 'sm2_paused'
+ }
+
+ this.includeClass = this.css.sDefault;
+
+
+ this.addEventHandler = function(o,evtName,evtHandler) {
+ typeof(attachEvent)=='undefined'?o.addEventListener(evtName,evtHandler,false):o.attachEvent('on'+evtName,evtHandler);
+ }
+
+ this.removeEventHandler = function(o,evtName,evtHandler) {
+ typeof(attachEvent)=='undefined'?o.removeEventListener(evtName,evtHandler,false):o.detachEvent('on'+evtName,evtHandler);
+ }
+
+ this.classContains = function(o,cStr) {
+ return (typeof(o.className)!='undefined'?o.className.match(new RegExp('(\\s|^)'+cStr+'(\\s|$)')):false);
+ }
+
+ this.addClass = function(o,cStr) {
+ if (!o || !cStr || self.classContains(o,cStr)) return false;
+ o.className = (o.className?o.className+' ':'')+cStr;
+ }
+
+ this.removeClass = function(o,cStr) {
+ if (!o || !cStr || !self.classContains(o,cStr)) return false;
+ o.className = o.className.replace(new RegExp('( '+cStr+')|('+cStr+')','g'),'');
+ }
+
+ this.getSoundByURL = function(sURL) {
+ return (typeof self.soundsByURL[sURL] != 'undefined'?self.soundsByURL[sURL]:null);
+ }
+
+ this.isChildOfNode = function(o,sNodeName) {
+ if (!o || !o.parentNode) {
+ return false;
+ }
+ sNodeName = sNodeName.toLowerCase();
+ do {
+ o = o.parentNode;
+ } while (o && o.parentNode && o.nodeName.toLowerCase() != sNodeName);
+ return (o.nodeName.toLowerCase() == sNodeName?o:null);
+ }
+
+ this.events = {
+
+ // handlers for sound events as they're started/stopped/played
+
+ play: function() {
+ pl.removeClass(this._data.oLink,this._data.className);
+ this._data.className = pl.css.sPlaying;
+ pl.addClass(this._data.oLink,this._data.className);
+ },
+
+ stop: function() {
+ pl.removeClass(this._data.oLink,this._data.className);
+ this._data.className = '';
+ },
+
+ pause: function() {
+ pl.removeClass(this._data.oLink,this._data.className);
+ this._data.className = pl.css.sPaused;
+ pl.addClass(this._data.oLink,this._data.className);
+ },
+
+ resume: function() {
+ pl.removeClass(this._data.oLink,this._data.className);
+ this._data.className = pl.css.sPlaying;
+ pl.addClass(this._data.oLink,this._data.className);
+ },
+
+ finish: function() {
+ pl.removeClass(this._data.oLink,this._data.className);
+ this._data.className = '';
+ if (pl.config.playNext) {
+ var nextLink = (pl.indexByURL[this._data.oLink.href]+1);
+ if (nextLink<pl.links.length) {
+ pl.handleClick({'target':pl.links[nextLink]});
+ }
+ }
+ }
+
+ }
+
+ this.stopEvent = function(e) {
+ if (typeof e != 'undefined' && typeof e.preventDefault != 'undefined') {
+ e.preventDefault();
+ } else if (typeof event != 'undefined' && typeof event.returnValue != 'undefined') {
+ event.returnValue = false;
+ }
+ return false;
+ }
+
+ this.getTheDamnLink = (isIE)?function(e) {
+ // I really didn't want to have to do this.
+ return (e && e.target?e.target:window.event.srcElement);
+ }:function(e) {
+ return e.target;
+ }
+
+ this.handleClick = function(e) {
+ // a sound link was clicked
+ if (typeof e.button != 'undefined' && e.button>1) {
+ // ignore right-click
+ return true;
+ }
+ var o = self.getTheDamnLink(e);
+ if (o.nodeName.toLowerCase() != 'a') {
+ o = self.isChildOfNode(o,'a');
+ if (!o) return true;
+ }
+ var sURL = o.getAttribute('href');
+ if (!o.href || !soundManager.canPlayLink(o) || self.classContains(o,self.excludeClass)) {
+ return true; // pass-thru for non-MP3/non-links
+ }
+ if (!self.classContains(o,self.includeClass)) {
+ return true;
+ }
+ sm._writeDebug('handleClick()');
+ var soundURL = (o.href);
+ var thisSound = self.getSoundByURL(soundURL);
+ if (thisSound) {
+ // already exists
+ if (thisSound == self.lastSound) {
+ // and was playing (or paused)
+ thisSound.togglePause();
+ } else {
+ // different sound
+ thisSound.togglePause(); // start playing current
+ sm._writeDebug('sound different than last sound: '+self.lastSound.sID);
+ if (self.lastSound) self.stopSound(self.lastSound);
+ }
+ } else {
+ // create sound
+ thisSound = sm.createSound({
+ id:'basicMP3Sound'+(self.soundCount++),
+ url:soundURL,
+ onplay:self.events.play,
+ onstop:self.events.stop,
+ onpause:self.events.pause,
+ onresume:self.events.resume,
+ onfinish:self.events.finish
+ });
+ // tack on some custom data
+ thisSound._data = {
+ oLink: o, // DOM node for reference within SM2 object event handlers
+ className: self.css.sPlaying
+ };
+ self.soundsByURL[soundURL] = thisSound;
+ self.sounds.push(thisSound);
+ if (self.lastSound) {
+ // stop last sound
+ self.stopSound(self.lastSound);
+ }
+ thisSound.play();
+ }
+
+ self.lastSound = thisSound; // reference for next call
+
+ if (typeof e != 'undefined' && typeof e.preventDefault != 'undefined') {
+ e.preventDefault();
+ } else {
+ event.returnValue = false;
+ }
+ return false;
+ }
+
+ this.stopSound = function(oSound) {
+ soundManager.stop(oSound.sID);
+ soundManager.unload(oSound.sID);
+ }
+
+ this.init = function() {
+ sm._writeDebug('basicMP3Player.init()');
+ var oLinks = document.getElementsByTagName('a');
+ // grab all links, look for .mp3
+ var foundItems = 0;
+ for (var i=0, j=oLinks.length; i<j; i++) {
+ if (self.classContains(oLinks[i],self.css.sDefault) && !self.classContains(oLinks[i],self.excludeClass)) {
+ // self.addClass(oLinks[i],self.css.sDefault); // add default CSS decoration - good if you're lazy and want ALL MP3/playable links to do this
+ self.links[foundItems] = (oLinks[i]);
+ self.indexByURL[oLinks[i].href] = foundItems; // hack for indexing
+ foundItems++;
+ }
+ }
+ if (foundItems>0) {
+ self.addEventHandler(document,'click',self.handleClick);
+ if (self.config.autoPlay) {
+ self.handleClick({target:self.links[0],preventDefault:function(){}});
+ }
+ }
+ sm._writeDebug('basicMP3Player.init(): Found '+foundItems+' relevant items.');
+ }
+
+ this.init();
+
+}
+
+var basicMP3Player = null;
+
+soundManager.useFlashBlock = true;
+soundManager.url = '../../swf/'; // path to directory containing SM2 SWF
+
+soundManager.onready(function() {
+ if (soundManager.supported()) {
+ // soundManager.createSound() etc. may now be called
+ basicMP3Player = new BasicMP3Player();
+ }
+});
\ No newline at end of file diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/acoustic-drumkit.xml b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/acoustic-drumkit.xml new file mode 100755 index 0000000..3d6606a --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/acoustic-drumkit.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Acoustic drumkit example sounds
+ Source credit: http://www.akaipro.com/arc_kotw.html
+-->
+
+<!-- SoundManager Flash configuration -->
+<!-- Sound IDs are referenced from JS -->
+
+<items baseHref="audio/"> <!-- baseHref is optional, but note the trailing slash if used. -->
+
+ <sound id="s0" href="AMB_BD_1.mp3" />
+ <sound id="s1" href="AMB_FTM2.mp3" />
+ <sound id="s2" href="AMB_HHCL.mp3" />
+ <sound id="s3" href="AMB_HHOP.mp3" />
+ <sound id="s4" href="AMB_HHPD.mp3" />
+ <sound id="s5" href="AMB_HTM.mp3" />
+ <sound id="s6" href="AMB_LTM2.mp3" />
+ <sound id="s7" href="AMB_MTM.mp3" />
+ <sound id="s8" href="AMB_RIM1.mp3" />
+ <sound id="s9" href="AMB_SN13.mp3" />
+ <sound id="s10" href="AMB_SN_5.mp3" />
+ <sound id="s11" href="CHINA_1.mp3" />
+ <sound id="s12" href="CRASH_1.mp3" />
+ <sound id="s13" href="CRASH_5.mp3" />
+ <sound id="s14" href="CRASH_6.mp3" />
+ <sound id="s15" href="RIDE_1.mp3" />
+<!--
+ <sound id="s16" href="RIDE_3.mp3" />
+ <sound id="s17" href="SPLASH_1.mp3" />
+-->
+</items>
\ No newline at end of file diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/AMB_BD_1.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/AMB_BD_1.mp3 Binary files differnew file mode 100755 index 0000000..ac40028 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/AMB_BD_1.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/AMB_FTM2.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/AMB_FTM2.mp3 Binary files differnew file mode 100755 index 0000000..a181e07 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/AMB_FTM2.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/AMB_HHCL.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/AMB_HHCL.mp3 Binary files differnew file mode 100755 index 0000000..5833134 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/AMB_HHCL.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/AMB_HHOP.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/AMB_HHOP.mp3 Binary files differnew file mode 100755 index 0000000..679376c --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/AMB_HHOP.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/AMB_HHPD.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/AMB_HHPD.mp3 Binary files differnew file mode 100755 index 0000000..79bf78c --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/AMB_HHPD.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/AMB_HTM.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/AMB_HTM.mp3 Binary files differnew file mode 100755 index 0000000..990d8f1 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/AMB_HTM.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/AMB_LTM2.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/AMB_LTM2.mp3 Binary files differnew file mode 100755 index 0000000..d9c371c --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/AMB_LTM2.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/AMB_MTM.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/AMB_MTM.mp3 Binary files differnew file mode 100755 index 0000000..cadd93e --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/AMB_MTM.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/AMB_RIM1.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/AMB_RIM1.mp3 Binary files differnew file mode 100755 index 0000000..354c35a --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/AMB_RIM1.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/AMB_SN13.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/AMB_SN13.mp3 Binary files differnew file mode 100755 index 0000000..319348c --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/AMB_SN13.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/AMB_SN_5.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/AMB_SN_5.mp3 Binary files differnew file mode 100755 index 0000000..baf7a87 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/AMB_SN_5.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/CHINA_1.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/CHINA_1.mp3 Binary files differnew file mode 100755 index 0000000..18a5142 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/CHINA_1.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/CRASH_1.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/CRASH_1.mp3 Binary files differnew file mode 100755 index 0000000..db77301 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/CRASH_1.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/CRASH_5.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/CRASH_5.mp3 Binary files differnew file mode 100755 index 0000000..4d999f2 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/CRASH_5.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/CRASH_6.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/CRASH_6.mp3 Binary files differnew file mode 100755 index 0000000..d20ec27 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/CRASH_6.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/RIDE_1.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/RIDE_1.mp3 Binary files differnew file mode 100755 index 0000000..1e5601c --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/RIDE_1.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/RIDE_3.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/RIDE_3.mp3 Binary files differnew file mode 100755 index 0000000..701e150 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/RIDE_3.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/SPLASH_1.mp3 b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/SPLASH_1.mp3 Binary files differnew file mode 100755 index 0000000..77cb0de --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/audio/SPLASH_1.mp3 diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/css/mpc.css b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/css/mpc.css new file mode 100755 index 0000000..dd10668 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/css/mpc.css @@ -0,0 +1,164 @@ +/* Demo/example CSS - not needed for general use */
+
+body {
+ background:#000;
+ font:normal 75% "helvetica neue",helvetica,verdana,arial,tahoma,"times new roman","sans serif";
+ color:#fff;
+ margin:0px;
+ padding:0px;
+}
+
+#background {
+ position:absolute;
+ left:0px;
+ top:0px;
+ width:100%;
+ height:100%;
+ background:transparent url(http://farm1.static.flickr.com/45/191496680_97cdc5351b_b.jpg) no-repeat 50% 50%;
+}
+
+#site {
+ position:relative;
+ z-index:2;
+ background:rgba(0,0,0,0.5);
+ padding:1em;
+}
+
+#site h1 {
+ margin-top:0px;
+}
+
+#site p {
+ margin:0.5em 0px 0.5em 0px;
+}
+
+#site p:last-child {
+ margin:0px;
+}
+
+.clear {
+ float:none;
+ clear:both;
+ font-size:1px;
+ line-height:1px;
+ height:1px;
+ overflow:hidden;
+}
+
+#mpc {
+ position:absolute;
+ left:50%;
+ top:50%;
+ margin-left:-19em;
+ margin-top:-19em;
+ width:38em;
+ _width:37.3em;
+ border:3px solid #666;
+ border:3px solid rgba(255,255,255,0.25);
+ -moz-border-radius:12px;
+ -webkit-border-radius:12px;
+ border-radius:12px;
+ z-index:2;
+}
+
+#mpc #wrapper {
+ position:relative;
+ background:#333;
+ background:rgba(0,0,0,0.5);
+ padding:0.5em;
+ -moz-border-radius:12px;
+ -webkit-border-radius:12px;
+ border-radius:12px;
+}
+
+#mpc ul {
+ margin:0px;
+ padding:0px;
+ margin-left:2px;
+ *margin-left:1em;
+ _margin-left:2px;
+ padding:2px 0px 2px 0px;
+}
+
+#mpc ul li {
+ position:relative;
+ float:left;
+ display:inline;
+ width:7em;
+ height:7em;
+ margin:0.5em;
+ background:#999;
+ border:1px solid rgba(0,0,0,0.75);
+ -moz-border-radius:2px;
+ -webkit-border-radius:2px;
+ border-radius:2px;
+ font:normal 1em/1em "helvetica",verdana,arial,system;
+ padding:0.5em;
+ cursor:pointer;
+ cursor:hand;
+ color:#eee;
+ text-transform:uppercase;
+ font-weight:bold;
+}
+
+#mpc ul li span {
+ text-transform:none;
+ font-weight:normal;
+ color:#ccc;
+}
+
+#mpc ul li.active {
+ background:#666;
+}
+
+#mpc ul li div {
+ /* progress indicator */
+ position:absolute;
+ left:0px;
+ bottom:1em;
+ font-size:1em;
+ line-height:1em;
+ height:1em;
+ margin:0px 0px 0px 1em;
+ width:6em;
+ background:#888 url(../image/progress.png) no-repeat -256px 0px;
+ background-repeat:no-repeat;
+ border:1px solid #666;
+ visibility:hidden;
+}
+
+#mpc ul li.active div,
+#mpc ul li.loading div {
+ visibility:visible;
+}
+
+#soundmanager-debug {
+ position:absolute;
+ right:20px;
+ bottom:20px;
+ height:12em;
+ width:50em;
+ overflow:auto;
+ margin-left:1em;
+}
+
+#soundmanager-debug div {
+ font-size:11px;
+ font-family: "lucida console",system,terminal,verdana,arial; /* IE doesn't seem to obey short-hand font family here? */
+ padding:0px 1em 0.5em 0px;
+}
+
+#mpc-debug,
+.note {
+ color:#999;
+}
+
+#mpc-debug a,
+.note a {
+ color:#6699cc;
+ text-decoration:none;
+}
+
+#isHTML5 {
+ display:none;
+}
\ No newline at end of file diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/image/progress.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/image/progress.png Binary files differnew file mode 100755 index 0000000..54f9631 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/image/progress.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/index.html b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/index.html new file mode 100755 index 0000000..7dc68f7 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/index.html @@ -0,0 +1,72 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+<title>SoundManager 2: A Javascript Sound API - MPC Demo</title> +<meta name="robots" content="noindex" />
+<meta name="description" content="An example drum machine (MPC) demo using the SoundManager 2 JavaScript Audio API" />
+<meta name="keywords" content="javascript mpc, javascript drum machine, javascript sound, javascript audio, DHTML sound, work by Scott Schiller, schillmania, javascript to flash communication" />
+<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
+<link rel="stylesheet" href="css/mpc.css" media="screen" />
+<!-- soundManager.useFlashBlock: related CSS -->
+<link rel="stylesheet" type="text/css" href="../flashblock/flashblock.css" />
+<script type="text/javascript" src="../../script/soundmanager2.js"></script>
+<script type="text/javascript" src="script/mpc.js"></script>
+</head>
+<body>
+
+<div id="background"></div>
+
+<div id="site">
+
+ <h1 style="margin-bottom:0px"><a href="../" style="color:#99ccff;text-decoration:none">SoundManager 2</a>: Javascript Drum Machine Demo<span id="isHTML5"></span></h1>
+ <h2 style="margin-top:0px;color:#999">Trigger the pads to play different sounds.</h2>
+ <p id="mpc-debug" class="note">View <a href="#debug=1" onclick="window.location.hash='debug=1';window.location.reload()">with debug output</a></p>
+ <p class="note">Photo: <a href="http://www.flickr.com/photos/schill/191496680/">MPC 2500</a> by .schill on Flickr</a></p>
+ <p class="note"><span style="display:none">(If supported): </span><span id="isHTML5">Your browser is cool and is using 100% HTML5 Audio. Look ma, no Flash!</span></p>
+</div>
+
+<div id="mpc">
+
+ <div id="wrapper">
+
+ <ul>
+ <li id="btn-s0" onmousedown="soundManager.play('s0')">1<div></div></li>
+ <li id="btn-s1" onmousedown="soundManager.play('s1')">2<div></div></li>
+ <li id="btn-s2" onmousedown="soundManager.play('s2')">3<div></div></li>
+ <li id="btn-s3" onmousedown="soundManager.play('s3')">4<div></div></li>
+ </ul>
+
+ <ul>
+ <li id="btn-s4" onmousedown="soundManager.play('s4')">q<div></div></li>
+ <li id="btn-s5" onmousedown="soundManager.play('s5')">w<div></div></li>
+ <li id="btn-s6" onmousedown="soundManager.play('s6')">e<div></div></li>
+ <li id="btn-s7" onmousedown="soundManager.play('s7')">r<div></div></li>
+ </ul>
+
+ <ul>
+ <li id="btn-s8" onmousedown="soundManager.play('s8')">a<div></div></li>
+ <li id="btn-s9" onmousedown="soundManager.play('s9')">s<div></div></li>
+ <li id="btn-s10" onmousedown="soundManager.play('s10')">d<div></div></li>
+ <li id="btn-s11" onmousedown="soundManager.play('s11')">f<div></div></li>
+ </ul>
+
+ <ul>
+ <li id="btn-s12" onmousedown="soundManager.play('s12')">z<div></div></li>
+ <li id="btn-s13" onmousedown="soundManager.play('s13')">x<div></div></li>
+ <li id="btn-s14" onmousedown="soundManager.play('s14')">c<div></div></li>
+ <li id="btn-s15" onmousedown="soundManager.play('s15')">v<div></div></li>
+ </ul>
+
+ <div class="clear"></div>
+
+ </div>
+
+</div>
+
+ <script type="text/javascript">if (window.location.href.toString().match(/debug/i)) { document.getElementById('mpc-debug').style.display = 'none'; }</script>
+
+</div>
+
+</body>
+</html> diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/script/mpc.js b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/script/mpc.js new file mode 100755 index 0000000..3f91667 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/mpc/script/mpc.js @@ -0,0 +1,144 @@ +// demo-specific code - not needed for general use
+
+// refer to bottom for initialisation and soundManager tie-ins, however!
+
+var MPC = function() {
+ var self = this;
+ this.idPrefix = 'btn-'; // HTML ID prefix
+ this.statusWidth = 6;
+ this.progressWidth = 256;
+ this.keys = {'1':0,'2':1,'3':2,'4':3,'q':4,'w':5,'e':6,'r':7,'a':8,'s':9,'d':10,'f':11,'z':12,'x':13,'c':14,'v':15}
+
+ // scope within these event handler methods: "this" = SMSound() object instance (see SMSound() in soundmanager.js for reference)
+
+ this.showProgress = function() {
+ // sound is loading, update bytes received using this.bytesLoaded / this.bytesTotal
+ if (self._getButton(this.sID).className != 'loading') self._getButton(this.sID).className = 'loading'; // a bit inefficient here..
+ self._showStatus(this.sID,this.bytesLoaded,this.bytesTotal);
+ }
+
+ this.onid3 = function() {
+ soundManager._writeDebug('mpc.onid3()');
+ var oName = null;
+ for (var oName in this.id3) {
+ soundManager._writeDebug(oName+': '+this.id3[oName]) // write out name/value ID3 pairs (eg. "artist: Beck")
+ }
+ }
+
+ this.onload = function() {
+ var sID = this.sID;
+ self._getButton(this.sID).className = '';
+ self._getButton(this.sID).title = ('Sound ID: '+this.sID+' ('+this.url+')');
+ }
+
+ this.onfinish = function() {
+ self._getButton(this.sID).className = '';
+ self._reset(this.sID);
+ }
+
+ this.onplay = function() {
+ self._getButton(this.sID).className = 'active';
+ }
+
+ this.whileplaying = function() {
+ self._showStatus(this.sID,this.position,this.duration);
+ }
+
+ this._keyHandler = function(e) {
+ var oEvt = e?e:event;
+ var sChar = String.fromCharCode(oEvt.keyCode).toLowerCase();
+ if (typeof self.keys[sChar] != 'undefined') soundManager.play('s'+self.keys[sChar]);
+ }
+
+ this._showStatus = function(sID,n1,n2) {
+ var o = self._getButton(sID).getElementsByTagName('div')[0];
+ var offX = (n2>0?(-self.progressWidth+parseInt((n1/n2)*o.offsetWidth)):-self.progressWidth);
+ o.style.backgroundPosition = offX+'px 0px';
+ }
+
+ this._getButton = function(sID) {
+ return document.getElementById(self.idPrefix+sID);
+ }
+
+ this._reset = function(sID) {
+ var id = sID;
+ self._showStatus(sID,1,1);
+ setTimeout(function(){self._showStatus(sID,0,0);},200);
+ }
+
+ this.init = function() {
+ document.onkeydown = self._keyHandler;
+ }
+
+}
+
+var mpc = new MPC();
+
+soundManager.useHTML5Audio = true; // why not.
+soundManager.flashVersion = (window.location.toString().match(/#flash8/i)?8:9);
+if (soundManager.flashVersion != 8) {
+ soundManager.useHighPerformance = true;
+ soundManager.useFastPolling = true;
+}
+soundManager.url = '../../swf/'; // path to load SWF from (overriding default)
+soundManager.bgcolor = '#333333';
+soundManager.wmode = 'transparent';
+soundManager.debugMode = false;
+soundManager.consoleOnly = false;
+soundManager.useFlashBlock = true;
+
+soundManager.onready(function() {
+
+ // This is the "onload" equivalent which is called when SoundManager has been initialised (sounds can be created, etc.)
+
+ mpc.init();
+
+ // set up some default options / event handlers - so all sounds created are given these handlers
+
+ soundManager.defaultOptions.autoLoad = true;
+ soundManager.defaultOptions.whileloading = mpc.showProgress;
+ soundManager.defaultOptions.onid3 = mpc.onid3;
+ soundManager.defaultOptions.onload = mpc.onload;
+ soundManager.defaultOptions.onplay = mpc.onplay;
+ soundManager.defaultOptions.whileplaying = mpc.whileplaying;
+ soundManager.defaultOptions.onfinish = mpc.onfinish;
+
+ // get drumkit sounds from XML file (as opposed to using createSound)
+
+ if (!soundManager.hasHTML5) {
+ soundManager.loadFromXML('acoustic-drumkit.xml');
+ } else {
+ if (!soundManager.html5.needsFlash) {
+ document.getElementById('isHTML5').style.display = 'inline';
+ }
+ var soundURLs = 'AMB_BD_1,AMB_FTM2,AMB_HHCL,AMB_HHOP,AMB_HHPD,AMB_HTM,AMB_LTM2,AMB_MTM,AMB_RIM1,AMB_SN13,AMB_SN_5,CHINA_1,CRASH_1,CRASH_5,CRASH_6,RIDE_1'.split(',');
+ for (var i=0; i<soundURLs.length; i++) {
+ soundManager.createSound('s'+i, 'audio/'+soundURLs[i]+'.mp3');
+ }
+ }
+
+ /*
+
+ You can also create sounds using Javascript methods, instead of XML.
+ Options can also be set on a per-file basis, with specific option overrides.
+ (Options not specified here will inherit defaults as defined in soundManager.defaultOptions.)
+
+ eg.
+
+ soundManager.createSound({
+ id: 'mySound',
+ url: '/path/to/some.mp3',
+ stream: true,
+ autoPlay: true,
+ multiShot: false,
+ whileloading: function() { alert('sound '+this.sID+': '+this.bytesLoaded+' of '+this.bytesTotal+' bytes loaded.'); } // event handler: "this" is scoped to SMSound() object instance for easy access to methods/properties
+ });
+
+ - OR -
+
+ If you just want a sound with all default options, you can also specify just the required id and URL as string parameters:
+
+ soundManager.createSound('mySound','/path/to/some.mp3');
+
+ */
+});
diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/page-player/basic.html b/docs/dymaxion/soundmanagerv297a-20101010/demo/page-player/basic.html new file mode 100755 index 0000000..851be17 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/page-player/basic.html @@ -0,0 +1,103 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+<title>SoundManager 2 Demo: Play MP3 links on a page, "page as playlist" style</title>
+<style type="text/css">
+
+/*
+
+ -------------------------------------------------------------
+
+ In-page demo CSS - see external CSS for actual relevant stuff.
+
+ --------------------------------------------------------------
+
+ */
+
+#soundmanager-debug {
+ /* SM2 debug container (optional, makes debug more useable) */
+ position:absolute;position:fixed;*position:absolute;bottom:10px;right:10px;width:50em;height:18em;overflow:auto;background:#fff;margin:1em;padding:1em;border:1px solid #999;font-family:"lucida console",verdana,tahoma,"sans serif";font-size:x-small;line-height:1.5em;opacity:0.9;filter:alpha(opacity=90);z-index:99;
+}
+
+body {
+ font:75% normal verdana,arial,tahoma,"sans serif";
+}
+</style>
+<link rel="stylesheet" type="text/css" href="css/page-player.css" />
+<!-- soundManager.useFlashBlock: related CSS -->
+<link rel="stylesheet" type="text/css" href="../flashblock/flashblock.css" />
+<script type="text/javascript" src="../../script/soundmanager2.js"></script>
+<script type="text/javascript" src="script/page-player.js"></script>
+<script type="text/javascript">
+
+soundManager.url = '../../swf/';
+
+// demo only..
+function setTheme(sTheme) {
+ var o = document.getElementsByTagName('ul')[0];
+ o.className = 'playlist'+(sTheme?' '+sTheme:'');
+ return false;
+}
+</script>
+</head>
+
+<body>
+
+<div>
+
+ <h1><a href="http://www.schillmania.com/projects/soundmanager2/" title="Play a page of mp3s with javascript via SoundManager 2">SoundManager 2</a> / page as a playlist, basic template (flash 8)</h1>
+
+ <div id="sm2-container">
+ <!-- SM2 flash movie goes here -->
+ </div>
+
+ <ul class="playlist">
+
+ <li><a href="../jsAMP-preview/audio/rain.mp3">Rain</a></li>
+ <li><a href="../jsAMP-preview/audio/going_outside.mp3">Going Outside</a></li>
+ <li><a href="../jsAMP-preview/audio/office_lobby.mp3">Office Lobby</a></li>
+ <li><a href="../jsAMP-preview/audio/walking.mp3">Walking</a></li>
+ <li><a href="http://freshly-ground.com/data/audio/mpc/20060812%20-%20Groove.mp3" title="Dr. John Groove">Schill - Dr. John Groove</a></li>
+ <!-- files from the web (note that ID3 and waveformData information will *not* load from remote domains without permission, due to Flash security restrictions) -->
+ <li><a href="http://www.freshly-ground.com/misc/music/carl-3-barlp.mp3">Barrlping with Carl (featureblend.com)</a></li>
+ <li><a href="http://www.freshly-ground.com/data/audio/binaural/Mak.mp3">Angry cow sound?</a></li>
+ <li><a href="http://www.freshly-ground.com/data/audio/binaural/Things that open, close and roll.mp3">Things that open, close and roll</a></li>
+ <li><a href="http://www.freshly-ground.com/data/audio/binaural/A%20Trip%20to%20the%20Basement%20Garage.mp3">A Trip To The Basement Garage</a></li>
+
+ </ul>
+
+ <div id="control-template">
+ <!-- control markup inserted dynamically after each link -->
+ <div class="controls">
+ <div class="statusbar">
+ <div class="loading"></div>
+ <div class="position"></div>
+ </div>
+ </div>
+ <div class="timing">
+ <div id="sm2_timing" class="timing-data">
+ <span class="sm2_position">%s1</span> / <span class="sm2_total">%s2</span></div>
+ </div>
+ <div class="peak">
+ <div class="peak-box"><span class="l"></span><span class="r"></span>
+ </div>
+ </div>
+ </div>
+
+ <div id="spectrum-container" class="spectrum-container">
+ <div class="spectrum-box">
+ <div class="spectrum"></div>
+ </div>
+ </div>
+
+ <p>For alternate themes, add the class to the playlist UL - eg. <a href="#" onclick="return setTheme('dark')"><ul class="playlist dark"></a> or <a href="#" onclick="return setTheme('bubblegum')"><ul class="playlist bubblegum"></a>; the base default is <a href="#" onclick="return setTheme()"><ul class="playlist"></a>.</p>
+
+ <p>A reminder that if loading from the local filesystem, Flash will deny access to remote (network/internet) URLs by default unless whitelisted via the <a href="http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html">Flash Player Global Security Settings Page</a>. Some URLs in this example are remote to demonstrate this.</p>
+
+ <p>Note that by default, the Flash 8 version is used and therefore Flash 9-only features such as the VU meter, waveform etc. are not available. Refer to the main "page player" demo for configuration examples, or view the source of page-player.js for the configuration object (similar to that used in SoundManager 2 itself.)</p>
+
+ <p><a href="http://www.schillmania.com/projects/soundmanager2/" title="Javascript MP3 sound player API">SoundManager 2 project</a></p>
+
+</body>
+</html>
diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/page-player/css/demo.css b/docs/dymaxion/soundmanagerv297a-20101010/demo/page-player/css/demo.css new file mode 100755 index 0000000..f11964e --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/page-player/css/demo.css @@ -0,0 +1,124 @@ +/*
+ -----------------------------------------------------------------
+ In-page demo CSS for code, documentation etc.
+ See page-player.css for actual playlist-relevant stuff.
+ -----------------------------------------------------------------
+ */
+
+#soundmanager-debug {
+ /* SM2 debug container (optional, makes debug more useable) */
+ position:absolute;position:fixed;*position:absolute;bottom:10px;right:10px;width:50em;height:18em;overflow:auto;background:#fff;margin:1em;padding:1em;border:1px solid #999;font-family:"lucida console",verdana,tahoma,"sans serif";font-size:x-small;line-height:1.5em;opacity:0.9;filter:alpha(opacity=90);z-index:99;
+}
+
+body {
+ font:75% normal verdana,arial,tahoma,"sans serif";
+}
+
+h1, h2, h3 {
+ font:lighter 3em "Helvetica Neue Light","Helvetica Neue",georgia,"times new roman","Arial Rounded MT Bold",helvetica,verdana,tahoma,arial,"sans serif";
+ margin-bottom:0px;
+}
+
+h1, h2 {
+ letter-spacing:-1px; /* zomg web x.0! ;) */
+}
+
+h1, h2, h3 {
+ float:left;
+ clear:both;
+ border-bottom:1px solid #999;
+ padding-bottom:1px;
+ margin-bottom:0.25em;
+}
+
+h1 {
+ margin-top:0px;
+ margin-bottom:0px;
+ background-color:#666;
+ color:#ccc;
+ margin-left:-5px;
+ padding-left:5px;
+ padding-right:5px;
+}
+
+h1,
+h1 a {
+ color:#fff;
+ text-decoration:none;
+}
+
+h1 a:hover {
+ text-decoration:underline;
+}
+
+h2 {
+ font-size:2em;
+ margin-top:1em;
+ background-color:#aaa;
+ color:#fff;
+ padding:5px;
+ margin-left:-5px;
+ min-width:23em;
+}
+
+h3 {
+ font-size:1.65em;
+ margin-top:0.5em;
+ margin-bottom:0.25em;
+ color:#333;
+ min-width:28em;
+}
+
+h3 a {
+ font-size:small;
+}
+
+h4 {
+ color:#444;
+}
+
+ul.notes {
+ margin-left:0px;
+ padding-left:1.5em;
+}
+
+.note {
+ margin-top:0px;
+ font-style:italic;
+ color:#999;
+}
+
+pre {
+ font-size:1.2em;
+ _font-size:1em;
+}
+
+code {
+ font-family:"lucida console",monaco,courier,terminal,system;
+ font-size:1em;
+ color:#003366;
+}
+
+code span {
+ color:#666;
+}
+
+ul,
+p,
+pre {
+ clear:left;
+ max-width:46em;
+}
+
+ul.tight li {
+ max-width:44.5em;
+}
+
+ul.playlist {
+ /* undo the above nonsense */
+ max-width:none;
+}
+
+ul.tight {
+ padding-left:1.5em;
+}
diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/page-player/css/optional-annotations.css b/docs/dymaxion/soundmanagerv297a-20101010/demo/page-player/css/optional-annotations.css new file mode 100755 index 0000000..123457f --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/page-player/css/optional-annotations.css @@ -0,0 +1,168 @@ +/*
+ ------------------------------------------
+ -- annotations (sub-tracks, notes etc.) --
+ ------------------------------------------
+*/
+
+ul.playlist li a.sm2_link .metadata {
+ display:none; /* hide by default */
+}
+
+ul.playlist li.sm2_paused a.sm2_link .metadata,
+ul.playlist li.sm2_playing a.sm2_link .metadata {
+ display:inline;
+}
+
+ul.playlist li ul {
+ list-style-type:none;
+ margin:0px;
+ padding:0px;
+ position:relative;
+ font-size:small;
+ display:none;
+}
+
+ul.playlist li ul li {
+ position:relative;
+ margin:0px;
+ padding:2px 3px;
+ border:1px solid transparent;
+ -moz-border-radius:6px;
+ -khtml-border-radius:6px;
+ border-radius:6px;
+ margin-right:1em;
+ font-family:helvetica,verdana,tahoma,arial,"sans serif";
+ font-size:x-small;
+ font-weight:lighter;
+ letter-spacing:0px;
+ background-color:transparent;
+ opacity:0.66;
+}
+
+ul.playlist li ul li:hover {
+ opacity:1;
+ background-color:#fff;
+ border-color:#ccc;
+ color:#666;
+}
+
+ul.playlist li.sm2_playing ul li,
+ul.playlist li.sm2_paused ul li {
+ color:#fff;
+}
+
+ul.playlist li.sm2_playing ul li:hover {
+ background-color:#fff;
+ color:#5588bb;
+ border-color:#336699;
+ opacity:0.9;
+}
+
+ul.playlist li.sm2_paused ul li:hover {
+ background-color:#888;
+}
+
+/* metadata */
+
+ul.playlist li .metadata .duration {
+ /* optional timing data */
+ display:none;
+}
+
+ul.playlist li .metadata ul li p {
+ margin:0px;
+ padding:0px;
+}
+
+ul.playlist li .metadata ul li span {
+ display:none;
+}
+
+ul.playlist li .controls .statusbar .annotation {
+ position:absolute;
+ background-color:transparent;
+ top:0px;
+ color:#666;
+ text-align:right;
+ margin-left:10px;
+ height:0.5em;
+}
+
+ul.playlist li .controls .statusbar .annotation:hover {
+ z-index:12; /* sit on top of note */
+}
+
+ul.playlist li .controls .statusbar .annotation span.bubble {
+ /* using · */
+ display:inline-block;
+ background-color:#fff;
+ border:1px solid #666;
+ border-radius:6px;
+ -moz-border-radius:6px;
+ -webkit-border-radius:6px;
+}
+
+ul.playlist li .controls .statusbar .annotation span {
+ display:block;
+ background:transparent url(../image/divot.png) no-repeat 50% 0px;
+ width:15px;
+ margin-left:-15px;
+ height:12px;
+ text-align:center;
+}
+
+ul.playlist li .controls .statusbar .annotation.alt {
+ top:auto;
+ bottom:0px;
+}
+
+ul.playlist li .controls .statusbar .annotation span:hover {
+ cursor:none; /* Fx3 rules. */
+ margin-top:0.1em;
+}
+
+ul.playlist li .controls .statusbar .annotation.alt span:hover {
+ margin-top:-0.1em;
+}
+
+ul.playlist li .controls .statusbar .annotation.alt span {
+ background:transparent url(../image/divot-bottom.png) no-repeat 50% bottom;
+}
+
+ul.playlist li .note {
+ position:absolute;
+ display:none;
+ left:0px;
+ top:0px;
+ z-index:10;
+ font-size:x-small;
+ padding:2px 4px 2px 4px;
+ width:auto;
+ color:#666;
+ background-color:#fff;
+ border:1px solid #ccc;
+ border-radius:6px;
+ -moz-border-radius:6px;
+ -webkit-border-radius:6px;
+ font-style:normal;
+ font-weight:bold;
+ font-family:arial,tahoma,verdana,"sans serif";
+ letter-spacing:0px;
+ margin-top:1.1em;
+}
+
+ul.playlist li .note.alt {
+ margin-top:-1.32em;
+}
+
+ul.playlist li .note:hover {
+ display:block !important;
+}
+
+ul.playlist li .sm2_divider {
+ font-size:0.75em;
+}
+
+ul.playlist li .sm2_metadata {
+ font-size:0.65em;
+}
diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/page-player/css/optional-themes.css b/docs/dymaxion/soundmanagerv297a-20101010/demo/page-player/css/optional-themes.css new file mode 100755 index 0000000..62a8146 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/page-player/css/optional-themes.css @@ -0,0 +1,206 @@ +/*
+ ---------------------------------
+ -- alternate (optional) themes --
+ ---------------------------------
+*/
+
+ul.playlist.dark li.sm2_playing a {
+ color:#fff;
+}
+
+ul.playlist.dark li.sm2_playing .timing,
+ul.playlist.use-peak.dark li.sm2_playing .peak {
+ color:#999;
+}
+
+ul.playlist.use-spectrum.dark li.sm2_playing .spectrum-container {
+ background-color:#222;
+ border-color:#444;
+}
+
+ul.playlist.use-spectrum.dark li.sm2_playing .spectrum-container .spectrum {
+ background-color:#999;
+}
+
+ul.playlist.dark li.sm2_paused {
+ background-color:#333;
+}
+
+ul.playlist.dark li.sm2_paused a {
+ color:#999;
+}
+
+ul.playlist.dark li.sm2_playing,
+ul.playlist.dark li.sm2_playing:hover {
+ background-color:#333;
+}
+
+ul.playlist.dark li:hover .controls .statusbar {
+ background-color:#666;
+}
+
+ul.playlist.dark li .controls {
+ background-color:#333;
+}
+
+ul.playlist.dark li .controls .statusbar {
+ background-color:#666;
+ border-color:#444;
+}
+
+ul.playlist.dark li .controls .statusbar .position {
+ background-color:#111;
+ border-right:3px solid #111;
+ border-radius:3px;
+ -moz-border-radius:3px;
+ -webkit-border-radius:3px;
+}
+
+ul.playlist.dark li .controls .statusbar .loading {
+ background-color:#444;
+}
+
+ul.playlist.dark li .timing,
+ul.playlist.use-peak.dark li .peak {
+ background-color:#222;
+ border-color:#444;
+}
+
+ul.playlist.dark.use-peak li .peak .l,
+ul.playlist.dark.use-peak li .peak .r {
+ border-color:#444;
+ background-color:#999;
+}
+
+
+/* gold theme */
+
+ul.playlist.gold li.sm2_paused {
+ background-color:#996600;
+}
+
+ul.playlist.gold li.sm2_playing,
+ul.playlist.gold li.sm2_playing:hover {
+ background-color:#cc9900;
+}
+
+ul.playlist.gold li .controls {
+ background-color:transparent;
+}
+
+ul.playlist.gold li .controls .statusbar {
+ background-color:#fff;
+ border-color:#fff;
+}
+
+ul.playlist.gold li .controls .statusbar .position {
+ background-color:#996600;
+ border-right:3px solid #996600;
+ border-radius:3px;
+ -moz-border-radius:3px;
+ -webkit-border-radius:3px;
+}
+
+ul.playlist.gold li .controls .statusbar .loading {
+ background-color:#ffeedd;
+}
+
+ul.playlist.gold li .timing,
+ul.playlist.use-peak.gold li .peak {
+ background-color:#CC9900;
+ border-color:#ffcc33;
+}
+
+ul.playlist.use-spectrum.gold li.sm2_playing .spectrum-container {
+ background-color:#cc9900;
+ border-color:#ffcc33;
+}
+
+ul.playlist.use-spectrum.gold li.sm2_playing .spectrum-container .spectrum {
+ background-color:#fff;
+}
+
+ul.playlist.gold.use-peak li .peak .l,
+ul.playlist.gold.use-peak li .peak .r {
+ border-color:#fff;
+ background-color:#fff;
+}
+
+
+/* ZOMG PONIES!!!ONEONEONE */
+
+ul.playlist.bubblegum li a {
+ font-family:"comic sans ms",verdana,arial,tahoma,"sans serif"; /* heh */
+}
+
+ul.playlist.bubblegum li.sm2_paused,
+ul.playlist.bubblegum li.sm2_paused:hover {
+ background-color:#ffccee;
+}
+
+ul.playlist.bubblegum li.sm2_paused a,
+ul.playlist.bubblegum li.sm2_paused:hover a,
+ul.playlist.bubblegum li.sm2_paused .timing,
+ul.playlist.use-peak.bubblegum li.sm2_paused .peak {
+ color:#ff6699;
+}
+
+ul.playlist.bubblegum li:hover {
+ background-color:#ffddee;
+}
+
+ul.playlist.bubblegum li.sm2_playing,
+ul.playlist.bubblegum li.sm2_playing:hover {
+ background-color:#ff7799;
+}
+
+ul.playlist.bubblegum li .controls {
+ background-color:transparent;
+}
+
+ul.playlist.bubblegum li .controls .statusbar {
+ background-color:#fff;
+ border-color:#fff;
+}
+
+ul.playlist.bubblegum li .controls .statusbar .position {
+ background-color:#ffaacc;
+ border-right:3px solid #ffaacc;
+ border-radius:3px;
+ -moz-border-radius:3px;
+ -webkit-border-radius:3px;
+}
+
+ul.playlist.bubblegum li .controls .statusbar .loading {
+ background-color:#ffeedd;
+}
+
+ul.playlist.bubblegum li .timing,
+ul.playlist.use-peak.bubblegum li .peak {
+ background-color:#ffaacc;
+ border-color:#ffccee;
+}
+
+ul.playlist.use-spectrum.bubblegum li.sm2_playing .spectrum-container {
+ background-color:#ffaacc;
+ border-color:#ffccee;
+}
+
+ul.playlist.use-spectrum.bubblegum li.sm2_playing .spectrum-container .spectrum {
+ background-color:#fff;
+}
+
+ul.playlist.bubblegum.use-peak li .peak .l,
+ul.playlist.bubblegum.use-peak li .peak .r {
+ border-color:#fff;
+ background-color:#fff;
+}
+
+
+ul.playlist.shiny li.sm2_paused,
+ul.playlist.shiny li.sm2_playing {
+ background-image:url(../image/top-highlight.png);
+ background-repeat:repeat-x;
+ background-position:0px -1px;
+ _background-image:none; /* can't be bothered with IE 6. */
+}
\ No newline at end of file diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/page-player/css/page-player.css b/docs/dymaxion/soundmanagerv297a-20101010/demo/page-player/css/page-player.css new file mode 100755 index 0000000..2c0ca3b --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/page-player/css/page-player.css @@ -0,0 +1,320 @@ +/*
+
+ SoundManager 2: "page as playlist" example
+ ------------------------------------------
+ http://schillmania.com/projects/soundmanager2/
+
+*/
+
+.spectrum-container {
+ display:none;
+}
+
+ul.use-spectrum li.sm2_playing .spectrum-container {
+ position:absolute;
+ left:0px;
+ top:0px;
+ margin-left:-266px;
+ margin-top:-1px;
+ display:block;
+ background-color:#5588bb;
+ border:1px solid #99ccff;
+ -moz-border-radius:4px;
+ -webkit-border-radius:4px;
+ border-radius:4px;
+}
+
+ul.use-spectrum .spectrum-box {
+ position:relative;
+ width:255px;
+ font-size:1em;
+ padding:2px 0px;
+ height:1.2em;
+ overflow:hidden;
+}
+
+ul.use-spectrum .spectrum-box .spectrum {
+ position:absolute;
+ left:0px;
+ top:-2px;
+ margin-top:20px;
+ display:block;
+ font-size:1px;
+ width:1px;
+ height:1px; /* set to 50px for a thick line, 1px for a thin line, etc. */
+ overflow:hidden;
+ background-color:#fff;
+}
+
+ul.playlist {
+ list-style-type:none;
+ margin:0px;
+ padding:0px;
+
+}
+
+ul.playlist li {
+ /* assume all items will be sounds rather than wait for onload etc. in this example.. may differ for your uses. */
+ position:relative;
+ display:block;
+ width:auto;
+ font-size:2em;
+ color:#666;
+ padding:0.25em 0.5em 0.25em 0.5em;
+ border:none;
+ letter-spacing:-1px; /* ZOMG WEB X.0. ;) */
+ background-color:#f9f9f9;
+ -webkit-transition-property: hover;
+ -webkit-transition: background-color 0.15s ease-in-out;
+ -moz-transition: background-color 0.15s linear 0s; /* firefox 4 */
+ -o-transition-property: background-color; /* opera 10.5 */
+ -o-transition-duration: 0.15s;
+
+}
+
+ul.playlist li a {
+ display:block;
+ text-decoration:none;
+ font-weight:normal;
+ color:#000;
+ font-size:120%;
+ outline:none;
+ position:relative;
+ z-index:2;
+}
+
+ul.playlist li.sm2_playing,
+ul.playlist li.sm2_paused,
+ul.playlist li.sm2_playing a {
+ color:#fff;
+ border-radius:3px;
+ -webkit-border-radius:3px;
+ -moz-border-radius:3px;
+}
+
+ul.playlist li:hover {
+ background-color:#eee;
+}
+
+ul.playlist li:hover a {
+ color:#333;
+}
+
+ul.playlist li.sm2_playing,
+ul.playlist li.sm2_playing:hover {
+ background-color:#6699cc;
+}
+
+ul.playlist li.sm2_paused {
+ background-color:#999;
+}
+
+ul.playlist li.sm2_playing:hover a,
+ul.playlist li.sm2_paused a {
+ color:#fff;
+}
+
+ul.playlist li .controls {
+ display:none;
+}
+
+ul.playlist li .peak,
+ul.playlist.use-peak li .peak {
+ display:none;
+ position:absolute;
+ top:0.55em;
+ right:0.5em;
+}
+
+ul.playlist li.sm2_playing .controls,
+ul.playlist li.sm2_paused .controls {
+ position:relative;
+ display:block;
+}
+
+ul.playlist.use-peak li.sm2_playing .peak,
+ul.playlist.use-peak li.sm2_paused .peak {
+ display:inline;
+ display:inline-block;
+}
+
+ul.playlist.use-peak li .peak {
+ display:none; /* IE 7 */
+}
+
+ul.playlist li.sm2_paused .controls {
+ background-color:#666;
+}
+
+ul.playlist li:hover .controls .statusbar {
+ position:relative;
+ cursor:ew-resize;
+ cursor:-moz-grab;
+ cursor:grab;
+}
+
+ul.playlist li.sm2_paused .controls .statusbar {
+ background-color:#ccc;
+}
+
+ul.playlist li .controls {
+ position:relative;
+ margin-top:0.25em;
+ margin-bottom:0.25em;
+ background-color:#99ccff;
+}
+
+ul.playlist li .controls .statusbar {
+ position:relative;
+ height:0.5em;
+ background-color:#ccddff;
+ border:2px solid #fff;
+ border-radius:2px;
+ -moz-border-radius:2px;
+ -webkit-border-radius:2px;
+ overflow:hidden;
+ cursor:-moz-grab;
+ cursor:grab;
+}
+
+ul.playlist li .controls.dragging .statusbar {
+ cursor:-moz-grabbing;
+ cursor:grabbing;
+}
+
+ul.playlist li .controls .statusbar .position,
+ul.playlist li .controls .statusbar .loading,
+ul.playlist li .controls .statusbar .annotation {
+ position:absolute;
+ left:0px;
+ top:0px;
+ height:0.5em;
+}
+
+ul.playlist li .controls .statusbar .position {
+ background-color:#336699;
+ border-right:3px solid #336699;
+ border-radius:3px;
+ -moz-border-radius:3px;
+ -webkit-border-radius:3px;
+}
+
+ul.playlist li.sm2_paused .controls .statusbar .position {
+ background-color:#666;
+ border-color:#666;
+}
+
+ul.playlist li .controls .statusbar .loading {
+ background-color:#eee;
+}
+
+ul.playlist li .controls .statusbar .position,
+ul.playlist li .controls .statusbar .loading {
+ width:0px;
+}
+
+ul.playlist li.sm2_playing a.sm2_link,
+ul.playlist li.sm2_paused a.sm2_link {
+ margin-right:4.5em; /* room for timing stuff */
+}
+
+ul.playlist li .timing {
+ position:absolute;
+ display:none;
+ text-align:right;
+ right:1em;
+ top:1em;
+ width:auto;
+ height:1em;
+ padding:3px 5px;
+ background-color:#5588bb;
+ border:1px solid #99ccff;
+ -moz-border-radius:4px;
+ -khtml-border-radius:4px;
+ border-radius:4px;
+ letter-spacing:0px;
+ font:44% monaco,"VT-100",terminal,"lucida console",courier,system;
+ line-height:1em;
+ vertical-align:middle;
+}
+
+ul.playlist.use-peak li .timing {
+ right:4.25em;
+}
+
+ul.playlist li:hover .timing {
+ z-index:2;
+}
+
+ul.playlist li .timing div.sm2_timing {
+ margin:0px;
+ padding:0px;
+ margin-top:-1em;
+}
+
+ul.playlist li.sm2_playing .timing,
+ul.playlist li.sm2_paused .timing {
+ display:block;
+}
+
+ul.playlist li.sm2_paused .timing .sm2_position {
+ text-decoration:blink; /* hee hee. first actual appropriate use? :D */
+}
+
+ul.playlist li.sm2_paused .timing,
+ul.playlist.use-peak li.sm2_paused .peak {
+ background-color:#888;
+ border-color:#ccc;
+}
+
+/* peak data */
+
+/* ul.playlist ... */
+
+ul.playlist.use-peak li .peak {
+ display:none;
+ zoom:1;
+ border:1px solid #99ccff;
+ padding:2px;
+ height:0.55em;
+ -moz-border-radius:4px;
+ -khtml-border-radius:4px;
+ border-radius:4px;
+ background-color:#5588bb;
+ width:0.8em;
+ height:0.55em;
+ margin-top:-3px;
+}
+
+ul.playlist.use-peak li .peak-box {
+ position:relative;
+ width:100%;
+ height:0.55em;
+ overflow:hidden;
+}
+
+ul.playlist li .peak .l,
+ul.playlist li .peak .r {
+ position:absolute;
+ left:0px;
+ top:0px;
+ width:7px;
+ height:50px;
+ background:#fff;
+ border:1px solid #fff;
+ -moz-border-radius:1px;
+ -khtml-border-radius:1px;
+ margin-top:1em;
+}
+
+ul.playlist li .peak .l {
+ margin-right:1px;
+}
+
+ul.playlist li .peak .r {
+ left:10px;
+}
+
+#control-template {
+ display:none;
+}
\ No newline at end of file diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/page-player/image/divot-bottom.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/page-player/image/divot-bottom.png Binary files differnew file mode 100755 index 0000000..05b1dff --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/page-player/image/divot-bottom.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/page-player/image/divot.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/page-player/image/divot.png Binary files differnew file mode 100755 index 0000000..fbcf930 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/page-player/image/divot.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/page-player/image/top-highlight.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/page-player/image/top-highlight.png Binary files differnew file mode 100755 index 0000000..f88668d --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/page-player/image/top-highlight.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/page-player/index.html b/docs/dymaxion/soundmanagerv297a-20101010/demo/page-player/index.html new file mode 100755 index 0000000..ee5bf79 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/page-player/index.html @@ -0,0 +1,367 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+<title>SoundManager 2 Demo: Play MP3 links on a page, "page as playlist" style</title> +<meta name="robots" content="noindex" />
+
+<!-- for this page only, make things pretty -->
+<link rel="stylesheet" type="text/css" href="css/demo.css" />
+
+<!-- player core CSS -->
+<link rel="stylesheet" type="text/css" href="css/page-player.css" />
+
+<!-- soundManager.useFlashBlock: related CSS -->
+<link rel="stylesheet" type="text/css" href="../flashblock/flashblock.css" />
+
+<!-- optional: annotations/sub-tracks/notes, and alternate themes -->
+<link rel="stylesheet" type="text/css" href="css/optional-annotations.css" />
+<link rel="stylesheet" type="text/css" href="css/optional-themes.css" />
+
+<style type="text/css">
+ul.playlist li .comment {font-size:0.65em;opacity:0.5}
+</style>
+<script type="text/javascript" src="../../script/soundmanager2.js"></script>
+<script type="text/javascript">
+
+/* --------
+
+ Config override: This demo uses shiny flash 9 stuff, overwriting Flash 8-based defaults
+ Alternate PP_CONFIG object must be defined before page-player JS is included/executed.
+ Alternately, edit the config in page-player.js to simply use the values below by default
+
+-------- */
+
+// demo only..
+soundManager.useHighPerformance = true; // keep flash on screen, boost performance
+soundManager.wmode = 'transparent'; // transparent SWF, if possible
+soundManager.useFastPolling = true; // increased JS callback frequency
+soundManager.url = '../../swf/';
+
+var PP_CONFIG = {
+ flashVersion: 9, // version of Flash to tell SoundManager to use - either 8 or 9. Flash 9 required for peak / spectrum data.
+ usePeakData: true, // [Flash 9 only] whether or not to show peak data (left/right channel values) - nor noticable on CPU
+ useWaveformData: true, // [Flash 9 only] show raw waveform data - WARNING: LIKELY VERY CPU-HEAVY
+ useEQData: false, // [Flash 9 only] show EQ (frequency spectrum) data
+ useFavIcon: false, // try to apply peakData to address bar (Firefox + Opera) - performance note: appears to make Firefox 3 do some temporary, heavy disk access/swapping/garbage collection at first(?) - may be too heavy on CPU
+ useMovieStar: true // Flash 9.0r115+ only: Support for a subset of MPEG4 formats.
+}
+
+</script>
+<script type="text/javascript" src="script/page-player.js"></script>
+<script type="text/javascript">
+var is_shiny = false;
+function setTheme(sTheme) {
+ var o = pagePlayer.getElementsByClassName('playlist','ul');
+ for (var i=o.length; i--;) {
+ o[i].className = 'playlist'+(pagePlayer.cssBase?' '+pagePlayer.cssBase:'')+(sTheme?' '+sTheme:'')+(is_shiny?' shiny':'');
+ }
+ return false;
+}
+function setShiny(bShiny) {
+ is_shiny = bShiny;
+ var o = pagePlayer.getElementsByClassName('playlist','ul');
+ var sClass = 'shiny';
+ for (var i=o.length; i--;) {
+ if (!bShiny) {
+ pagePlayer.removeClass(o[i],sClass);
+ } else {
+ pagePlayer.addClass(o[i],sClass);
+ }
+ }
+}
+</script>
+</head>
+
+<body>
+
+<div id="left">
+
+ <h1><a href="http://www.schillmania.com/projects/soundmanager2/" title="Play a page of mp3s with javascript via SoundManager 2">SoundManager 2</a> / "Page as a playlist"</h1>
+
+ <h2 style="margin-top:0px;border:none">Muxtape.com-style UI, MP3/AAC Player Example</h2>
+ <p class="note">*CSS 3 border-radius supported by Firefox 2.x+, Safari (2.x?) and IE 9.</p>
+
+ <p style="margin-top:1.5em;color:#333">This page uses shiny features which require Flash 9. The <a href="basic.html" title="Basic page player demo">default config</a> uses Flash 8.</p>
+
+ <div id="sm2-container">
+ <!-- SM2 flash goes here -->
+ </div>
+
+ <ul class="playlist">
+ <li><a href="../mpc/audio/CRASH_1.mp3">Crash cymbal</a></li>
+ <li><a href="../_mp3/bass.mp3">Bass</a></li>
+ <li><a href="../_mp3/sine,%20square,%20sawtooth,%20rando.mp3">440 Hz sine, square, sawtooth, pink noise, random</a></li>
+ <li><a href="../_mp3/1hz-10khz-sweep.mp3">1Hz - 10KHz sweep</a></li>
+ <!-- files from the web (note that ID3 and waveformData information will *not* load from remote domains without permission, due to Flash security restrictions) -->
+ <li><a href="http://freshly-ground.com/misc/music/20060826%20-%20Armstrong.mp3">20060826 - Armstrong</a></li>
+ <li><a href="http://freshly-ground.com/misc/music/carl-3-barlp.mp3">Barrlping with Carl <span class="comment">(featureblend.com)</span></a></li>
+ <li><a href="http://freshly-ground.com/data/audio/binaural/Mak.mp3" class="exclude">Angry cow sound with "exclude" CSS class <span class="comment">(Browser follows link normally)</span></a></li>
+ </ul>
+
+ <h2>MPEG4 / H.264 + HE-AAC (Flash "MovieStar" 9.0r115+) format support - audio-only example</h2>
+ <h3>A subset of MPEG4 <a href="http://www.adobe.com/support/documentation/en/flashplayer/9/releasenotes.html#fixes_90115">is supported</a> including AAC, FLV, MP4, M4A, MOV, MP4V, 3GP and 3G2 files.</h3>
+
+ <ul class="playlist">
+ <li><a href="http://freshly-ground.com/data/video/Rain%20on%20Car%20Roof.aac">Rain on Car Roof <span class="comment">(MPEG4 .AAC audio, 128 kbps AAC-LC exported from QuickTime)</span></a></li>
+ <li><a href="http://freshly-ground.com/data/video/Jellyfish.mov">Jellyfish <span class="comment">(848x480 H.264 video, playing audio portion only)</span></a></li>
+ </ul>
+
+ <div id="control-template">
+ <!-- control markup inserted dynamically after each link -->
+ <div class="controls">
+ <div class="statusbar">
+ <div class="loading"></div>
+ <div class="position"></div>
+ </div>
+ </div>
+ <div class="timing">
+ <div id="sm2_timing" class="timing-data">
+ <span class="sm2_position">%s1</span> / <span class="sm2_total">%s2</span>
+ </div>
+ </div>
+ <div class="peak">
+ <div class="peak-box"><span class="l"></span><span class="r"></span></div>
+ </div>
+ </div>
+
+ <div id="spectrum-container" class="spectrum-container">
+ <div class="spectrum-box">
+ <div class="spectrum"></div>
+ </div>
+ </div>
+
+ <h3 style="margin-top:1em">Basics</h3>
+
+ <p class="note">Don't want a Flash 9 requirement, EQ/waveform, perhaps less CPU? See Flash 8-based <a href="basic.html" title="Page as playlist demo">basic demo</a>.</p>
+
+ <p>Clicking a title will start loading + playing, or pause, a sound.</p>
+ <p>Once loading, click (or click and drag) on the loading/position bar to seek within the sound.</p>
+ <p>The document title reflects the currently-playing sound, and by default the list will play sequentially if left alone. (This is configurable.)</p>
+
+ <h3>Themes</h3>
+ <p>Just for fun, a few color schemes (visible when playing/paused):</p>
+ <ul class="themes">
+ <li><a href="#" onclick="return setTheme('dark')"><ul class="playlist dark"></a> - #333 and #666, mostly</li>
+ <li><a href="#" onclick="return setTheme('gold')"><ul class="playlist gold"></a> - Frontin' the bling</li>
+ <li><a href="#" onclick="return setTheme('bubblegum')"><ul class="playlist bubblegum"></a> - ZOMG PONIES!!!ONEONEONE</li>
+ <li><a href="#" onclick="return setTheme('')"><ul class="playlist"></a> (default)</li>
+ </ul>
+
+ <form style="margin:0px;padding:0px" action="#" onsubmit="return false">
+ <div>
+ <input id="makeShiny" name="makeShiny" type="checkbox" onchange="setShiny(this.checked)" value="Shiny" /> <label for="makeShiny">Also add "shiny", eg. <ul class="shiny playlist">...</label>
+ </div>
+ </form>
+ <script type="text/javascript">document.getElementById('makeShiny').checked=false;</script>
+
+ <h2 id="metadata">Experimental (Alpha) Variant: MP3 "Metadata": Annotations / notes / sub-tracks</h2>
+ <p>A potential approach to noting interesting moments in sounds, scene changes, new tracks in seamless DJ mixes etc. Keep in mind this is a single MP3 being loaded, but annotations are placed along the timeline as shown.</p>
+ <p>A "metadata" element contains a nested list of data (UL/LI combination) - in this case, a summary of each scene - and the time at which this item occurs/begins. In order to help with positioning, the total length of the sound is also specified up-front. View the source code of this page for the details.</p>
+
+ <ul class="playlist">
+
+ <li>
+ <a href="http://freshly-ground.com/data/audio/binaural/A%20Virtual%20Haircut%20in%20San%20Francisco%20%283%20Scenes%29.mp3">A Virtual Haircut (3 scenes)</a>
+ <div class="metadata">
+ <div class="duration">4:43</div> <!-- total track time (for positioning while loading, until determined -->
+ <ul>
+ <li><p>Electric razor</p><span>0:00</span></li> <!-- first scene -->
+ <li><p>Water, scissors</p><span>2:41</span></li> <!-- start time of second scene -->
+ <li><p>More razor work</p><span>4:00</span></li>
+ </ul>
+ </div>
+ </li>
+
+ <li>
+ <a href="http://freshly-ground.com/data/audio/binaural/Rubber%20Chicken%20Launch%20%28office%29.mp3">Rubber Chicken Launch (Office)</a>
+ <div class="metadata">
+ <div class="duration">0:47</div>
+ <ul>
+ <li><p>First attempt</p><span>0:00</span></li>
+ <li><p>Fire!</p><span>0:02</span></li>
+ <li><p>"Too much angle"</p><span>0:05</span></li>
+ <li><p>Random chicken noise</p><span>0:18</span></li>
+ <li><p>"Wait a second"</p><span>0:31</span></li>
+ <li><p>Derrr..</p><span>0:34</span></li>
+ <li><p>Launch attempt #2</p><span>0:36</span></li>
+ <li><p>"Wrong angle"</p><span>0:39</span></li>
+ <li><p>"Fail"</p><span>0:42</span></li>
+ </ul>
+ </div>
+ </li>
+
+ </ul>
+
+ <h2>How It Works</h2>
+
+ <p>This example uses <a href="http://www.schillmania.com/projects/soundmanager2/" title="SoundManager 2 Javascript Sound API">SoundManager 2</a> to find links to MP3 files within an unordered list, and makes them playable "in-place" on a page. The script assigns CSS classes to links' parent LI nodes to indicate their state (playing/paused, etc.)</p>
+
+ <h3>Progressive Enhancement</h3>
+
+ <p>This provides a nice HTML base for all browsers and user agents, and enhances progressively for those with Javascript and Flash. Links pointing to MP3s are assigned an onclick handler which intercepts the click (preventing the browser from following the link and unloading the page. SM2 will then create sound objects as needed to play the MP3s. In the event there is an error at runtime or a lack of support (no JS/Flash etc.), the browser will simply load the MP3s directly as it normally would. This includes iPhones, etc.</p>
+
+ <h3>HTML Fragments (UI Element Templates)</h3>
+ <p>Each item in the playlist has its own set of controls and progress indicators, etc. This content is defined once as a hidden template of HTML in-page separate from the playlist markup and is cloned for each item as needed. This can be easily styled with CSS as well, of course.</p>
+
+<h2>I'd like to use this.</h2>
+<p>See this <a href="basic.html" title="Page as playlist demo">basic demo</a> for reference.</p>
+<p>The basic demo uses the default Flash 8 configuration, but you can easily change this to use Flash 9 features. The only difference in code is the configuration.</p>
+
+<p>A reminder that if loading from the local filesystem, Flash will deny access to remote (network/internet) URLs by default unless whitelisted via the <a href="http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html">Flash Player Global Security Settings Page</a>. Some URLs in this example are remote to demonstrate this.</p>
+
+<h2>Configuration + Options</h2>
+
+<h3>Default configuration</h3>
+
+<p>Behaviours such as auto-start and UI elements like VU meters and spectrum graphs are easy configurable, using an object literal format as shown below.</p>
+<p>The page player config (see related page-player.js file) as below.</p>
+<p>The custom parameters used to make this demo page are highlighted in red.</p>
+<pre class="block"><code> <span>// ( within page-player.js )</span>
+
+ this.config = {
+ flashVersion: <span style="color:red">9</span>, <span>// version of Flash to tell SoundManager to use - either 8 or 9.</span>
+ usePeakData: <span style="color:red">true</span>, <span>// [Flash 9 only] show peak (VU-meter) data</span>
+ useFavIcon: <span style="color:red">true</span>, <span>// try to show peakData in address bar (Firefox + Opera) - requires usePeakData = true too, of course.</span>
+ useWaveformData: <span style="color:red">true</span>, <span>// [Flash 9 only] true: show raw waveform data - WARNING: CPU-intensive</span>
+ useEQData: false, <span>// [Flash 9 only] show EQ (frequency spectrum) data - WARNING: CPU-intensive</span>
+ fillGraph: false, <span>// [Flash 9 only] draw full lines instead of only top (peak) spectrum points</span>
+ allowRightClick:true, <span>// let users right-click MP3 links ("save as...", etc.) or discourage (can't prevent.)</span>
+ useThrottling: false, <span>// try to rate-limit potentially-expensive calls (eg. dragging position around)</span>
+ autoStart: false, <span>// begin playing first sound when page loads</span>
+ playNext: true, <span>// stop after one sound, or play through list until end</span>
+ updatePageTitle: true, <span>// change the page title while playing sounds</span>
+ emptyTime: '-:--' <span>// null/undefined timer values (before data is available)</span>
+ }
+</code></pre>
+
+<h3>Per-page configuration override</h3>
+
+<p>Alternately, you may override the defaults on a per-page basis by defining an "alternate configuration" object <b>before</b> the page-player.js file has been included in your source code:</p>
+
+<pre class="block"><code> <span>// ( before page-player.js )</span>
+
+ var PP_CONFIG = {
+ flashVersion: 9, <span>// version of Flash to tell SoundManager to use - either 8 or 9. Flash 9 required for peak / spectrum data.</span>
+ usePeakData: true, <span>// [Flash 9 only] whether or not to show peak data (no notable CPU cost)</span>
+ useWaveformData: true <span>// [Flash 9 only] show raw waveform data. WARNING: Experimental, likely CPU-heavy</span>
+ }</code></pre>
+
+<p>Any options specified in PP_CONFIG will override the defaults defined in page-player.js.</p>
+
+ <h3>Basic CSS</h3>
+
+<pre>
+ If you want to make your own UI from scratch, here is the base:
+
+ ul.playlist {}
+
+ Default + hover state, "click to play":
+
+ li.sm2_link {}
+ li.sm2_link:hover {}
+
+ Playing + hover state, "click to pause":
+
+ li.sm2_playing {}
+ li.sm2_playing:hover {}
+
+ Paused + hover state, "click to resume":
+
+ li.sm2_paused {}
+ li.sm2_paused:hover {}
+</pre>
+
+<p>The positioning (load status / control bar) template is also applied after each MP3 link, from an element named "control-template"</p>
+
+<p>"loading" and "position" have background colors applied, and have their width adjusted dynamically by SM2 as the sound(s) load/play. "timing" is replaced with the current time / duration, eg. 1:23 / 4:20</p>
+<p>The class names applied can be edited within the source JS also, for convenience.</p>
+<p>The controls are shown and hidden via the same dynamic CSS updates. See the source CSS for the timing / status bar layout.</p>
+
+<h2>Performance Considerations</h2>
+<h3>Experimental Flash 9 features</h3>
+<ul class="tight" style="padding-top:1px">
+ <li>
+ <h4>Dynamic "favicon" VU meter</h4>
+ <p>The VU meter "favicon" option as shown in the address/location bar for Firefox and Opera can cause a lot of disk access in Firefox (2.x/3.0 at time of writing, from what has been reported.) It may be garbage collection-related.</p>
+ <p>The behaviour seems to be connected to the dynamic swapping of <link> elements with data: URIs containing the VU meter data, and looks to be noticeable with the first sound played - after which point things settle down. Perhaps the browser is attempting to cache the favicon data being assigned.</p>
+ </li>
+ <li>
+ <h4>Waveform/spectrum visualization graph</h4>
+ <p>Enabling the waveformData and/or eqData features will result in some heavy DOM calls (manipulation of 256 <div> elements with each "frame" drawn) which can eat up a good amount of CPU and may make really old computers cower in fear.</p>
+ <p>Ultimately, the UI refresh rate will simply be limited if a CPU ceiling is hit, and audio playback should not be affected.</p>
+ </li>
+</ul>
+
+<h3>More CSS comments</h3>
+
+<div>
+<pre>
+ SoundManager 2: "page as playlist" example
+ ------------------------------------------
+
+ Clicks on links to MP3s are intercepted via JS, calls are
+ made to SoundManager to load/play sounds. CSS classes are
+ appended to the LI parent, which are used to highlight the
+ current play state and so on.
+
+ Class names are applied in addition to "sm2_link" base.
+
+ Default:
+
+ sm2_link
+
+ Additional states:
+
+ sm2_playing
+ sm2_paused
+
+ eg.
+
+ <!-- default -->
+ <li class="sm2_link"><a href="some.mp3">some.mp3</a></li>
+
+ <!-- playing -->
+ <li class="sm2_link sm2_playing"><a href="some.mp3">some.mp3</a></li>
+
+ The script also injects an HTML template containing control bar
+ and timing elements, which can also be targeted with CSS.
+
+
+ Note you don't necessarily require ul.playlist for your use
+ if only using one style on a page. You can just use .sm2_link
+ and so on, but isolate the CSS you want.
+
+ Side note: Would do multiple class definitions eg.
+
+ li.sm2_default.sm2_playing{}
+
+ .. except IE 6 has a parsing bug which may break behaviour,
+ applying sm2_playing {} even when the class is set to sm2_default.
+
+
+ If you want to make your own UI from scratch, here is the base:
+
+ Default + hover state, "click to play":
+
+ li.sm2_link {}
+ li.sm2_link:hover {}
+
+ Playing + hover state, "click to pause":
+
+ li.sm2_playing {}
+ li.sm2_playing:hover {}
+
+ Paused + hover state, "click to resume":
+
+ li.sm2_paused {}
+ li.sm2_paused:hover {}
+</pre>
+</div>
+
+<p><a href="http://www.schillmania.com/projects/soundmanager2/" title="Javascript MP3 sound player API">SoundManager 2 project home</a></p>
+
+</div>
+
+</body>
+</html>
diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/page-player/script/page-player.js b/docs/dymaxion/soundmanagerv297a-20101010/demo/page-player/script/page-player.js new file mode 100755 index 0000000..607cfff --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/page-player/script/page-player.js @@ -0,0 +1,936 @@ +/*
+
+ SoundManager 2 Demo: "Page as playlist"
+ ----------------------------------------------
+ http://schillmania.com/projects/soundmanager2/
+
+ An example of a Muxtape.com-style UI, where an
+ unordered list of MP3 links becomes a playlist
+
+ Flash 9 "MovieStar" edition supports MPEG4
+ audio as well.
+
+ Requires SoundManager 2 Javascript API.
+
+*/
+
+function PagePlayer(oConfigOverride) {
+ var self = this;
+ var pl = this;
+ var sm = soundManager; // soundManager instance
+ // sniffing for favicon stuff/IE workarounds
+ var uA = navigator.userAgent;
+ var isIE = uA.match(/msie/i);
+ var isOpera = uA.match(/opera/i);
+ var isFirefox = uA.match(/firefox/i);
+ var isTouchDevice = (uA.match(/ipad|iphone/i));
+
+ this.config = {
+ flashVersion: 8, // version of Flash to tell SoundManager to use - either 8 or 9. Flash 9 required for peak / spectrum data.
+ usePeakData: false, // [Flash 9 only]: show peak data
+ useWaveformData: false, // [Flash 9 only]: enable sound spectrum (raw waveform data) - WARNING: CPU-INTENSIVE: may set CPUs on fire.
+ useEQData: false, // [Flash 9 only]: enable sound EQ (frequency spectrum data) - WARNING: Also CPU-intensive.
+ fillGraph: false, // [Flash 9 only]: draw full lines instead of only top (peak) spectrum points
+ allowRightClick:true, // let users right-click MP3 links ("save as...", etc.) or discourage (can't prevent.)
+ useThrottling: true, // try to rate-limit potentially-expensive calls (eg. dragging position around)
+ autoStart: false, // begin playing first sound when page loads
+ playNext: true, // stop after one sound, or play through list until end
+ updatePageTitle: true, // change the page title while playing sounds
+ emptyTime: '-:--', // null/undefined timer values (before data is available)
+ useFavIcon: false // try to show peakData in address bar (Firefox + Opera) - may be too CPU heavy
+ }
+
+ sm.debugMode = (window.location.href.toString().match(/debug=1/i)?true:false); // enable with #debug=1 for example
+
+ this._mergeObjects = function(oMain,oAdd) {
+ // non-destructive merge
+ var o1 = {}; // clone o1
+ for (var i in oMain) {
+ o1[i] = oMain[i];
+ }
+ var o2 = (typeof oAdd == 'undefined'?{}:oAdd);
+ for (var o in o2) {
+ if (typeof o1[o] == 'undefined') o1[o] = o2[o];
+ }
+ return o1;
+ }
+
+ if (typeof oConfigOverride != 'undefined' && oConfigOverride) {
+ // allow overriding via arguments object
+ this.config = this._mergeObjects(oConfigOverride,this.config);
+ }
+
+ this.css = { // CSS class names appended to link during various states
+ sDefault: 'sm2_link', // default state
+ sLoading: 'sm2_loading',
+ sPlaying: 'sm2_playing',
+ sPaused: 'sm2_paused'
+ }
+
+ // apply externally-defined override, if applicable
+ this.cssBase = []; // optional features added to ul.playlist
+ if (this.config.usePeakData) this.cssBase.push('use-peak');
+ if (this.config.useWaveformData || this.config.useEQData) this.cssBase.push('use-spectrum');
+ this.cssBase = this.cssBase.join(' ');
+
+ // apply some items to SM2
+ sm.useFlashBlock = true;
+ sm.flashVersion = this.config.flashVersion;
+ if (sm.flashVersion >= 9) {
+ sm.useMovieStar = this.config.useMovieStar; // enable playing FLV, MP4 etc.
+ sm.defaultOptions.usePeakData = this.config.usePeakData;
+ sm.defaultOptions.useWaveformData = this.config.useWaveformData;
+ sm.defaultOptions.useEQData = this.config.useEQData;
+ }
+
+ this.links = [];
+ this.sounds = [];
+ this.soundsByObject = [];
+ this.lastSound = null;
+ this.soundCount = 0;
+ this.strings = [];
+ this.dragActive = false;
+ this.dragExec = new Date();
+ this.dragTimer = null;
+ this.pageTitle = document.title;
+ this.lastWPExec = new Date();
+ this.lastWLExec = new Date();
+ this.vuMeterData = [];
+ this.oControls = null;
+
+ this.addEventHandler = function(o,evtName,evtHandler) {
+ typeof(attachEvent)=='undefined'?o.addEventListener(evtName,evtHandler,false):o.attachEvent('on'+evtName,evtHandler);
+ }
+
+ this.removeEventHandler = function(o,evtName,evtHandler) {
+ typeof(attachEvent)=='undefined'?o.removeEventListener(evtName,evtHandler,false):o.detachEvent('on'+evtName,evtHandler);
+ }
+
+ this.hasClass = function(o,cStr) {
+ return (typeof(o.className)!='undefined'?new RegExp('(^|\\s)'+cStr+'(\\s|$)').test(o.className):false);
+ }
+
+ this.addClass = function(o,cStr) {
+ if (!o || !cStr) return false; // safety net
+ if (self.hasClass(o,cStr)) return false;
+ o.className = (o.className?o.className+' ':'')+cStr;
+ }
+
+ this.removeClass = function(o,cStr) {
+ if (!o || !cStr) return false; // safety net
+ if (!self.hasClass(o,cStr)) return false;
+ o.className = o.className.replace(new RegExp('( '+cStr+')|('+cStr+')','g'),'');
+ }
+
+ this.getElementsByClassName = function(className,tagNames,oParent) {
+ var doc = (oParent?oParent:document);
+ var matches = [];
+ var i,j;
+ var nodes = [];
+ if (typeof(tagNames)!='undefined' && typeof(tagNames)!='string') {
+ for (i=tagNames.length; i--;) {
+ if (!nodes || !nodes[tagNames[i]]) {
+ nodes[tagNames[i]] = doc.getElementsByTagName(tagNames[i]);
+ }
+ }
+ } else if (tagNames) {
+ nodes = doc.getElementsByTagName(tagNames);
+ } else {
+ nodes = doc.all||doc.getElementsByTagName('*');
+ }
+ if (typeof(tagNames)!='string') {
+ for (i=tagNames.length; i--;) {
+ for (j=nodes[tagNames[i]].length; j--;) {
+ if (self.hasClass(nodes[tagNames[i]][j],className)) {
+ matches[matches.length] = nodes[tagNames[i]][j];
+ }
+ }
+ }
+ } else {
+ for (i=0; i<nodes.length; i++) {
+ if (self.hasClass(nodes[i],className)) {
+ matches[matches.length] = nodes[i];
+ }
+ }
+ }
+ return matches;
+ }
+
+ this.getOffX = function(o) {
+ // http://www.xs4all.nl/~ppk/js/findpos.html
+ var curleft = 0;
+ if (o.offsetParent) {
+ while (o.offsetParent) {
+ curleft += o.offsetLeft;
+ o = o.offsetParent;
+ }
+ }
+ else if (o.x) curleft += o.x;
+ return curleft;
+ }
+
+ this.isChildOfClass = function(oChild,oClass) {
+ if (!oChild || !oClass) return false;
+ while (oChild.parentNode && !self.hasClass(oChild,oClass)) {
+ oChild = oChild.parentNode;
+ }
+ return (self.hasClass(oChild,oClass));
+ }
+
+ this.getParentByNodeName = function(oChild,sParentNodeName) {
+ if (!oChild || !sParentNodeName) return false;
+ sParentNodeName = sParentNodeName.toLowerCase();
+ while (oChild.parentNode && sParentNodeName != oChild.parentNode.nodeName.toLowerCase()) {
+ oChild = oChild.parentNode;
+ }
+ return (oChild.parentNode && sParentNodeName == oChild.parentNode.nodeName.toLowerCase()?oChild.parentNode:null);
+ }
+
+ this.getTime = function(nMSec,bAsString) {
+ // convert milliseconds to mm:ss, return as object literal or string
+ var nSec = Math.floor(nMSec/1000);
+ var min = Math.floor(nSec/60);
+ var sec = nSec-(min*60);
+ // if (min == 0 && sec == 0) return null; // return 0:00 as null
+ return (bAsString?(min+':'+(sec<10?'0'+sec:sec)):{'min':min,'sec':sec});
+ }
+
+ this.getSoundByObject = function(o) {
+ return (typeof self.soundsByObject[o.rel] != 'undefined'?self.soundsByObject[o.rel]:null);
+ }
+
+ this.getSoundIndex = function(o) {
+ for (var i=self.links.length; i--;) {
+ if (self.links[i].rel == o.rel) return i;
+ }
+ return -1;
+ }
+
+ this.setPageTitle = function(sTitle) {
+ if (!self.config.updatePageTitle) return false;
+ try {
+ document.title = (sTitle?sTitle+' - ':'')+self.pageTitle;
+ } catch(e) {
+ // oh well
+ self.setPageTitle = function() {return false;}
+ }
+ }
+
+ this.events = {
+
+ // handlers for sound events as they're started/stopped/played
+
+ play: function() {
+ pl.removeClass(this._data.oLI,this._data.className);
+ this._data.className = pl.css.sPlaying;
+ pl.addClass(this._data.oLI,this._data.className);
+ self.setPageTitle(this._data.originalTitle);
+ },
+
+ stop: function() {
+ pl.removeClass(this._data.oLI,this._data.className);
+ this._data.className = '';
+ this._data.oPosition.style.width = '0px';
+ self.setPageTitle();
+ self.resetPageIcon();
+ },
+
+ pause: function() {
+ if (pl.dragActive) return false;
+ pl.removeClass(this._data.oLI,this._data.className);
+ this._data.className = pl.css.sPaused;
+ pl.addClass(this._data.oLI,this._data.className);
+ self.setPageTitle();
+ self.resetPageIcon();
+ },
+
+ resume: function() {
+ if (pl.dragActive) return false;
+ pl.removeClass(this._data.oLI,this._data.className);
+ this._data.className = pl.css.sPlaying;
+ pl.addClass(this._data.oLI,this._data.className);
+ },
+
+ finish: function() {
+ pl.removeClass(this._data.oLI,this._data.className);
+ this._data.className = '';
+ this._data.oPosition.style.width = '0px';
+ // play next if applicable
+ if (self.config.playNext && this._data.nIndex<pl.links.length-1) {
+ pl.handleClick({target:pl.links[this._data.nIndex+1]}); // fake a click event - aren't we sneaky. ;)
+ } else {
+ self.setPageTitle();
+ self.resetPageIcon();
+ }
+ },
+
+ whileloading: function() {
+ function doWork() {
+ this._data.oLoading.style.width = (((this.bytesLoaded/this.bytesTotal)*100)+'%'); // theoretically, this should work.
+ if (!this._data.didRefresh && this._data.metadata) {
+ this._data.didRefresh = true;
+ this._data.metadata.refresh();
+ }
+ }
+ if (!pl.config.useThrottling) {
+ doWork.apply(this);
+ } else {
+ d = new Date();
+ if (d && d-self.lastWLExec>30 || this.bytesLoaded === this.bytesTotal) {
+ doWork.apply(this);
+ self.lastWLExec = d;
+ }
+ }
+
+ },
+
+ onload: function() {
+ if (!this.loaded) {
+ var oTemp = this._data.oLI.getElementsByTagName('a')[0];
+ var oString = oTemp.innerHTML;
+ var oThis = this;
+ oTemp.innerHTML = oString+' <span style="font-size:0.5em"> | Load failed, d\'oh! '+(sm.sandbox.noRemote?' Possible cause: Flash sandbox is denying remote URL access.':(sm.sandbox.noLocal?'Flash denying local filesystem access':'404?'))+'</span>';
+ setTimeout(function(){
+ oTemp.innerHTML = oString;
+ // pl.events.finish.apply(oThis); // load next
+ },5000);
+ } else {
+ if (this._data.metadata) {
+ this._data.metadata.refresh();
+ }
+ }
+ },
+
+ whileplaying: function() {
+ var d = null;
+ if (pl.dragActive || !pl.config.useThrottling) {
+ self.updateTime.apply(this);
+ if (sm.flashVersion >= 9) {
+ if (pl.config.usePeakData && this.instanceOptions.usePeakData) self.updatePeaks.apply(this);
+ if (pl.config.useWaveformData && this.instanceOptions.useWaveformData || pl.config.useEQData && this.instanceOptions.useEQData) {
+ self.updateGraph.apply(this);
+ }
+ }
+ if (this._data.metadata) {
+ d = new Date();
+ if (d && d-self.lastWPExec>500) {
+ self.refreshMetadata(this);
+ self.lastWPExec = d;
+ }
+ }
+ this._data.oPosition.style.width = (((this.position/self.getDurationEstimate(this))*100)+'%');
+ } else {
+ d = new Date();
+ if (d-self.lastWPExec>30) {
+ self.updateTime.apply(this);
+ if (sm.flashVersion >= 9) {
+ if (pl.config.usePeakData && this.instanceOptions.usePeakData) {
+ self.updatePeaks.apply(this);
+ }
+ if (pl.config.useWaveformData && this.instanceOptions.useWaveformData || pl.config.useEQData && this.instanceOptions.useEQData) {
+ self.updateGraph.apply(this);
+ }
+ }
+ if (this._data.metadata) self.refreshMetadata(this);
+ this._data.oPosition.style.width = (((this.position/self.getDurationEstimate(this))*100)+'%');
+ self.lastWPExec = d;
+ }
+ }
+ }
+
+ } // events{}
+
+ var _head = document.getElementsByTagName('head')[0];
+
+ this.setPageIcon = function(sDataURL) {
+ if (!self.config.useFavIcon || !self.config.usePeakData || !sDataURL) {
+ return false;
+ }
+ var link = document.getElementById('sm2-favicon');
+ if (link) {
+ _head.removeChild(link);
+ link = null;
+ }
+ if (!link) {
+ link = document.createElement('link');
+ link.id = 'sm2-favicon';
+ link.rel = 'shortcut icon';
+ link.type = 'image/png';
+ link.href = sDataURL;
+ document.getElementsByTagName('head')[0].appendChild(link);
+ }
+ }
+
+ this.resetPageIcon = function() {
+ if (!self.config.useFavIcon) {
+ return false;
+ }
+ var link = document.getElementById('favicon');
+ if (link) {
+ link.href = '/favicon.ico';
+ }
+ }
+
+ this.updatePeaks = function() {
+ var o = this._data.oPeak;
+ var oSpan = o.getElementsByTagName('span');
+ oSpan[0].style.marginTop = (13-(Math.floor(15*this.peakData.left))+'px');
+ oSpan[1].style.marginTop = (13-(Math.floor(15*this.peakData.right))+'px');
+ // highly experimental
+ if (self.config.flashVersion > 8 && self.config.useFavIcon && self.config.usePeakData) {
+ self.setPageIcon(self.vuMeterData[parseInt(16*this.peakData.left)][parseInt(16*this.peakData.right)]);
+ }
+ }
+
+ this.updateGraph = function() {
+ if ((!pl.config.useWaveformData && !pl.config.useEQData) || pl.config.flashVersion<9) return false;
+ var sbC = this._data.oGraph.getElementsByTagName('div');
+ if (pl.config.useWaveformData) {
+ // raw waveform
+ var scale = 8; // Y axis (+/- this distance from 0)
+ for (var i=255; i--;) {
+ sbC[255-i].style.marginTop = (1+scale+Math.ceil(this.waveformData.left[i]*-scale))+'px';
+ }
+ } else {
+ // eq spectrum
+ var offset = 9;
+ for (var i=255; i--;) {
+ sbC[255-i].style.marginTop = ((offset*2)-1+Math.ceil(this.eqData[i]*-offset))+'px';
+ }
+ }
+ }
+
+ this.resetGraph = function() {
+ if (!pl.config.useEQData || pl.config.flashVersion<9) return false;
+ var sbC = this._data.oGraph.getElementsByTagName('div');
+ var scale = (!pl.config.useEQData?'9px':'17px');
+ var nHeight = (!pl.config.fillGraph?'1px':'32px');
+ for (var i=255; i--;) {
+ sbC[255-i].style.marginTop = scale; // EQ scale
+ sbC[255-i].style.height = nHeight;
+ }
+ }
+
+ this.refreshMetadata = function(oSound) {
+ // Display info as appropriate
+ var index = null;
+ var now = oSound.position;
+ var metadata = oSound._data.metadata.data;
+ for (var i=0, j=metadata.length; i<j; i++) {
+ if (now >= metadata[i].startTimeMS && now <= metadata[i].endTimeMS) {
+ index = i;
+ break;
+ }
+ }
+ if (index != metadata.currentItem) {
+ // update
+ oSound._data.oLink.innerHTML = metadata.mainTitle+' <span class="metadata"><span class="sm2_divider"> | </span><span class="sm2_metadata">'+metadata[index].title+'</span></span>';
+ self.setPageTitle(metadata[index].title+' | '+metadata.mainTitle);
+ metadata.currentItem = index;
+ }
+ }
+
+ this.updateTime = function() {
+ var str = self.strings['timing'].replace('%s1',self.getTime(this.position,true));
+ str = str.replace('%s2',self.getTime(self.getDurationEstimate(this),true));
+ this._data.oTiming.innerHTML = str;
+ }
+
+ this.getTheDamnTarget = function(e) {
+ return (e.target||(window.event?window.event.srcElement:null));
+ }
+
+ this.withinStatusBar = function(o) {
+ return (self.isChildOfClass(o,'controls'));
+ }
+
+ this.handleClick = function(e) {
+ // a sound (or something) was clicked - determine what and handle appropriately
+ if (e.button == 2) {
+ if (!pl.config.allowRightClick) {
+ pl.stopEvent(e);
+ }
+ return pl.config.allowRightClick; // ignore right-clicks
+ }
+ var o = self.getTheDamnTarget(e);
+ if (!o) {
+ return true;
+ }
+ if (self.dragActive) self.stopDrag(); // to be safe
+ if (self.withinStatusBar(o)) {
+ // self.handleStatusClick(e);
+ return false;
+ }
+ if (o.nodeName.toLowerCase() != 'a') {
+ o = self.getParentByNodeName(o,'a');
+ }
+ if (!o) {
+ // not a link
+ return true;
+ }
+ var sURL = o.getAttribute('href');
+ if (!o.href || (!sm.canPlayLink(o) && !self.hasClass(o,'playable')) || self.hasClass(o,'exclude')) {
+ // do nothing, don't return anything.
+ } else {
+ // we have something we're interested in.
+ var soundURL = o.href;
+ var thisSound = self.getSoundByObject(o);
+ if (thisSound) {
+ // sound already exists
+ self.setPageTitle(thisSound._data.originalTitle);
+ if (thisSound == self.lastSound) {
+ // ..and was playing (or paused) and isn't in an error state
+ if (thisSound.readyState != 2) {
+ if (thisSound.playState != 1) {
+ // not yet playing
+ thisSound.play();
+ } else {
+ thisSound.togglePause();
+ }
+ } else {
+ sm._writeDebug('Warning: sound failed to load (security restrictions, 404 or bad format)',2);
+ }
+ } else {
+ // ..different sound
+ if (self.lastSound) self.stopSound(self.lastSound);
+ thisSound._data.oTimingBox.appendChild(document.getElementById('spectrum-container'));
+ thisSound.togglePause(); // start playing current
+ }
+ } else {
+ // create sound
+ thisSound = sm.createSound({
+ id:'pagePlayerMP3Sound'+(self.soundCount++),
+ url:decodeURI(soundURL),
+ onplay:self.events.play,
+ onstop:self.events.stop,
+ onpause:self.events.pause,
+ onresume:self.events.resume,
+ onfinish:self.events.finish,
+ whileloading:self.events.whileloading,
+ whileplaying:self.events.whileplaying,
+ onmetadata:self.events.metadata,
+ onload:self.events.onload
+ });
+ // append control template
+ var oControls = self.oControls.cloneNode(true);
+ o.parentNode.appendChild(oControls);
+ o.parentNode.appendChild(document.getElementById('spectrum-container'));
+ self.soundsByObject[o.rel] = thisSound;
+ // tack on some custom data
+ thisSound._data = {
+ oLink: o, // DOM reference within SM2 object event handlers
+ oLI: o.parentNode,
+ oControls: self.getElementsByClassName('controls','div',o.parentNode)[0],
+ oStatus: self.getElementsByClassName('statusbar','div',o.parentNode)[0],
+ oLoading: self.getElementsByClassName('loading','div',o.parentNode)[0],
+ oPosition: self.getElementsByClassName('position','div',o.parentNode)[0],
+ oTimingBox: self.getElementsByClassName('timing','div',o.parentNode)[0],
+ oTiming: self.getElementsByClassName('timing','div',o.parentNode)[0].getElementsByTagName('div')[0],
+ oPeak: self.getElementsByClassName('peak','div',o.parentNode)[0],
+ oGraph: self.getElementsByClassName('spectrum-box','div',o.parentNode)[0],
+ nIndex: self.getSoundIndex(o),
+ className: self.css.sPlaying,
+ originalTitle: o.innerHTML,
+ metadata: null
+ };
+ thisSound._data.oTimingBox.appendChild(document.getElementById('spectrum-container'));
+ // "Metadata"
+ if (thisSound._data.oLI.getElementsByTagName('ul').length) {
+ thisSound._data.metadata = new Metadata(thisSound);
+ }
+ // set initial timer stuff (before loading)
+ var str = self.strings['timing'].replace('%s1',self.config.emptyTime);
+ str = str.replace('%s2',self.config.emptyTime);
+ thisSound._data.oTiming.innerHTML = str;
+ self.sounds.push(thisSound);
+ if (self.lastSound) self.stopSound(self.lastSound);
+ self.resetGraph.apply(thisSound);
+ thisSound.play();
+ }
+ self.lastSound = thisSound; // reference for next call
+ return self.stopEvent(e);
+ }
+ }
+
+ this.handleMouseDown = function(e) {
+ // a sound link was clicked
+ if (isTouchDevice && e.touches) {
+ e = e.touches[0];
+ }
+ if (e.button == 2) {
+ if (!pl.config.allowRightClick) pl.stopEvent(e);
+ return (pl.config.allowRightClick); // ignore right-clicks
+ }
+ var o = self.getTheDamnTarget(e);
+ if (!o) {
+ return true;
+ }
+ if (!self.withinStatusBar(o)) return true;
+ self.dragActive = true;
+ self.lastSound.pause();
+ self.setPosition(e);
+ if (!isTouchDevice) {
+ self.addEventHandler(document,'mousemove',self.handleMouseMove);
+ } else {
+ self.addEventHandler(document,'touchmove',self.handleMouseMove);
+ }
+ self.addClass(self.lastSound._data.oControls,'dragging');
+ self.stopEvent(e);
+ return false;
+ }
+
+ this.handleMouseMove = function(e) {
+ if (isTouchDevice && e.touches) {
+ e = e.touches[0];
+ }
+ // set position accordingly
+ if (self.dragActive) {
+ if (self.config.useThrottling) {
+ // be nice to CPU/externalInterface
+ var d = new Date();
+ if (d-self.dragExec>20) {
+ self.setPosition(e);
+ } else {
+ window.clearTimeout(self.dragTimer);
+ self.dragTimer = window.setTimeout(function(){self.setPosition(e)},20);
+ }
+ self.dragExec = d;
+ } else {
+ // oh the hell with it
+ self.setPosition(e);
+ }
+ } else {
+ self.stopDrag();
+ }
+ e.stopPropagation = true;
+ return false;
+ }
+
+ this.stopDrag = function(e) {
+ if (self.dragActive) {
+ self.removeClass(self.lastSound._data.oControls,'dragging');
+ if (!isTouchDevice) {
+ self.removeEventHandler(document,'mousemove',self.handleMouseMove);
+ } else {
+ self.removeEventHandler(document,'touchmove',self.handleMouseMove);
+ }
+ // self.removeEventHandler(document,'mouseup',self.stopDrag);
+ if (!pl.hasClass(self.lastSound._data.oLI,self.css.sPaused)) {
+ self.lastSound.resume();
+ }
+ self.dragActive = false;
+ self.stopEvent(e);
+ return false;
+ }
+ }
+
+ this.handleStatusClick = function(e) {
+ self.setPosition(e);
+ if (!pl.hasClass(self.lastSound._data.oLI,self.css.sPaused)) self.resume();
+ return self.stopEvent(e);
+ }
+
+ this.stopEvent = function(e) {
+ if (typeof e != 'undefined') {
+ if (typeof e.preventDefault != 'undefined') {
+ e.preventDefault();
+ } else if (typeof e.returnValue != 'undefined' || typeof event != 'undefined') {
+ (e||event).cancelBubble = true;
+ (e||event).returnValue = false;
+ }
+ }
+ return false;
+ }
+
+ this.setPosition = function(e) {
+ // called from slider control
+ var oThis = self.getTheDamnTarget(e);
+ if (!oThis) {
+ return true;
+ }
+ var oControl = oThis;
+ while (!self.hasClass(oControl,'controls') && oControl.parentNode) {
+ oControl = oControl.parentNode;
+ }
+ var oSound = self.lastSound;
+ var x = parseInt(e.clientX);
+ // play sound at this position
+ var nMsecOffset = Math.floor((x-self.getOffX(oControl)-4)/(oControl.offsetWidth)*self.getDurationEstimate(oSound));
+ if (!isNaN(nMsecOffset)) nMsecOffset = Math.min(nMsecOffset,oSound.duration);
+ if (!isNaN(nMsecOffset)) oSound.setPosition(nMsecOffset);
+ }
+
+ this.stopSound = function(oSound) {
+ sm._writeDebug('stopping sound: '+oSound.sID);
+ sm.stop(oSound.sID);
+ sm.unload(oSound.sID);
+ }
+
+ this.getDurationEstimate = function(oSound) {
+ if (oSound.instanceOptions.isMovieStar) {
+ return (oSound.duration);
+ } else {
+ return (!oSound._data.metadata || !oSound._data.metadata.data.givenDuration?(oSound.durationEstimate||0):oSound._data.metadata.data.givenDuration);
+ }
+ }
+
+ this.createVUData = function() {
+ var i=0;
+ var j=0;
+ var canvas = vuDataCanvas.getContext('2d');
+ var vuGrad = canvas.createLinearGradient(0, 16, 0, 0);
+ vuGrad.addColorStop(0,'rgb(0,192,0)');
+ vuGrad.addColorStop(0.30,'rgb(0,255,0)');
+ vuGrad.addColorStop(0.625,'rgb(255,255,0)');
+ vuGrad.addColorStop(0.85,'rgb(255,0,0)');
+ var bgGrad = canvas.createLinearGradient(0, 16, 0, 0);
+ var outline = 'rgba(0,0,0,0.2)';
+ bgGrad.addColorStop(0,outline);
+ bgGrad.addColorStop(1,'rgba(0,0,0,0.5)');
+ for (i=0; i<16; i++) {
+ self.vuMeterData[i] = [];
+ }
+ for (var i=0; i<16; i++) {
+ for (j=0; j<16; j++) {
+ // reset/erase canvas
+ vuDataCanvas.setAttribute('width',16);
+ vuDataCanvas.setAttribute('height',16);
+ // draw new stuffs
+ canvas.fillStyle = bgGrad;
+ canvas.fillRect(0,0,7,15);
+ canvas.fillRect(8,0,7,15);
+ /*
+ // shadow
+ canvas.fillStyle = 'rgba(0,0,0,0.1)';
+ canvas.fillRect(1,15-i,7,17-(17-i));
+ canvas.fillRect(9,15-j,7,17-(17-j));
+ */
+ canvas.fillStyle = vuGrad;
+ canvas.fillRect(0,15-i,7,16-(16-i));
+ canvas.fillRect(8,15-j,7,16-(16-j));
+ // and now, clear out some bits.
+ canvas.clearRect(0,3,16,1);
+ canvas.clearRect(0,7,16,1);
+ canvas.clearRect(0,11,16,1);
+ self.vuMeterData[i][j] = vuDataCanvas.toDataURL('image/png');
+ // for debugging VU images
+ /*
+ var o = document.createElement('img');
+ o.style.marginRight = '5px';
+ o.src = self.vuMeterData[i][j];
+ document.documentElement.appendChild(o);
+ */
+ }
+ }
+ };
+
+ var vuDataCanvas = null;
+
+ this.testCanvas = function() {
+ // canvas + toDataURL();
+ var c = document.createElement('canvas');
+ var ctx = null;
+ if (!c || typeof c.getContext == 'undefined') {
+ return null;
+ }
+ ctx = c.getContext('2d');
+ if (!ctx || typeof c.toDataURL != 'function') {
+ return null;
+ }
+ // just in case..
+ try {
+ var ok = c.toDataURL('image/png');
+ } catch(e) {
+ // no canvas or no toDataURL()
+ return null;
+ }
+ // assume we're all good.
+ return c;
+ }
+
+ if (this.config.useFavIcon) {
+ vuDataCanvas = self.testCanvas();
+ if (vuDataCanvas && (isFirefox || isOpera)) {
+ // these browsers support dynamically-updating the favicon
+ self.createVUData();
+ } else {
+ // browser doesn't support doing this
+ this.config.useFavIcon = false;
+ }
+ }
+
+ this.init = function() {
+ sm._writeDebug('pagePlayer.init()');
+ var oLinks = document.getElementsByTagName('a');
+ // grab all links, look for .mp3
+ var foundItems = 0;
+ for (var i=0; i<oLinks.length; i++) {
+ if ((sm.canPlayLink(oLinks[i]) || self.hasClass(oLinks[i],'playable')) && !self.hasClass(oLinks[i],'exclude')) {
+ oLinks[i].rel = 'pagePlayerMP3Sound'+i;
+ self.links[self.links.length] = oLinks[i];
+ self.addClass(oLinks[i],self.css.sDefault); // add default CSS decoration
+ foundItems++;
+ }
+ }
+ if (foundItems>0) {
+ var oTiming = document.getElementById('sm2_timing');
+ self.strings['timing'] = oTiming.innerHTML;
+ oTiming.innerHTML = '';
+ oTiming.id = '';
+ self.addEventHandler(document,'click',self.handleClick);
+ if (!isTouchDevice) {
+ self.addEventHandler(document,'mousedown',self.handleMouseDown);
+ self.addEventHandler(document,'mouseup',self.stopDrag);
+ } else {
+ self.addEventHandler(document,'touchstart',self.handleMouseDown);
+ self.addEventHandler(document,'touchend',self.stopDrag);
+ }
+ // self.addEventHandler(window,'unload',function(){}); // force page reload when returning here via back button (Opera tries to remember old state, etc.)
+ }
+ sm._writeDebug('pagePlayer.init(): Found '+foundItems+' relevant items.');
+ if (self.config.autoStart) {
+ pl.handleClick({target:pl.links[0]});
+ }
+ }
+
+var Metadata = function(oSound) {
+ var self = this;
+ var oLI = oSound._data.oLI;
+ var o = oLI.getElementsByTagName('ul')[0];
+ var oItems = o.getElementsByTagName('li');
+ var oTemplate = document.createElement('div');
+ oTemplate.innerHTML = '<span> </span>';
+ oTemplate.className = 'annotation';
+ var oTemplate2 = document.createElement('div');
+ oTemplate2.innerHTML = '<span> </span>';
+ oTemplate2.className = 'annotation alt';
+
+ var oTemplate3 = document.createElement('div');
+ oTemplate3.className = 'note';
+
+ this.totalTime = 0;
+ this.strToTime = function(sTime) {
+ var segments = sTime.split(':');
+ var seconds = 0;
+ for (var i=segments.length; i--;) {
+ seconds += parseInt(segments[i])*Math.pow(60,segments.length-1-i,10); // hours, minutes
+ }
+ return seconds;
+ }
+ this.data = [];
+ this.data.givenDuration = null;
+ this.data.currentItem = null;
+ this.data.mainTitle = oSound._data.oLink.innerHTML;
+ for (var i=0; i<oItems.length; i++) {
+ this.data[i] = {
+ o: null,
+ title: oItems[i].getElementsByTagName('p')[0].innerHTML,
+ startTime: oItems[i].getElementsByTagName('span')[0].innerHTML,
+ startSeconds: self.strToTime(oItems[i].getElementsByTagName('span')[0].innerHTML.replace(/[()]/g,'')),
+ duration: 0,
+ durationMS: null,
+ startTimeMS: null,
+ endTimeMS: null,
+ oNote: null
+ }
+ }
+ var oDuration = pl.getElementsByClassName('duration','div',oLI);
+ this.data.givenDuration = (oDuration.length?self.strToTime(oDuration[0].innerHTML)*1000:0);
+ for (i=0; i<this.data.length; i++) {
+ this.data[i].duration = parseInt(this.data[i+1]?this.data[i+1].startSeconds:(self.data.givenDuration?self.data.givenDuration:oSound.durationEstimate)/1000)-this.data[i].startSeconds;
+ this.data[i].startTimeMS = this.data[i].startSeconds*1000;
+ this.data[i].durationMS = this.data[i].duration*1000;
+ this.data[i].endTimeMS = this.data[i].startTimeMS+this.data[i].durationMS;
+ this.totalTime += this.data[i].duration;
+ }
+ // make stuff
+ this.createElements = function() {
+ var oFrag = document.createDocumentFragment();
+ var oNode = null;
+ var oNodeSpan = null;
+ var oNode2 = null;
+ for (var i=0; i<self.data.length; i++) {
+ oNode = (i%2==0?oTemplate:oTemplate2).cloneNode(true);
+ oNodeSpan = oNode.getElementsByTagName('span')[0];
+ oNode.rel = i;
+ self.data[i].o = oNode;
+ oNode2 = oTemplate3.cloneNode(true);
+ if (i%2==0) oNode2.className = 'note alt';
+ oNode2.innerHTML = this.data[i].title;
+ // evil old-skool event handlers, css:hover-only ideally would be nice excluding IE 6
+ oNode.onmouseover = self.mouseover;
+ oNode.onmouseout = self.mouseout;
+ this.data[i].oNote = oNode2;
+ oSound._data.oControls.appendChild(oNode2);
+ oFrag.appendChild(oNode);
+ }
+ self.refresh();
+ oSound._data.oStatus.appendChild(oFrag);
+ }
+
+ this.refresh = function() {
+ var offset = 0;
+ var relWidth = null;
+ var duration = (self.data.givenDuration?self.data.givenDuration:oSound.durationEstimate);
+ for (var i=0; i<self.data.length; i++) {
+ if (duration) {
+ relWidth = (((self.data[i].duration*1000)/duration)*100);
+ self.data[i].o.style.left = (offset?offset+'%':'-2px');
+ self.data[i].oNote.style.left = (offset?offset+'%':'0px');
+ offset += relWidth;
+ }
+ }
+ }
+
+ this.mouseover = function(e) {
+ self.data[this.rel].oNote.style.visibility = 'hidden';
+ self.data[this.rel].oNote.style.display = 'inline-block';
+ self.data[this.rel].oNote.style.marginLeft = -parseInt(self.data[this.rel].oNote.offsetWidth/2)+'px';
+ self.data[this.rel].oNote.style.visibility = 'visible';
+ }
+
+ this.mouseout = function() {
+ self.data[this.rel].oNote.style.display = 'none';
+ }
+
+ // ----
+
+ this.createElements();
+ this.refresh();
+
+} // MetaData();
+
+ this.initDOM = function() {
+ // set up graph box stuffs
+ var sb = self.getElementsByClassName('spectrum-box','div',document.documentElement)[0];
+ if (sm.flashVersion >= 9) {
+ var lists = self.getElementsByClassName('playlist','ul',document.documentElement);
+ for (var i=lists.length; i--;) {
+ self.addClass(lists[i],self.cssBase);
+ }
+ var sbC = sb.getElementsByTagName('div')[0];
+ var oF = document.createDocumentFragment();
+ var oClone = null;
+ for (i=256; i--;) {
+ oClone = sbC.cloneNode(false);
+ oClone.style.left = (i)+'px';
+ oF.appendChild(oClone);
+ }
+ sb.removeChild(sbC);
+ sb.appendChild(oF);
+ }
+ this.oControls = document.getElementById('control-template').cloneNode(true);
+ this.oControls.id = '';
+ this.init();
+ }
+
+}
+
+var pagePlayer = new PagePlayer(typeof PP_CONFIG != 'undefined'?PP_CONFIG:null);
+
+soundManager.onready(function() {
+ if (soundManager.supported()) {
+ // soundManager.createSound() etc. may now be called
+ pagePlayer.initDOM();
+ }
+});
\ No newline at end of file diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/play-mp3-links/basic.html b/docs/dymaxion/soundmanagerv297a-20101010/demo/play-mp3-links/basic.html new file mode 100755 index 0000000..2e0e623 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/play-mp3-links/basic.html @@ -0,0 +1,60 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+<title>SoundManager 2 Demo: Play MP3 Links on a page</title>
+<style type="text/css">
+
+/*
+
+ -------------------------------------------------------------
+
+ In-page demo CSS - see external CSS for actual relevant stuff.
+
+ --------------------------------------------------------------
+
+ */
+
+#soundmanager-debug {
+ /* SM2 debug container (optional, makes debug more useable) */
+ position:absolute;position:fixed;*position:absolute;bottom:10px;right:10px;width:50em;height:18em;overflow:auto;background:#fff;margin:1em;padding:1em;border:1px solid #999;font-family:"lucida console",verdana,tahoma,"sans serif";font-size:x-small;line-height:1.5em;opacity:0.9;filter:alpha(opacity=90);
+}
+
+body {
+ font:75% normal verdana,arial,tahoma,"sans serif";
+}
+
+</style>
+<link rel="stylesheet" type="text/css" href="css/inlineplayer.css" />
+<link rel="stylesheet" type="text/css" href="../flashblock/flashblock.css" />
+<script type="text/javascript" src="../../script/soundmanager2.js"></script>
+<script type="text/javascript" src="script/inlineplayer.js"></script>
+</head>
+
+<body>
+
+ <h1><a href="http://www.schillmania.com/projects/soundmanager2/" title="Play a page of mp3s with javascript via SoundManager 2">SoundManager 2</a> / page as a playlist, basic template</h1>
+
+ <p>Don't forget to set debugMode = false within <em>inlineplayer.js</em> to disable debug output.</p>
+
+ <div id="sm2-container">
+ <!-- SM2 flash goes here -->
+ </div>
+
+ <ul class="graphic">
+
+ <li><a href="../jsAMP-preview/audio/rain.mp3">Rain</a></li>
+ <li><a href="../jsAMP-preview/audio/walking.mp3">Walking</a></li>
+ <li><a href="http://www.freshly-ground.com/misc/music/carl-3-barlp.mp3">Barrlping with Carl (featureblend.com)</a></li>
+ <li><a href="http://www.freshly-ground.com/data/audio/binaural/Mak.mp3">Angry cow sound?</a></li>
+ <li><a href="http://www.freshly-ground.com/data/audio/binaural/Things that open, close and roll.mp3">Things that open, close and roll</a></li>
+ <li><a href="http://www.freshly-ground.com/misc/music/20060826%20-%20Armstrong.mp3">20060826 - Armstrong</a></li>
+ <li><a href="http://freshly-ground.com/data/video/Rain%20on%20Car%20Roof.aac">Rain On Car Roof (AAC Audio)</a></li>
+ </ul>
+
+ <p><a href="http://www.schillmania.com/projects/soundmanager2/" title="SoundManager 2 project page">SoundManager 2 project home</a></p>
+
+</div>
+
+</body>
+</html>
diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/play-mp3-links/css/inlineplayer.css b/docs/dymaxion/soundmanagerv297a-20101010/demo/play-mp3-links/css/inlineplayer.css new file mode 100755 index 0000000..1fa31c7 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/play-mp3-links/css/inlineplayer.css @@ -0,0 +1,212 @@ +/*
+
+ SoundManager 2: In-page MP3 player example
+ ------------------------------------------
+
+ Clicks on links to MP3s are intercepted via JS, calls are
+ made to SoundManager to load/play sounds. CSS classes are
+ appended to the link, which are used to highlight the
+ current play state and so on.
+
+ Class names are applied in addition to "sm2_link" base.
+
+ Default:
+
+ sm2_link
+
+ Additional states:
+
+ sm2_playing
+ sm2_paused
+
+ eg.
+
+ <!-- default -->
+ <a href="some.mp3" class="sm2_link">some.mp3</a>
+
+ <!-- playing -->
+ <a href="some.mp3" class="sm2_link sm2_playing">some.mp3</a>
+
+
+ Note you don't require ul.graphic / ul.flat etc. for your use
+ if only using one style on a page. You can just use .sm2_link{}
+ and so on, but isolate the CSS you want.
+
+ Side note: Would do multiple class definitions eg.
+
+ a.sm2_default.sm2_playing{}
+
+ .. except IE 6 has a parsing bug which may break behaviour,
+ applying sm2_playing {} even when the class is set to sm2_default.
+
+
+ If you want to make your own UI from scratch, here is the base:
+
+ Default + hover state, "click to play":
+
+ a.sm2_link {}
+ a.sm2_link:hover {}
+
+ Playing + hover state, "click to pause":
+
+ a.sm2_playing {}
+ a.sm2_playing:hover {}
+
+ Paused + hover state, "click to resume":
+
+ a.sm2_paused {}
+ a.sm2_paused:hover {}
+
+
+*/
+
+/* two different list types */
+
+ul.flat {
+ list-style-type:none;
+ padding-left:0px;
+}
+
+ul.flat li,
+ul.graphic li {
+ padding-bottom:1px;
+}
+
+ul.flat li a {
+ display:inline-block;
+ padding:2px 4px 2px 4px;
+}
+
+ul.graphic {
+ list-style-type:none;
+ padding-left:0px;
+ margin-left:0px;
+}
+
+/* background-image-based CSS3 example */
+
+ul.graphic {
+ list-style-type:none;
+ margin:0px;
+ padding:0px;
+}
+
+ul.graphic li {
+ margin-bottom:2px;
+}
+
+ul.graphic li a,
+ul.graphic li a.sm2_link {
+ /* assume all items will be sounds rather than wait for onload etc. in this example.. may differ for your uses. */
+ display:inline-block;
+ padding-left:22px;
+ min-height:16px;
+ vertical-align: middle;
+ background-color:#778899;
+ -moz-border-radius:3px;
+ -webkit-border-radius:3px;
+ border-radius:3px;
+ padding:3px 3px 3px 25px;
+ min-width:19em;
+ _width:19em; /* IE 6 */
+ text-decoration:none;
+ font-weight:normal;
+ color:#f6f9ff;
+}
+
+ul.graphic li a.sm2_link {
+ /* safari 3.1+ fun (or, proprietary crap. TBD.) */
+ -webkit-transition-property: hover;
+ -webkit-transition: background-color 0.15s linear;
+ -moz-transition: background-color 0.15s linear 0s; /* firefox 4 */
+ -o-transition-property: background-color; /* opera 10.5 */
+ -o-transition-duration: 0.15s;
+}
+
+ul.graphic li a, /* use a.sm2_link {} if you want play icons showing only if SM2 is supported */
+ul.graphic li a.sm2_paused:hover,
+ul.graphic li a.sm2_link:hover {
+ background-image:url(../image/icon_play.png);
+ background-position:3px 50%;
+ background-repeat:no-repeat;
+ _background-image:url(../image/icon_play.gif); /* IE 6 */
+}
+
+ul.graphic li a.sm2_link:hover {
+ /* default hover color, if you'd like.. */
+ background-color:#445566;
+ color:#fff;
+}
+
+ul.graphic li a.sm2_paused {
+ background-color:#ccc;
+}
+
+ul.graphic li a.sm2_paused:hover {
+ background:#999 url(../image/icon_play.png) no-repeat 3px 50%;
+ _background-image:url(../image/icon_play.gif);
+}
+
+ul.graphic li a.sm2_playing,
+ul.graphic li a.sm2_playing:hover {
+ background:#334455 url(../image/icon_pause.png) no-repeat 3px 50%;
+ _background-image:url(../image/icon_pause.gif);
+ text-decoration:none;
+}
+
+/* hide button while playing?
+ul.graphic li a.sm2_playing {
+ background-image:none;
+}
+*/
+
+body #sm2-container object,
+body #sm2-container embed {
+ /*
+ flashblock handling: hide SWF off-screen by default (until blocked timeout case.)
+ include body prefix to ensure override of flashblock.css.
+ */
+
+ left:-9999em;
+ top:-9999em;
+}
+
+/* flat CSS example */
+
+ul.flat a.sm2_link {
+ /* default state: "a playable link" */
+ border-left:6px solid #999;
+ padding-left:4px;
+ padding-right:4px;
+}
+
+ul.flat a.sm2_link:hover {
+ /* default (inactive) hover state */
+ border-left-color:#333;
+}
+
+
+ul.flat a.sm2_playing {
+ /* "now playing" */
+ border-left-color:#6666ff;
+ background-color:#000;
+ color:#fff;
+ text-decoration:none;
+}
+
+ul.flat a.sm2_playing:hover {
+ /* "clicking will now pause" */
+ border-left-color:#cc3333;
+}
+
+ul.flat a.sm2_paused {
+ /* "paused state" */
+ background-color:#666;
+ color:#fff;
+ text-decoration:none;
+}
+
+ul.flat a.sm2_paused:hover {
+ /* "clicking will resume" */
+ border-left-color:#33cc33;
+}
\ No newline at end of file diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/play-mp3-links/image/icon_pause.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/play-mp3-links/image/icon_pause.gif Binary files differnew file mode 100755 index 0000000..7f3443d --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/play-mp3-links/image/icon_pause.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/play-mp3-links/image/icon_pause.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/play-mp3-links/image/icon_pause.png Binary files differnew file mode 100755 index 0000000..5775ce2 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/play-mp3-links/image/icon_pause.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/play-mp3-links/image/icon_play.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/play-mp3-links/image/icon_play.gif Binary files differnew file mode 100755 index 0000000..3954336 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/play-mp3-links/image/icon_play.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/play-mp3-links/image/icon_play.png b/docs/dymaxion/soundmanagerv297a-20101010/demo/play-mp3-links/image/icon_play.png Binary files differnew file mode 100755 index 0000000..303fc4b --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/play-mp3-links/image/icon_play.png diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/play-mp3-links/image/test.gif b/docs/dymaxion/soundmanagerv297a-20101010/demo/play-mp3-links/image/test.gif Binary files differnew file mode 100755 index 0000000..075c135 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/play-mp3-links/image/test.gif diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/play-mp3-links/index.html b/docs/dymaxion/soundmanagerv297a-20101010/demo/play-mp3-links/index.html new file mode 100755 index 0000000..040966a --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/play-mp3-links/index.html @@ -0,0 +1,228 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+<title>SoundManager 2 Demo: Play MP3 Links on a page</title> +<meta name="robots" content="noindex" />
+<style type="text/css">
+
+/*
+
+ -------------------------------------------------------------
+
+ In-page demo CSS - see external CSS for actual relevant stuff.
+
+ --------------------------------------------------------------
+
+ */
+
+#soundmanager-debug {
+ /* SM2 debug container (optional, makes debug more useable) */
+ position:absolute;position:fixed;*position:absolute;bottom:10px;right:10px;width:50em;height:18em;overflow:auto;background:#fff;margin:1em;padding:1em;border:1px solid #999;font-family:"lucida console",verdana,tahoma,"sans serif";font-size:x-small;line-height:1.5em;opacity:0.9;filter:alpha(opacity=90);
+}
+
+body {
+ font:75% normal verdana,arial,tahoma,"sans serif";
+}
+
+h1, h2, h3 {
+ font:2.5em arial,tahoma,verdana;
+ font-weight:normal;
+ margin-bottom:0px;
+}
+
+h1, h2 {
+ letter-spacing:-1px; /* zomg web x.0! ;) */
+ margin-top:0.5em;
+}
+
+h2, h3 {
+ color:#333;
+}
+
+h2 {
+ font-size:2em;
+}
+
+h3 {
+ font-size:1.5em;
+}
+
+h1 a,
+h1 a:hover {
+ color:#000;
+ text-decoration:none;
+}
+
+h1 a:hover {
+ text-decoration:underline;
+}
+
+ul.notes {
+ margin-left:0px;
+ padding-left:1.5em;
+}
+
+.note {
+ margin-top:0px;
+ font-style:italic;
+ color:#999;
+}
+
+pre {
+ font-size:1.2em;
+ _font-size:1em;
+}
+
+#left {
+ max-width:56em;
+}
+
+code {
+ font-size:120%;
+ line-height:1.5em;
+ color:#006600;
+ font-weight:bold;
+}
+
+p {
+ line-height:1.75em;
+}
+
+</style>
+<link rel="stylesheet" type="text/css" href="css/inlineplayer.css" />
+<link rel="stylesheet" type="text/css" href="../flashblock/flashblock.css" />
+<script type="text/javascript" src="../../script/soundmanager2.js"></script>
+<script type="text/javascript" src="script/inlineplayer.js"></script>
+</head>
+
+<body>
+
+<div id="left">
+
+ <h1><a href="http://www.schillmania.com/projects/soundmanager2/" title="Play MP3s inline with javascript using SoundManager 2">SoundManager 2</a> / Make MP3 links play in-place</h1>
+
+ <h2>Inline MP3 Player Example: Fancy* CSS 3 version</h2>
+ <p class="note">*CSS 3 border-radius supported only by Firefox 2.x+, Safari (2.x?) - sadly, not IE 8.</p>
+
+ <div id="sm2-container">
+ <!-- SM2 flash goes here -->
+ </div>
+
+ <ul class="graphic">
+
+ <li><a href="../jsAMP-preview/audio/rain.mp3">Rain</a></li>
+ <li><a href="../jsAMP-preview/audio/walking.mp3">Walking</a></li>
+ <!-- files from the web (note that ID3 information will *not* load from remote domains without permission, Flash restriction) -->
+ <li><a href="http://www.freshly-ground.com/misc/music/carl-3-barlp.mp3">Barrlping with Carl (featureblend.com)</a></li>
+ <li><a href="http://www.freshly-ground.com/data/audio/binaural/Mak.mp3">Angry cow sound?</a></li>
+ <li><a href="http://www.freshly-ground.com/data/audio/binaural/Things that open, close and roll.mp3">Things that open, close and roll</a></li>
+ <li><a href="http://www.freshly-ground.com/misc/music/20060826%20-%20Armstrong.mp3">20060826 - Armstrong</a></li>
+ <li><a href="http://freshly-ground.com/data/video/Rain%20on%20Car%20Roof.aac">Rain On Car Roof (AAC Audio)</a></li>
+ </ul>
+
+ <h2>How It Works</h2>
+
+ <ul class="notes">
+ <li>Lightweight (single JS click event handler)</li>
+ <li>Uses existing SoundManager 2 API</li>
+ <li>CSS for UI, easy to modify to taste</li>
+ </ul>
+
+ <p>This example uses <a href="http://www.schillmania.com/projects/soundmanager2/" title="SoundManager 2 Javascript Sound API">SoundManager 2</a> to find links to MP3 files, and makes them playable "in-place" on a page. The script assigns CSS classes to links to indicate their state (playing/paused, etc.)</p>
+ <p>Links pointing to MP3s are assigned an onclick handler which intercepts the click (preventing the browser from following the link and unloading the page. SM2 will then create sound objects as needed to play the MP3s.</p>
+
+ <h3>Static Examples</h3>
+ <p style="margin-top:0px">CSS classes are dynamically applied as follows:</p>
+ <ul class="graphic">
+ <li><a href="#" class="sm2_link" title="'Click to play' state">Default: class="sm2_link"</a></li>
+ <li><a href="#" class="sm2_link sm2_playing" title="'Click to pause' state">Playing: class="sm2_link sm2_playing"</a></li>
+ <li><a href="#" class="sm2_link sm2_paused" title="'Click to resume' state">Paused: class="sm2_link sm2_paused"</a></li>
+ </ul>
+ <p>:hover effects are also active.</p>
+
+ <h2>Flat (CSS-only) style</h2>
+
+ <ul class="flat">
+
+ <li><a href="../jsAMP-preview/audio/going_outside.mp3">Going Outside</a></li>
+ <li><a href="../jsAMP-preview/audio/office_lobby.mp3">Office Lobby Entrance</a></li>
+
+ <!-- files from the web (note that ID3 information will *not* load from remote domains without permission, Flash restriction) -->
+
+ <li><a href="http://www.freshly-ground.com/data/audio/binaural/Rain 3.mp3">Rain 3</a></li>
+ <li><a href="http://www.freshly-ground.com/data/audio/binaural/Frogs @ Yahoo!.mp3">Frogs @ Yahoo!</a></li>
+ <li><a href="http://www.freshly-ground.com/data/audio/binaural/Walking past sprinklers, mailbox.mp3">Walking past sprinklers, mailbox</a></li>
+ <li><a href="http://www.freshly-ground.com/data/audio/binaural/Cup of Coffee.mp3">Cup of Coffee</a></li>
+
+ </ul>
+
+ <h3>Static Examples</h3>
+
+ <ul class="flat">
+
+ <li><a href="#" class="sm2_link" title="'Click to play' state">Default: class="sm2_link"</a></li>
+ <li><a href="#" class="sm2_link sm2_playing" title="'Click to pause' state">Playing: class="sm2_link sm2_playing"</a></li>
+ <li><a href="#" class="sm2_link sm2_paused" title="'Click to resume' state">Paused: class="sm2_link sm2_paused"</a></li>
+
+ </ul>
+
+ <h3>Forcing play (or exclusion) of links</h3>
+
+ <p>If you have a link to a PHP file that serves MP3 files eg. /music.php?fileID=123, it won't be picked up by the script as containing a known, playable .mp3 extension. To tell the script it should be treated as playable, include a <code>type="audio/mpeg"</code> MIME type attribute, or CSS <code>class="inline-playable"</code> in the link. eg:</p>
+
+ <p>
+ <code><a href="/music.php?fileID=123" type="audio/mpeg">A song</a></code>
+ </p>
+
+ <p>Or via CSS class name:</p>
+ <code><a href="/music.php?fileID=123" class="inline-playable">A song</a></code>
+</p>
+
+ <p>
+ To exclude an .MP3 or otherwise-playable link from being handled by SM2, use <code>class="inline-exclude"</code> and it will be ignored.
+ </p>
+
+ <p>
+ <a href="http://www.schillmania.com/projects/soundmanager2/" title="SoundManager 2 home">SoundManager 2 project page</a> (not an MP3 link)
+ </p>
+
+ <h3>Basic CSS</h3>
+
+<pre>
+ If you want to make your own UI from scratch, here is the base:
+
+ Default + hover state, "click to play":
+
+ a.sm2_link {}
+ a.sm2_link:hover {}
+
+ Playing + hover state, "click to pause":
+
+ a.sm2_playing {}
+ a.sm2_playing:hover {}
+
+ Paused + hover state, "click to resume":
+
+ a.sm2_paused {}
+ a.sm2_paused:hover {}
+</pre>
+
+ <h3>Other Options</h3>
+
+ <p>By default, one sound will be played at a time; you can easily change a "config" object value to turn on playlist-like behaviour (i.e., play the next MP3 when the current one finishes.)</p>
+
+<pre>
+// (within inlineplayer.js)
+this.config = {
+ playNext: false // stop after one sound, or play through list until end
+}
+</pre>
+
+ <h3>I'd like to use this.</h3>
+ <p>See this <a href="basic.html" title="basic template: inline mp3 player">basic demo</a> for reference.</p>
+
+</div>
+
+</body>
+</html>
diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/play-mp3-links/script/inlineplayer.js b/docs/dymaxion/soundmanagerv297a-20101010/demo/play-mp3-links/script/inlineplayer.js new file mode 100755 index 0000000..2bd1a84 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/play-mp3-links/script/inlineplayer.js @@ -0,0 +1,246 @@ +/*
+
+ SoundManager 2 Demo: Play MP3 links "in-place"
+ ----------------------------------------------
+
+ http://schillmania.com/projects/soundmanager2/
+
+ A simple demo making MP3s playable "inline"
+ and easily styled/customizable via CSS.
+
+ Requires SoundManager 2 Javascript API.
+
+*/
+
+function InlinePlayer() {
+ var self = this;
+ var pl = this;
+ var sm = soundManager; // soundManager instance
+ this.playableClass = 'inline-playable'; // CSS class for forcing a link to be playable (eg. doesn't have .MP3 in it)
+ this.excludeClass = 'inline-exclude'; // CSS class for ignoring MP3 links
+ this.links = [];
+ this.sounds = [];
+ this.soundsByURL = [];
+ this.indexByURL = [];
+ this.lastSound = null;
+ this.soundCount = 0;
+ var isIE = (navigator.userAgent.match(/msie/i));
+
+ this.config = {
+ playNext: false, // stop after one sound, or play through list until end
+ autoPlay: false // start playing the first sound right away
+ }
+
+ this.css = {
+ // CSS class names appended to link during various states
+ sDefault: 'sm2_link', // default state
+ sLoading: 'sm2_loading',
+ sPlaying: 'sm2_playing',
+ sPaused: 'sm2_paused'
+ }
+
+ this.addEventHandler = function(o,evtName,evtHandler) {
+ typeof(attachEvent)=='undefined'?o.addEventListener(evtName,evtHandler,false):o.attachEvent('on'+evtName,evtHandler);
+ }
+
+ this.removeEventHandler = function(o,evtName,evtHandler) {
+ typeof(attachEvent)=='undefined'?o.removeEventListener(evtName,evtHandler,false):o.detachEvent('on'+evtName,evtHandler);
+ }
+
+ this.classContains = function(o,cStr) {
+ return (typeof(o.className)!='undefined'?o.className.match(new RegExp('(\\s|^)'+cStr+'(\\s|$)')):false);
+ }
+
+ this.addClass = function(o,cStr) {
+ if (!o || !cStr || self.classContains(o,cStr)) return false;
+ o.className = (o.className?o.className+' ':'')+cStr;
+ }
+
+ this.removeClass = function(o,cStr) {
+ if (!o || !cStr || !self.classContains(o,cStr)) return false;
+ o.className = o.className.replace(new RegExp('( '+cStr+')|('+cStr+')','g'),'');
+ }
+
+ this.getSoundByURL = function(sURL) {
+ return (typeof self.soundsByURL[sURL] != 'undefined'?self.soundsByURL[sURL]:null);
+ }
+
+ this.isChildOfNode = function(o,sNodeName) {
+ if (!o || !o.parentNode) {
+ return false;
+ }
+ sNodeName = sNodeName.toLowerCase();
+ do {
+ o = o.parentNode;
+ } while (o && o.parentNode && o.nodeName.toLowerCase() != sNodeName);
+ return (o.nodeName.toLowerCase() == sNodeName?o:null);
+ }
+
+ this.events = {
+
+ // handlers for sound events as they're started/stopped/played
+
+ play: function() {
+ pl.removeClass(this._data.oLink,this._data.className);
+ this._data.className = pl.css.sPlaying;
+ pl.addClass(this._data.oLink,this._data.className);
+ },
+
+ stop: function() {
+ pl.removeClass(this._data.oLink,this._data.className);
+ this._data.className = '';
+ },
+
+ pause: function() {
+ pl.removeClass(this._data.oLink,this._data.className);
+ this._data.className = pl.css.sPaused;
+ pl.addClass(this._data.oLink,this._data.className);
+ },
+
+ resume: function() {
+ pl.removeClass(this._data.oLink,this._data.className);
+ this._data.className = pl.css.sPlaying;
+ pl.addClass(this._data.oLink,this._data.className);
+ },
+
+ finish: function() {
+ pl.removeClass(this._data.oLink,this._data.className);
+ this._data.className = '';
+ if (pl.config.playNext) {
+ var nextLink = (pl.indexByURL[this._data.oLink.href]+1);
+ if (nextLink<pl.links.length) {
+ pl.handleClick({'target':pl.links[nextLink]});
+ }
+ }
+ }
+
+ }
+
+ this.stopEvent = function(e) {
+ if (typeof e != 'undefined' && typeof e.preventDefault != 'undefined') {
+ e.preventDefault();
+ } else if (typeof event != 'undefined' && typeof event.returnValue != 'undefined') {
+ event.returnValue = false;
+ }
+ return false;
+ }
+
+ this.getTheDamnLink = (isIE)?function(e) {
+ // I really didn't want to have to do this.
+ return (e && e.target?e.target:window.event.srcElement);
+ }:function(e) {
+ return e.target;
+ }
+
+ this.handleClick = function(e) {
+ // a sound link was clicked
+ if (typeof e.button != 'undefined' && e.button>1) {
+ // ignore right-click
+ return true;
+ }
+ var o = self.getTheDamnLink(e);
+ if (o.nodeName.toLowerCase() != 'a') {
+ o = self.isChildOfNode(o,'a');
+ if (!o) return true;
+ }
+ var sURL = o.getAttribute('href');
+ if (!o.href || (!sm.canPlayLink(o) && !self.classContains(o,self.playableClass)) || self.classContains(o,self.excludeClass)) {
+ return true; // pass-thru for non-MP3/non-links
+ }
+ var soundURL = (o.href);
+ var thisSound = self.getSoundByURL(soundURL);
+ if (thisSound) {
+ // already exists
+ if (thisSound == self.lastSound) {
+ // and was playing (or paused)
+ thisSound.togglePause();
+ } else {
+ // different sound
+ thisSound.togglePause(); // start playing current
+ sm._writeDebug('sound different than last sound: '+self.lastSound.sID);
+ if (self.lastSound) self.stopSound(self.lastSound);
+ }
+ } else {
+ // create sound
+ thisSound = sm.createSound({
+ id:'inlineMP3Sound'+(self.soundCount++),
+ url:soundURL,
+ onplay:self.events.play,
+ onstop:self.events.stop,
+ onpause:self.events.pause,
+ onresume:self.events.resume,
+ onfinish:self.events.finish
+ });
+ // tack on some custom data
+ thisSound._data = {
+ oLink: o, // DOM node for reference within SM2 object event handlers
+ className: self.css.sPlaying
+ };
+ self.soundsByURL[soundURL] = thisSound;
+ self.sounds.push(thisSound);
+ if (self.lastSound) self.stopSound(self.lastSound);
+ thisSound.play();
+ // stop last sound
+ }
+
+ self.lastSound = thisSound; // reference for next call
+
+ if (typeof e != 'undefined' && typeof e.preventDefault != 'undefined') {
+ e.preventDefault();
+ } else {
+ event.returnValue = false;
+ }
+ return false;
+ }
+
+ this.stopSound = function(oSound) {
+ soundManager.stop(oSound.sID);
+ soundManager.unload(oSound.sID);
+ }
+
+ this.init = function() {
+ sm._writeDebug('inlinePlayer.init()');
+ var oLinks = document.getElementsByTagName('a');
+ // grab all links, look for .mp3
+ var foundItems = 0;
+ for (var i=0, j=oLinks.length; i<j; i++) {
+ if ((sm.canPlayLink(oLinks[i]) || self.classContains(oLinks[i],self.playableClass)) && !self.classContains(oLinks[i],self.excludeClass)) {
+ self.addClass(oLinks[i],self.css.sDefault); // add default CSS decoration
+ self.links[foundItems] = (oLinks[i]);
+ self.indexByURL[oLinks[i].href] = foundItems; // hack for indexing
+ foundItems++;
+ }
+ }
+ if (foundItems>0) {
+ self.addEventHandler(document,'click',self.handleClick);
+ if (self.config.autoPlay) {
+ self.handleClick({target:self.links[0],preventDefault:function(){}});
+ }
+ }
+ sm._writeDebug('inlinePlayer.init(): Found '+foundItems+' relevant items.');
+ }
+
+ this.init();
+
+}
+
+var inlinePlayer = null;
+
+soundManager.debugMode = true; // disable or enable debug output
+soundManager.useFlashBlock = true;
+soundManager.url = '../../swf/'; // path to directory containing SM2 SWF
+
+// optional: enable MPEG-4/AAC support (requires flash 9)
+
+soundManager.flashVersion = 9;
+soundManager.useMovieStar = true;
+
+// ----
+
+soundManager.onready(function() {
+ if (soundManager.supported()) {
+ // soundManager.createSound() etc. may now be called
+ inlinePlayer = new InlinePlayer();
+ }
+});
+
diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/template/deferred-example.html b/docs/dymaxion/soundmanagerv297a-20101010/demo/template/deferred-example.html new file mode 100755 index 0000000..2f33a55 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/template/deferred-example.html @@ -0,0 +1,127 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+<title>SoundManager 2: Deferred loading / Lazy-loading / Dynamic script loading Example</title>
+<meta name="description" content="How to load soundmanager2.js on-the-fly using JavaScript, and start it dynamically after window.load() has already fired using beginDelayedInit()." />
+<style type="text/css">
+#soundmanager-debug {
+ /* SM2 debug container (optional, use or customize this as you like - makes in-browser debug output more useable) */
+ position:fixed;_position:absolute;right:1em;bottom:1em;width:50em;height:18em;overflow:auto;background:#fff;margin:1em;padding:1em;border:1px solid #999;font-family:monaco,"lucida console",verdana,tahoma,"sans serif";font-size:x-small;line-height:1.5em;opacity:0.9;filter:alpha(opacity=90);
+}
+</style>
+<!-- some CSS for this demo page, not required for SM2 -->
+<link rel="stylesheet" href="template.css" />
+
+<!-- SM2 BAREBONES TEMPLATE: START -->
+
+<script type="text/javascript">
+
+function loadScript(sURL,onLoad) {
+ try {
+ var loadScriptHandler = function() {
+ var rs = this.readyState;
+ if (rs == 'loaded' || rs == 'complete') {
+ this.onreadystatechange = null;
+ this.onload = null;
+ if (onLoad) {
+ onLoad();
+ }
+ }
+ }
+ function scriptOnload() {
+ this.onreadystatechange = null;
+ this.onload = null;
+ window.setTimeout(onLoad,20);
+ }
+ var oS = document.createElement('script');
+ oS.type = 'text/javascript';
+ if (onLoad) {
+ oS.onreadystatechange = loadScriptHandler;
+ oS.onload = scriptOnload;
+ }
+ oS.src = sURL;
+ document.getElementsByTagName('head')[0].appendChild(oS);
+ } catch(e) {
+ // oh well
+ }
+}
+
+function msg(s) {
+ document.getElementById('sm2-status').innerHTML = s;
+}
+
+window.onload = function() {
+ msg('Window loaded, waiting 1 second...');
+ setTimeout(function(){
+ msg('Loading soundmanager2.js...');
+ loadScript('../../script/soundmanager2.js',function(){
+ // SM2 script has loaded
+ soundManager.url = '../../swf/';
+ soundManager.onready(function() {
+ if (soundManager.supported()) {
+ soundManager.createSound({
+ id:'foo',
+ url:'../_mp3/mouseover.mp3'
+ }).play();
+ }
+ msg(soundManager.supported()?'started OK':'Loaded OK, but unable to start: unsupported/flash blocked, etc.');
+ });
+ soundManager.beginDelayedInit(); // ensure start-up in case document.readyState and/or DOMContentLoaded are unavailable
+ });
+ },1000);
+}
+
+</script>
+</head>
+
+<body style="height:100%">
+
+<div style="margin-right:43em">
+ <h1>SoundManager 2: Lazy Loading Example</h1>
+ <p>This is an example of dynamically loading SoundManager 2 using JS, after window.onload() has fired.</p>
+ <h2>How it works</h2>
+ <p>This page waits until window.onload(), delays 1 second and loads soundmanager2.js, which should then start up.</p>
+
+<p>SoundManager 2 status: <b id="sm2-status">Waiting for window.onload()...</b></p>
+
+<pre>window.onload = function() {
+ <span>// Window loaded, waiting 1 second...</span>
+ setTimeout(function() {
+ <span>// Loading soundmanager2.js...</span>
+ loadScript('../../script/soundmanager2.js',function() {
+ <span>// SM2 script has loaded</span>
+ soundManager.url = '../../swf/';
+ soundManager.onready(function() {
+ if (soundManager.supported()) {
+ soundManager.createSound({
+ id:'foo',
+ url:'../_mp3/mouseover.mp3'
+ }).play();
+ }
+ <span>// msg(soundManager.supported()?'started OK':'Loaded OK, but unable to start: unsupported/flash blocked, etc.');</span>
+ });
+ soundManager.beginDelayedInit(); <span>// ensure start-up in case document.readyState and/or DOMContentLoaded are unavailable</span>
+ });
+ },1000);
+}</pre>
+
+ <h2 id="flashblock-handling">Handling flash blockers</h2>
+ <p>It's good to let users see the flash component of SM2, so those with flash blockers can unblock it and allow SM2 to start. For more info on this, see the <a href="../flashblock/" title="SoundManager 2 with Flash block handling" onclick="if (!document.domain) this.href=this.href+'index.html'">Flashblock</a> example.</p>
+
+ <h2>Making SM2 wait for window.onload()</h2>
+ <p>If you prefer to have the library wait for window.onload() before calling soundManager.onload()/onerror() methods, you can modify SM2's "waitForWindowLoad" property:</p>
+<code>soundManager.waitForWindowLoad = true;</code>
+ <h2 style="margin-top:1em">Disabling debug output</h2>
+ <p>SoundManager 2 will write to a debug <div> element or a javascript console if available, by default. To disable it, simply set the relevant property to false:</p>
+<code>soundManager.debugMode = false;</code>
+ <p>To see related configuration code, refer to the source of this page which basically does all of the above "for real."</p>
+ <h2>Troubleshooting</h2>
+ <p>If SM2 is failing to start and throwing errors due to flash security, timeouts or other issues, check out the <a href="../../doc/getstarted/#troubleshooting" title="SoundManager 2 troubleshooting tool" onclick="if (!document.domain) this.href=this.href.replace(/\#/,'index.html#')">troubleshooting tool</a> which can help you fix things.</p>
+ <h2>No-debug, compressed version of soundmanager2.js</h2>
+ <p>Once development is finished, you can also use the "minified" (60% smaller) version of SM2, which has debug output and comments removed for you: <a href="../../script/soundmanager2-nodebug-jsmin.js">soundmanager2-nodebug-jsmin.js</a>. If you can, serve this with gzip compression for even greater bandwidth savings!</p>
+
+</div>
+
+</body>
+</html>
diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/template/html5-dtd-test.html b/docs/dymaxion/soundmanagerv297a-20101010/demo/template/html5-dtd-test.html new file mode 100755 index 0000000..4d1b102 --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/template/html5-dtd-test.html @@ -0,0 +1,77 @@ +<!DOCTYPE html>
+<html>
+<head>
+<title>SoundManager 2: HTML 5 DTD test</title>
+<meta name="description" content="A test page using SoundManager 2 under an HTML 5 DOCTYPE." />
+<script>
+
+// -- Movie size/positioning test case, Firefox/Win32 --
+
+// SM2 normally works at 6x6px SWF size, position:fixed bottom/left:0px.
+// Was failing with this case using HTML 5 doctype? ..
+// Started working when 8x8px SWF size was used.
+
+// Previous notes, courtesy Jacob Seidelin ...
+
+// This fails to load in Firefox 3.6 (Win7) but will load after one of the following changes:
+// 1. Remove the doctype or set it to eg.
+// <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+// 2. Set soundManager.useHighPerformance = false
+// 3. Set soundManager.debugFlash = true
+
+function loadScript(sURL,onLoad) {
+ try {
+ var loadScriptHandler = function() {
+ var rs = this.readyState;
+ if (rs == 'loaded' || rs == 'complete') {
+ this.onreadystatechange = null;
+ this.onload = null;
+ if (onLoad) {
+ onLoad();
+ }
+ }
+ }
+ function scriptOnload() {
+ this.onreadystatechange = null;
+ this.onload = null;
+ window.setTimeout(onLoad,20);
+ }
+ var oS = document.createElement('script');
+ oS.type = 'text/javascript';
+ if (onLoad) {
+ oS.onreadystatechange = loadScriptHandler;
+ oS.onload = scriptOnload;
+ }
+ oS.src = sURL;
+ document.getElementsByTagName('head')[0].appendChild(oS);
+ } catch(e) {
+ // oh well
+ }
+}
+
+window.onload = function() {
+ loadScript('../../script/soundmanager2.js', function() {
+ soundManager.flashVersion = 9;
+ soundManager.flash9Options.useEQData = true;
+ soundManager.flash9Options.useWaveformData = true;
+ soundManager.allowPolling = true;
+ soundManager.url = '../../swf/'; // path to directory containing SoundManager2 .SWF file
+ soundManager.onload = function() {
+ alert('Loaded!');
+ };
+ soundManager.debugMode = true;
+ soundManager.useHighPerformance = true;
+ soundManager.debugFlash = false;
+ soundManager.beginDelayedInit(); // ensure things start, in case document.readyState / domReady are missed (eg. Firefox 3.5.5/win32 with HTML5 DTD, no document.readyState??)
+ });
+}
+
+</script>
+
+</head>
+
+<body>
+
+</body>
+</html>
+
diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/template/index.html b/docs/dymaxion/soundmanagerv297a-20101010/demo/template/index.html new file mode 100755 index 0000000..214342c --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/template/index.html @@ -0,0 +1,131 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+<title>SoundManager 2 Template</title>
+<style type="text/css">
+#soundmanager-debug {
+ /* SM2 debug container (optional, use or customize this as you like - makes in-browser debug output more useable) */
+ position:fixed;_position:absolute;right:1em;bottom:1em;width:50em;height:18em;overflow:auto;background:#fff;margin:1em;padding:1em;border:1px solid #999;font-family:monaco,"lucida console",verdana,tahoma,"sans serif";font-size:x-small;line-height:1.5em;opacity:0.9;filter:alpha(opacity=90);
+}
+</style>
+<!-- some CSS for this demo page, not required for SM2 -->
+<link rel="stylesheet" href="template.css" />
+
+
+<!-- SM2 BAREBONES TEMPLATE: START -->
+
+<!-- include SM2 library -->
+<script type="text/javascript" src="../../script/soundmanager2.js"></script>
+
+<!-- And now, customize it! -->
+<script type="text/javascript">
+
+// soundManager.debugMode = false; // disable debug output
+soundManager.url = '../../swf/'; // path to directory containing SoundManager2 .SWF file
+soundManager.flashVersion = 8;
+soundManager.useFlashBlock = false; // skip for now. See the flashblock demo when you want to start getting fancy.
+
+soundManager.onload = function() {
+ // soundManager.createSound() etc. may now be called
+ soundManager._writeDebug('soundManager.onload() - your code executes here');
+}
+
+</script>
+
+<!-- SM2 BAREBONES TEMPLATE: END -->
+
+
+
+</head>
+
+<body style="height:100%">
+
+<div style="margin-right:43em">
+ <h1>SoundManager 2 Template Example</h1>
+ <p>This is a basic template for adding SoundManager to your page.</p>
+ <h2>How it works</h2>
+ <p>This page includes the SM2 script, which starts up on its own as appropriate. By default it will try to start as soon as possible.</p>
+ <p>The minimal code needed to get SoundManager 2 going is below, with <em><em>configurable parts</em></em>:</p>
+<code>
+<pre>
+
+<span><!-- include SM2 library --></span>
+<script type="text/javascript" src="<em><em>/path/to/soundmanager2.js</em></em>"></script>
+
+<span><!-- configure it for your use --></span>
+<script type="text/javascript">
+
+soundManager.url = '<em><em>/path/to/sm2-flash-movies/</em></em>'; <span>// directory where SM2 .SWFs live</span>
+
+<span>// Note that SoundManager will determine and append the appropriate .SWF file to the URL,
+// eg. /path/to/sm2-flash-movies/soundmanager2.swf automatically.</span>
+
+<span>// Beta-ish HTML5 audio support (force-enabled for iPad), flash-free sound for Safari + Chrome. Enable if you want to try it!</span>
+<span>// soundManager.useHTML5Audio = true;</span>
+
+<span>// do this to skip flash block handling for now. See the <a href="../flashblock/" title="SoundManager 2 flashblock handling demo" onclick="if (!document.domain) this.href=this.href+'index.html'">flashblock demo</a> when you want to start getting fancy.</span>
+soundManager.useFlashBlock = false;
+
+<span>// disable debug mode after development/testing..</span>
+<span>// soundManager.debugMode = false;</span>
+
+<span style="background:#eee;padding:0.25em">// Option 1: Simple onload() + createSound() method</span>
+
+soundManager.onload = function() {
+ <span>// SM2 has loaded - now you can create and play sounds!</span>
+ <em><em>soundManager.createSound('helloWorld','/path/to/hello-world.mp3');
+ soundManager.play('helloWorld');</em></em>
+};
+
+<span style="background:#eee;padding:0.25em">// Option 2 (better): More flexible onload() + createSound() method</span>
+
+soundManager.onload = function() {
+ <em><em>var mySound = soundManager.createSound({
+ id: 'aSound',
+ url: '/path/to/an.mp3'
+ <span>// onload: <span>[ event handler function object ],</span></span>
+ <span>// other options here..</span>
+ });
+ mySound.play();
+</em></em>}
+
+<span style="background:#eee;padding:0.25em">// Option 3 (best): onready() + createSound() methods, handle load/failure together:</span>
+
+soundManager.onready(function() {
+ <span>// check if SM2 successfully loaded..</span>
+ <em><em>if (soundManager.supported()) {</em></em>
+ <span>// SM2 has loaded - now you can create and play sounds!</span>
+ <em><em>var mySound = soundManager.createSound({
+ id: 'aSound',
+ url: '/path/to/an.mp3'
+ <span>// onload: <span>[ event handler function object ],</span></span>
+ <span>// other options here..</span>
+ });
+ mySound.play();
+ } else {
+ <span>// (Optional) Hrmm, SM2 could not start. Show an error, etc.?</span>
+ }</em></em>
+});
+
+</script></pre></code>
+
+ <h2 id="flashblock-handling">Handling flash blockers</h2>
+ <p>It's good to let users see the flash component of SM2, so those with flash blockers can unblock it and allow SM2 to start. For more info on this, see the <a href="../flashblock/" title="SoundManager 2 with Flash block handling" onclick="if (!document.domain) this.href=this.href+'index.html'">Flashblock</a> example.</p>
+
+ <h2>Making SM2 wait for window.onload()</h2>
+ <p>If you prefer to have the library wait for window.onload() before calling soundManager.onload()/onerror() methods, you can modify SM2's "waitForWindowLoad" property:</p>
+<code>soundManager.waitForWindowLoad = true;</code>
+ <h2 style="margin-top:1em">Disabling debug output</h2>
+ <p>SoundManager 2 will write to a debug <div> element or a javascript console if available, by default. To disable it, simply set the relevant property to false:</p>
+<code>soundManager.debugMode = false;</code>
+ <p>To see related configuration code, refer to the source of this page which basically does all of the above "for real."</p>
+ <h2>Troubleshooting</h2>
+ <p>If SM2 is failing to start and throwing errors due to flash security, timeouts or other issues, check out the <a href="../../doc/getstarted/#troubleshooting" title="SoundManager 2 troubleshooting tool" onclick="if (!document.domain) this.href=this.href.replace(/\#/,'index.html#')">troubleshooting tool</a> which can help you fix things.</p>
+ <h2>No-debug, compressed version of soundmanager2.js</h2>
+ <p>Once development is finished, you can also use the "minified" (down to 10% of original size with gzip!) version of SM2, which has debug output and comments removed for you: <a href="../../script/soundmanager2-nodebug-jsmin.js">soundmanager2-nodebug-jsmin.js</a>. Serve with gzip compression wherever possible for best bandwidth savings.</p>
+
+</div>
+
+</body>
+</html>
diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/template/template.css b/docs/dymaxion/soundmanagerv297a-20101010/demo/template/template.css new file mode 100755 index 0000000..448853e --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/template/template.css @@ -0,0 +1,67 @@ +/*
+
+ DEMO ONLY, just to make the demo page pretty.
+
+ You don't need this stuff for SM2 to work. :)
+
+*/
+
+body {
+ font-size:75%;
+}
+
+code, pre {
+ font-family:"lucida console",monaco,courier,terminal,system;
+ font-size:100%;
+ color:#2233cc;
+}
+
+em em {
+ font-weight:normal;
+ font-style:normal;
+ color:#339933;
+}
+
+h1,
+h2.special {
+ letter-spacing:-1px;
+}
+
+h1, h2, h3, h4 {
+ font-family:"helvetica neue",helvetica,verdana,arial,tahoma,"sans serif";
+ font-size:1em;
+ margin:0px;
+ padding:0px;
+ vertical-align:middle;
+}
+
+h1 {
+ font-size:2em;
+}
+
+h2 {
+ font-family:helvetica,arial,verdana,tahoma,"sans serif";
+ font-size:1.5em;
+}
+
+h3 {
+ font-size:1.17em;
+ border-bottom:1px solid #ccc;
+ padding-bottom:0.25em;
+ margin-top:1.5em;
+}
+
+h4 {
+ margin:1.5em 0px 0.5em 0px;
+ font-size:1.1em;
+}
+
+
+p {
+ font:normal 1em verdana,tahoma,arial,"sans serif";
+}
+
+code span,
+pre span {
+ color:#666;
+}
\ No newline at end of file diff --git a/docs/dymaxion/soundmanagerv297a-20101010/demo/template/xhtml-test.xhtml b/docs/dymaxion/soundmanagerv297a-20101010/demo/template/xhtml-test.xhtml new file mode 100755 index 0000000..a77db8f --- /dev/null +++ b/docs/dymaxion/soundmanagerv297a-20101010/demo/template/xhtml-test.xhtml @@ -0,0 +1,86 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+<title>SoundManager 2 Template</title>
+<style type="text/css">
+#soundmanager-debug {
+ /* SM2 debug container (optional, use or customize this as you like - makes in-browser debug output more useable) */
+ position:fixed;_position:absolute;right:1em;bottom:1em;width:50em;height:18em;overflow:auto;background:#fff;margin:1em;padding:1em;border:1px solid #999;font-family:monaco,"lucida console",verdana,tahoma,"sans serif";font-size:x-small;line-height:1.5em;opacity:0.9;filter:alpha(opacity=90);
+}
+</style>
+<!-- some CSS for this demo page, not required for SM2 -->
+<link rel="stylesheet" href="template.css" />
+
+
+
+<!-- SM2 BAREBONES TEMPLATE: START -->
+
+<!-- include SM2 library -->
+<script type="text/javascript" src="../../script/soundmanager2.js"></script>
+
+<!-- And now, customize it! -->
+<script type="text/javascript">
+
+// soundManager.debugMode = false; // disable debug output
+
+soundManager.url = '../../swf/'; // path to directory containing SoundManager2 .SWF file
+
+soundManager.onload = function() {
+ // soundManager.createSound() etc. may now be called
+ soundManager._writeDebug('soundManager.onload() - your code executes here');
+}
+
+</script>
+
+<!-- SM2 BAREBONES TEMPLATE: END -->
+
+
+
+</head>
+
+<body>
+<div style="margin-right:43em">
+ <h1>SoundManager 2 Template Example</h1>
+ <p>This is a basic template for adding SoundManager to your page.</p>
+ <h2>How it works</h2>
+ <p>This page includes the SM2 script, which starts up on its own as appropriate. By default it will try to start as soon as possible.</p>
+ <p>The minimal code needed to get SoundManager 2 going is below, with <em><em>configurable parts</em></em>:</p>
+<code>
+<pre>
+
+<span><-- include SM2 library --></span>
+<script type="text/javascript" src="<em><em>/path/to/soundmanager2.js</em></em>"></script>
+
+<span><-- configure it for your use --></span>
+<script type="text/javascript">
+
+soundManager.url = '<em><em>/path/to/sm2-flash-movies/</em></em>'; <span>// directory where SM2 .SWFs live</span>
+
+<span>// Note that SounndManager will determine and append the appropriate .SWF file to the URL.</span>
+
+<span>// disable debug mode after development/testing..
+// soundManager.debugMode = false;</span>
+
+soundManager.onload = function() {
+ <span>// SM2 has loaded - now you can create and play sounds!</span>
+ <em><em>soundManager.createSound('helloWorld','/path/to/hello-world.mp3');
+ soundManager.play('helloWorld');</em></em>
+}
+
+</script></pre></code>
+
+ <h2>Making SM2 wait for window.onload()</h2>
+ <p>If you prefer to have the library wait for window.onload() before calling soundManager.onload()/onerror() methods, you can modify SM2's "waitForWindowLoad" property:</p>
+<code>soundManager.waitForWindowLoad = true;</code>
+ <h2>Disabling debug output</h2>
+ <p>SoundManager 2 will write to a debug <div> element or a javascript console if available, by default. To disable it, simply set the relevant property to false:</p>
+<code>soundManager.debugMode = false;</code>
+ <p>To see related configuration code, refer to the source of this page which basically does all of the above "for real."</p>
+ <h2>No-debug, compressed version of soundmanager2.js</h2>
+ <p>Once development is finished, you can also use the "minified" (60% smaller) version of SM2, which has debug output and comments removed for you: <a href="../../script/soundmanager2-nodebug-jsmin.js">soundmanager2-nodebug-jsmin.js</a>. If you can, serve this with gzip compression for even greater bandwidth savings!</p>
+
+</div>
+
+</body>
+</html>
|
