Changeset 3 for trunk/src/sample.cpp


Ignore:
Timestamp:
08/12/06 16:21:35 (18 years ago)
Author:
zorg
Message:

Update to 1.2 (work in progress)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sample.cpp

    r1 r3  
    3737#include <time.h>
    3838
    39 #include "musepack/musepack.h"
     39#include <mpcdec/mpcdec.h>
    4040
    4141/*
     
    4646    FILE *file;
    4747    long size;
    48     BOOL seekable;
     48    mpc_bool_t seekable;
    4949} reader_data;
    5050
     
    5959}
    6060
    61 BOOL
     61mpc_bool_t
    6262seek_impl(void *data, mpc_int32_t offset)
    6363{
     
    8080}
    8181
    82 BOOL
     82mpc_bool_t
    8383canseek_impl(void *data)
    8484{
     
    133133
    134134        m_data_bytes_written = 0;
    135     } BOOL WriteSamples(const MPC_SAMPLE_FORMAT * p_buffer, unsigned p_size) {
     135    } mpc_bool_t WriteSamples(const MPC_SAMPLE_FORMAT * p_buffer, unsigned p_size) {
    136136        unsigned n;
    137137        int clip_min = -1 << (m_bps - 1),
     
    172172  private:
    173173
    174     BOOL Seek(unsigned p_offset) {
     174    mpc_bool_t Seek(unsigned p_offset) {
    175175        return !fseek(m_file, p_offset, SEEK_SET);
    176176    }
    177177
    178     BOOL WriteRaw(const void *p_buffer, unsigned p_bytes) {
     178    mpc_bool_t WriteRaw(const void *p_buffer, unsigned p_bytes) {
    179179        return fwrite(p_buffer, 1, p_bytes, m_file) == p_bytes;
    180180    }
    181181
    182     BOOL WriteDword(unsigned long p_val) {
     182    mpc_bool_t WriteDword(unsigned long p_val) {
    183183        return WriteInt(p_val, 32);
    184184    }
    185     BOOL WriteWord(unsigned short p_val) {
     185    mpc_bool_t WriteWord(unsigned short p_val) {
    186186        return WriteInt(p_val, 16);
    187187    }
    188188
    189189    // write a little-endian number properly
    190     BOOL WriteInt(unsigned int p_val, unsigned p_width_bits) {
     190    mpc_bool_t WriteInt(unsigned int p_val, unsigned p_width_bits) {
    191191        unsigned char temp;
    192192        unsigned shift = 0;
     
    284284    begin = clock();
    285285    unsigned total_samples = 0;
    286     BOOL successful = FALSE;
     286    mpc_bool_t successful = FALSE;
    287287    for (;;) {
    288288        unsigned status = mpc_decoder_decode(&decoder, sample_buffer, 0, 0);
Note: See TracChangeset for help on using the changeset viewer.