function to check whether a prompt was loaded and exists

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1247 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Stefan Sayer 18 years ago
parent e44d2a100f
commit 1c4057a3b3

@ -105,6 +105,19 @@ AmCachedAudioFile* AudioFileEntry::getAudio(){
return new AmCachedAudioFile(&cache);
}
bool AmPromptCollection::hasPrompt(const string& name) {
string s = name;
std::map<std::string, AudioFileEntry*>::iterator it=store.begin();
while (it != store.end()) {
if (!strcmp(it->first.c_str(), s.c_str()))
break;
it++;
}
return it != store.end();
}
int AmPromptCollection::addToPlaylist(const std::string& name, long sess_id,
AmPlaylist& list, bool front,
bool loop) {

@ -92,6 +92,12 @@ class AmPromptCollection {
int setPrompt(const string& name,
const string& filename,
const char* mod_name);
/**
* check whether prompt exists
*/
bool hasPrompt(const string& name);
/**
* add the announcement identified with @param name
* to the playlist @list

Loading…
Cancel
Save