33 using namespace basis;
40 int main(
int argc,
char *argv[])
44 out.
log(
astring(argv[0]) +
" usage:", ALWAYS_PRINT);
45 out.
log(
astring(
"This program takes one or more parameters which are interpreted"), ALWAYS_PRINT);
46 out.
log(
astring(
"as the names of sound files."), ALWAYS_PRINT);
49 for (
int i = 1; i < argc; i++) {
51 out.
log(
a_sprintf(
"soundfile %d: %s", i, sound_file.
s()), ALWAYS_PRINT);
52 if (sound_file.
ends(
".mp3")) {
53 out.
log(
astring(
"skipping MP3 file ") + sound_file, ALWAYS_PRINT);
57 if (!PlaySound(to_unicode_temp(sound_file),
NULL_POINTER, SND_FILENAME))
58 out.
log(
astring(
"failed to play ") + sound_file, ALWAYS_PRINT);
60 out.
log(
astring(
"this program is a NO-OP, ignoring ") + sound_file, ALWAYS_PRINT);
66 #ifdef __BUILD_STATIC_APPLICATION__
a_sprintf is a specialization of astring that provides printf style support.
Provides a dynamically resizable ASCII character string.
const char * s() const
synonym for observe. the 's' stands for "string", if that helps.
bool ends(const astring &maybe_suffix) const
returns true if this string ends with "maybe_suffix".
virtual basis::outcome log(const basis::base_string &info, int filter)
sends the string "info" to the standard output device.
#define NULL_POINTER
The value representing a pointer to nothing.
The guards collection helps in testing preconditions and reporting errors.
A logger that sends to the console screen using the standard output device.
A dynamic container class that holds any kind of object via pointers.
int main(int argc, char *argv[])
HOOPLE_STARTUP_CODE;.
Support for unicode builds.
Aids in achievement of platform independence.