Commit 634852ea authored by Jacob Vosmaer's avatar Jacob Vosmaer

Add flac-cp-tag

parent ace6a9d0
tag-dump
flac-set
m4a-set
flac-cp-tag
PREFIX=/usr/local
LDLIBS=-ljsoncpp -ltag
all: tag-dump flac-set m4a-set
all: tag-dump flac-set m4a-set flac-cp-tag
install: tag-dump flac-set m4a-set
install: tag-dump flac-set m4a-set flac-cp-tag
install $^ ${PREFIX}/bin/
test: tag-dump
......@@ -12,4 +12,4 @@ test: tag-dump
.PHONY: clean
clean:
rm -f tag-dump flac-set m4a-set
rm -f tag-dump flac-set m4a-set flac-cp-tag
#include <iostream>
#include <taglib/flacfile.h>
#include <taglib/xiphcomment.h>
#include <taglib/tpropertymap.h>
int main(int argc, char **argv) {
if (argc != 3) {
std::cout << "usage: " << argv[0] << " SOURCE_FLAC DEST_FLAC" << std::endl;
exit(1);
}
TagLib::FLAC::File src(argv[1]);
if (!src.isValid()) {
std::cerr << "Invalid FLAC file: " << argv[1] << std::endl;
exit(1);
}
TagLib::FLAC::File dst(argv[2]);
if (!dst.isValid()) {
std::cerr << "Invalid FLAC file: " << argv[2] << std::endl;
exit(1);
}
dst.xiphComment()->setProperties(src.xiphComment()->properties());
if (!dst.save()) {
std::cerr << "Aborting: failed to save " << argv[2] << std::endl;
exit(1);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment