AmPromptCollection.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00029 #ifndef AM_PROMPT_COLLECTION_H
00030 #define AM_PROMPT_COLLECTION_H
00031
00042 #define AM_PROMPT_START \
00043 { \
00044 std::vector<std::pair<string, string> > _prompt_names
00045
00046 #define AM_PROMPT_ADD(_name, _default_file) \
00047 _prompt_names.push_back(std::make_pair(_name, _default_file))
00048
00049 #define AM_PROMPT_END(_prompts, _cfg, _MOD_NAME) \
00050 _prompts.configureModule(_cfg, _prompt_names, _MOD_NAME); \
00051 }
00052
00053 #include <map>
00054 #include <string>
00055 #include <utility>
00056 using std::string;
00057
00058 #include "AmCachedAudioFile.h"
00059 #include "AmPlaylist.h"
00060 #include "AmConfigReader.h"
00061
00062 class AudioFileEntry;
00063
00067 class AmPromptCollection {
00068
00069
00070 std::map<string, AudioFileEntry*> store;
00071
00072
00073 std::map<long, vector<AmCachedAudioFile*> > items;
00074
00075 AmMutex items_mut;
00076
00077 public:
00078 AmPromptCollection();
00079 ~AmPromptCollection();
00080
00086 int configureModule(AmConfigReader& cfg,
00087 vector<std::pair<string, string> >& announcements,
00088 const char* mod_name);
00092 int setPrompt(const string& name,
00093 const string& filename,
00094 const char* mod_name);
00099 int addToPlaylist(const string& name, long sess_id,
00100 AmPlaylist& list, bool front=false);
00104 void cleanup(long sess_id);
00105 };
00106
00111 class AudioFileEntry : public AmAudioFile {
00112 AmFileCache cache;
00113 bool isopen;
00114
00115 public:
00116 AudioFileEntry();
00117 ~AudioFileEntry();
00118
00119 int load(const std::string& filename);
00120 bool isOpen() { return isopen; }
00121
00122 AmCachedAudioFile* getAudio();
00123 };
00124
00125 #endif
Generated on Fri May 16 12:02:05 2008 for SEMS by
1.5.1