/* Version numbering for LAME.
* Copyright (c) 1999 A.L. Faber
*/
#include "lame.h"
#include "machine.h"
#include "version.h" /* macros of version numbers */
/*! Get the LAME version string.
\return a pointer to a string which describes the version of LAME.
*/
const char * get_lame_version() {
// primary to write screen reports
// Here we can also add informations about compile time configurations
#if LAME_ALPHA_VERSION
return STR(LAME_MAJOR_VERSION) "." STR(LAME_MINOR_VERSION) " "
"(alpha " STR(LAME_PATCH_VERSION) ", " __DATE__ " " __TIME__ ")";
#elif LAME_BETA_VERSION
return STR(LAME_MAJOR_VERSION) "." STR(LAME_MINOR_VERSION) " "
"(beta " STR(LAME_PATCH_VERSION) ", " __DATE__ ")";
#elif LAME_RELEASE_VERSION && (LAME_PATCH_VERSION > 0)
return STR(LAME_MAJOR_VERSION) "." STR(LAME_MINOR_VERSION) "." STR(LAME_PATCH_VERSION);
#else
return STR(LAME_MAJOR_VERSION) "." STR(LAME_MINOR_VERSION);
#endif
}
/*! Get the short LAME version string.
It's mainly for inclusion into the MP3 stream.
\return a pointer to the short version of the LAME version string.
*/
const char * get_lame_short_version() {
// adding date and time to version string makes it harder for output validation
#if LAME_ALPHA_VERSION
return STR(LAME_MAJOR_VERSION) "." STR(LAME_MINOR_VERSION) " (alpha " STR(LAME_PATCH_VERSION) ")";
#elif LAME_BETA_VERSION
return STR(LAME_MAJOR_VERSION) "." STR(LAME_MINOR_VERSION) " (beta " STR(LAME_PATCH_VERSION) ")";
#elif LAME_RELEASE_VERSION && (LAME_PATCH_VERSION > 0)
return STR(LAME_MAJOR_VERSION) "." STR(LAME_MINOR_VERSION) "." STR(LAME_PATCH_VERSION);
#else
return STR(LAME_MAJOR_VERSION) "." STR(LAME_MINOR_VERSION);
#endif
}
#if LAME_ALPHA_VERSION
#define P "a"
#elif LAME_BETA_VERSION
#define P "b"
#elif LAME_RELEASE_VERSION && (LAME_PATCH_VERSION > 0)
#define P "r"
#else
#define P " "
#endif
/*! Get the _very_ short LAME version string.
It's used in the LAME VBR tag only, limited to 9 characters max.
Due to some 3rd party HW/SW decoders, it has to start with LAME.
\return a pointer to the short version of the LAME version string.
*/
const char*get_lame_tag_encoder_short_version() {
// FIXME: new scheme / new version counting / drop versioning here ?
return "LAME" STR(LAME_MAJOR_VERSION) "." STR(LAME_MINOR_VERSION) P;
}
#undef P
const char *get_lame_url() {
return LAME_URL;
}
/*! Get the numerical representation of the version. */
/*!
Writes the numerical representation of the version of LAME and
GPSYCHO into lvp.
\param lvp
*/
lame_version_t::lame_version_t():
major(LAME_MAJOR_VERSION),
minor(LAME_MINOR_VERSION),
#if LAME_ALPHA_VERSION
alpha(LAME_PATCH_VERSION),
#else
alpha(0),
#endif
#if LAME_BETA_VERSION
beta(LAME_PATCH_VERSION),
#else
beta(0),
#endif
/* psy version */
psy_major(PSY_MAJOR_VERSION),
psy_minor(PSY_MINOR_VERSION),
psy_alpha(PSY_ALPHA_VERSION),
psy_beta(PSY_BETA_VERSION),
features("") {}
const char * get_lame_os_bitness() {
switch (sizeof(void*)) {
case 4: return "32bits";
case 8: return "64bits";
default: return "";
}
}
Detected encoding: UTF-8 | 0
|