void CSoundPage::browse()
{
    std::vector<NLMISC::TStringId> names;


    NLSOUND::UAudioMixer *audioMixer = Modules::sound().getAudioMixer();
    if (audioMixer)
    {
        audioMixer->getSoundNames(names);
    }

    // TODO: create CPickSound dialog
    QStringList items;
    items << tr("");
    for(size_t i = 0; i < names.size(); ++i)
        items << QString(names[i]->c_str());

    bool ok;
    QString item = QInputDialog::getItem(this, tr("Select your sound"),
                                         tr("Sound:"), items, 0, false, &ok);
    if (ok)
    {
        _ui.soundNameLineEdit->setText(item);
        updateModifiedFlag();
    }
}
Example #2
0
void CSoundAnimDlg::OnAddSound()
{
	if (_SelectedMarker != 0)
	{
//		CPickSound::TNameVect names;
		vector<NLMISC::TStringId>	names;
		

		NLSOUND::UAudioMixer *audioMixer = CSoundSystem::getAudioMixer();
		if (audioMixer)
		{
			audioMixer->getSoundNames(names);
		}

		CPickSound ps(names, this);

		if (ps.DoModal() == IDOK)
		{
//			string name = ps.getName();
			_SelectedMarker->addSound(ps.getName());
			updateSounds();	
		}
	}
}