#include <CSSample.h>
Public Member Functions | |
CSSample (const CSSample &Sample) | |
virtual | ~CSSample () |
virtual std::string | getType () |
void | play () |
void | stop () |
void | pause () |
void | resume () |
Static Public Member Functions | |
void | pauseAll () |
void | resumeAll () |
void | channel_finished (int channel) |
void | addCallback (int channel, CSSample *sample) |
void | removeCallback (int channel) |
void | init () |
void | deinit () |
bool | isPlaying () |
Static Public Attributes | |
const char * | CLASS = "CSSample" |
|
Definition at line 59 of file CSSample.cpp. References LOG_ENTER, LOG_EXIT, and mSample.
|
|
Definition at line 35 of file CSSample.cpp. References deinit(), LOG_ENTER, LOG_EXIT, and stop().
|
Here is the call graph for this function:
|
Definition at line 71 of file CSSample.h. References CLASS.
00071 {return (std::string) CLASS;} |
|
Definition at line 67 of file CSSample.cpp. References LOG_ENTER, LOG_EXIT, and stop().
|
Here is the call graph for this function:
|
Definition at line 78 of file CSSample.cpp. References LOG_ENTER, LOG_EXIT, and removeCallback(). Referenced by play(), and ~CSSample().
00079 { 00080 static char *functionName="stop"; 00081 LOG_ENTER 00082 int frequency; 00083 Uint16 format; 00084 int channels; 00085 removeCallback(mChannel); 00086 int state = Mix_QuerySpec(&frequency, &format, &channels); 00087 if (state) 00088 { 00089 if (mChannel != -1) 00090 { 00091 Mix_HaltChannel(mChannel); 00092 mChannel = -1; 00093 } 00094 } 00095 LOG_EXIT 00096 } |
Here is the call graph for this function:
|
Definition at line 106 of file CSSample.cpp. References LOG_ENTER, and LOG_EXIT.
|
|
Definition at line 114 of file CSSample.cpp. References LOG_ENTER, and LOG_EXIT.
|
|
Definition at line 122 of file CSSample.cpp. References LOG_ENTER, and LOG_EXIT. Referenced by CSGame::doPause().
00123 { 00124 static char *functionName="pauseAll"; 00125 LOG_ENTER 00126 while (mLock) 00127 { 00128 SDL_Delay(50); 00129 } 00130 00131 mLock = true; 00132 for (CSSampleMap::iterator iter = mAllPlayingSamples->begin(); iter != mAllPlayingSamples->end(); iter++) 00133 { 00134 iter->second->pause(); 00135 } 00136 mLock = false; 00137 LOG_EXIT 00138 } |
|
Definition at line 140 of file CSSample.cpp. References LOG_ENTER, and LOG_EXIT. Referenced by CSGame::doPause().
00141 { 00142 static char *functionName="resumeAll"; 00143 LOG_ENTER 00144 while (mLock) 00145 { 00146 SDL_Delay(50); 00147 } 00148 00149 mLock = true; 00150 for (CSSampleMap::iterator iter = mAllPlayingSamples->begin(); iter != mAllPlayingSamples->end(); iter++) 00151 { 00152 iter->second->resume(); 00153 } 00154 mLock = false; 00155 LOG_EXIT 00156 } |
|
Definition at line 158 of file CSSample.cpp. References LOG_ENTER, LOG_EXIT, and removeCallback(). Referenced by init().
00159 { 00160 static char *functionName="channel_finished"; 00161 LOG_ENTER 00162 removeCallback(channel); 00163 LOG_EXIT 00164 } |
Here is the call graph for this function:
|
Definition at line 166 of file CSSample.cpp. References LOG_ENTER, and LOG_EXIT.
00167 { 00168 static char *functionName="addCallback"; 00169 LOG_ENTER 00170 if (channel < 0) 00171 { 00172 LOG_EXIT 00173 return; 00174 } 00175 while (mLock) 00176 { 00177 SDL_Delay(50); 00178 } 00179 00180 mLock = true; 00181 mAllPlayingSamples->insert(CSSampleMap::value_type(channel, sample)); 00182 mLock = false; 00183 LOG_EXIT 00184 } |
|
Definition at line 186 of file CSSample.cpp. References LOG_ENTER, and LOG_EXIT. Referenced by channel_finished(), and stop().
00187 { 00188 static char *functionName="removeCallback"; 00189 LOG_ENTER 00190 if (channel < 0) 00191 { 00192 LOG_EXIT 00193 return; 00194 } 00195 00196 while (mLock) 00197 { 00198 SDL_Delay(50); 00199 } 00200 00201 mLock = true; 00202 CSSampleMap::iterator iter; 00203 for (iter = mAllPlayingSamples->begin(); iter!=mAllPlayingSamples->end(); iter++) 00204 { 00205 if (iter->first == channel) 00206 { 00207 mAllPlayingSamples->erase(iter); 00208 break; 00209 } 00210 } 00211 mLock = false; 00212 LOG_EXIT 00213 } |
|
Definition at line 215 of file CSSample.cpp. References channel_finished(), CSSampleMap, LOG_ENTER, and LOG_EXIT.
00216 { 00217 static char *functionName="init"; 00218 LOG_ENTER 00219 if (mIsInit == 0) 00220 { 00221 mAllPlayingSamples = new CSSampleMap(); 00222 Mix_ChannelFinished(CSSample::channel_finished); 00223 } 00224 mIsInit++; 00225 LOG_EXIT 00226 } |
Here is the call graph for this function:
|
Definition at line 228 of file CSSample.cpp. References LOG_ENTER, and LOG_EXIT. Referenced by ~CSSample().
|
|
Definition at line 243 of file CSSample.cpp. References LOG_ENTER, and LOG_EXIT. Referenced by CSGame::isSamplePlaying().
|
|
Definition at line 19 of file CSSample.cpp. Referenced by getType(). |