rem: { NP_Entry,     (ULONG) RecSlaveEntry }, { NP_Name,      (ULONG) LibName       }, { NP_Priority,  1                     }, { TAG_DONE,     0                     }
add: { NP_Entry,     (ULONG) &recslaveentry }, { NP_Name,      (ULONG) LibName        }, { NP_Priority,  1                      }, { TAG_DONE,     0                      }
context: ULONG _AHIsub_Start(    ULONG Flags,    struct AHIAudioCtrlDrv *AudioCtrl,    struct DriverBase*      AHIsubBase ){  struct FilesaveBase* FilesaveBase = (struct FilesaveBase*) AHIsubBase;  AHIsub_Stop(Flags, AudioCtrl);  if(Flags & AHISF_PLAY)  {    ULONG savebufferlength;    if(!(dd->fs_MixBuffer = AllocVec(AudioCtrl->ahiac_BuffSize, MEMF_ANY)))      return AHIE_NOMEM;    dd->fs_SaveBufferSize = AudioCtrl->ahiac_MaxBuffSamples;    // S16 has two buffers (L/R) instead    if((AudioCtrl->ahiac_Flags & AHIACF_STEREO) && dd->fs_Format != FORMAT_S16)    {      dd->fs_SaveBufferSize <<=1;    }    if(dd->fs_SaveBufferSize < SAVEBUFFERSIZE)    {      dd->fs_SaveBufferSize = SAVEBUFFERSIZE;    }    savebufferlength = dd->fs_SaveBufferSize;    switch(dd->fs_Format)    {      case FORMAT_8SVX:        break;      case FORMAT_AIFF:        savebufferlength <<= 1;        break;      case FORMAT_AIFC:        savebufferlength <<= 1;        break;      case FORMAT_S16:        savebufferlength <<= 1;        break;      case FORMAT_WAVE:        savebufferlength <<= 1;        break;      default:        break;    }    if(!(dd->fs_SaveBuffer = AllocVec(savebufferlength, MEMF_ANY)))    {      return AHIE_NOMEM;    }    if ((AudioCtrl->ahiac_Flags & AHIACF_STEREO) && dd->fs_Format == FORMAT_S16)    {      if(!(dd->fs_SaveBuffer2 = AllocVec(savebufferlength, MEMF_ANY)))      {        return AHIE_NOMEM;      }    }    if(AslRequest(dd->fs_FileReq,NULL))    {      struct TagItem proctags[] =      {	{ NP_Entry,     (ULONG) PlaySlaveEntry },	{ NP_Name,      (ULONG) LibName        },	{ NP_Priority,  -1                     }, // It's a number cruncher...	{ NP_StackSize, 10000,                 },	{ TAG_DONE,     0                      }      };      Forbid();      dd->fs_SlaveTask = CreateNewProc( proctags );            if( dd->fs_SlaveTask != NULL )      {        dd->fs_SlaveTask->pr_Task.tc_UserData = AudioCtrl;      }      Permit();      if(dd->fs_SlaveTask)      {        Wait(1L<<dd->fs_MasterSignal);  // Wait for slave to come alive        if(dd->fs_SlaveTask == NULL)    // Is slave alive or dead?        {          return AHIE_UNKNOWN;        }      }      else      {        return AHIE_NOMEM;      }    }    else    {      if(IoErr())      {        return AHIE_NOMEM;    //error occured      }      else      {        return AHIE_ABORTED;  //requester cancelled      }    }  }  if(Flags & AHISF_RECORD)  {    if(!(dd->fs_RecBuffer = AllocVec(RECBUFFERSIZE*4,MEMF_ANY)))    {      return AHIE_NOMEM;    }    if(AslRequest(dd->fs_RecFileReq,NULL))    {      struct TagItem proctags[] =      {	{ NP_Entry,     (ULONG) RecSlaveEntry },	{ NP_Name,      (ULONG) LibName       },	{ NP_Priority,  1                     },  // Make it steady...	{ TAG_DONE,     0                     }      };      Delay(TICKS_PER_SECOND);         // Wait for window to close etc...      Forbid();      dd->fs_RecSlaveTask = CreateNewProc( proctags );	      if( dd->fs_RecSlaveTask != NULL )      {        dd->fs_RecSlaveTask->pr_Task.tc_UserData = AudioCtrl;      }      Permit();      if(dd->fs_RecSlaveTask)      {        Wait(1L<<dd->fs_RecMasterSignal);  // Wait for slave to come alive        if(dd->fs_RecSlaveTask == NULL)    // Is slave alive or dead?        {          return AHIE_UNKNOWN;        }      }      else      {        return AHIE_NOMEM;      }    }    else    {      if(IoErr())      {        return AHIE_NOMEM;    //error occured      }      else      {        return AHIE_ABORTED;  //requester cancelled      }    }  }  return AHIE_OK;}