comparison js/core.js @ 2409:f595f5f5a7b9

Implementation for #93
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Thu, 26 May 2016 15:55:00 +0100
parents fbc22422d73d
children 2f6a1f510ade
comparison
equal deleted inserted replaced
2408:fbc22422d73d 2409:f595f5f5a7b9
2485 { 2485 {
2486 this.parent = audioObject; 2486 this.parent = audioObject;
2487 this.outsideReferenceHolder = document.createElement('button'); 2487 this.outsideReferenceHolder = document.createElement('button');
2488 this.outsideReferenceHolder.className = 'outside-reference'; 2488 this.outsideReferenceHolder.className = 'outside-reference';
2489 this.outsideReferenceHolder.setAttribute('track-id',index); 2489 this.outsideReferenceHolder.setAttribute('track-id',index);
2490 this.outsideReferenceHolder.textContent = "Play Reference"; 2490 this.outsideReferenceHolder.textContent = this.parent.specification.label || "Reference";
2491 this.outsideReferenceHolder.disabled = true; 2491 this.outsideReferenceHolder.disabled = true;
2492 2492
2493 this.outsideReferenceHolder.onclick = function(event) 2493 this.outsideReferenceHolder.onclick = function(event)
2494 { 2494 {
2495 audioEngineContext.play(event.currentTarget.getAttribute('track-id')); 2495 audioEngineContext.play(event.currentTarget.getAttribute('track-id'));
2508 { 2508 {
2509 progress = String(progress); 2509 progress = String(progress);
2510 progress = progress.split('.')[0]; 2510 progress = progress.split('.')[0];
2511 this.outsideReferenceHolder.textContent = progress+'%'; 2511 this.outsideReferenceHolder.textContent = progress+'%';
2512 } else { 2512 } else {
2513 this.outsideReferenceHolder.textContent = "Play Reference"; 2513 this.outsideReferenceHolder.textContent = this.parent.specification.label || "Reference";
2514 } 2514 }
2515 }; 2515 };
2516 this.startPlayback = function() 2516 this.startPlayback = function()
2517 { 2517 {
2518 // Called when playback has begun 2518 // Called when playback has begun
2533 { 2533 {
2534 return 0; 2534 return 0;
2535 }; 2535 };
2536 this.getPresentedId = function() 2536 this.getPresentedId = function()
2537 { 2537 {
2538 return 'Reference'; 2538 return this.parent.specification.label || "Reference";
2539 }; 2539 };
2540 this.canMove = function() 2540 this.canMove = function()
2541 { 2541 {
2542 return false; 2542 return false;
2543 }; 2543 };