当前位置: 首页>>代码示例>>C++>>正文


C++ DPR函数代码示例

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


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

示例1: sndioGetFmt

/*
 * convert sndio encoding to PA encoding, return true on success
 */
static int
sndioGetFmt(struct sio_par *sio, PaSampleFormat *fmt)
{
	if ((sio->bps * 8 != sio->bits && !sio->msb) ||
	    (sio->bps > 1 && sio->le != SIO_LE_NATIVE)) {
		DPR("sndioGetFmt: bits = %u, le = %u, msb = %u, bps = %u\n",
		    sio->bits, sio->le, sio->msb, sio->bps);
		return 0;
	}

	switch (sio->bits) {
	case 32:
		if (!sio->sig)
			return 0;
		*fmt = paInt32;
		break;
	case 24:
		if (!sio->sig)
			return 0;
		*fmt = (sio->bps == 3) ? paInt24 : paInt32;
		break;
	case 16:
		if (!sio->sig)
			return 0;
		*fmt = paInt16;
		break;
	case 8:
		*fmt = sio->sig ? paInt8 : paUInt8;
		break;
	default:
		DPR("sndioGetFmt: %u: unsupported\n", sio->bits);
		return 0;
	}
	return 1;
}
开发者ID:Bluerise,项目名称:bitrig-ports,代码行数:38,代码来源:pa_sndio.c

示例2: StopStream

static PaError
StopStream(PaStream *stream)
{
	PaSndioStream *s = (PaSndioStream *)stream;
	void *ret;
	int err;

	DPR("StopStream: s=%d, a=%d\n", s->stopped, s->active);

	if (s->stopped) {
		DPR("StartStream: already started\n");
		return paNoError;
	}
	s->stopped = 1;
	if (s->base.streamCallback) {
		err = pthread_join(s->thread, &ret);
		if (err) {
			DPR("SndioStop: couldn't join thread\n");
			return paUnanticipatedHostError;
		}
	}
	if (!sio_stop(s->hdl))
		return paUnanticipatedHostError;
	return paNoError;
}
开发者ID:Bluerise,项目名称:bitrig-ports,代码行数:25,代码来源:pa_sndio.c

示例3: ximsWaitDone

void	ximsWaitDone()
{
    int		ret;
    UserSelection	*sel = &userSel;

    DPR(("ximsWaitDone():\tOpState=%s  OpErrCode=%s[%d]\n",
				StateName(), error_name(OpErrCode), OpErrCode));

    set_sig_chld(False);

    ret = sel->renv->status;
    switch (ret) {
	case ErrImsWaiting:
		sel->status = ErrImsTimeout;
		put_xims_log("'%s' timed-out.", sel->name, 0, 0);
		break;

	case ErrImsWaitDone:
		sel->status = NoError;
# ifdef	old_hpux
		if ((OpFlag & FLAG_CONNECT)
				|| (sel->ent->ims->flags & F_TRY_CONNECT)) {
		    sel->status = try_connection(sel);
		}
# endif	/* old_hpux */
		break;

	case ErrImsConnecting:
	case ErrImsConnectDone:
		sel->status = NoError;
		break;

	case ErrImsAborted:
		/* put_xims_log("'%s' aborted.", sel->name, 0, 0); */
	case ErrImsExecution:
	default:
		sel->status = ret;
		break;
    }

    if (sel->status != NoError) {
	OpErrCode = sel->status;
	DPR(("ximsWaitDone(): OpErrCode=%s[%d]\n",
					error_name(OpErrCode), OpErrCode));
    }

    restore_resources();

    settle_ims(sel);		/* clear WM_COMMAND property */

    OpState = OpErrCode == NoError ? State_Wait_Done : State_Wait_Err;

    ximsMain();
}
开发者ID:juddy,项目名称:edcde,代码行数:54,代码来源:start.c

示例4: ximsWait

void	ximsWait()
{
    OpStateVal	oldOpState = OpState;
    UserSelection	*sel = &userSel;
    struct timeval	interval;
    time_t	start_tm = 0;
    int		lapse;

    DPR(("ximsWait(): OpState=%s  OpErrCode=%s[%d]\n",
				StateName(), error_name(OpErrCode), OpErrCode));

    OpState = State_Wait;

    if (oldOpState == State_Start_Err) {
	/* don't change OpErrCode */
	OpState = State_Wait_Err;
	return;
    }

    if (!is_waiting() || (OpFlag & FLAG_NOWAIT)) {
	ximsWaitDone();
    }

    if (im_mod_available(sel->renv) != 1) {

	if (useWINDOW()) {
	    xt_start_waiting();	/* never returns unless failed */
	}

	    /* waiting */
	lapse = 0;
	interval.tv_sec = Opt.Interval / 1000;
	interval.tv_usec = (Opt.Interval % 1000) * 1000;
	start_tm = time((time_t) 0);

	while (is_waiting()) {
	    select(0, 0, 0, 0, &interval);		/* usleep */
	    lapse = (int) time((time_t) 0) - start_tm;

	    if (im_mod_available(sel->renv) != 0 || lapse >= Opt.Timeout) {
		DPR(("ximsWait(tmout=%d): wait done (%d sec.)\n",
							Opt.Timeout, lapse));
		break;
	    }
	}
    }

    ximsWaitDone();
}
开发者ID:juddy,项目名称:edcde,代码行数:49,代码来源:start.c

示例5: AbortStream

static PaError
AbortStream(PaStream *stream)
{
	DPR("AbortStream:\n");

	return StopStream(stream);
}
开发者ID:Bluerise,项目名称:bitrig-ports,代码行数:7,代码来源:pa_sndio.c

示例6: sndioSetFmt

/*
 * convert PA encoding to sndio encoding, return true on success
 */
static int
sndioSetFmt(struct sio_par *sio, PaSampleFormat fmt)
{
	switch (fmt & ~paNonInterleaved) {
	case paInt32:
		sio->sig = 1;
		sio->bits = 32;
		break;
	case paInt24:
		sio->sig = 1;
		sio->bits = 24;
		sio->bps = 3;	/* paInt24 is packed format */
		break;
	case paInt16:
	case paFloat32:
		sio->sig = 1;
		sio->bits = 16;
		break;
	case paInt8:
		sio->sig = 1;
		sio->bits = 8;
		break;
	case paUInt8:
		sio->sig = 0;
		sio->bits = 8;
		break;
	default:
		DPR("sndioSetFmt: %x: unsupported\n", fmt);
		return 0;
	}
	sio->le = SIO_LE_NATIVE;
	return 1;
}
开发者ID:Bluerise,项目名称:bitrig-ports,代码行数:36,代码来源:pa_sndio.c

示例7: sunaudio_stream_get_position

static int
sunaudio_stream_get_position(cubeb_stream *s, uint64_t *p)
{
  int rv = CUBEB_OK;
  pthread_mutex_lock(&s->mutex);
  if (s->active && s->fd > 0) {
    if (s->using_oss) {
      int delay;
      ioctl(s->fd, SNDCTL_DSP_GETODELAY, &delay);
      int64_t t = s->frm_played - delay / s->n_channles / 2;
      if (t < 0) {
        *p = 0;
      } else {
        *p = t;
      }
    } else {
      audio_info_t info;
      ioctl(s->fd, AUDIO_GETINFO, &info);
      *p = info.play.samples;
    }
    DPR("sunaudio_stream_get_position() %lld\n", *p);
  } else {
    rv = CUBEB_ERROR;
  }
  pthread_mutex_unlock(&s->mutex);
  return rv;
}
开发者ID:OpenSXCE-org,项目名称:FireFox-43-port-for-all-OpenSolaris-distros,代码行数:27,代码来源:cubeb_sun.c

示例8: sndio_stream_destroy

static void
sndio_stream_destroy(cubeb_stream *s)
{
  DPR("sndio_stream_destroy()\n");
  sio_close(s->hdl);
  free(s);
}
开发者ID:MichaelKohler,项目名称:gecko-dev,代码行数:7,代码来源:cubeb_sndio.c

示例9: BlockingWriteStream

static PaError
BlockingWriteStream(PaStream* stream, const void *data, unsigned long numFrames)
{
	PaSndioStream *s = (PaSndioStream *)stream;
	unsigned n, res;

	while (numFrames > 0) {
		n = s->par.round;
		if (n > numFrames)
			n = numFrames;
		PaUtil_SetOutputFrameCount(&s->bufproc, n);
		PaUtil_SetInterleavedOutputChannels(&s->bufproc, 0, s->wbuf, s->par.pchan);
		res = PaUtil_CopyOutput(&s->bufproc, &data, n);
		if (res != n) {
			DPR("BlockingWriteStream: copyOutput: %u != %u\n");
			return paUnanticipatedHostError;
		}
		res = sio_write(s->hdl, s->wbuf, n * s->par.pchan * s->par.bps);
		if (res == 0)
			return paUnanticipatedHostError;		
		s->wpos += n;
		numFrames -= n;
	}
	return paNoError;
}
开发者ID:Bluerise,项目名称:bitrig-ports,代码行数:25,代码来源:pa_sndio.c

示例10: BlockingReadStream

static PaError
BlockingReadStream(PaStream *stream, void *data, unsigned long numFrames)
{
	PaSndioStream *s = (PaSndioStream *)stream;
	unsigned n, res, todo;
	void *buf;
	
	while (numFrames > 0) {
		n = s->par.round;
		if (n > numFrames)
			n = numFrames;
		buf = s->rbuf;
		todo = n * s->par.rchan * s->par.bps;
		while (todo > 0) {
			res = sio_read(s->hdl, buf, todo);
			if (res == 0)
				return paUnanticipatedHostError;
			buf = (char *)buf + res;
			todo -= res;
		}
		s->rpos += n;
		PaUtil_SetInputFrameCount(&s->bufproc, n);
		PaUtil_SetInterleavedInputChannels(&s->bufproc, 0, s->rbuf, s->par.rchan);
		res = PaUtil_CopyInput(&s->bufproc, &data, n);
		if (res != n) {
			DPR("BlockingReadStream: copyInput: %u != %u\n");
			return paUnanticipatedHostError;
		}
		numFrames -= n;
	}
	return paNoError;
}
开发者ID:Bluerise,项目名称:bitrig-ports,代码行数:32,代码来源:pa_sndio.c

示例11: QObject

    Transport::Transport(TransportType t, City* origin, City* destination,
                         const QList<quint16> passengers,
                         QObject *parent) :
            QObject(parent), m_origin(origin),
            m_destination(destination), m_position(origin->getPosition()),
            m_type(t), m_speed(TRANSPORT_SPEEDS[t]),
            m_travelTimeLeft((m_position.distanceTo(m_destination->getPosition()) /
                              m_speed) * 60 * 60) // travel time in seconds
    {
        Q_ASSERT_X(passengers.size() == PT_MAX_TYPES, Q_FUNC_INFO,
                   "Amount of passenger types must be exactly PT_MAX_TYPES");
        this->setObjectName(TRANSPORT_NAMES[m_type] %
                            "-" % QString::number(s_transportId++));

        for(int i = 0; i < PT_MAX_TYPES; ++i) {
            m_passengers[i] = passengers.at(i);
            CDPR(tr("Passenger type %1, amount %2").arg(PASSENGER_TYPE_NAMES[i]).
                                                    arg(m_passengers[i]));
        }

        DPR(tr("Transport %1 speed %2 from %3 to %4 (%5->%6). ETA %7 (%8s)").
            arg(objectName()).
            arg(m_speed).
            arg(m_origin->getName()).
            arg(m_destination->getName()).
            arg(m_position.toString()).
            arg(m_destination->getPosition().toString()).
            arg(m_travelTimeLeft.toString()).
            arg(m_travelTimeLeft.toSeconds()));

    }
开发者ID:ORBAT,项目名称:epidemic,代码行数:31,代码来源:transport.cpp

示例12: while

/*
 * Given a specific type of board, if found, detached link and 
 * returns the first occurrence in the list.
 */
struct cnode *dgap_find_config(int type, int bus, int slot)
{
	struct cnode *p, *prev = NULL, *prev2 = NULL, *found = NULL;

	p = &dgap_head;

	while (p->next != NULL) {
		prev = p;
		p = p->next;

		if (p->type == BNODE) {

			if (p->u.board.type == type) {

				if (p->u.board.v_pcibus && p->u.board.pcibus != bus) {
					DPR(("Found matching board, but wrong bus position. System says bus %d, we want bus %ld\n",
						bus, p->u.board.pcibus));
					continue;
				}
				if (p->u.board.v_pcislot && p->u.board.pcislot != slot) {
					DPR_INIT(("Found matching board, but wrong slot position. System says slot %d, we want slot %ld\n",
						slot, p->u.board.pcislot));
					continue;
				}

				DPR_INIT(("Matched type in config file\n"));

				found = p;
				/*
				 * Keep walking thru the list till we find the next board.
				 */
				while (p->next != NULL) {
					prev2 = p;
					p = p->next;
					if (p->type == BNODE) {

						/*
						 * Mark the end of our 1 board chain of configs.
						 */
						prev2->next = NULL;

						/*
						 * Link the "next" board to the previous board,
						 * effectively "unlinking" our board from the main config.
						 */
						prev->next = p;

						return found;
					}
				}
				/*
				 * It must be the last board in the list.
				 */
				prev->next = NULL;
				return found;
			}
		}
	}
	return NULL;
}
开发者ID:AnadoluPanteri,项目名称:kernel-plus-harmattan,代码行数:64,代码来源:dgap_parse.c

示例13: sndio_stream_get_position

static int
sndio_stream_get_position(cubeb_stream *s, uint64_t *p)
{
  pthread_mutex_lock(&s->mtx);
  DPR("sndio_stream_get_position() %" PRId64 "\n", s->hwpos);
  *p = s->hwpos;
  pthread_mutex_unlock(&s->mtx);
  return CUBEB_OK;
}
开发者ID:luke-chang,项目名称:gecko-1,代码行数:9,代码来源:cubeb_sndio.c

示例14: sndio_init

/*static*/ int
sndio_init(cubeb **context, char const *context_name)
{
  DPR("sndio_init(%s)\n", context_name);
  *context = malloc(sizeof(*context));
  (*context)->ops = &sndio_ops;
  (void)context_name;
  return CUBEB_OK;
}
开发者ID:luke-chang,项目名称:gecko-1,代码行数:9,代码来源:cubeb_sndio.c

示例15: sndio_stream_set_volume

static int
sndio_stream_set_volume(cubeb_stream *s, float volume)
{
  DPR("sndio_stream_set_volume(%f)\n", volume);
  pthread_mutex_lock(&s->mtx);
  sio_setvol(s->hdl, SIO_MAXVOL * volume);
  pthread_mutex_unlock(&s->mtx);
  return CUBEB_OK;
}
开发者ID:luke-chang,项目名称:gecko-1,代码行数:9,代码来源:cubeb_sndio.c


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