void CCreateOURANOSNormal::InitClass(const CStringArray& option)
{
	GetParamClassInfo().m_className.LoadString( IDS_SOURCENAME_CREATE_OURANOS_NORMAL );

	CToolsBase::InitClass(option);
	ASSERT( GetParameters().GetSize() < I_NB_ATTRIBUTE);

	CStringArrayEx str;
	str.LoadString( IDS_PROPERTIES_CREATE_OURANOS_NORMAL);
	ASSERT( str.GetSize() == NB_ATTRIBUTE);

//		CString filter1 = "*.loc|*.loc||";
	CString filter2 = GetString( IDS_CMN_FILTER_NORMALS);
	GetParameters().Add( CParamDef(CParamDef::PATH, ATTRIBUTE_NAME[0], str[0], "" ) );
	GetParameters().Add( CParamDef(CParamDef::FILEPATH, ATTRIBUTE_NAME[1], str[1], filter2 ) );

	CParamDef p(CParamDef::COMBO, ATTRIBUTE_NAME[2], str[2], "");
	p.m_subType = CParamDef::BY_NUMBER;
	for(int i=0; i<12; i++)
	{
		CString tmp;
		tmp.Format("%d-%d", 1961+10*i, 1990+10*i);
		p.m_listValue.Add(tmp);
	}
	GetParameters().Add(p);
}
Example #2
0
void CSongState::MakeSections()
{
	CSong::CSectionArray	Section;
	CStringArrayEx	SectionName;
	int	nChords = m_SectionMap.GetSize();
	if (nChords) {	// if at least one chord
		int	iPrevSec = -1;
		CSong::CSection	sec(0, 0, 0);
		int	iBeat = 0;
		for (int iChord = 0; iChord < nChords; iChord++) {	// for each chord
			int	iSection = m_SectionMap[iChord];
			if (iSection != iPrevSec) {	// if section changed
				int	nSecLen = iBeat - sec.m_Start;	// compute section length
				if (nSecLen > 0) {	// if previous section pending
					sec.m_Length = nSecLen;	// update section length
					Section.Add(sec);	// add section to output array
					SectionName.Add(m_SectionName[iPrevSec]);
				}
				sec = m_Section[iSection];
				sec.m_Start = iBeat;
				iPrevSec = iSection;
			}
			iBeat += m_Chord[iChord].m_Duration;
		}
		int	nSecLen = iBeat - sec.m_Start;	// compute final section length
		if (nSecLen > 0) {	// if previous section pending
			sec.m_Length = nSecLen;	// update section length
			Section.Add(sec);	// add section to output array
			SectionName.Add(m_SectionName[iPrevSec]);
		}
	}
	m_Section = Section;
	m_SectionName = SectionName;
}
BOOL CSongPropsDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();

	SetIcon(theApp.LoadIcon(IDR_MAINFRAME), 0);

	CPatchGeneralDlg::InitNoteCombo(m_KeySig);
	m_KeySig.SetCurSel(m_Props.m_Key);
	m_TimeSigNumer.SetVal(m_Props.m_Meter.m_Numerator);
	CStringArrayEx	sUnit;
	CPartBassDlg::GetPowerOfTwoStrings(sUnit, 
		CSong::CMeter::MIN_UNIT_EXP, CSong::CMeter::MAX_UNIT_EXP);
	int	nUnits = sUnit.GetSize();
	for (int iUnit = 0; iUnit < nUnits; iUnit++)
		m_TimeSigDenom.AddString(sUnit[iUnit]);
	DWORD	iSelUnit;
	_BitScanReverse(&iSelUnit, m_Props.m_Meter.m_Denominator);
	m_TimeSigDenom.SetCurSel(iSelUnit);
	m_Tempo.SetVal(m_Props.m_Tempo);
	m_Transpose.SetVal(m_Props.m_Transpose);
	m_Comments.SetWindowText(m_Props.m_Comments);

	EnableToolTips();

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
void CPartBassDlg::InitPowerOfTwoCombo(CComboBox& Combo, int LowerExp, int UpperExp)
{
	CStringArrayEx	str;
	GetPowerOfTwoStrings(str, LowerExp, UpperExp);
	int	nItems = str.GetSize();
	for (int iItem = 0; iItem < nItems; iItem++)
		Combo.AddString(str[iItem]);
}
Example #5
0
void CChordEaseApp::LoadStringArray(LPCTSTR Section, CStringArrayEx& Arr)
{
	int	nItems = theApp.GetProfileInt(Section, _T("Count"), 0);
	Arr.SetSize(nItems);
	for (int iItem = 0; iItem < nItems; iItem++) {
		CString	sKey;
		sKey.Format(_T("%d"), iItem);
		Arr[iItem] = theApp.GetProfileString(Section, sKey);
	}
}
Example #6
0
void CChordEaseApp::StoreStringArray(LPCTSTR Section, const CStringArrayEx& Arr)
{
	int	nItems = Arr.GetSize();
	theApp.WriteProfileInt(Section, _T("Count"), nItems);
	for (int iItem = 0; iItem < nItems; iItem++) {
		CString	sKey;
		sKey.Format(_T("%d"), iItem);
		theApp.WriteProfileString(Section, sKey, Arr[iItem]);
	}
}
void CUSHourly::InitClass(const CStringArray& option)
{
	GetParamClassInfo().m_className.LoadString( IDS_SOURCENAME_US_HOURLY );

	CUIWeather::InitClass(option);

	ASSERT( GetParameters().GetSize() < I_NB_ATTRIBUTE);

	CStringArrayEx strList;
	strList.LoadString( IDS_PROPERTIES_ENVCAN_HOURLY);
	ASSERT( strList.GetSize() >= NB_ATTRIBUTE);

	
	GetParameters().Add( CParamDef(CParamDef::COMBO, CParamDef::BY_NUMBER, ATTRIBUTE_NAME[0], strList[0], CGlobal::GetMonths(), "0" ));
	GetParameters().Add( CParamDef(CParamDef::COMBO, CParamDef::BY_NUMBER, ATTRIBUTE_NAME[1], strList[1], CGlobal::GetMonths(), "11" ));
	GetParameters().Add( CParamDef(CParamDef::EDIT_BROWSE, ATTRIBUTE_NAME[2], strList[2]) );
	GetParameters().Add( CParamDef(CParamDef::COORD_RECT, ATTRIBUTE_NAME[3], strList[3]) );
//	GetParameters().Add( CParamDef(CParamDef::COMBO, CParamDef::BY_NUMBER, ATTRIBUTE_NAME[4], array[4], forceList, "4") );
//	GetParameters().Add( CParamDef(CParamDef::BOOL, ATTRIBUTE_NAME[5], array[5], "0") );
//	GetParameters().Add( CParamDef(CParamDef::BOOL, ATTRIBUTE_NAME[6], array[6], "1") );

}
void CPartBassDlg::GetPowerOfTwoStrings(CStringArrayEx& Str, int LowerExp, int UpperExp)
{
	int	nItems = UpperExp - LowerExp + 1;
	Str.SetSize(nItems);
	for (int iItem = 0; iItem < nItems; iItem++) {
		int	iExp = iItem + LowerExp;
		int	shift = iExp;
		LPCTSTR	fmt;
		if (iExp < 0) {
			fmt = _T("1/%d");
			shift = -shift;
		} else
			fmt = _T("%d");
		Str[iItem].Format(fmt, 1 << shift);
	}
}