예제 #1
0
/*------------------------------------ cmd_List ---*/
Pvoid
cmd_List(SpeakPtr xx,
         PSymbol  message,
         short    argc,
         PAtom    argv)
{
#pragma unused(message)
  bool  okSoFar = true;

  EnterCallback();
  if (xx && xx->fSpeaker)
  {
    if (xx->fPaused)
    {
      xx->fActive = xx->fPaused = false;
      StopSpeechAt(xx->fSpeaker, kImmediate);
      outlet_bang(xx->fDoneOut);
    }
    else if (xx->fActive)
    {
      LOG_POST_1(OUTPUT_PREFIX "previous speech not finished")
      xx->fActive = false;
      StopSpeechAt(xx->fSpeaker, kImmediate);
      outlet_bang(xx->fDoneOut);
    }
    clearDataBuffer(*xx->fBuffer);
    for (short ii = 0; okSoFar && (ii < argc); ++ii)
      okSoFar = addAtomToBuffer(OUR_NAME, *xx->fBuffer, &argv[ii]);
    if (okSoFar)
      transmitBuffer(xx);
  }
  ExitMaxMessageHandler()
} /* cmd_List */
예제 #2
0
int prSetSpeechStop(struct VMGlobals *g, int numArgsPushed){

	OSErr theErr = noErr;
	//PyrSlot *a = g->sp-2;
	PyrSlot *b = g->sp-1;
	PyrSlot *c = g->sp;
	int  selector [3] = {kImmediate, kEndOfWord, kEndOfWord};
	int val;
	int chan;
	slotIntVal(b, &chan);
	slotIntVal(c, &val);
	StopSpeechAt(fCurSpeechChannel[chan], selector[val]);
	if(speechStrings[chan] != NULL) {
		free(speechStrings[chan]);
		speechStrings[chan] = NULL;
	}

	return errNone;
}