Changeset 36861
- Timestamp:
- 2022-10-22T17:45:58+13:00 (18 months ago)
- Location:
- gs3-installations/mars/trunk/sites/mars/collect/amc-essentia
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs3-installations/mars/trunk/sites/mars/collect/amc-essentia/etc/collectionConfig.xml
r36860 r36861 119 119 <xsl:choose> 120 120 <xsl:when test="/page/pageResponse/service/@name = 'AudioQuery'"> 121 <gsf:variable name="frameOffset"> 122 <xsl:value-of select="@frameOffset"/> 123 </gsf:variable> 124 <gsf:variable name="rank"> 125 <xsl:value-of select="@rank"/> 126 </gsf:variable> 127 121 128 <a> 122 129 <xsl:choose> … … 130 137 <gsf:metadata name="amc.title"/> 131 138 by <gsf:metadata name="amc.artist"/> 132 </a> 139 </a> 140 141 <span style="font-style: italics; font-size: 100%" > 142 (Matching offset @ <xsl:value-of select="@frameOffset"/> secs) 143 </span> 144 145 133 146 </xsl:when> 134 147 <xsl:otherwise> … … 474 487 <gsf:template name="documentHeading"> 475 488 <!-- title will be dsiplayed in playbar at top of page, so supress showing title here --> 489 <!-- 476 490 <gsf:script src="interfaces/{$interface_name}/js/direct-edit-source.js"/> 477 491 <xsl:call-template name="init-direct-edit"/> 492 --> 478 493 </gsf:template> 479 494 … … 512 527 --> 513 528 529 <gsf:script src="{$httpCollection}/js/av_document.js"/> 530 514 531 <div class="documenttext" style="padding-bottom: 20px; width:100%;"> 515 532 <style> … … 548 565 549 566 <div class="documenttext"> 550 551 567 568 <style> 569 #wave-timeline { 570 background-color: #fff; 571 } 572 </style> 573 552 574 <div id="demo"> 553 575 <div id="waveform"> … … 578 600 <div> 579 601 580 <div class="controls"> 602 <div class="controls"> 603 <button class="btn btn-primary" onclick="AVSeekTo(0)"> 604 Return to Start 605 </button> 606 607 <!-- 581 608 <button class="btn btn-primary" data-action="play"> 582 609 <i class="glyphicon glyphicon-play"></i> … … 585 612 Pause 586 613 </button> 614 --> 615 616 <button class="btn btn-primary" onclick="AVPlayPause()"> 617 Play 618 </button> 619 587 620 </div> 588 621 </div> … … 594 627 <xsl:text> </xsl:text> 595 628 </script> 629 596 630 <gsf:script> 631 //var currentPosIsZero = true; 632 633 634 597 635 document.addEventListener('DOMContentLoaded', function() { 636 postInitWavesurfer(wavesurfer); 637 /* 598 638 // Load audio from URL 599 639 wavesurfer.load(gs.variables.mp3url); … … 604 644 var current_time_rounded = current_time.toFixed(1); 605 645 $('#audioCurrentPos').html(current_time_rounded + " secs"); 606 }); 646 647 if (current_time == 0) { 648 recommendFromStart(); 649 //currentPosIsZero = true; 650 //$('#makeRecommendationFrom').html("Based on the start of this musical/sound art work: "); 651 } 652 else if ((currentPosIsZero) && (current_time > 0)) { 653 recommendFromPos(); 654 //currentPosIsZero = false; 655 // $('#makeRecommendationFrom').html("Based on the current timeline position of this musical/sound art work: "); 656 } 657 }); 658 */ 607 659 }); 608 660 </gsf:script> 661 609 662 </div> 610 663 … … 663 716 <input name="s1.arousal" type="hidden" value="0"/> 664 717 <input name="s1.valence" type="hidden" value="0"/> 718 719 <div style="font-style: italics;"> 720 <span id="makeRecommendationFrom"> 721 Based on the start of this musical/sound art work: 722 </span> 723 <input onclick="preSubmit(this.form);" type="submit" value="Make Arousal-Valence Recommendations"/> 724 </div> 665 725 666 <div style="font-style: italics;">Make arousal-valence music recommendation based on content @ <span id="audioCurrentPos">0 secs</span>: 726 <div style="font-style: italics; display: none;"> 727 Make arousal-valence music recommendation based on content @ <span id="audioCurrentPos">0 secs 728 </span>: 667 729 <!--, 668 730 with excerpt lasting <span class="editable-offset" id="audioWindowDuration" style="cursor: pointer; border: 1px solid black; padding: 3px; width: 200px; min-width: 200px;">3.0</span> secs 669 731 --> 670 < input onclick="preSubmit(this.form);" type="submit" value="Recommend"/></div>732 </div> 671 733 </form> 672 734 <hr/> 735 <!-- 673 736 <script> 674 737 <xsl:text disable-output-escaping="yes"> 675 676 /*677 function playFromOffset(id,frameOffset)678 {679 var msecOffset = 250 * frameOffset;680 idElem = document.getElementById(id);681 pagePlayer.handleClick({target:idElem}); // fake a click682 soundManager.stopAll();683 // soundManager.setPosition(id,5000);684 soundManager.play(id,{position: msecOffset});685 }686 */687 688 function preSubmit(form)689 {690 // Note, the Arousal and Valence feature window values used is:691 // 6 secs + 50% overlap692 // So the Weka computed AV values are spaced out:693 // 6s, 9s, 12s, ...694 695 // clamp to ensure >= 6.0 secs696 var current_time = Math.max(6.0,wavesurfer.getCurrentTime());697 698 wavesurfer.pause();699 700 weka_segment = Math.round(current_time/3) * 3;701 form.elements["s1.offset"].value = weka_segment;702 703 var arousal_val = parseFloat($('#arousal-val').text());704 var valence_val = parseFloat($('#valence-val').text());705 706 //console.log("arousal val = " + arousal_val);707 //console.log("valence val = " + valence_val);708 709 form.elements["s1.arousal"].value = arousal_val;710 form.elements["s1.valence"].value = valence_val;711 712 713 /*714 var currentPosElem = document.getElementById("audioCurrentPos");715 var offsetInMSecs = currentPosElem.getAttribute("offsetInMSecs");716 var frameOffset = Math.round(offsetInMSecs/250.0);717 form.elements["s1.offset"].value = frameOffset;718 719 var lengthInSecs = document.getElementById("audioWindowDuration").innerHTML;720 721 var frameLength = Math.round(lengthInSecs*1000/250.0);722 form.elements["s1.length"].value = frameLength;723 */724 return true;725 }726 738 </xsl:text> 727 739 </script> 728 740 --> 729 741 730 742 </xsl:template>
Note:
See TracChangeset
for help on using the changeset viewer.