bool CTimeServerThread::loadAMBE()
{
	wxString ambeFileName;
	wxString indxFileName;

	switch (m_language) {
		case LANG_ENGLISH_US_1:
		case LANG_ENGLISH_US_2:
			ambeFileName = wxT("TIME_en_US.ambe");
			indxFileName = wxT("TIME_en_US.indx");
			break;
		case LANG_DEUTSCH_1:
		case LANG_DEUTSCH_2:
			ambeFileName = wxT("TIME_de_DE.ambe");
			indxFileName = wxT("TIME_de_DE.indx");
			break;
		case LANG_FRANCAIS:
			ambeFileName = wxT("TIME_fr_FR.ambe");
			indxFileName = wxT("TIME_fr_FR.indx");
			break;
		case LANG_NEDERLANDS:
			ambeFileName = wxT("TIME_nl_NL.ambe");
			indxFileName = wxT("TIME_nl_NL.indx");
			break;
		case LANG_SVENSKA:
			ambeFileName = wxT("TIME_se_SE.ambe");
			indxFileName = wxT("TIME_se_SE.indx");
			break;
		default:
			ambeFileName = wxT("TIME_en_GB.ambe");
			indxFileName = wxT("TIME_en_GB.indx");
			break;
	}

	bool ret = readAMBE(ambeFileName);
	if (!ret) {
		delete[] m_ambe;
		m_ambe = NULL;
		return false;
	}

	ret = readIndex(indxFileName);
	if (!ret) {
		delete[] m_ambe;
		m_ambe = NULL;
		return false;
	}

	return true;
}
void CDExtraGatewayAudioUnit::setLanguage(TEXT_LANG language)
{
	m_language = language;

	wxString ambeFileName;
	wxString indxFileName;

	switch (language) {
		case TL_DEUTSCH:
			ambeFileName = wxT("de_DE.ambe");
			indxFileName = wxT("de_DE.indx");
			break;
		case TL_DANSK:
			ambeFileName = wxT("dk_DK.ambe");
			indxFileName = wxT("dk_DK.indx");
			break;
		case TL_ITALIANO:
			ambeFileName = wxT("it_IT.ambe");
			indxFileName = wxT("it_IT.indx");
			break;
		case TL_FRANCAIS:
			ambeFileName = wxT("fr_FR.ambe");
			indxFileName = wxT("fr_FR.indx");
			break;
		case TL_ESPANOL:
			ambeFileName = wxT("es_ES.ambe");
			indxFileName = wxT("es_ES.indx");
			break;
		case TL_SVENSKA:
			ambeFileName = wxT("se_SE.ambe");
			indxFileName = wxT("se_SE.indx");
			break;
		case TL_POLSKI:
			ambeFileName = wxT("pl_PL.ambe");
			indxFileName = wxT("pl_PL.indx");
			break;
		case TL_ENGLISH_US:
			ambeFileName = wxT("en_US.ambe");
			indxFileName = wxT("en_US.indx");
			break;
		case TL_NORSK:
			ambeFileName = wxT("no_NO.ambe");
			indxFileName = wxT("no_NO.indx");
			break;
//		case TL_NEDERLANDS_NL:
//			ambeFileName = wxT("nl_NL.ambe");
//			indxFileName = wxT("nl_NL.indx");
//			break;
//		case TL_NEDERLANDS_BE:
//			ambeFileName = wxT("nl_BE.ambe");
//			indxFileName = wxT("nl_BE.indx");
//			break;
		default:
			ambeFileName = wxT("en_GB.ambe");
			indxFileName = wxT("en_GB.indx");
			break;
	}

	bool ret = readAMBE(ambeFileName);
	if (!ret) {
		delete[] m_ambe;
		m_ambe = NULL;
		return;
	}

	ret = readIndex(indxFileName);
	if (!ret) {
		delete[] m_ambe;
		m_ambe = NULL;
	}
}