Ejemplo n.º 1
0
bool Window::verifyAndSpecifyTypes(Types const& _inTypes, Types& o_outTypes)
{
	Typed<Contiguous> in = _inTypes[0];
	if (!in || in->arity() != 1)
		return false;
	o_outTypes[0] = WaveChunk(m_size + m_padding, in->frequency() / float(m_hop), in->frequency(), in->max(), in->min());
	return true;
}
Ejemplo n.º 2
0
bool Fan::verifyAndSpecifyTypes(Types const& _inTypes, Types& _outTypes)
{
	Typed<Spectrum> in = _inTypes[0];
	if (!in) return false;
	m_outBins = in->bins() / _outTypes.count();
	// Should be FreqSteppedSpectrum with offset if possible.
	// In general add a method to Spectrum to get a new type based on subset.
	_outTypes = Spectrum(m_outBins, in->frequency());
	return true;
}
Ejemplo n.º 3
0
bool DeciBel::verifyAndSpecifyTypes(Types const& _inTypes, Types& _outTypes)
{
	Typed<Spectrum> in = _inTypes[0];
	if (!in) return false;

	m_min = in->min();
	m_delta = in->max() - m_min;
	m_bins = in->bins();
	in->setRange(0, 60);
	_outTypes[0] = in;

	return true;
}
Ejemplo n.º 4
0
bool PeakTracker::processorStarted()
{
	m_tracks.resize(m_maxTracks);
	for (int i = 0; i < m_maxTracks; i++)
	{
		m_tracks[i].frequency = m_type->maxFrequency() * i / m_maxTracks;
		m_tracks[i].confidence = 0;
	}

	return true;
}
Ejemplo n.º 5
0
		static void FrictionJointConfigure(unsigned int aId, const tinyxml2::XMLElement *element)
		{
			Typed<b2FrictionJointDef> defs = Database::frictionjointdef.Open(aId);

			// get the sub-identifier
			unsigned int aSubId;
			if (const char *name = element->Attribute("name"))
				aSubId = Hash(name);
			else
				aSubId = defs.GetCount() + 1;

			// configure the joint definition
			b2FrictionJointDef &def = defs.Open(aSubId);
			for (const tinyxml2::XMLElement *child = element->FirstChildElement(); child != NULL; child = child->NextSiblingElement())
			{
				ConfigureFrictionJointItem(child, def);
			}
			defs.Close(aSubId);

			Database::frictionjointdef.Close(aId);
		}