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


C++ reset函数代码示例

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


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

示例1: hardStop

void SampleChannel::sum(int frame, bool running) {

	if (wave == NULL || status & ~(STATUS_PLAY | STATUS_ENDING))
		return;

	if (frame != frameRewind) {

		/* volume envelope, only if seq is running */

		if (running) {
			volume_i += volume_d;
			if (volume_i < 0.0f)
				volume_i = 0.0f;
			else
			if (volume_i > 1.0f)
				volume_i = 1.0f;
		}

		/* fadein or fadeout processes. If mute, delete any signal. */

		/** TODO - big issue: fade[in/out]Vol * internal_volume might be a
		 * bad choice: it causes glitches when muting on and off during a
		 * volume envelope. */

		if (mute || mute_i) {
			vChan[frame]   = 0.0f;
			vChan[frame+1] = 0.0f;
		}
		else
		if (fadeinOn) {
			if (fadeinVol < 1.0f) {
				vChan[frame]   *= fadeinVol * volume_i;
				vChan[frame+1] *= fadeinVol * volume_i;
				fadeinVol += 0.01f;
			}
			else {
				fadeinOn  = false;
				fadeinVol = 0.0f;
			}
		}
		else
		if (fadeoutOn) {
			if (fadeoutVol > 0.0f) { // fadeout ongoing
				if (fadeoutType == XFADE) {
					vChan[frame]   *= volume_i;
					vChan[frame+1] *= volume_i;
					vChan[frame]    = pChan[frame]   * fadeoutVol * volume_i;
					vChan[frame+1]  = pChan[frame+1] * fadeoutVol * volume_i;
				}
				else {
					vChan[frame]   *= fadeoutVol * volume_i;
					vChan[frame+1] *= fadeoutVol * volume_i;
				}
				fadeoutVol -= fadeoutStep;
			}
			else {  // fadeout end
				fadeoutOn  = false;
				fadeoutVol = 1.0f;

				/* QWait ends with the end of the xfade */

				if (fadeoutType == XFADE) {
					qWait = false;
				}
				else {
					if (fadeoutEnd == DO_MUTE)
						mute = true;
					else
					if (fadeoutEnd == DO_MUTE_I)
						mute_i = true;
					else             // DO_STOP
						hardStop(frame);
				}
			}
		}
		else {
			vChan[frame]   *= volume_i;
			vChan[frame+1] *= volume_i;
		}
	}
	else {

		if (mode & (SINGLE_BASIC | SINGLE_PRESS | SINGLE_RETRIG) ||
			 (mode == SINGLE_ENDLESS && status == STATUS_ENDING)   ||
			 (mode & LOOP_ANY && !running))     // stop loops when the seq is off
		{
			status = STATUS_OFF;
		}

		/* temporary stop LOOP_ONCE not in ENDING status, otherwise they
		 * would return in wait, losing the ENDING status */

		//if (mode == LOOP_ONCE && status != STATUS_ENDING)
		if ((mode & (LOOP_ONCE | LOOP_ONCE_BAR)) && status != STATUS_ENDING)
			status = STATUS_WAIT;

		/* check for end of samples. SINGLE_ENDLESS runs forever unless
		 * it's in ENDING mode. */

		reset(frame);
//.........这里部分代码省略.........
开发者ID:slegroux,项目名称:giada,代码行数:101,代码来源:sampleChannel.cpp

示例2: reset

void
PlaylistModel::setColumns (const QList<QString> &new_columns)
{
	m_columns = new_columns;
	reset ();
}
开发者ID:dsheeler,项目名称:esperanza-six600110,代码行数:6,代码来源:playlistmodel.cpp

示例3: ShaderCompileDesc

 ShaderCompileDesc()
 {
     reset();
 }
开发者ID:ming4883,项目名称:MingDx11Test,代码行数:4,代码来源:mdk_D3D11.cpp

示例4: reset

void WebPageImportanceSignals::onCommitLoad()
{
    Platform::current()->histogramEnumeration("PageImportanceSignals.HadFormInteraction.OnCommitLoad", m_hadFormInteraction, 2);

    reset();
}
开发者ID:smishenk,项目名称:chromium-crosswalk,代码行数:6,代码来源:WebPageImportanceSignals.cpp

示例5: remove

 virtual void remove(unsigned long items) {
     reset();
     views.clear();
     delete theModel;
     reset();
 }
开发者ID:sck,项目名称:oobench,代码行数:6,代码来源:MVCPerformance.cpp

示例6: QWidget

FilterBar::FilterBar(QWidget *parent)
 : QWidget(parent)/*, m_blinkTimer(this), m_blinkedTimes(0)*/
{
	QHBoxLayout *hBox  = new QHBoxLayout(this, /*margin*/0, /*spacing*/0);

	// Create every widgets:
	// (Aaron Seigo says we don't need to worry about the 
	//	"Toolbar group" stuff anymore.)
	
	QIcon resetIconSet = KIcon("dialog-close", KIconLoader::global());
	QIcon inAllIconSet = KIcon("edit-find", KIconLoader::global());

	m_resetButton        = new QToolButton(this);
	m_resetButton->setIconSet(resetIconSet);
	m_resetButton->setTextLabel(i18n("Reset Filter"));//, /*groupText=*/"", this, SLOT(reset()), 0);
	m_resetButton->setAutoRaise(true);
			//new KToolBarButton("locationbar_erase", /*id=*/1230, this, /*name=*/0, i18n("Reset Filter"));
	m_lineEdit = new KLineEdit(this);
	QLabel *label        = new QLabel(m_lineEdit, i18n("&Filter: "), this);
	m_tagsBox = new KComboBox(this);
	QLabel *label2       = new QLabel(m_tagsBox, i18n("T&ag: "), this);
	m_inAllBasketsButton = new QToolButton(this);
	m_inAllBasketsButton->setIconSet(inAllIconSet);
	m_inAllBasketsButton->setTextLabel(i18n("Filter All Baskets"));//, /*groupText=*/"", this, SLOT(inAllBaskets()), 0);
	m_inAllBasketsButton->setAutoRaise(true);

	// Configure the Tags combobox:
	repopulateTagsCombo();

	// Configure the Serach in all Baskets button:
	m_inAllBasketsButton->setToggleButton(true);
//	m_inAllBasketsButton->setOn(true);
//	Global::bnpView->toggleFilterAllBaskets(true);

//	m_lineEdit->setMaximumWidth(150);
	m_lineEdit->setClearButtonShown(true);

	// Layout all those widgets:
//	hBox->addStretch();
	hBox->addWidget(m_resetButton);
	hBox->addSpacing(KDialog::spacingHint());
	hBox->addWidget(label);
	hBox->addWidget(m_lineEdit);
	hBox->addSpacing(KDialog::spacingHint());
	hBox->addWidget(label2);
	hBox->addWidget(m_tagsBox);
	hBox->addSpacing(KDialog::spacingHint());
	hBox->addWidget(m_inAllBasketsButton);

	m_data = new FilterData(); // TODO: Not a pointer! and return a const &  !!

//	connect( &m_blinkTimer,         SIGNAL(timeout()),                   this, SLOT(blinkBar())                  );
	connect(  m_resetButton,        SIGNAL(clicked()),                   this, SLOT(reset())                     );
	connect(  m_lineEdit,           SIGNAL(textChanged(const QString&)), this, SLOT(changeFilter()) );
	connect(  m_tagsBox,            SIGNAL(activated(int)),              this, SLOT(tagChanged(int))             );

//	connect(  m_inAllBasketsButton, SIGNAL(clicked()),                   this, SLOT(inAllBaskets())              );
	connect(  m_inAllBasketsButton, SIGNAL(toggled(bool)), Global::bnpView, SLOT(toggleFilterAllBaskets(bool)) );

	FocusWidgetFilter *lineEditF = new FocusWidgetFilter(m_lineEdit);
	m_tagsBox->installEventFilter(lineEditF);
	connect(lineEditF, SIGNAL(escapePressed()), SLOT(reset()));
	connect(lineEditF, SIGNAL(returnPressed()), SLOT(changeFilter()));
}
开发者ID:jesper,项目名称:basket,代码行数:64,代码来源:filter.cpp

示例7: reset

AP_Gimbal_Parameters::AP_Gimbal_Parameters()
{
    reset();
}
开发者ID:raulshepherd,项目名称:ardupilot-solo,代码行数:4,代码来源:AP_Gimbal_Parameters.cpp

示例8: reset

AsyncConnection::~AsyncConnection() {
  reset();
}
开发者ID:JWUST,项目名称:hyrise,代码行数:3,代码来源:AsyncConnection.cpp

示例9:

uint16_t ILI9341_kbv::readID(void)                          //{ return 0x9341; }
{
    if (!done_reset) reset();
	return (readcommand8(0xD3, 2) << 8) | readcommand8(0xD3, 3);
}
开发者ID:prenticedavid,项目名称:TFT_SPI_kbv,代码行数:5,代码来源:ILI9341_kbv.cpp

示例10: assign

 any& assign(const T& x) {
     reset();
     policy = anyimpl::get_policy<T>();
     policy->copy_from_value(&x, &object);
     return *this;
 }
开发者ID:ascetic85,项目名称:ziwei,代码行数:6,代码来源:any.hpp

示例11: reset

Authenticator::~Authenticator() {
	reset();
}
开发者ID:KristofRobot,项目名称:ZoneMinder,代码行数:3,代码来源:zm_rtsp_auth.cpp

示例12: reset

void PreviewMatrix::clear()
{
	d_matrix_model->clear();
	reset();
}
开发者ID:BackupTheBerlios,项目名称:qtiplot-svn,代码行数:5,代码来源:ImportASCIIDialog.cpp

示例13: switch

void SampleChannel::start(int frame, bool doQuantize) {

	switch (status)	{
		case STATUS_EMPTY:
		case STATUS_MISSING:
		case STATUS_WRONG:
		{
			return;
		}

		case STATUS_OFF:
		{
			if (mode & LOOP_ANY) {
				status = STATUS_WAIT;
			}
			else {
				if (G_Mixer.quantize > 0 && G_Mixer.running && doQuantize)
					qWait = true;
				else {
					
					/* fillChan only if frame != 0. If you call fillChan on frame == 0
					 * a duplicate call to fillChan occurs with loss of data. */
					
					status = STATUS_PLAY;
					if (frame != 0)
						tracker = fillChan(vChan, tracker, frame); 
				}
			}
			break;
		}

		case STATUS_PLAY:
		{
			if (mode == SINGLE_BASIC)
				setFadeOut(DO_STOP);
			else
			if (mode == SINGLE_RETRIG) {
				if (G_Mixer.quantize > 0 && G_Mixer.running && doQuantize)
					qWait = true;
				else
					reset(frame);
			}
			else
			if (mode & (LOOP_ANY | SINGLE_ENDLESS))
				status = STATUS_ENDING;
			break;
		}

		case STATUS_WAIT:
		{
			status = STATUS_OFF;
			break;
		}

		case STATUS_ENDING:
		{
			status = STATUS_PLAY;
			break;
		}
	}
}
开发者ID:slegroux,项目名称:giada,代码行数:61,代码来源:sampleChannel.cpp

示例14: hashtable

 hashtable() :
   itable(new std::array< std::pair<uint64_t, uint32_t>, TABLE_SIZE >),
   table(*itable)
   {
   reset();
   }
开发者ID:4Ykw,项目名称:keyhotee,代码行数:6,代码来源:hashtable.hpp

示例15: reset

/* Construct a MD5 object with a file. */
MD5::MD5(ifstream &in) {
	reset();
	update(in);
}
开发者ID:ALEXLCC,项目名称:T3000_Building_Automation_System,代码行数:5,代码来源:md5.cpp


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