コード例 #1
0
ファイル: DrawGraph.cpp プロジェクト: Kousuke-N/Mai-Kagami
void MyDrawGraph::SetExAnimation(double target_ex, Easing ease) {
	if (GetTime() != 0)
		return;
	default_ex = GetEx();
	this->target_ex = target_ex;
	ease_ex = ease;
}
コード例 #2
0
ファイル: mdkimp.cpp プロジェクト: Buzztrax/buzzmachines
void CMDKMachineInterface::Init(CMachineDataInput * const pi)
{
    pImp = (CMDKImplementation*)pCB->GetNearestWaveLevel(-1,-1);
	pImp->pmi = this;

	CMDKMachineInterfaceEx *pex = GetEx();
	pex->pImp = pImp;
	pCB->SetMachineInterfaceEx(pex);

	pImp->Init(pi);
}
コード例 #3
0
ファイル: mdkimp.cpp プロジェクト: Buzztrax/buzztrax
void CMDKMachineInterface::Init(CMachineDataInput * const pi)
{
	DBG2("  CMDKMachineInterface::Init(0x%p) called, this=0x%p\n",pi,this);
    pImp = (CMDKImplementation*)pCB->GetNearestWaveLevel(-1,-1);
	pImp->pmi = this;
	DBG1("    mdk impl=0x%p\n",pImp);

	CMDKMachineInterfaceEx *pex = GetEx();
	DBG1("    mdkiface ex=0x%p\n",pex);
	pex->pImp = pImp;
	pCB->SetMachineInterfaceEx(pex);

	DBG("    calling mdk->Init()\n");
	pImp->Init(pi);
}
コード例 #4
0
bool CSettings::Save()
{
	// Are we not flagged as open?
	if(!m_bOpen)
		return false;

	// Are we not flagged as allowed to save the file?
	if(!m_bSave)
		return false;

	// Loop through all values
	for(std::map<String, SettingsValue *>::iterator iter = m_values.begin(); iter != m_values.end(); iter++)
	{
		// Get the setting pointer
		SettingsValue * setting = iter->second;

		// Find all nodes for this value
		bool bFoundNode = false;

		for(TiXmlNode * pNode = m_XMLDocument.RootElement()->FirstChildElement(iter->first.Get()); pNode; pNode = pNode->NextSibling())
		{
			// Is this not an element node?
			if(pNode->Type() != TiXmlNode::ELEMENT)
				continue;

			// Is this not the node we are looking for?
			if(iter->first.Compare(pNode->Value()))
				continue;

			// Is this a list node?
			if(setting->IsList())
			{
				// Remove the node
				m_XMLDocument.RootElement()->RemoveChild(pNode);
			}
			else
			{
				// Clear the node
				pNode->Clear();

				// Get the node value
				String strValue = GetEx(iter->first);

				// Create a new node value
				TiXmlText * pNewNodeValue = new TiXmlText(strValue.Get());

				// Add the new node value to the new node
				pNode->LinkEndChild(pNewNodeValue);
			}

			// Flag as found a node
			bFoundNode = true;
			break;
		}

		// Is this a list value?
		if(setting->IsList())
		{
			// Loop through each list item
			for(std::list<String>::iterator iter2 = setting->listValue.begin(); iter2 != setting->listValue.end(); iter2++)
			{
				// Create a new node
				TiXmlElement * pNewNode = new TiXmlElement(iter->first.Get());

				// Create a new node value
				TiXmlText * pNewNodeValue = new TiXmlText((*iter2).Get());

				// Add the new node value to the new node
				pNewNode->LinkEndChild(pNewNodeValue);

				// Add the new node to the XML document
				m_XMLDocument.RootElement()->LinkEndChild(pNewNode);
			}
		}
		else
		{
			// Do we need to create a new node?
			if(!bFoundNode)
			{
				// Create a new node
				TiXmlElement * pNewNode = new TiXmlElement(iter->first.Get());

				// Get the node value
				String strValue = GetEx(iter->first);

				// Create a new node value
				TiXmlText * pNewNodeValue = new TiXmlText(strValue.Get());

				// Add the new node value to the new node
				pNewNode->LinkEndChild(pNewNodeValue);

				// Add the new node to the XML document
				m_XMLDocument.RootElement()->LinkEndChild(pNewNode);
			}
		}
	}

	// Save the XML document
	return m_XMLDocument.SaveFile();
}