Commit f8165580 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠

taglib: indent C++ sources

parent 0f1b1358
Pipeline #20863 passed with stages
in 29 minutes and 34 seconds
......@@ -228,10 +228,10 @@ add_count_or_num_tag (ID3v2::Tag * id3v2tag, const GstTagList * list,
const gchar *corr_num; /* corresponding NUMBER tag (if count) */
} corr[] = {
{
GST_TAG_TRACK_NUMBER, GST_TAG_TRACK_COUNT, NULL}, {
GST_TAG_TRACK_COUNT, NULL, GST_TAG_TRACK_NUMBER}, {
GST_TAG_ALBUM_VOLUME_NUMBER, GST_TAG_ALBUM_VOLUME_COUNT, NULL}, {
GST_TAG_ALBUM_VOLUME_COUNT, NULL, GST_TAG_ALBUM_VOLUME_NUMBER}
GST_TAG_TRACK_NUMBER, GST_TAG_TRACK_COUNT, NULL}, {
GST_TAG_TRACK_COUNT, NULL, GST_TAG_TRACK_NUMBER}, {
GST_TAG_ALBUM_VOLUME_NUMBER, GST_TAG_ALBUM_VOLUME_COUNT, NULL}, {
GST_TAG_ALBUM_VOLUME_COUNT, NULL, GST_TAG_ALBUM_VOLUME_NUMBER}
};
guint idx;
......@@ -315,19 +315,20 @@ add_musicbrainz_tag (ID3v2::Tag * id3v2tag, const GstTagList * list,
const gchar realworld_id[28];
} mb_ids[] = {
{
GST_TAG_MUSICBRAINZ_ARTISTID, "MusicBrainz Artist Id",
"musicbrainz_artistid"}, {
GST_TAG_MUSICBRAINZ_ALBUMID, "MusicBrainz Album Id", "musicbrainz_albumid"}, {
GST_TAG_MUSICBRAINZ_ALBUMARTISTID, "MusicBrainz Album Artist Id",
"musicbrainz_albumartistid"}, {
GST_TAG_MUSICBRAINZ_TRMID, "MusicBrainz TRM Id", "musicbrainz_trmid"}, {
GST_TAG_CDDA_MUSICBRAINZ_DISCID, "MusicBrainz DiscID",
"musicbrainz_discid"}, {
/* the following one is more or less made up, there seems to be little
* evidence that any popular application is actually putting this info
* into TXXX frames; the first one comes from a musicbrainz wiki 'proposed
* tags' page, the second one is analogue to the vorbis/ape/flac tag. */
GST_TAG_CDDA_CDDB_DISCID, "CDDB DiscID", "discid"}
GST_TAG_MUSICBRAINZ_ARTISTID, "MusicBrainz Artist Id",
"musicbrainz_artistid"}, {
GST_TAG_MUSICBRAINZ_ALBUMID, "MusicBrainz Album Id",
"musicbrainz_albumid"}, {
GST_TAG_MUSICBRAINZ_ALBUMARTISTID, "MusicBrainz Album Artist Id",
"musicbrainz_albumartistid"}, {
GST_TAG_MUSICBRAINZ_TRMID, "MusicBrainz TRM Id", "musicbrainz_trmid"}, {
GST_TAG_CDDA_MUSICBRAINZ_DISCID, "MusicBrainz DiscID",
"musicbrainz_discid"}, {
/* the following one is more or less made up, there seems to be little
* evidence that any popular application is actually putting this info
* into TXXX frames; the first one comes from a musicbrainz wiki 'proposed
* tags' page, the second one is analogue to the vorbis/ape/flac tag. */
GST_TAG_CDDA_CDDB_DISCID, "CDDB DiscID", "discid"}
};
guint i, idx;
......@@ -384,8 +385,8 @@ add_id3v2frame_tag (ID3v2::Tag * id3v2tag, const GstTagList * list,
GstMapInfo map;
gst_buffer_map (buf, &map, GST_MAP_READ);
GST_DEBUG ("Injecting ID3v2.%u frame %u/%u of length %" G_GSIZE_FORMAT " and type %"
GST_PTR_FORMAT, version, i, num_tags, map.size, s);
GST_DEBUG ("Injecting ID3v2.%u frame %u/%u of length %" G_GSIZE_FORMAT
" and type %" GST_PTR_FORMAT, version, i, num_tags, map.size, s);
frame = factory->createFrame (ByteVector ((const char *) map.data,
map.size), (TagLib::uint) version);
......@@ -441,8 +442,8 @@ add_image_tag (ID3v2::Tag * id3v2tag, const GstTagList * list,
gst_buffer_map (image, &map, GST_MAP_READ);
GST_DEBUG ("Attaching picture of %" G_GSIZE_FORMAT " bytes and mime type %s",
map.size, mime_type);
GST_DEBUG ("Attaching picture of %" G_GSIZE_FORMAT
" bytes and mime type %s", map.size, mime_type);
id3v2tag->addFrame (frame);
frame->setPicture (ByteVector ((const char *) map.data, map.size));
......@@ -472,7 +473,8 @@ add_image_tag (ID3v2::Tag * id3v2tag, const GstTagList * list,
}
}
frame->setType ((TagLib::ID3v2::AttachedPictureFrame::Type) image_type);
frame->setType ((TagLib::ID3v2::AttachedPictureFrame::
Type) image_type);
}
}
} else {
......@@ -640,11 +642,11 @@ add_relative_volume_tag (ID3v2::Tag * id3v2tag, const GstTagList * list,
}
/* copying mutagen: always write as 16 bits for sanity. */
peak_int = (short)(peak_val * G_MAXSHORT);
peak_int = (short) (peak_val * G_MAXSHORT);
encoded_peak.bitsRepresentingPeak = 16;
encoded_peak.peakVolume = ByteVector::fromShort(peak_int, true);
encoded_peak.peakVolume = ByteVector::fromShort (peak_int, true);
GST_DEBUG ("setting peak value %g", peak_val);
frame->setPeakVolume(encoded_peak);
frame->setPeakVolume (encoded_peak);
} else {
gst_tag_list_get_double (list, tag, &gain_val);
......@@ -652,7 +654,8 @@ add_relative_volume_tag (ID3v2::Tag * id3v2tag, const GstTagList * list,
frame->setVolumeAdjustment (gain_val);
if (gst_tag_list_get_tag_size (list, peak_tag_name) != 0) {
GST_DEBUG ("both gain and peak tags exist, not adding frame this time around");
GST_DEBUG
("both gain and peak tags exist, not adding frame this time around");
delete frame;
return;
}
......@@ -671,7 +674,7 @@ add_bpm_tag (ID3v2::Tag * id3v2tag, const GstTagList * list,
ID3v2::TextIdentificationFrame * frame;
gchar *tag_str;
tag_str = g_strdup_printf ("%u", (guint)bpm);
tag_str = g_strdup_printf ("%u", (guint) bpm);
GST_DEBUG ("Setting %s to %s", tag, tag_str);
frame = new ID3v2::TextIdentificationFrame ("TBPM", String::UTF8);
......@@ -691,42 +694,42 @@ static const struct
const gchar data[5];
} add_funcs[] = {
{
GST_TAG_ARTIST, add_text_tag, "TPE1"}, {
GST_TAG_ALBUM_ARTIST, add_text_tag, "TPE2"}, {
GST_TAG_TITLE, add_text_tag, "TIT2"}, {
GST_TAG_ALBUM, add_text_tag, "TALB"}, {
GST_TAG_COPYRIGHT, add_text_tag, "TCOP"}, {
GST_TAG_COMPOSER, add_text_tag, "TCOM"}, {
GST_TAG_GENRE, add_text_tag, "TCON"}, {
GST_TAG_COMMENT, add_comment_tag, ""}, {
GST_TAG_EXTENDED_COMMENT, add_comment_tag, ""}, {
GST_TAG_DATE, add_date_tag, ""}, {
GST_TAG_IMAGE, add_image_tag, ""}, {
GST_TAG_PREVIEW_IMAGE, add_image_tag, ""}, {
GST_ID3_DEMUX_TAG_ID3V2_FRAME, add_id3v2frame_tag, ""}, {
GST_TAG_MUSICBRAINZ_ARTISTID, add_musicbrainz_tag, "\000"}, {
GST_TAG_MUSICBRAINZ_ALBUMID, add_musicbrainz_tag, "\001"}, {
GST_TAG_MUSICBRAINZ_ALBUMARTISTID, add_musicbrainz_tag, "\002"}, {
GST_TAG_MUSICBRAINZ_TRMID, add_musicbrainz_tag, "\003"}, {
GST_TAG_CDDA_MUSICBRAINZ_DISCID, add_musicbrainz_tag, "\004"}, {
GST_TAG_CDDA_CDDB_DISCID, add_musicbrainz_tag, "\005"}, {
GST_TAG_MUSICBRAINZ_TRACKID, add_unique_file_id_tag, ""}, {
GST_TAG_ARTIST_SORTNAME, add_text_tag, "TSOP"}, {
GST_TAG_ALBUM_SORTNAME, add_text_tag, "TSOA"}, {
GST_TAG_TITLE_SORTNAME, add_text_tag, "TSOT"}, {
GST_TAG_TRACK_NUMBER, add_count_or_num_tag, "TRCK"}, {
GST_TAG_TRACK_COUNT, add_count_or_num_tag, "TRCK"}, {
GST_TAG_ALBUM_VOLUME_NUMBER, add_count_or_num_tag, "TPOS"}, {
GST_TAG_ALBUM_VOLUME_COUNT, add_count_or_num_tag, "TPOS"}, {
GST_TAG_ENCODER, add_encoder_tag, ""}, {
GST_TAG_ENCODER_VERSION, add_encoder_tag, ""}, {
GST_TAG_COPYRIGHT_URI, add_uri_tag, "WCOP"}, {
GST_TAG_LICENSE_URI, add_uri_tag, "WCOP"}, {
GST_TAG_TRACK_PEAK, add_relative_volume_tag, ""}, {
GST_TAG_TRACK_GAIN, add_relative_volume_tag, ""}, {
GST_TAG_ALBUM_PEAK, add_relative_volume_tag, ""}, {
GST_TAG_ALBUM_GAIN, add_relative_volume_tag, ""}, {
GST_TAG_BEATS_PER_MINUTE, add_bpm_tag, ""}
GST_TAG_ARTIST, add_text_tag, "TPE1"}, {
GST_TAG_ALBUM_ARTIST, add_text_tag, "TPE2"}, {
GST_TAG_TITLE, add_text_tag, "TIT2"}, {
GST_TAG_ALBUM, add_text_tag, "TALB"}, {
GST_TAG_COPYRIGHT, add_text_tag, "TCOP"}, {
GST_TAG_COMPOSER, add_text_tag, "TCOM"}, {
GST_TAG_GENRE, add_text_tag, "TCON"}, {
GST_TAG_COMMENT, add_comment_tag, ""}, {
GST_TAG_EXTENDED_COMMENT, add_comment_tag, ""}, {
GST_TAG_DATE, add_date_tag, ""}, {
GST_TAG_IMAGE, add_image_tag, ""}, {
GST_TAG_PREVIEW_IMAGE, add_image_tag, ""}, {
GST_ID3_DEMUX_TAG_ID3V2_FRAME, add_id3v2frame_tag, ""}, {
GST_TAG_MUSICBRAINZ_ARTISTID, add_musicbrainz_tag, "\000"}, {
GST_TAG_MUSICBRAINZ_ALBUMID, add_musicbrainz_tag, "\001"}, {
GST_TAG_MUSICBRAINZ_ALBUMARTISTID, add_musicbrainz_tag, "\002"}, {
GST_TAG_MUSICBRAINZ_TRMID, add_musicbrainz_tag, "\003"}, {
GST_TAG_CDDA_MUSICBRAINZ_DISCID, add_musicbrainz_tag, "\004"}, {
GST_TAG_CDDA_CDDB_DISCID, add_musicbrainz_tag, "\005"}, {
GST_TAG_MUSICBRAINZ_TRACKID, add_unique_file_id_tag, ""}, {
GST_TAG_ARTIST_SORTNAME, add_text_tag, "TSOP"}, {
GST_TAG_ALBUM_SORTNAME, add_text_tag, "TSOA"}, {
GST_TAG_TITLE_SORTNAME, add_text_tag, "TSOT"}, {
GST_TAG_TRACK_NUMBER, add_count_or_num_tag, "TRCK"}, {
GST_TAG_TRACK_COUNT, add_count_or_num_tag, "TRCK"}, {
GST_TAG_ALBUM_VOLUME_NUMBER, add_count_or_num_tag, "TPOS"}, {
GST_TAG_ALBUM_VOLUME_COUNT, add_count_or_num_tag, "TPOS"}, {
GST_TAG_ENCODER, add_encoder_tag, ""}, {
GST_TAG_ENCODER_VERSION, add_encoder_tag, ""}, {
GST_TAG_COPYRIGHT_URI, add_uri_tag, "WCOP"}, {
GST_TAG_LICENSE_URI, add_uri_tag, "WCOP"}, {
GST_TAG_TRACK_PEAK, add_relative_volume_tag, ""}, {
GST_TAG_TRACK_GAIN, add_relative_volume_tag, ""}, {
GST_TAG_ALBUM_PEAK, add_relative_volume_tag, ""}, {
GST_TAG_ALBUM_GAIN, add_relative_volume_tag, ""}, {
GST_TAG_BEATS_PER_MINUTE, add_bpm_tag, ""}
};
......
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