22 #include "vorbis/vorbisfile.h" 25 #define ERR_AUDIO LOG_STREAM(err, log_audio) 26 #define LOG_AUDIO LOG_STREAM(info, log_audio) 48 once_(node[
"play_once"].to_bool()),
49 append_(node[
"append"].to_bool()),
51 shuffle_(node[
"shuffle"].to_bool(true))
73 LOG_AUDIO <<
"empty track filename specified for track identification";
80 LOG_AUDIO <<
"could not find track '" <<
id_ <<
"' for track identification";
91 vorbis_comment* comments = ov_comment(&vf, -1);
92 char** user_comments = comments->user_comments;
95 for (
int i=0;
i< comments->comments;
i++) {
96 const std::string comment_string(user_comments[
i]);
97 const std::vector<std::string> comment_list =
utils::split(comment_string,
'=');
99 if (comment_list[0] ==
"TITLE" || comment_list[0] ==
"title") {
105 LOG_AUDIO <<
"No title for music track '" <<
id_ <<
"'";
static lg::log_domain log_audio("audio")
void write(config &parent_node, bool append) const
std::string get_binary_file_location(const std::string &type, const std::string &filename)
Returns a complete path to the actual file of a given type or an empty string if the file isn't prese...
Audio output for sound and music.
Definitions for the interface to Wesnoth Markup Language (WML).
Declarations for File-IO.
config & add_child(config_key_type key)
std::vector< std::string > split(const config_attribute_value &val)
Standard logging facilities (interface).
A config object defines a single node in a WML file, with access to child nodes.