Ignore:
Timestamp:
10/06/06 17:14:05 (18 years ago)
Author:
zorg
Message:

Separated public interface from private headers
Use opaque objects whenever possible
Some (useless?) cosmetics on libmpcdec
Remove sv5-6 outdated support
Added libwavformat for upcoming mpcdec
New layout
Work in progress...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libmpcdec/branches/zorg/include/mpcdec/streaminfo.h

    r37 r68  
    3232  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    3333*/
     34/// \file streaminfo.h
     35#ifndef _MPCDEC_STREAMINFO_H_
     36#define _MPCDEC_STREAMINFO_H_
     37#ifdef WIN32
     38#pragma once
     39#endif
    3440
    35 /// \file streaminfo.h
     41#include "mpc_types.h"
     42#include "reader.h"
    3643
    37 #ifndef _mpcdec_streaminfo_h_
    38 #define _mpcdec_streaminfo_h_
     44#ifdef __cplusplus
     45extern "C" {
     46#endif
     47
    3948
    4049typedef mpc_int32_t mpc_streaminfo_off_t;
     
    4554/// by the streaminfo_read function.
    4655typedef struct mpc_streaminfo {
    47     /// @name core mpc stream properties
     56    /// @name Core mpc stream properties
    4857    //@{
    49     mpc_uint32_t         sample_freq;        ///< sample frequency of stream
    50     mpc_uint32_t         channels;           ///< number of channels in stream
    51     mpc_streaminfo_off_t header_position;    ///< byte offset of position of header in stream
    52     mpc_uint32_t         stream_version;     ///< streamversion of stream
    53     mpc_uint32_t         bitrate;            ///< bitrate of stream file (in bps)
    54     double               average_bitrate;    ///< average bitrate of stream (in bits/sec)
    55     mpc_uint32_t         frames;             ///< number of frames in stream
    56     mpc_int64_t          pcm_samples;
    57     mpc_uint32_t         max_band;           ///< maximum band-index used in stream (0...31)
    58     mpc_uint32_t         is;                 ///< intensity stereo (0: off, 1: on)
    59     mpc_uint32_t         ms;                 ///< mid/side stereo (0: off, 1: on)
    60     mpc_uint32_t         block_size;         ///< only needed for SV4...SV6 -> not supported
    61     mpc_uint32_t         profile;            ///< quality profile of stream
    62     const char*          profile_name;       ///< name of profile used by stream
     58    mpc_uint32_t         sample_freq;        ///< Sample frequency of stream
     59    mpc_uint32_t         channels;           ///< Number of channels in stream
     60    mpc_streaminfo_off_t header_position;    ///< Byte offset of position of header in stream
     61    mpc_uint32_t         stream_version;     ///< Streamversion of stream
     62    mpc_uint32_t         bitrate;            ///< Bitrate of stream file (in bps)
     63    double               average_bitrate;    ///< Average bitrate of stream (in bits/sec)
     64    mpc_uint32_t         frames;             ///< Number of frames in stream
     65    mpc_int64_t          pcm_samples;        ///< Approximate number of pcm samples in stream
     66    mpc_uint32_t         max_band;           ///< Maximum band-index used in stream (0...31)
     67    mpc_uint32_t         is;                 ///< Intensity stereo (0: off, 1: on)
     68    mpc_uint32_t         ms;                 ///< Mid/side stereo (0: off, 1: on)
     69    mpc_uint32_t         block_size;         ///< Only needed for SV4...SV6 -> not supported
     70    mpc_uint32_t         profile;            ///< Quality profile of stream
     71    const char*          profile_name;       ///< Name of profile used by stream
     72    mpc_uint32_t         fast_seek;          ///< True if stream supports fast-seeking
    6373    //@}
    6474
    65     /// @name replaygain related fields
     75    /// @name Replaygain properties
    6676    //@{
    67     mpc_int16_t         gain_title;          ///< replaygain title value
    68     mpc_int16_t         gain_album;          ///< replaygain album value
    69     mpc_uint16_t        peak_album;          ///< peak album loudness level
    70     mpc_uint16_t        peak_title;          ///< peak title loudness level
     77    mpc_int16_t          gain_title;         ///< Replaygain title value
     78    mpc_int16_t          gain_album;         ///< Replaygain album value
     79    mpc_uint16_t         peak_album;         ///< Peak album loudness level
     80    mpc_uint16_t         peak_title;         ///< Peak title loudness level
    7181    //@}
    7282
    73     /// @name true gapless support data
     83    /// @name True gapless properties
    7484    //@{
    75     mpc_uint32_t        is_true_gapless;     ///< true gapless? (0: no, 1: yes)
    76     mpc_uint32_t        last_frame_samples;  ///< number of valid samples within last frame
     85    mpc_uint32_t         is_true_gapless;    ///< True gapless? (0: no, 1: yes)
     86    mpc_uint32_t         last_frame_samples; ///< Number of valid samples within last frame
    7787
    78     mpc_uint32_t        encoder_version;     ///< version of encoder used
    79     char                encoder[256];        ///< encoder name
     88    mpc_uint32_t         encoder_version;    ///< Version of encoder used
     89    char                 encoder[256];       ///< Encoder name
    8090
    81     mpc_streaminfo_off_t tag_offset;         ///< offset to file tags
    82     mpc_streaminfo_off_t total_file_length;  ///< total length of underlying file
    83     //@}
    84 
    85     /// @name fast seeking support
    86     //@{
    87     mpc_uint32_t        fast_seek;           ///< support fast seeking ? (0: no, 1: yes)
     91    mpc_streaminfo_off_t tag_offset;         ///< Ofset to file tags
     92    mpc_streaminfo_off_t total_file_length;  ///< Total length of underlying file
    8893    //@}
    8994} mpc_streaminfo;
    9095
    91 #endif // _mpcdec_streaminfo_h_
     96/// Initializes a streaminfo structure.
     97/// \param si streaminfo structure to initialize
     98void mpc_streaminfo_init(mpc_streaminfo *si);
     99
     100/// Reads streaminfo header from the mpc stream supplied by r.
     101/// \param si si pointer to which info will be written
     102/// \param p_reader stream reader to supply raw data
     103/// \return error code
     104mpc_status mpc_streaminfo_read(mpc_streaminfo *si, mpc_reader *p_reader);
     105
     106/// Gets length of stream si, in seconds.
     107/// \return length of stream in seconds
     108double mpc_streaminfo_get_length(mpc_streaminfo *si);
     109
     110/// Returns length of stream si, in samples.
     111/// \return length of stream in samples
     112mpc_int64_t mpc_streaminfo_get_length_samples(mpc_streaminfo *si);
     113
     114#ifdef __cplusplus
     115}
     116#endif
     117#endif
Note: See TracChangeset for help on using the changeset viewer.