| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 importScripts('function_sequence.js'); | 5 importScripts('function_sequence.js'); |
| 6 importScripts('function_parallel.js'); | 6 importScripts('function_parallel.js'); |
| 7 | 7 |
| 8 function Id3Parser(parent) { | 8 function Id3Parser(parent) { |
| 9 MetadataParser.call(this, parent, 'id3', /\.(mp3)$/i); | 9 MetadataParser.call(this, parent, 'id3', /\.(mp3)$/i); |
| 10 } | 10 } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 return reader.readScalar(2, false) << 16 | reader.readScalar(1, false); | 48 return reader.readScalar(2, false) << 16 | reader.readScalar(1, false); |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 /** | 51 /** |
| 52 * Reads string from reader with specified encoding | 52 * Reads string from reader with specified encoding |
| 53 * | 53 * |
| 54 * @private | 54 * @private |
| 55 * @param {ByteReader} reader reader to use. | 55 * @param {ByteReader} reader reader to use. |
| 56 * @param {int} encoding string encoding. | 56 * @param {int} encoding string encoding. |
| 57 * @param {int} size maximum string size. Actual result may be shorter. | 57 * @param {int} size maximum string size. Actual result may be shorter. |
| 58 * @return {string} // TODO(JSDOC). |
| 58 */ | 59 */ |
| 59 Id3Parser.prototype.readString_ = function(reader, encoding, size) { | 60 Id3Parser.prototype.readString_ = function(reader, encoding, size) { |
| 60 switch (encoding) { | 61 switch (encoding) { |
| 61 case Id3Parser.v2.ENCODING.ISO_8859_1: | 62 case Id3Parser.v2.ENCODING.ISO_8859_1: |
| 62 return reader.readNullTerminatedString(size); | 63 return reader.readNullTerminatedString(size); |
| 63 | 64 |
| 64 case Id3Parser.v2.ENCODING.UTF_16: | 65 case Id3Parser.v2.ENCODING.UTF_16: |
| 65 return reader.readNullTerminatedStringUTF16(true, size); | 66 return reader.readNullTerminatedStringUTF16(true, size); |
| 66 | 67 |
| 67 case Id3Parser.v2.ENCODING.UTF_16BE: | 68 case Id3Parser.v2.ENCODING.UTF_16BE: |
| (...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 TYER: 'ID3_YEAR', | 695 TYER: 'ID3_YEAR', |
| 695 WCOP: 'ID3_COPYRIGHT', | 696 WCOP: 'ID3_COPYRIGHT', |
| 696 WOAF: 'ID3_OFFICIAL_AUDIO_FILE_WEBPAGE', | 697 WOAF: 'ID3_OFFICIAL_AUDIO_FILE_WEBPAGE', |
| 697 WOAR: 'ID3_OFFICIAL_ARTIST', | 698 WOAR: 'ID3_OFFICIAL_ARTIST', |
| 698 WOAS: 'ID3_OFFICIAL_AUDIO_SOURCE_WEBPAGE', | 699 WOAS: 'ID3_OFFICIAL_AUDIO_SOURCE_WEBPAGE', |
| 699 WPUB: 'ID3_PUBLISHERS_OFFICIAL_WEBPAGE' | 700 WPUB: 'ID3_PUBLISHERS_OFFICIAL_WEBPAGE' |
| 700 } | 701 } |
| 701 }; | 702 }; |
| 702 | 703 |
| 703 MetadataDispatcher.registerParserClass(Id3Parser); | 704 MetadataDispatcher.registerParserClass(Id3Parser); |
| OLD | NEW |