Changeset 29895

Show
Ignore:
Timestamp:
18.05.2015 23:08:07 (4 years ago)
Author:
davidb
Message:

Development of Piano-hero element. 90 degree turn and scale based on interface name. Starting improvment on musicbrainz metadata

Location:
main/trunk/model-sites-dev/respooled/collect/popup-video-respooled
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/model-sites-dev/respooled/collect/popup-video-respooled/etc/collectionConfig.xml

    r29893 r29895  
    295295    <gsf:link src="{$httpCollection}/style/jtab-helper.css"/> 
    296296    <gsf:script src="{$httpCollection}/js/raphael.js"/> 
     297    <gsf:script src="{$httpCollection}/js/raphael.group.js"/> 
    297298    <gsf:script src="{$httpCollection}/js/jtab.js"/> 
    298299<!-- 
  • main/trunk/model-sites-dev/respooled/collect/popup-video-respooled/js/game-on.js

    r29893 r29895  
    44 
    55var goPaper = null; 
     6var go_top_level_group = null;; 
    67 
    78var go_paper_x_dim = 920; 
     
    1314var num_midi_pitches = 128; 
    1415 
     16var group_x_scale; 
     17var group_y_scale; 
     18var group_rotate; 
     19var group_x_trans; 
     20var group_y_trans; 
    1521 
    1622function updateGameOnCurrentTimeline() 
    1723{ 
    1824    gameOnCurrentTimeXPos = (mediaPlayer.currentTime / mediaPlayer.duration) *  go_paper_x_dim; 
     25 
     26    var gameOnCurrentTimeYPos = (mediaPlayer.currentTime / mediaPlayer.duration) *  go_paper_y_dim; 
    1927    //console.log("*** x pos = " + gameOnCurrentTimeXPos); 
    2028 
    2129    gameOnCurrentTimelineRect.attr({x: gameOnCurrentTimeXPos}); 
     30 
     31    if (gs.xsltParams.interface_name == "respooled") { 
     32    go_top_level_group.translate(group_x_scale*go_paper_y_dim, go_paper_y_dim+(gameOnCurrentTimeYPos * group_x_scale * Math.abs(group_y_scale))); 
     33    } 
     34 
    2235} 
    2336 
     
    149162 
    150163    goPaper.clear(); 
     164     
     165    // Clear takes out any previous group element, so need to be regenerated 
     166    go_top_level_group = new goPaper.group("gameOnPaper",[]); 
    151167 
    152168    if (hasLocalStorage) { 
     
    174190 
    175191        var midi_stats = computeMidiStats(track); 
     192        console.log("*** midi stats = " + JSON.stringify(midi_stats)); 
    176193 
    177194        if (midi_stats.min_midi_pitch < min_midi_pitch) { 
     
    206223    //console.log("*** max pitch = " + max_midi_pitch + ", min pitch = " + min_midi_pitch); 
    207224     
    208     var raw_midi_range = max_midi_pitch - min_midi_pitch; 
     225    var raw_midi_range = max_midi_pitch - min_midi_pitch + 1; 
    209226    var midi_range = Math.max(4,raw_midi_range);  
    210227     
     228    console.log("*** midi_range = " + midi_range); 
     229 
    211230    var midi_y_dim_spacing = go_paper_y_dim / midi_range; 
     231 
    212232 
    213233    for (var i=0; i<atl.length; i++) { 
     
    230250            var startPercTime = (base_ctime + note_event.startCurrentTime)/total_duration; 
    231251            var rx_org = startPercTime * go_paper_x_dim; 
    232             var ry_org = go_paper_y_dim - ((note_event.midiPitch - min_midi_pitch) * midi_y_dim_spacing); 
     252            var ry_org = go_paper_y_dim - ((note_event.midiPitch - min_midi_pitch) * midi_y_dim_spacing) - midi_y_dim_spacing; 
    233253             
    234254            var rx_dim = (note_event.duration/1000)/total_duration * go_paper_x_dim; 
    235255            var ry_dim = midi_y_dim_spacing; 
    236256             
    237             var rect = goPaper.rect(rx_org,ry_org,rx_dim,ry_dim); 
    238             rect.attr({stroke:"black",fill:"#2E52A4"}); 
     257            var rect = goPaper.rect(rx_org,ry_org,rx_dim,ry_dim-0.2); 
     258            //rect.attr({stroke:"none", strokeWidth:0.2, fill:"#2E52A4"}); 
     259            //rect.attr({stroke:"black",fill:"#2E52A4"}); 
     260            rect.attr({"stroke":"black","stroke-width":0.25, "fill":"#2E52A4"}); 
     261            go_top_level_group.push(rect); 
    239262            } 
    240263        } 
     
    245268    gameOnCurrentTimelineRect = goPaper.rect(-2,0,1,go_paper_y_dim); 
    246269    gameOnCurrentTimelineRect.attr({fill: "red", stroke: "red"}); 
     270    go_top_level_group.push(gameOnCurrentTimelineRect); 
     271 
     272    go_top_level_group.scale(group_x_scale,group_y_scale); 
     273    go_top_level_group.rotate(group_rotate,0,0); 
     274    //go_top_level_group.translate(group_x_scale*go_paper_y_dim,go_paper_y_dim); 
     275    go_top_level_group.translate(group_x_trans,group_y_trans); 
    247276} 
    248277 
     
    250279{ 
    251280    console.log("initGameOn()"); 
     281 
     282    if (gs.xsltParams.interface_name == "respooled") { 
     283    group_x_scale = 2.0; 
     284    group_y_scale = -5.0; 
     285    group_rotate  = 90.0; 
     286 
     287    group_x_trans = group_x_scale * go_paper_y_dim; 
     288    group_y_trans = go_paper_y_dim; 
     289    } 
     290    else { 
     291    group_x_scale = 1.0; 
     292    group_y_scale = 1.0; 
     293    group_rotate  = 0.0; 
     294 
     295    group_x_trans = 0.0; 
     296    group_y_trans = 0.0; 
     297    } 
    252298 
    253299    goDocStorage = getDocStorage(gs.cgiParams.d); 
     
    263309    goPaper = Raphael("gameOnPaper",go_paper_x_dim,go_paper_y_dim); 
    264310    goPaper.canvas.style.backgroundColor = '#FFFFFF'; 
     311 
    265312 
    266313    console.log("Browser supports LocalStorage: " + hasLocalStorage); 
  • main/trunk/model-sites-dev/respooled/collect/popup-video-respooled/style/media-player.css

    r29890 r29895  
    8282    border: 0; 
    8383*/ 
     84/* 
    8485    border: 2px solid black; 
     86*/ 
    8587    padding: 2px; 
    8688    padding-left: 4px; 
    8789    padding-right: 4px; 
     90 
    8891 
    8992} 
  • main/trunk/model-sites-dev/respooled/collect/popup-video-respooled/transform/pages/document.xsl

    r29893 r29895  
    219219        <td><gsf:metadata name="dc.Creator"/></td> 
    220220      </tr> 
     221 
     222      <tr> 
     223        <td>Released</td> 
     224        <td><gsf:metadata name="dc.Coverage"/></td> 
     225      </tr> 
    221226       
     227<!-- 
    222228      <tr valign="top"> 
    223229        <td>Artist Summary</td> 
     
    235241        </td> 
    236242      </tr> 
     243--> 
     244 
    237245       
    238246<!-- 
     
    308316          </td> 
    309317          <td> 
    310             <a href="http://dbtune.org/musicbrainz/page/artist/{$musicbrainzartistid}" target="#musicbrainz" class="external"> 
     318            <a href="https://musicbrainz.org/artist/{$musicbrainzartistid}" target="#musicbrainz" class="external"> 
    311319              <xsl:copy-of select="$musicbrainzartistid"/> 
    312320            </a> 
    313321          </td> 
    314322        </tr> 
     323<!-- 
    315324        <tr> 
    316325          <td> 
     
    326335          </td> 
    327336        </tr> 
     337--> 
     338 
    328339        <tr> 
    329340          <td colspan="2">         
     
    13181329  <div id='media-player' style="width: 96%"> 
    13191330 
     1331    <xsl:if test="$interface_name='dlfm'"> 
     1332      <style> 
     1333    .openclose a:visited { 
     1334        color: #ffffff; 
     1335    } 
     1336    .openclose a:link { 
     1337        color: #ffffff; 
     1338    } 
     1339    .openclose a:hover {  
     1340      color: #000000;  
     1341    } 
     1342 
     1343      </style> 
     1344    </xsl:if> 
     1345 
    13201346    <div class="about-bar"> 
    13211347      <div id="about-titlebar" style="background-image: none; background-color: #2E52A4; width: 97%; float: left; margin-bottom: 10px; z-index: 4; position: relative;"> 
    1322     About: <xsl:call-template name="choose-title"/> 
     1348 
     1349    <xsl:choose> 
     1350          <xsl:when test="$interface_name='dlfm'"> 
     1351        Linked Data: <xsl:call-template name="choose-title"/> 
     1352      </xsl:when> 
     1353      <xsl:otherwise> 
     1354        About: <xsl:call-template name="choose-title"/> 
     1355      </xsl:otherwise> 
     1356    </xsl:choose> 
    13231357      </div> 
    13241358 
     
    13711405    <input id="progress-bar" type="range"  
    13721406           min='0' max='100' step='0.01' value='0'  
     1407           class="ui-state-default ui-corner-all" 
    13731408           style="width: 98%"/> <!-- used to be 100% --> 
    13741409 
     
    19161951        $('#scaled-mytab').append($('#offscreen-jtab-chord-lineup')); 
    19171952 
     1953        console.log("!!!! forced background colour for F major in Guitar Tab area!!!") 
     1954        $('#builder_6').css("background-color","rgba(46,82,164,0.50)"); 
    19181955      }); 
    19191956    </gsf:script>