[commit] r2159 - Latest updates for soundplugin.h and macintosh carbon VM sound recording fixes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[commit] r2159 - Latest updates for soundplugin.h and macintosh carbon VM sound recording fixes

commits-3
 
Author: johnmci
Date: 2010-03-30 14:54:16 -0700 (Tue, 30 Mar 2010)
New Revision: 2159

Modified:
   trunk/platforms/Cross/plugins/SoundPlugin/SoundPlugin.h
   trunk/platforms/Mac OS/plugins/SoundPlugin/sqMacUnixInterfaceSound.c
   trunk/platforms/Mac OS/plugins/SoundPlugin/sqMacUnixInterfaceSound.h
   trunk/platforms/Mac OS/plugins/SoundPlugin/sqUnixSoundMacOSXJMM.c
   trunk/platforms/Mac OS/vm/Documentation/4.x.x Release Notes.rtf
Log:
Latest updates for soundplugin.h and macintosh carbon VM sound recording fixes

Modified: trunk/platforms/Cross/plugins/SoundPlugin/SoundPlugin.h
===================================================================
--- trunk/platforms/Cross/plugins/SoundPlugin/SoundPlugin.h 2010-03-29 01:16:36 UTC (rev 2158)
+++ trunk/platforms/Cross/plugins/SoundPlugin/SoundPlugin.h 2010-03-30 21:54:16 UTC (rev 2159)
@@ -6,8 +6,8 @@
 
 /* sound output */
 sqInt snd_AvailableSpace(void);
-sqInt snd_InsertSamplesFromLeadTime(sqInt frameCount, usqInt * srcBufPtr, sqInt samplesOfLeadTime);
-sqInt snd_PlaySamplesFromAtLength(sqInt frameCount, usqInt* arrayIndex, sqInt startIndex);
+sqInt snd_InsertSamplesFromLeadTime(sqInt frameCount, void *srcBufPtr, sqInt samplesOfLeadTime);
+sqInt snd_PlaySamplesFromAtLength(sqInt frameCount, void *srcBufPtr, sqInt startIndex);
 sqInt snd_PlaySilence(void);
 sqInt snd_Start(sqInt frameCount, sqInt samplesPerSec, sqInt stereo, sqInt semaIndex);
 sqInt snd_Stop(void);
@@ -17,11 +17,12 @@
 sqInt snd_StartRecording(sqInt desiredSamplesPerSec, sqInt stereo, sqInt semaIndex);
 sqInt snd_StopRecording(void);
 double snd_GetRecordingSampleRate(void);
-sqInt snd_RecordSamplesIntoAtLength(usqInt * buf, sqInt startSliceIndex, sqInt bufferSizeInBytes);
-void snd_Volume(double *left, double *right); //[hidden email] Nov 6th 2000
-void snd_SetVolume(double left, double right);//[hidden email] Nov 6th 2000
+sqInt snd_RecordSamplesIntoAtLength(void *buf, sqInt startSliceIndex, sqInt bufferSizeInBytes);
+void snd_Volume(double *left, double *right);  /* [hidden email] Nov 6th 2000 */
+void snd_SetVolume(double left, double right); /* [hidden email] Nov 6th 2000 */
 
 /* mixer interface */
 sqInt snd_GetSwitch(sqInt identifier, sqInt captureFlag, sqInt channel);
 sqInt snd_SetSwitch(sqInt identifier, sqInt captureFlag, sqInt parameter);
 sqInt snd_SetDevice(sqInt identifier, char *name);
+

Modified: trunk/platforms/Mac OS/plugins/SoundPlugin/sqMacUnixInterfaceSound.c
===================================================================
--- trunk/platforms/Mac OS/plugins/SoundPlugin/sqMacUnixInterfaceSound.c 2010-03-29 01:16:36 UTC (rev 2158)
+++ trunk/platforms/Mac OS/plugins/SoundPlugin/sqMacUnixInterfaceSound.c 2010-03-30 21:54:16 UTC (rev 2159)
@@ -7,9 +7,9 @@
  *
  */
 
-#include "sqMacUnixInterfaceSound.h"
 
 #include "sq.h"
+#include "sqMacUnixInterfaceSound.h"
 #include "SoundPlugin.h"
 #include "SqModule.h"
 #include "SqSound.h"
@@ -36,14 +36,14 @@
   return sound_AvailableSpace();
 }
 
-sqInt snd_InsertSamplesFromLeadTime(sqInt frameCount, usqInt* srcBufPtr, sqInt samplesOfLeadTime)
+sqInt snd_InsertSamplesFromLeadTime(sqInt frameCount, void* srcBufPtr, sqInt samplesOfLeadTime)
 {
   return sound_InsertSamplesFromLeadTime(frameCount, srcBufPtr, samplesOfLeadTime);
 }
 
-sqInt snd_PlaySamplesFromAtLength(sqInt frameCount, usqInt* arrayIndex, sqInt startIndex)
+sqInt snd_PlaySamplesFromAtLength(sqInt frameCount, void *srcBufPtr, sqInt startIndex)
 {
-  return sound_PlaySamplesFromAtLength(frameCount, arrayIndex, startIndex);
+  return sound_PlaySamplesFromAtLength(frameCount, srcBufPtr, startIndex);
 }
 
 sqInt snd_PlaySilence(void)
@@ -78,7 +78,7 @@
   return sound_GetRecordingSampleRate();
 }
 
-sqInt snd_RecordSamplesIntoAtLength(usqInt *buf, sqInt startSliceIndex, sqInt bufferSizeInBytes)
+sqInt snd_RecordSamplesIntoAtLength(void *buf, sqInt startSliceIndex, sqInt bufferSizeInBytes)
 {
   return sound_RecordSamplesIntoAtLength(buf, startSliceIndex, bufferSizeInBytes);
 }

Modified: trunk/platforms/Mac OS/plugins/SoundPlugin/sqMacUnixInterfaceSound.h
===================================================================
--- trunk/platforms/Mac OS/plugins/SoundPlugin/sqMacUnixInterfaceSound.h 2010-03-29 01:16:36 UTC (rev 2158)
+++ trunk/platforms/Mac OS/plugins/SoundPlugin/sqMacUnixInterfaceSound.h 2010-03-30 21:54:16 UTC (rev 2159)
@@ -6,21 +6,18 @@
  *
  */
 
-       char *dpyPixels  = 0;
-       int dpyPitch   = 0;
- int noSoundMixer = 0;
-  int    sound_AvailableSpace(void);
-  int    sound_InsertSamplesFromLeadTime(int frameCount, int srcBufPtr, int samplesOfLeadTime);
-  int    sound_PlaySamplesFromAtLength(int frameCount, int arrayIndex, int startIndex);
-  int    sound_PlaySilence(void);
-  int    sound_Start(int frameCount, int samplesPerSec, int stereo, int semaIndex);
-  int    sound_Stop(void);
+ sqInt    sound_AvailableSpace(void);
+  sqInt    sound_InsertSamplesFromLeadTime(sqInt frameCount, void* srcBufPtr, sqInt samplesOfLeadTime);
+  sqInt    sound_PlaySamplesFromAtLength(sqInt frameCount, void* srcBufPtr, sqInt startIndex);
+  sqInt    sound_PlaySilence(void);
+  sqInt    sound_Start(sqInt frameCount, sqInt samplesPerSec, sqInt stereo, sqInt semaIndex);
+  sqInt    sound_Stop(void);
   /* input */
-  int    sound_StartRecording(int desiredSamplesPerSec, int stereo, int semaIndex);
-  int    sound_StopRecording(void);
+  sqInt    sound_StartRecording(sqInt desiredSamplesPerSec, sqInt stereo, sqInt semaIndex);
+  sqInt    sound_StopRecording(void);
   double sound_GetRecordingSampleRate(void);
-  int    sound_RecordSamplesIntoAtLength(int buf, int startSliceIndex, int bufferSizeInBytes);
+  sqInt    sound_RecordSamplesIntoAtLength(void * buf, sqInt startSliceIndex, sqInt bufferSizeInBytes);
   /* mixer */
   void sound_Volume(double *left, double *right);
   void sound_SetVolume(double left, double right);
-  int    sound_SetRecordLevel(int level);
+  sqInt    sound_SetRecordLevel(sqInt level);

Modified: trunk/platforms/Mac OS/plugins/SoundPlugin/sqUnixSoundMacOSXJMM.c
===================================================================
--- trunk/platforms/Mac OS/plugins/SoundPlugin/sqUnixSoundMacOSXJMM.c 2010-03-29 01:16:36 UTC (rev 2158)
+++ trunk/platforms/Mac OS/plugins/SoundPlugin/sqUnixSoundMacOSXJMM.c 2010-03-30 21:54:16 UTC (rev 2159)
@@ -66,6 +66,7 @@
 #include <string.h>
 #include <assert.h>
 
+
 #define SqueakFrameSize 4 // guaranteed (see class SoundPlayer)
 #define DeviceFrameSize 8 // ditto (<CoreAudio/AudioHardware.h>, para 9)
 
@@ -77,12 +78,17 @@
 #if (!TESTING)
 # include "sq.h"
 #else
-   sqInt noSoundMixer= 0;
    inline sqInt signalSemaphoreWithIndex(sqInt sema) { return 0; }
    inline sqInt success(sqInt flag) { return 0; }
    inline sqInt primitiveFail(void) { return -1; }
 #endif
 
+#include "sqMacUnixInterfaceSound.h"
+
+char *dpyPixels  = 0;
+sqInt dpyPitch   = 0;
+sqInt noSoundMixer = 0;
+
 #if (DEBUG)
 
  void dumpFormat(AudioStreamBasicDescription *fmt); // atend
@@ -737,9 +743,7 @@
 // Note: this is only used when the "sound quick start" preference is
 // enabled in the image.
 //
- sqInt sound_InsertSamplesFromLeadTime(sqInt frameCount, usqInt* srcBufPtr,
-  sqInt framesOfLeadTime);
- sqInt sound_InsertSamplesFromLeadTime(sqInt frameCount, usqInt* srcBufPtr,
+ sqInt sound_InsertSamplesFromLeadTime(sqInt frameCount, void* srcBufPtr,
   sqInt framesOfLeadTime)
 {
 #pragma unused(framesOfLeadTime)
@@ -828,8 +832,8 @@
 // play (exactly) frameCount of samples (and no less, since the result is
 // ignored).
 //
- sqInt sound_PlaySamplesFromAtLength(sqInt frameCount, usqInt* arrayIndex, sqInt startIndex);
-  sqInt sound_PlaySamplesFromAtLength(sqInt frameCount, usqInt* arrayIndex, sqInt startIndex)
+
+  sqInt sound_PlaySamplesFromAtLength(sqInt frameCount, void* arrayIndex, sqInt startIndex)
 {
   if (output)
     {
@@ -965,15 +969,18 @@
 }
 
 
- sqInt sound_RecordSamplesIntoAtLength(sqInt buf, sqInt startSliceIndex, sqInt bufferSizeInBytes);
- sqInt sound_RecordSamplesIntoAtLength(sqInt buf, sqInt startSliceIndex, sqInt bufferSizeInBytes)
+ sqInt sound_RecordSamplesIntoAtLength(void * buf, sqInt startSliceIndex, sqInt bufferSizeInBytes)
 {
   if (input)
     {
       if (Buffer_avail(input->buffer) >= (512 * DeviceFrameSize))
  {
   sqInt    start= startSliceIndex * SqueakFrameSize / 2;
-  UInt32 count= min(input->cvtBufSize, bufferSizeInBytes - start);
+  sqInt count= min(input->cvtBufSize, bufferSizeInBytes);
+ if (count <= 0) {
+ success(false);
+ return 0;
+ }
   if (kAudioHardwareNoError == AudioConverterFillBuffer(input->converter, bufferDataProc, input,
  &count, (char *)buf + start))
     return count / (SqueakFrameSize / 2) / input->channels;

Modified: trunk/platforms/Mac OS/vm/Documentation/4.x.x Release Notes.rtf
===================================================================
--- trunk/platforms/Mac OS/vm/Documentation/4.x.x Release Notes.rtf 2010-03-29 01:16:36 UTC (rev 2158)
+++ trunk/platforms/Mac OS/vm/Documentation/4.x.x Release Notes.rtf 2010-03-30 21:54:16 UTC (rev 2159)
@@ -1,4 +1,4 @@
-{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf250
+{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf290
 {\fonttbl\f0\fnil\fcharset0 Geneva;\f1\fswiss\fcharset0 Helvetica;}
 {\colortbl;\red255\green255\blue255;\red0\green116\blue0;}
 \margl1440\margr1440\vieww13080\viewh12220\viewkind0
@@ -15,11 +15,16 @@
 Aug 20th, 2009 (4.2.1b1)\
 Sept 17th, 2009 (4.2.2b1)\
 Mar 13th, 2010 (4.2.3b1)\
+Mar 29th 2010 (4.2.4b1)\
 \
 \
-\
 Still yet to do, in future versions -> Verify that file delete rename etc works on aliases, not the targets. (Yawn, someday)\
 \
+4.2.4b1 We update to VMMaker 166 \
+ imageFormatBackwardCompatibilityVersion\
+ uti clock \
+ We fix sound record buffer crash after vmmaker 163\
+ \
 4.2.3b1   We update to VMMaker 160\
 \
  Reference Mantis 7405: Array new: SmallInteger maxVal broken.\