diff --git a/templates/opera2an.xslt b/templates/opera2an.xslt index 8d3da281f529b5397a2023ee5183ed2e71f16c40..6523d48532680efd9a7502827a4852e7ace3aa48 100644 --- a/templates/opera2an.xslt +++ b/templates/opera2an.xslt @@ -203,48 +203,17 @@ </subHeading> </xsl:template> -<xsl:template match="tei:ptr[contains(@target,'audio-cues')]"> -<!-- FIXME How will we get the Toma.HK JavaScript source into the HTML <head>? --> - <xsl:variable name="audio-cue-id"><xsl:value-of select="substring-after(@target,'#')" /></xsl:variable> - <xsl:variable name="track" select="document('../der-ring-des-nibelungen/audio-cues.xml')//cue[@id=$audio-cue-id]" /> - <!-- - <xsl:message>[ptr] Found track: <xsl:value-of select="$track/performance" /> <xsl:value-of select="$track/tracksort" /></xsl:message> - --> - <script> -var track; -<!-- FIXME What arguments should we send to this Track function? Do we actually have anything that will retrieve what we want? --> -track = window.tomahkAPI.Track("<xsl:value-of select="$track/track" />","<xsl:value-of select="substring-before($track/performance, '19')" />", { - width:, - height:, - disabledResolvers: [ - "", - "" - // options: "SoundCloud", "Officialfm", "Lastfm", "Jamendo", "Youtube", "Rdio", "SpotifyMetadata", "Deezer", "Exfm" - ], - handlers: { - onloaded: function() { - log(track.connection+":\n api loaded"); - }, - onended: function() { - log(track.connection+":\n Song ended: "+track.artist+" - "+track.title); - }, - onplayable: function() { - log(track.connection+":\n playable"); - }, - onresolved: function(resolver, result) { - log(track.connection+":\n Track found: "+resolver+" - "+ result.track + " by "+result.artist); - }, - ontimeupdate: function(timeupdate) { - var currentTime = timeupdate.currentTime; - var duration = timeupdate.duration; - currentTime = parseInt(currentTime); - duration = parseInt(duration); - - log(track.connection+":\n Time update: "+currentTime + " "+duration); - } - } -}); -</script> +<xsl:template match="tei:anchor[@type='audio-cue']"> + <xsl:variable name="id"><xsl:value-of select="concat('#',@xml:id)" /></xsl:variable> + <xsl:variable name="link" select="//tei:link[contains(@target,$id)]" /> + <!-- FIXME Should we include only audio cues from the given $PERFORMANCE ? --> + <!-- <xsl:if test="contains(@xml:id,$PERFORMANCE) and $link"> --> + <xsl:if test="$link"> + <xsl:variable name="linkGrp" select="$link/ancestor::tei:linkGrp" /> + <xsl:variable name="release">http://musicbrainz.org/release/<xsl:value-of select="substring-after($linkGrp/@domains,'http://musicbrainz.org/release/')" /></xsl:variable> + <xsl:variable name="track"><xsl:value-of select="substring-after(substring-after(substring-after($link/@target,'#'),'#'),'#')" /></xsl:variable> + <a href="{$release}#{$track}"><xsl:value-of select="substring-after($id,'#cue-')" /></a> + </xsl:if> </xsl:template> <xsl:template match="tei:role"/>