• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ pd_error函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中pd_error函数的典型用法代码示例。如果您正苦于以下问题:C++ pd_error函数的具体用法?C++ pd_error怎么用?C++ pd_error使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了pd_error函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: fwriteln_open

static void fwriteln_open (t_fwriteln *x, t_symbol *s, t_symbol*type)
{
   char* filename;

   string_copy(s->s_name, &filename);

   sys_bashfilename (filename, filename);

   fwriteln_close (x);

/*   if(0==type || type!=gensym("cr")) {
     pd_error(x, "unknown type '%s'", (type)?type->s_name:"");
     return;
   }*/

   if (type==gensym("cr"))
      strcpy(x->linebreak_chr,"\n");
   else
      strcpy(x->linebreak_chr,";\n");

   if (!(x->x_file=fopen(filename, "w"))) {
      pd_error(x, "failed to open %128s",filename);
      free(filename);
      return;
   }
   string_copy(filename, &x->x_filename);
   free(filename);
   x->x_textbuf = (char *) getbytes (MAXPDSTRING + 1);
}
开发者ID:Tzero2,项目名称:pd,代码行数:29,代码来源:fwriteln.c


示例2: dict_unbind

/* adapted pd_unbind() from m_pd.c */
void dict_unbind(t_dict *x, t_pd *obj, t_symbol *s)
{
#ifdef DICT_DEBUG
    post("unbind %x from \"%s\" at %x", (int)obj, s->s_name, (int)s);
#endif
    if (s->s_thing == obj) s->s_thing = 0;
    else if (s->s_thing && *s->s_thing == x->d_bindlist_class)
    {
    	    /* bindlists always have at least two elements... if the number
    	    goes down to one, get rid of the bindlist and bind the symbol
    	    straight to the remaining element. */

    	t_dict_bindlist *b = (t_dict_bindlist *)s->s_thing;
    	t_dict_bindelem *e, *e2;
    	if ((e = b->b_list)->e_who == obj)
    	{
    	    b->b_list = e->e_next;
    	    freebytes(e, sizeof(t_dict_bindelem));
    	}
    	else for (e = b->b_list; e2 = e->e_next; e = e2)
    	    if (e2->e_who == obj)
    	{
    	    e->e_next = e2->e_next;
    	    freebytes(e2, sizeof(t_dict_bindelem));
    	    break;
    	}
    	if (!b->b_list->e_next)
    	{
    	    s->s_thing = b->b_list->e_who;
    	    freebytes(b->b_list, sizeof(t_dict_bindelem));
    	    pd_free(&b->b_pd);
    	}
    }
    else pd_error(obj, "%s: couldn't unbind", s->s_name);
}
开发者ID:pure-data,项目名称:xeq,代码行数:36,代码来源:dict.c


示例3: pd_vmess

    /* convenience routine giving a stdarg interface to typedmess().  Only
    ten args supported; it seems unlikely anyone will need more since
    longer messages are likely to be programmatically generated anyway. */
void pd_vmess(t_pd *x, t_symbol *sel, char *fmt, ...)
{
    va_list ap;
    t_atom arg[10], *at = arg;
    int nargs = 0;
    char *fp = fmt;

    va_start(ap, fmt);
    while (1)
    {
        if (nargs >= 10)
        {
            pd_error(x, "pd_vmess: only 10 allowed");
            break;
        }
        switch(*fp++)
        {
        case 'f': SETFLOAT(at, va_arg(ap, double)); break;
        case 's': SETSYMBOL(at, va_arg(ap, t_symbol *)); break;
        case 't':
            SETBLOB(at, va_arg(ap, t_blob *));
            /*post("pd_vmess: arg[0].a_w.w_blob = %p", arg[0].a_w.w_blob);*/
            break; /* MP 20061226 blob type */
        case 'i': SETFLOAT(at, va_arg(ap, t_int)); break;       
        case 'p': SETPOINTER(at, va_arg(ap, t_gpointer *)); break;
        default: goto done;
        }
        at++;
        nargs++;
    }
done:
    va_end(ap);
    typedmess(x, sel, nargs, arg);
}
开发者ID:IvanKhodorich,项目名称:pd,代码行数:37,代码来源:m_class.c


示例4: colorpanel_list

static void colorpanel_list(t_colorpanel *x, t_symbol *s, int argc, t_atom *argv)
{
    t_symbol *tmp_symbol = s; /* <-- this gets rid of the unused variable warning */
    int i;
    unsigned int tmp_int;
    char color_buffer[3];
    char color_string[MAXPDSTRING];

    strncpy(color_string,"#",MAXPDSTRING);
    if(argc > 3) 
        logpost(x, 2, "[colorpanel] warning more than three elements in list");
    for(i=0; i<3; i++)
    {
        tmp_symbol = atom_getsymbolarg(i, argc, argv);
        if(tmp_symbol == &s_)
        {
            tmp_int = (unsigned int)(atom_getfloatarg(i, argc , argv) * 255);
            snprintf(color_buffer, 3, "%02x", (tmp_int > 255 ? 255 : tmp_int));
            strncat(color_string, color_buffer, 3);
        }
        else 
        {
            pd_error(x,"[colorpanel] symbols are not allowed in the color list");
            return;
        }
    }
    memcpy(x->current_color, color_string, 7);
    colorpanel_bang(x);
}
开发者ID:Angeldude,项目名称:pd,代码行数:29,代码来源:colorpanel.c


示例5: packRTCP_version

static void packRTCP_version(t_packRTCP *x, t_symbol*s, int argc, t_atom*argv) {
  if(argc) {
    int version = atom_getint(argv);
    if(version != 2) pd_error(x, "currently only version '2' is supported!");
    x->x_rtcp.common.version = 2;
  } else post("%s: %d", s->s_name, x->x_rtcp.common.version);
}
开发者ID:iem-projects,项目名称:pd-iemrtp,代码行数:7,代码来源:packRTCP.c


示例6: packRTCP_p

static void packRTCP_p(t_packRTCP *x, t_symbol*s, int argc, t_atom*argv) {
  if(argc) {
    int p = atom_getint(argv);
    if(p != 0) pd_error(x, "currently only padding '0' is supported!");
    x->x_rtcp.common.p = 0;
  }  else     post("'%s': %d", s->s_name, x->x_rtcp.common.p);
}
开发者ID:iem-projects,项目名称:pd-iemrtp,代码行数:7,代码来源:packRTCP.c


示例7: pd_unbind

void pd_unbind(t_pd *x, t_symbol *s)
{
    if (s->s_thing == x) s->s_thing = 0;
    else if (s->s_thing && *s->s_thing == bindlist_class)
    {
            /* bindlists always have at least two elements... if the number
            goes down to one, get rid of the bindlist and bind the symbol
            straight to the remaining element. */

        t_bindlist *b = (t_bindlist *)s->s_thing;
        t_bindelem *e, *e2;
        if ((e = b->b_list)->e_who == x)
        {
            b->b_list = e->e_next;
            freebytes(e, sizeof(t_bindelem));
        }
        else for (e = b->b_list; (e2 = e->e_next); e = e2)
            if (e2->e_who == x)
        {
            e->e_next = e2->e_next;
            freebytes(e2, sizeof(t_bindelem));
            break;
        }
        if (!b->b_list->e_next)
        {
            s->s_thing = b->b_list->e_who;
            freebytes(b->b_list, sizeof(t_bindelem));
            pd_free(&b->b_pd);
        }
    }
    else pd_error(x, "%s: couldn't unbind", s->s_name);
}
开发者ID:avilleret,项目名称:pure-data,代码行数:32,代码来源:m_pd.c


示例8: freadln_open

static void freadln_open (t_freadln *x, t_symbol *s, t_symbol*type)
{
   char filenamebuf[MAXPDSTRING], *filenamebufptr;
   char*dirname=canvas_getdir(x->x_canvas)->s_name;
   int fd, len;

   freadln_close(x);

/*
   if(type!=gensym("cr")) {
     pd_error(x, "currently only 'cr' type files are implemented!");
     return;
   }
*/
   if (type==gensym("cr"))
      strcpy(x->linebreak_chr,"\n");
   else
      strcpy(x->linebreak_chr,";\n");
      

   /* directory, filename, extension, dirresult, nameresult, unsigned int size, int bin */
   if ((fd=open_via_path(dirname,
	       s->s_name,"", filenamebuf, &filenamebufptr, MAXPDSTRING,0)) < 0 ) {
      pd_error(x, "%s: failed to open %s", s->s_name, filenamebuf);
      return;
   }
   close(fd);
   len=strlen(filenamebuf);
   if (!(x->x_filename=(char*)getbytes(sizeof(char)*(len+strlen(s->s_name)+2)))) {
      pd_error(x, "out of memory");
      freadln_close(x);
      return;
   }
   strcpy(x->x_filename,filenamebuf);
   strcpy(x->x_filename+len,"/");
   strcpy(x->x_filename+len+1,s->s_name);
   if (!(x->x_file=fopen(x->x_filename, "r"))) {
      pd_error(x, "freadln: failed to open %128s",filenamebuf);
      return;
   }
   if (!(x->x_textbuf = (char *) getbytes (MIN_FREADLN_LENGTH * sizeof(char)))) {
      pd_error(x, "out of memory");
      freadln_close(x);
      return;
   }
   x->x_textbuf_length=MIN_FREADLN_LENGTH;
}
开发者ID:jptrkz,项目名称:pd-zexy,代码行数:47,代码来源:freadln.c


示例9: outlet_new

static void *specCentroid_new(t_symbol *s)
{
    t_specCentroid *x = (t_specCentroid *)pd_new(specCentroid_class);
	int i;
	t_garray *a;

	x->x_centroid = outlet_new(&x->x_obj, &s_float);
	
	if(s)
	{
		x->x_arrayname = s;

	    if(!(a = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class)))
	        ;
	    else if(!garray_getfloatwords(a, &x->x_arrayPoints, &x->x_vec))
	    	pd_error(x, "%s: bad template for specCentroid", x->x_arrayname->s_name);
	}
	else
		error("specCentroid: no array specified.");

	x->sr = 44100.0;
	x->window = 1; // should be a bogus size initially to force the proper resizes when a real _analyze request comes through
	x->windowFuncSize = 1;
	x->windowFunction = 4; // 4 is hann window
	x->powerSpectrum = 0; // choose mag (0) or power (1) spec in the specCentroid computation

	x->maxWindowSize = MAXWINDOWSIZE; // this seems to be the maximum size allowable by mayer_realfft();
	x->powersOfTwo = (int *)t_getbytes(sizeof(int));

	x->powersOfTwo[0] = 64; // must have at least this large of a window

	i=1;
	while(x->powersOfTwo[i-1] < x->maxWindowSize)
	{
		x->powersOfTwo = (int *)t_resizebytes(x->powersOfTwo, i*sizeof(int), (i+1)*sizeof(int));
		x->powersOfTwo[i] = pow(2, i+6); // +6 because we're starting at 2**6
		i++;
	}

	x->powTwoArrSize = i;

	x->signal_R = (t_sample *)t_getbytes(x->window*sizeof(t_sample));

	for(i=0; i<x->window; i++)
		x->signal_R[i] = 0.0;

  	x->blackman = (t_float *)t_getbytes(x->windowFuncSize*sizeof(t_float));
  	x->cosine = (t_float *)t_getbytes(x->windowFuncSize*sizeof(t_float));
  	x->hamming = (t_float *)t_getbytes(x->windowFuncSize*sizeof(t_float));
  	x->hann = (t_float *)t_getbytes(x->windowFuncSize*sizeof(t_float));

 	// initialize signal windowing functions
	tIDLib_blackmanWindow(x->blackman, x->windowFuncSize);
	tIDLib_cosineWindow(x->cosine, x->windowFuncSize);
	tIDLib_hammingWindow(x->hamming, x->windowFuncSize);
	tIDLib_hannWindow(x->hann, x->windowFuncSize);

    return (x);
}
开发者ID:avilleret,项目名称:timbreID,代码行数:59,代码来源:specCentroid.c


示例10: pd_defaultanything

static void pd_defaultanything(t_pd *x, t_symbol *s, int argc, t_atom *argv)
{
#ifdef ROCKBOX
    (void) argc;
    (void) argv;
#endif
    pd_error(x, "%s: no method for '%s'", (*x)->c_name->s_name, s->s_name);
}
开发者ID:BurntBrunch,项目名称:rockbox-fft,代码行数:8,代码来源:m_class.c


示例11: muse_set

static void muse_set(t_muse *x, t_symbol *s, int ac, t_atom *av) {
	if (ac==2 && av->a_type == A_FLOAT)
	{	int i = muse_limtr(x, av->a_w.w_float, 1);
		t_atomtype typ = (av+1)->a_type;
		if (typ == A_FLOAT) x->x_scl[i] = (av+1)->a_w.w_float;
		else if (typ == A_SYMBOL) muse_operate(x->x_scl+i, av+1);   }
	else pd_error(x, "muse_set: bad arguments");
}
开发者ID:myQuil,项目名称:pd-externals,代码行数:8,代码来源:muse.c


示例12: ctw_output_curl_error

static void ctw_output_curl_error(struct _ctw *common, CURLMsg *msg) {
	t_atom status_data[2];

	SETFLOAT(&status_data[0], msg->data.result);
	SETSYMBOL(&status_data[1], gensym(curl_easy_strerror(msg->data.result)));
	pd_error(common, "Error while performing request: %s", curl_easy_strerror(msg->data.result));
	outlet_list(common->status_out, &s_list, 2, &status_data[0]);
}
开发者ID:quahada,项目名称:PuRestJson,代码行数:8,代码来源:ctw.c


示例13: wiimote_cwiid_error

static void wiimote_cwiid_error(t_wiimote *x, struct cwiid_error_mesg *mesg) {
  switch(mesg->error) {
  case CWIID_ERROR_NONE:
    pd_error(x, "no error");
    break;
  case CWIID_ERROR_DISCONNECT:
    pd_error(x, "disconnect error");
    wiimote_doDisconnect(x);
    break;
  case CWIID_ERROR_COMM:
    pd_error(x, "comm error");
    wiimote_doDisconnect(x);
    break;
  default:
    pd_error(x, "unknown error %d", mesg->error);
  }
}
开发者ID:Angeldude,项目名称:pd,代码行数:17,代码来源:wiimote.c


示例14: readdir_seek

/*--------------------------------------------------------------------
 * seek FLOAT
 */
static void readdir_seek(t_readdir *x, t_floatarg pos)
{
  if (!x->x_dir) {
    pd_error(x, "readdir: seek %g: no directory opened!", pos);
    return;
  }
  seekdir(x->x_dir, (off_t)pos);
}
开发者ID:reduzent,项目名称:pd-moocow,代码行数:11,代码来源:readdir.c


示例15: readdir_next

/*--------------------------------------------------------------------
 * next : get next entry
 */
static void readdir_next(t_readdir *x)
{
  t_symbol *sel = sp_unknown;
  struct dirent *result = NULL;
  if ( !x->x_dir || !(result = readdir(x->x_dir)) ) {
    if (errno == EBADF) {
      //-- real error
      pd_error(x, "readdir: cannot read from %s: %s", x->x_dirname->s_name, strerror(errno));
    }
    else {
      //-- end of directory
      outlet_bang(x->x_eod_outlet);
    }
    return;
  }

#if HAVE_STRUCT_DIRENT_D_TYPE
  //-- get type (if this OS supports it, e.g. if we're not on windoof)
  switch (result->d_type)
    {
#if HAVE_DECL_DT_REG
    case DT_REG: sel = sp_file; break;
#endif

#if HAVE_DECL_DT_DIR
    case DT_DIR: sel = sp_dir; break;
#endif

#if HAVE_DECL_DT_FIFO
    case DT_FIFO: sel = sp_fifo; break;
#endif

#if HAVE_DECL_DT_SOCK
    case DT_SOCK: sel = sp_sock; break;
#endif

#if HAVE_DECL_DT_CHR
    case DT_CHR: sel = sp_chrdev; break;
#endif

#if HAVE_DECL_DT_BLK
    case DT_BLK: sel = sp_blkdev; break;
#endif

#if HAVE_DECL_DT_UNKNOWN
    case DT_UNKNOWN:
#endif
    default:
      sel = sp_unknown;
      break;
    }
#else  /* if !HAVE_STRUCT_DIRENT_D_TYPE */
  sel = sp_unknown;
#endif /* HAVE_STRUCT_DIRENT_D_TYPE */

  x->x_eatom.a_w.w_symbol = gensym(result->d_name);
  outlet_anything(x->x_ent_outlet, sel, 1, &x->x_eatom);
}
开发者ID:reduzent,项目名称:pd-moocow,代码行数:61,代码来源:readdir.c


示例16: _zmq_receive

/**
 * fetch a message
 */
static void _zmq_receive(t_zmq *x) {

   if ( ! _can_receive(x)) {
      return;
   }

   int r, err;
   char buf[MAXPDSTRING];
   t_binbuf *b;
   int msg;

   r=zmq_recv (x->zmq_socket, buf, MAXPDSTRING, ZMQ_DONTWAIT);
   if(r != -1) {
       if (r > MAXPDSTRING) r = MAXPDSTRING; // brutally cut off excessive bytes
       buf[r - 1] = 0; // terminate string
       if(r > 0) {
          b = binbuf_new();
          binbuf_text(b, buf, r);
          // the following code is cp'ed from x_net.c::netreceive_doit
          int natom = binbuf_getnatom(b);
          t_atom *at = binbuf_getvec(b);
          for (msg = 0; msg < natom;)
          {
              int emsg;
              for (emsg = msg; emsg < natom && at[emsg].a_type != A_COMMA
                      && at[emsg].a_type != A_SEMI; emsg++)
                  ;
              if (emsg > msg)
              {
                  int i;
                  for (i = msg; i < emsg; i++)
                      if (at[i].a_type == A_DOLLAR || at[i].a_type == A_DOLLSYM)
                      {
                          pd_error(x, "zmq_receive: got dollar sign in message");
                          goto nodice;
                      }
                  if (at[msg].a_type == A_FLOAT)
                  {
                      if (emsg > msg + 1)
                          outlet_list(x->s_out, 0, emsg-msg, at + msg);
                      else outlet_float(x->s_out, at[msg].a_w.w_float);
                  }
                  else if (at[msg].a_type == A_SYMBOL)
                      outlet_anything(x->s_out, at[msg].a_w.w_symbol,
                              emsg-msg-1, at + msg + 1);
              }
          nodice:
              msg = emsg + 1;
          }

       } else {
          outlet_bang(x->s_out);
       }
       if((err=zmq_errno())!=EAGAIN) {
          _zmq_error(err);
       }
   }
}
开发者ID:sansculotte,项目名称:pd-zmq,代码行数:61,代码来源:zmq.c


示例17: clock_gettimesincewithunits

    /* parse a time unit such as "5 msec", "60 perminute", or "1 sample" to
    a form usable by clock_setunit)( and clock_gettimesincewithunits().
    This brute-force search through symbols really ought not to be done on
    the fly for incoming 'tempo' messages, hmm...  This isn't public because
    its interface might want to change - but it's used in x_text.c as well
    as here. */
void parsetimeunits(void *x, t_float amount, t_symbol *unitname,
    t_float *unit, int *samps)
{
    const char *s = unitname->s_name;
    if (amount <= 0)
        amount = 1;
    if (s[0] == 'p' && s[1] == 'e' && s[2] == 'r')  /* starts with 'per' */
    {
        const char *s2 = s+3;
        if (!strcmp(s2, "millisecond") || !strcmp(s2, "msec"))  /* msec */
            *samps = 0, *unit = 1./amount;
        else if (!strncmp(s2, "sec", 3))        /* seconds */
            *samps = 0, *unit = 1000./amount;
        else if (!strncmp(s2, "min", 3))        /* minutes */
            *samps = 0, *unit = 60000./amount;
        else if (!strncmp(s2, "sam", 3))        /* samples */
            *samps = 1, *unit = 1./amount;
        else goto fail;
    }
    else
    {
            /* empty string defaults to msec */
        if (!strcmp(s, "millisecond") || !strcmp(s, "msec"))
            *samps = 0, *unit = amount;
        else if (!strncmp(s, "sec", 3))
            *samps = 0, *unit = 1000.*amount;
        else if (!strncmp(s, "min", 3))
            *samps = 0, *unit = 60000.*amount;
        else if (!strncmp(s, "sam", 3))
            *samps = 1, *unit = amount;
        else
        {
        fail:
                /* empty time unit specification defaults to 1 msec for
                back compatibility, since it's possible someone threw a
                float argument to timer which had previously been ignored. */
            if (*s)
                pd_error(x, "%s: unknown time unit", s);
            else pd_error(x,
                "tempo setting needs time unit ('sec', 'samp', 'permin', etc.");
            *unit = 1;
            *samps = 0;
        }
    }
}
开发者ID:porres,项目名称:pure-data,代码行数:51,代码来源:x_time.c


示例18: disis_spi_open

/**********************************************************
 * disis_spi_open() :function is called by the "open" command
 * It is responsible for opening the spidev device
 * "devspi" and then setting up the spidev interface.
 * member variables are used to configure spidev.
 * They must be set appropriately before calling
 * this function.
 * *********************************************************/
static void disis_spi_open(t_disis_spi *spi, t_symbol *devspi){
    int statusVal = 0;
    if (strlen(devspi->s_name) == 0) {
      spi->spidev = gensym("/dev/spidev0.0");
    } else {
      spi->spidev = devspi;
    }
    spi->spifd = open(spi->spidev->s_name, O_RDWR);
    if(spi->spifd < 0) {
      statusVal = -1;
      pd_error(spi, "could not open SPI device");
      goto spi_output;
    }
 
    statusVal = ioctl (spi->spifd, SPI_IOC_WR_MODE, &(spi->mode));
    if(statusVal < 0){
      pd_error(spi, "Could not set SPIMode (WR)...ioctl fail");
      disis_spi_close(spi);
      goto spi_output;
    }
 
    statusVal = ioctl (spi->spifd, SPI_IOC_RD_MODE, &(spi->mode));
    if(statusVal < 0) {
      pd_error(spi, "Could not set SPIMode (RD)...ioctl fail");
      disis_spi_close(spi);
      goto spi_output;
    }
 
    statusVal = ioctl (spi->spifd, SPI_IOC_WR_BITS_PER_WORD, &(spi->bitsPerWord));
    if(statusVal < 0) {
      pd_error(spi, "Could not set SPI bitsPerWord (WR)...ioctl fail");
      disis_spi_close(spi);
      goto spi_output;
    }
 
    statusVal = ioctl (spi->spifd, SPI_IOC_RD_BITS_PER_WORD, &(spi->bitsPerWord));
    if(statusVal < 0) {
      pd_error(spi, "Could not set SPI bitsPerWord(RD)...ioctl fail");
      disis_spi_close(spi);
      goto spi_output;
    }  
 
    statusVal = ioctl (spi->spifd, SPI_IOC_WR_MAX_SPEED_HZ, &(spi->speed));    
    if(statusVal < 0) {
      pd_error(spi, "Could not set SPI speed (WR)...ioctl fail");
      disis_spi_close(spi);
      goto spi_output;
    }
 
    statusVal = ioctl (spi->spifd, SPI_IOC_RD_MAX_SPEED_HZ, &(spi->speed));    
    if(statusVal < 0) {
      pd_error(spi, "Could not set SPI speed (RD)...ioctl fail");
      disis_spi_close(spi);
      goto spi_output;
    }
spi_output:
    if (!statusVal) statusVal = 1;
    else statusVal = 0;
    outlet_float(spi->x_out9, statusVal);
}
开发者ID:IvanKhodorich,项目名称:pd,代码行数:68,代码来源:disis_spi.c


示例19: max_ex_tab

/*
 * max_ex_tab -- evaluate this table access
 *               eptr is the name of the table and arg is the index we
 *               have to put the result in optr
 *               return 1 on error and 0 otherwise
 *
 * Arguments:
 *  the expr object
 *  table
 *  the argument
 *  the result pointer
 */
int
max_ex_tab(struct expr *expr, fts_symbol_t s, struct ex_ex *arg,
    struct ex_ex *optr)
{
#ifdef PD
        t_garray *garray;
        int size, indx;
        t_word *wvec;

        if (!s || !(garray = (t_garray *)pd_findbyclass(s, garray_class)) ||
            !garray_getfloatwords(garray, &size, &wvec))
        {
                optr->ex_type = ET_FLT;
                optr->ex_flt = 0;
                pd_error(expr, "no such table '%s'", s->s_name);
                return (1);
        }
        optr->ex_type = ET_FLT;

        switch (arg->ex_type) {
        case ET_INT:
                indx = arg->ex_int;
                break;
        case ET_FLT:
                /* strange interpolation code deleted here -msp */
                indx = arg->ex_flt;
                break;

        default:        /* do something with strings */
                pd_error(expr, "expr: bad argument for table '%s'\n", fts_symbol_name(s));
                indx = 0;
        }
        if (indx < 0) indx = 0;
        else if (indx >= size) indx = size - 1;
        optr->ex_flt = wvec[indx].w_float;
#else /* MSP */
        /*
         * table lookup not done for MSP yet
         */
        post("max_ex_tab: not complete for MSP yet!");
        optr->ex_type = ET_FLT;
        optr->ex_flt = 0;
#endif
        return (0);
}
开发者ID:Angeldude,项目名称:pd,代码行数:57,代码来源:x_vexp_if.c


示例20: tabwrite_tilde_set

static void tabwrite_tilde_set(t_tabwrite_tilde *x, t_symbol *s)
{
    t_garray *a;

    x->x_arrayname = s;
    if (!(a = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class)))
    {
        if (*s->s_name) pd_error(x, "tabwrite~: %s: no such array",
            x->x_arrayname->s_name);
        x->x_vec = 0;
    }
    else if (!garray_getfloatwords(a, &x->x_nsampsintab, &x->x_vec))
    {
        pd_error(x, "%s: bad template for tabwrite~", x->x_arrayname->s_name);
        x->x_vec = 0;
    }
    else garray_usedindsp(a);
}
开发者ID:davidjonas,项目名称:mediawerf_game,代码行数:18,代码来源:d_array.c



注:本文中的pd_error函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ pd_findbyclass函数代码示例发布时间:2022-05-30
下一篇:
C++ pd_bind函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap