diff libinterp/dldfcn/player_class.cc @ 19509:b9df6b3fd5ef

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
author Vytautas Jančauskas <unaudio@gmail.com>
date Wed, 11 Sep 2013 22:38:04 +0300
parents 91ee78cdba6c
children 8bb399569393
line wrap: on
line diff
--- 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 <octave/oct.h>
-#include <octave/ov.h>
-#include <octave/parse.h>
+#include "oct.h"
+#include "ov.h"
+#include "parse.h"
 #include <portaudio.h>
 #include <stdint.h>
 
-#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);