| 1 | /* |
| 2 | * Original Copyright: |
| 3 | * |
| 4 | Copyright (c) 2005, The Musepack Development Team |
| 5 | All rights reserved. |
| 6 | |
| 7 | Redistribution and use in source and binary forms, with or without |
| 8 | modification, are permitted provided that the following conditions are |
| 9 | met: |
| 10 | |
| 11 | * Redistributions of source code must retain the above copyright |
| 12 | notice, this list of conditions and the following disclaimer. |
| 13 | |
| 14 | * Redistributions in binary form must reproduce the above |
| 15 | copyright notice, this list of conditions and the following |
| 16 | disclaimer in the documentation and/or other materials provided |
| 17 | with the distribution. |
| 18 | |
| 19 | * Neither the name of the The Musepack Development Team nor the |
| 20 | names of its contributors may be used to endorse or promote |
| 21 | products derived from this software without specific prior |
| 22 | written permission. |
| 23 | |
| 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 25 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 26 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 27 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 28 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 29 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 30 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 31 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 32 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 33 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 35 | */ |
| 36 | |
| 37 | #ifndef _musepack_h_ |
| 38 | #define _musepack_h_ |
| 39 | |
| 40 | typedef struct mpc_streaminfo { |
| 41 | /// @name core mpc stream properties |
| 42 | uint32_t sample_freq; ///< sample frequency of stream |
| 43 | uint32_t channels; ///< number of channels in stream |
| 44 | int32_t header_position; ///< byte offset of position of header in stream |
| 45 | uint32_t stream_version; ///< streamversion of stream |
| 46 | uint32_t bitrate; ///< bitrate of stream file (in bps) |
| 47 | double average_bitrate; ///< average bitrate of stream (in bits/sec) |
| 48 | uint32_t frames; ///< number of frames in stream |
| 49 | uint64_t pcm_samples; |
| 50 | uint32_t max_band; ///< maximum band-index used in stream (0...31) |
| 51 | uint32_t is; ///< intensity stereo (0: off, 1: on) |
| 52 | uint32_t ms; ///< mid/side stereo (0: off, 1: on) |
| 53 | uint32_t block_size; ///< only needed for SV4...SV6 -> not supported |
| 54 | uint32_t block_pwr; ///< Number of frames in a block = 2^block_pwr (sv8) |
| 55 | uint32_t profile; ///< quality profile of stream |
| 56 | float fprofile; ///< sv8 uses float profile |
| 57 | const char* profile_name; ///< name of profile used by stream |
| 58 | |
| 59 | /// @name replaygain related fields |
| 60 | int16_t gain_title; ///< replaygain title value |
| 61 | int16_t gain_album; ///< replaygain album value |
| 62 | uint16_t peak_album; ///< peak album loudness level |
| 63 | uint16_t peak_title; ///< peak title loudness level |
| 64 | |
| 65 | /// @name true gapless support data |
| 66 | uint32_t is_true_gapless; ///< true gapless? (0: no, 1: yes) |
| 67 | uint32_t last_frame_samples; ///< number of valid samples within last frame |
| 68 | uint64_t beg_silence; ///< Number of samples that must not be played at the beginning of the stream |
| 69 | |
| 70 | uint32_t encoder_version; ///< version of encoder used |
| 71 | char encoder[256]; ///< encoder name |
| 72 | |
| 73 | int32_t tag_offset; ///< offset to file tags |
| 74 | int32_t total_file_length; ///< total length of underlying file |
| 75 | |
| 76 | Buffer *buf; |
| 77 | PerlIO *infile; |
| 78 | } mpc_streaminfo; |
| 79 | |
| 80 | #endif |