Example #1
0
  bool try_initialize_more (Ekiga::ServiceCore& core,
			    int* /*argc*/,
			    char** /*argv*/[])
  {
    boost::shared_ptr<Ekiga::PresenceCore> presence = core.get<Ekiga::PresenceCore> ("presence-core");
    boost::shared_ptr<Ekiga::AccountCore> account = core.get<Ekiga::AccountCore> ("account-core");
    boost::shared_ptr<Ekiga::ChatCore> chat = core.get<Ekiga::ChatCore> ("chat-core");
    boost::shared_ptr<Ekiga::PersonalDetails> details = core.get<Ekiga::PersonalDetails> ("personal-details");

    if (presence && account && chat && details) {

      LM::DialectPtr dialect(new LM::Dialect (core));
      LM::ClusterPtr cluster(new LM::Cluster (dialect, details));
      LM::BankPtr bank (new LM::Bank (details, dialect, cluster));
      if (core.add (bank)) {

	chat->add_dialect (dialect);
	account->add_bank (bank);
	presence->add_cluster (cluster);
	result = true;
      }
    }

    return result;
  }
Example #2
0
 action_t list_voices::execute()
 {
   const std::set<voice_profile>& profiles=tts_engine->get_voice_profiles();
   reply r;
   if(profiles.empty())
     r("400 NO VOICES FOUND");
     else
       {
         std::string voice_name,language_code;
         std::string dialect("none");
         for(std::set<voice_profile>::const_iterator it=profiles.begin();it!=profiles.end();++it)
           {
             voice_name=it->get_name();
             language_code=it->primary()->get_language()->get_alpha2_code();
             if(language_code.empty())
               language_code="none";
             r("200-",voice_name," ",language_code," ",dialect);
           }
         r("200 OK VOICE LIST SENT");
       }
   return action_continue;
 }
Example #3
0
void AfxFindDictionaries(StringArray &aLanguage,
                         StringArray &aDialect)
{
	CString dicFileMatch = CConfiguration::GetInstance()->m_strSpellDictionaryPath + _T("\\*.dic");

	WIN32_FIND_DATA dirInfo;
	HANDLE hFile;
	BOOL bNext = TRUE;

	hFile = FindFirstFile(dicFileMatch,&dirInfo);

	while (hFile != INVALID_HANDLE_VALUE && bNext)
	{
		// Dictionary file format LANG_DIALACT{-extra}?.dic
		// Example: de_DE.dic en_US-slang.dic
		// Get the language and dialect of all installed dictionaries.
		TCHAR* dash;
		TCHAR* dot;
		dash = _tcschr(dirInfo.cFileName,_T('_'));

		if (dash != NULL)
			dot = _tcschr(dash,_T('.'));
		else
			dot = NULL;

		if ((dash != NULL) && (dot != NULL))
		{
			CString lang(dirInfo.cFileName,dash - dirInfo.cFileName);
			CString dialect(dash + 1,dot - dash - 1);
			aDialect.Add(dialect);
			aLanguage.Add(lang);
		}

		bNext = FindNextFile(hFile,&dirInfo);
	}

	FindClose(hFile);
}