# HG changeset patch # User Vytautas JanĨauskas # Date 1378928284 -10800 # Node ID b9df6b3fd5ef84db90f14a1d4cfe0627a365f0f1 # Parent 91ee78cdba6c97bcf436ed64622a6265745f33d0 Fix includes in player and recorder class files, add instructions to build them * module-files: lines to build player_class.cc and recorder_class.cc * player_class.cc, recorder_class.cc: change includes to use local versions of Octave headers, also added bits_to_format utility function diff -r 91ee78cdba6c -r b9df6b3fd5ef libinterp/dldfcn/module-files --- a/libinterp/dldfcn/module-files Wed Sep 11 22:08:20 2013 +0300 +++ b/libinterp/dldfcn/module-files Wed Sep 11 22:38:04 2013 +0300 @@ -23,4 +23,6 @@ audioread.cc|$(SNDFILE_CPPFLAGS)|$(SNDFILE_LDFLAGS)|$(SNDFILE_LIBS) audiowrite.cc|$(SNDFILE_CPPFLAGS)|$(SNDFILE_LDFLAGS)|$(SNDFILE_LIBS) audioinfo.cc|$(SNDFILE_CPPFLAGS)|$(SNDFILE_LDFLAGS)|$(SNDFILE_LIBS) -audiodevinfo.cc|$(PORTAUDIO_CPPFLAGS)|$(PORTAUDIO_LDFLAGS)|$(PORTAUDIO_LIBS) \ No newline at end of file +audiodevinfo.cc|$(PORTAUDIO_CPPFLAGS)|$(PORTAUDIO_LDFLAGS)|$(PORTAUDIO_LIBS) +player_class.cc|$(PORTAUDIO_CPPFLAGS)|$(PORTAUDIO_LDFLAGS)|$(PORTAUDIO_LIBS) +recorder_class.cc|$(PORTAUDIO_CPPFLAGS)|$(PORTAUDIO_LDFLAGS)|$(PORTAUDIO_LIBS) \ No newline at end of file diff -r 91ee78cdba6c -r b9df6b3fd5ef libinterp/dldfcn/player_class.cc --- a/libinterp/dldfcn/player_class.cc Wed Sep 11 22:08:20 2013 +0300 +++ b/libinterp/dldfcn/player_class.cc Wed Sep 11 22:38:04 2013 +0300 @@ -1,12 +1,39 @@ -#include -#include -#include +#include "oct.h" +#include "ov.h" +#include "parse.h" #include #include -#include "common.h" #include "player_class.h" +PaSampleFormat bits_to_format(int bits) +{ + if (bits == 8) + { + return paInt8; + } + else if (bits == 16) + { + return paInt16; + } + else if (bits == 24) + { + return paInt24; + } + else if (bits == 32) + { + return paInt32; + } + else if (bits == -1) + { + return paFloat32; + } + else + { + return 0; + } +} + #define BUFFER_SIZE 512 DEFINE_OCTAVE_ALLOCATOR (audioplayer); diff -r 91ee78cdba6c -r b9df6b3fd5ef libinterp/dldfcn/player_class.h --- a/libinterp/dldfcn/player_class.h Wed Sep 11 22:08:20 2013 +0300 +++ b/libinterp/dldfcn/player_class.h Wed Sep 11 22:38:04 2013 +0300 @@ -2,8 +2,8 @@ #define PLAYER_CLASS_H #include -#include -#include +#include "oct.h" +#include "ov-int32.h" #include #include "player_class.h" diff -r 91ee78cdba6c -r b9df6b3fd5ef libinterp/dldfcn/recorder_class.cc --- a/libinterp/dldfcn/recorder_class.cc Wed Sep 11 22:08:20 2013 +0300 +++ b/libinterp/dldfcn/recorder_class.cc Wed Sep 11 22:38:04 2013 +0300 @@ -1,13 +1,40 @@ -#include -#include -#include +#include "oct.h" +#include "ov.h" +#include "parse.h" #include #include -#include "common.h" #include "player_class.h" #include "recorder_class.h" +PaSampleFormat bits_to_format(int bits) +{ + if (bits == 8) + { + return paInt8; + } + else if (bits == 16) + { + return paInt16; + } + else if (bits == 24) + { + return paInt24; + } + else if (bits == 32) + { + return paInt32; + } + else if (bits == -1) + { + return paFloat32; + } + else + { + return 0; + } +} + #define BUFFER_SIZE 512 DEFINE_OCTAVE_ALLOCATOR (audiorecorder); diff -r 91ee78cdba6c -r b9df6b3fd5ef libinterp/dldfcn/recorder_class.h --- a/libinterp/dldfcn/recorder_class.h Wed Sep 11 22:08:20 2013 +0300 +++ b/libinterp/dldfcn/recorder_class.h Wed Sep 11 22:38:04 2013 +0300 @@ -3,8 +3,8 @@ #include -#include -#include +#include "oct.h" +#include "ov-int32.h" #include #include "player_class.h"