Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print taglib version #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/loudgain.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ int ebur128_v_major = 0;
int ebur128_v_minor = 0;
int ebur128_v_patch = 0;
char ebur128_version[15] = "";
int tag_v_major = 0;
int tag_v_minor = 0;
int tag_v_patch = 0;
char tag_version[15] = "";
unsigned swr_ver = 0;
char swr_version[15] = "";
unsigned lavf_ver = 0;
Expand Down Expand Up @@ -176,6 +180,11 @@ int main(int argc, char *argv[]) {
bool strip = false; // MP3 ID3v2: strip other tag types?
int id3v2version = 4; // MP3 ID3v2 version to write; can be 3 or 4

// taglib version
tag_get_version(&tag_v_major, &tag_v_minor, &tag_v_patch);
snprintf(tag_version, sizeof(tag_version), "%d.%d.%d",
tag_v_major, tag_v_minor, tag_v_patch);

// libebur128 version check -- versions before 1.2.4 aren’t recommended
ebur128_get_version(&ebur128_v_major, &ebur128_v_minor, &ebur128_v_patch);
snprintf(ebur128_version, sizeof(ebur128_version), "%d.%d.%d",
Expand Down Expand Up @@ -725,6 +734,7 @@ static inline void help(void) {

static inline void version(void) {
printf("%s %s - using:\n", PROJECT_NAME, PROJECT_VER);
printf(" %s %s\n", "libtag", tag_version);
printf(" %s %s\n", "libebur128", ebur128_version);
printf(" %s %s\n", "libavformat", lavf_version);
printf(" %s %s\n", "libswresample", swr_version);
Expand Down
6 changes: 6 additions & 0 deletions src/tag.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@
#include "tag.h"
#include "printf.h"

void tag_get_version(int* major, int* minor, int* patch) {
*major = TAGLIB_MAJOR_VERSION;
*minor = TAGLIB_MINOR_VERSION;
*patch = TAGLIB_PATCH_VERSION;
}

// define possible replaygain tags

enum RG_ENUM {
Expand Down
2 changes: 2 additions & 0 deletions src/tag.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
extern "C" {
#endif

void tag_get_version(int* major, int* minor, int* patch);

bool tag_write_mp3(scan_result *scan, bool do_album, char mode, char *unit,
bool lowercase, bool strip, int id3v2version);
bool tag_clear_mp3(scan_result *scan, bool strip, int id3v2version);
Expand Down