consistency

pull/14/head
Dimitri Diakopoulos 10 years ago
parent 4961219cf3
commit 5aba7f90aa

@ -39,9 +39,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
namespace nqr namespace nqr
{ {
const unsigned int FRAME_SIZE = 512; const uint32_t FRAME_SIZE = 512;
const int CHANNELS = 2; const int32_t CHANNELS = 2;
const int BUFFER_LENGTH = FRAME_SIZE * CHANNELS; const int32_t BUFFER_LENGTH = FRAME_SIZE * CHANNELS;
struct DeviceInfo struct DeviceInfo
{ {

@ -33,7 +33,7 @@ using namespace nqr;
static RingBufferT<float> buffer(BUFFER_LENGTH); static RingBufferT<float> buffer(BUFFER_LENGTH);
static int rt_callback(void * output_buffer, void * input_buffer, unsigned int num_bufferframes, double stream_time, RtAudioStreamStatus status, void * user_data) static int rt_callback(void * output_buffer, void * input_buffer, uint32_t num_bufferframes, double stream_time, RtAudioStreamStatus status, void * user_data)
{ {
if (status) std::cerr << "[rtaudio] Buffer over or underflow" << std::endl; if (status) std::cerr << "[rtaudio] Buffer over or underflow" << std::endl;
@ -73,11 +73,11 @@ void AudioDevice::ListAudioDevices()
std::unique_ptr<RtAudio> tempDevice(new RtAudio); std::unique_ptr<RtAudio> tempDevice(new RtAudio);
RtAudio::DeviceInfo info; RtAudio::DeviceInfo info;
unsigned int devices = tempDevice->getDeviceCount(); uint32_t devices = tempDevice->getDeviceCount();
std::cout << "[rtaudio] Found: " << devices << " device(s)\n"; std::cout << "[rtaudio] Found: " << devices << " device(s)\n";
for (unsigned int i = 0; i < devices; ++i) for (uint32_t i = 0; i < devices; ++i)
{ {
info = tempDevice->getDeviceInfo(i); info = tempDevice->getDeviceInfo(i);
std::cout << "\tDevice: " << i << " - " << info.name << std::endl; std::cout << "\tDevice: " << i << " - " << info.name << std::endl;

@ -36,7 +36,7 @@ class FlacDecoderInternal
public: public:
// N.B.: FLAC is a big-endian format. All values are unsigned. // FLAC is a big-endian format. All values are unsigned.
FlacDecoderInternal(AudioData * d, std::string filepath) : d(d) FlacDecoderInternal(AudioData * d, std::string filepath) : d(d)
{ {
@ -118,7 +118,7 @@ public:
// libflab callbacks // // libflab callbacks //
/////////////////////// ///////////////////////
static FLAC__StreamDecoderWriteStatus s_writeCallback(const FLAC__StreamDecoder*, const FLAC__Frame* frame, const FLAC__int32* const buffer[], void* userPtr) static FLAC__StreamDecoderWriteStatus s_writeCallback(const FLAC__StreamDecoder *, const FLAC__Frame* frame, const FLAC__int32 * const buffer[], void * userPtr)
{ {
FlacDecoderInternal * decoder = reinterpret_cast<FlacDecoderInternal *>(userPtr); FlacDecoderInternal * decoder = reinterpret_cast<FlacDecoderInternal *>(userPtr);
@ -126,7 +126,7 @@ public:
auto dataPtr = decoder->internalBuffer.data(); auto dataPtr = decoder->internalBuffer.data();
for(unsigned int i = 0; i < frame->header.blocksize; i++) for (uint32_t i = 0; i < frame->header.blocksize; i++)
{ {
for(int j = 0; j < decoder->d->channelCount; j++) for(int j = 0; j < decoder->d->channelCount; j++)
{ {
@ -138,12 +138,12 @@ public:
return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
} }
static void s_metadataCallback (const FLAC__StreamDecoder*, const FLAC__StreamMetadata* metadata, void* userPtr) static void s_metadataCallback (const FLAC__StreamDecoder *, const FLAC__StreamMetadata * metadata, void * userPtr)
{ {
static_cast<FlacDecoderInternal*>(userPtr)->processMetadata(metadata->data.stream_info); static_cast<FlacDecoderInternal*>(userPtr)->processMetadata(metadata->data.stream_info);
} }
static void s_errorCallback (const FLAC__StreamDecoder *, FLAC__StreamDecoderErrorStatus status, void*) static void s_errorCallback (const FLAC__StreamDecoder *, FLAC__StreamDecoderErrorStatus status, void *)
{ {
std::cerr << "FLAC Decoder Error: " << FLAC__StreamDecoderErrorStatusString[status] << std::endl; std::cerr << "FLAC Decoder Error: " << FLAC__StreamDecoderErrorStatusString[status] << std::endl;
} }

@ -134,7 +134,7 @@ public:
size_t totalSamplesRead = 0; size_t totalSamplesRead = 0;
while(MPC_TRUE) while (true)
{ {
mpc_frame_info frame; mpc_frame_info frame;

@ -36,12 +36,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif #endif
#include "musepack/libmpcdec/huffman.c" #include "musepack/libmpcdec/huffman.c"
//#include "musepack/libmpcdec/mpc_decoder.c"
//#include "musepack/libmpcdec/mpc_reader.c"
//#include "musepack/libmpcdec/mpc_bits_reader.c"
//#include "musepack/libmpcdec/mpc_demux.c"
#include "musepack/libmpcdec/requant.c" #include "musepack/libmpcdec/requant.c"
#include "musepack/libmpcdec/streaminfo.c" #include "musepack/libmpcdec/streaminfo.c"
#include "musepack/libmpcdec/synth_filter.c" #include "musepack/libmpcdec/synth_filter.c"

@ -39,12 +39,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#undef HAVE_CONFIG_H #undef HAVE_CONFIG_H
#define USE_ALLOCA 1 #define USE_ALLOCA 1
#define OPUS_BUILD 1 #define OPUS_BUILD 1
/* Enable SSE functions, if compiled with SSE/SSE2 (note that AMD64 implies SSE2) */ /* Enable SSE functions, if compiled with SSE/SSE2 (note that AMD64 implies SSE2) */
#if defined(_M_X64) || (defined(_M_IX86_FP) && (_M_IX86_FP >= 1)) #if defined(_M_X64) || (defined(_M_IX86_FP) && (_M_IX86_FP >= 1))
#define __SSE__ 1 #define __SSE__ 1
#endif #endif
////////// //////////

@ -59,7 +59,7 @@ WaveChunkHeader nqr::MakeWaveHeader(const EncoderParams param, const int sampleR
header.channel_count = param.channelCount; header.channel_count = param.channelCount;
header.sample_rate = sampleRate; header.sample_rate = sampleRate;
header.data_rate = sampleRate * param.channelCount * (bitdepth / 8); header.data_rate = sampleRate * param.channelCount * (bitdepth / 8);
header.frame_size = param.channelCount * (bitdepth/ 8); header.frame_size = param.channelCount * (bitdepth / 8);
header.bit_depth = bitdepth; header.bit_depth = bitdepth;
return header; return header;

Loading…
Cancel
Save