index.js
function (line) {
    /**
     * Background line : 0,0,"bg.jpg"
     * TODO: confirm that the second member is always zero
     *
     * Breaktimes lines : 2,1000,2000
     * second integer is start offset
     * third integer is end offset
     */
    members = line.split(',');

    if (members[0] == '0' && members[1] == '0' && members[2]) {
      var bgName = members[2].trim();

      if (bgName.charAt(0) == '"' && bgName.charAt(bgName.length - 1) == '"') {
        beatmap.bgFilename = bgName.substring(1, bgName.length - 1);
      } else {
        beatmap.bgFilename = bgName;
      }
    } else if (members[0] == '2' && /^[0-9]+$/.test(members[1]) && /^[0-9]+$/.test(members[2])) {
      beatmap.breakTimes.push({
        startTime: parseInt(members[1]),
        endTime: parseInt(members[2])
      });
    }
  }
function (line) {
    /**
     * Background line : 0,0,"bg.jpg"
     * TODO: confirm that the second member is always zero
     *
     * Breaktimes lines : 2,1000,2000
     * second integer is start offset
     * third integer is end offset
     */
    members = line.split(',');

    if (members[0] == '0' && members[1] == '0' && members[2]) {
      var bgName = members[2].trim();

      if (bgName.charAt(0) == '"' && bgName.charAt(bgName.length - 1) == '"') {
        beatmap.bgFilename = bgName.substring(1, bgName.length - 1);
      } else {
        beatmap.bgFilename = bgName;
      }
    } else if (members[0] == '2' && /^[0-9]+$/.test(members[1]) && /^[0-9]+$/.test(members[2])) {
      beatmap.breakTimes.push({
        startTime: parseInt(members[1]),
        endTime: parseInt(members[2])
      });
    }
  }
function ( line ) { /**
     * Background line : 0,0,"bg.jpg"
     * TODO: confirm that the second member is always zero
     *
     * Breaktimes lines : 2,1000,2000
     * second integer is start offset
     * third integer is end offset
     */ members = line . split ( ',' ) ; if ( members [ 0 ] == '0' && members [ 1 ] == '0' && members [ 2 ] ) { var bgName = members [ 2 ] . trim ( ) ; if ( bgName . charAt ( 0 ) == '"' && bgName . charAt ( bgName . length - 1 ) == '"' ) { beatmap . bgFilename = bgName . substring ( 1 , bgName . length - 1 ) ; } else { beatmap . bgFilename = bgName ; } } else if ( members [ 0 ] == '2' && / ^[0-9]+$ / . test ( members [ 1 ] ) && / ^[0-9]+$ / . test ( members [ 2 ] ) ) { beatmap . breakTimes . push ( { startTime : parseInt ( members [ 1 ] ) , endTime : parseInt ( members [ 2 ] ) } ) ; } }
Parse an event line
@param  {String} line
Parse an event line