libmpcdec  1.2.2
streaminfo.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2005-2009, The Musepack Development Team
3  All rights reserved.
4 
5  Redistribution and use in source and binary forms, with or without
6  modification, are permitted provided that the following conditions are
7  met:
8 
9  * Redistributions of source code must retain the above copyright
10  notice, this list of conditions and the following disclaimer.
11 
12  * Redistributions in binary form must reproduce the above
13  copyright notice, this list of conditions and the following
14  disclaimer in the documentation and/or other materials provided
15  with the distribution.
16 
17  * Neither the name of the The Musepack Development Team nor the
18  names of its contributors may be used to endorse or promote
19  products derived from this software without specific prior
20  written permission.
21 
22  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
35 #ifndef _MPCDEC_STREAMINFO_H_
36 #define _MPCDEC_STREAMINFO_H_
37 #ifdef WIN32
38 #pragma once
39 #endif
40 
41 #include <mpc/mpc_types.h>
42 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
47 
48 typedef mpc_int32_t mpc_streaminfo_off_t;
49 
54 typedef struct mpc_streaminfo {
56 
57  mpc_uint32_t sample_freq;
58  mpc_uint32_t channels;
59  mpc_uint32_t stream_version;
60  mpc_uint32_t bitrate;
61  double average_bitrate;
62  mpc_uint32_t max_band;
63  mpc_uint32_t ms;
64  mpc_uint32_t fast_seek;
65  mpc_uint32_t block_pwr;
66 
67 
69 
70  mpc_uint16_t gain_title;
71  mpc_uint16_t gain_album;
72  mpc_uint16_t peak_album;
73  mpc_uint16_t peak_title;
74 
75 
77 
78  mpc_uint32_t is_true_gapless;
79  mpc_uint64_t samples;
80  mpc_uint64_t beg_silence;
81 
82 
84 
85  mpc_uint32_t encoder_version;
86  char encoder[256];
87  mpc_bool_t pns;
88  float profile;
89  const char* profile_name;
90 
91 
92 
93  mpc_streaminfo_off_t header_position;
94  mpc_streaminfo_off_t tag_offset;
95  mpc_streaminfo_off_t total_file_length;
97 
100 MPC_API double mpc_streaminfo_get_length(mpc_streaminfo *si);
101 
104 MPC_API mpc_int64_t mpc_streaminfo_get_length_samples(mpc_streaminfo *si);
105 
106 #ifdef __cplusplus
107 }
108 #endif
109 #endif
mpc_uint32_t channels
Number of channels in stream.
Definition: streaminfo.h:58
mpc_uint32_t sample_freq
Sample frequency of stream.
Definition: streaminfo.h:57
MPC_API double mpc_streaminfo_get_length(mpc_streaminfo *si)
mpc_uint64_t beg_silence
Number of samples that must not be played at the beginning of the stream.
Definition: streaminfo.h:80
char encoder[256]
Encoder name.
Definition: streaminfo.h:86
mpc_uint16_t peak_album
Peak album loudness level.
Definition: streaminfo.h:72
mpc_uint16_t peak_title
Peak title loudness level.
Definition: streaminfo.h:73
struct mpc_streaminfo mpc_streaminfo
mpc stream properties structure
mpc_uint64_t samples
Number of samples in the stream.
Definition: streaminfo.h:79
mpc_streaminfo_off_t total_file_length
Total length of underlying file.
Definition: streaminfo.h:95
mpc_uint32_t encoder_version
Version of encoder used.
Definition: streaminfo.h:85
float profile
Quality profile of stream.
Definition: streaminfo.h:88
mpc_uint32_t ms
Mid/side stereo (0: off, 1: on)
Definition: streaminfo.h:63
double average_bitrate
Average bitrate of stream (in bits/sec)
Definition: streaminfo.h:61
mpc_uint32_t max_band
Maximum band-index used in stream (0...31)
Definition: streaminfo.h:62
mpc_streaminfo_off_t header_position
Byte offset of position of header in stream.
Definition: streaminfo.h:93
mpc_uint32_t is_true_gapless
True gapless? (0: no, 1: yes)
Definition: streaminfo.h:78
mpc_streaminfo_off_t tag_offset
Offset to file tags.
Definition: streaminfo.h:94
mpc_bool_t pns
pns used
Definition: streaminfo.h:87
mpc_uint16_t gain_album
Replaygain album value.
Definition: streaminfo.h:71
mpc_uint32_t fast_seek
True if stream supports fast-seeking (sv7)
Definition: streaminfo.h:64
const char * profile_name
Name of profile used by stream.
Definition: streaminfo.h:89
mpc_uint32_t stream_version
Streamversion of stream.
Definition: streaminfo.h:59
mpc_uint32_t block_pwr
Number of frames in a block = 2^block_pwr (sv8)
Definition: streaminfo.h:65
MPC_API mpc_int64_t mpc_streaminfo_get_length_samples(mpc_streaminfo *si)
mpc_uint16_t gain_title
Replaygain title value.
Definition: streaminfo.h:70
mpc_uint32_t bitrate
Bitrate of stream file (in bps)
Definition: streaminfo.h:60
mpc stream properties structure
Definition: streaminfo.h:54