⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mixerpreset.cpp

📁 miXo is a buzz machine (www.buzzmachines.com) - a plugin for the freely available jeskola buzz track
💻 CPP
字号:
// MixerPreset.cpp: implementation of the CMixerPreset class.
//
//////////////////////////////////////////////////////////////////////

#include "MixerPreset.h"
#include <sstream>
using namespace std;
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CMixerPreset::CMixerPreset() : m_lstSet()
{

}

CMixerPreset::~CMixerPreset()
{

}
void CMixerPreset::Save(CMachineDataOutput * const pcOut)
{
	int iNum=0;								//we dont save internals
	int i;
	for(i=0;i<m_lstSet.size();i++) {
		if(!m_lstSet[i].IsInternal())
			iNum++;
	}
	pcOut->Write(iNum);
	for(i=0;i<m_lstSet.size();i++) {
		if(!m_lstSet[i].IsInternal())
			m_lstSet[i].Save(pcOut);
	}
}
void CMixerPreset::Init(CMachineDataInput * const pcIn,unsigned uDataVersion)
{
	if(!m_lstSet.empty())
		m_lstSet.clear();
	int iNum;
	pcIn->Read(iNum);
	for(int i=0;i<iNum;i++) {
		CMixerSet cSet;
		cSet.Init(pcIn,uDataVersion);
		m_lstSet.push_back(cSet);
	}
}
CMixerSet *CMixerPreset::Get(string str)
{
	TLstSet::iterator ite=find(m_lstSet.begin(),m_lstSet.end(),str);
	if(ite != m_lstSet.end())
		return &(*ite);
	return NULL;
}
void CMixerPreset::AutoAdd(CMixerSet &c)
{
	stringstream stm;
	stm << "Preset " << (m_lstSet.size()+1) << ends;
	c.SetName(stm.str());
	Add(c);
}
void CMixerPreset::Add(const CMixerSet &c) 
{
	CMixerSet *pSet=Get(c.GetName());
	if(pSet) 
	{
		*pSet=c;
	}
	else
		m_lstSet.push_back(c);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -