Improve detection for songs not in playlists
[ncmpcpp.git] / src / tags.h
bloba9ceaef5ae7f031ddee50f2c390116a28372a9f7
1 /***************************************************************************
2 * Copyright (C) 2008-2016 by Andrzej Rybczak *
3 * electricityispower@gmail.com *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
19 ***************************************************************************/
21 #ifndef NCMPCPP_TAGS_H
22 #define NCMPCPP_TAGS_H
24 #include "config.h"
26 #ifdef HAVE_TAGLIB_H
28 #include <tfile.h>
29 #include "mutable_song.h"
31 namespace Tags {
33 struct ReplayGainInfo
35 ReplayGainInfo() { }
36 ReplayGainInfo(std::string reference_loudness, std::string track_gain,
37 std::string track_peak, std::string album_gain,
38 std::string album_peak)
39 : m_reference_loudness(reference_loudness), m_track_gain(track_gain)
40 , m_track_peak(track_peak), m_album_gain(album_gain), m_album_peak(album_peak) { }
42 bool empty() const
44 return m_reference_loudness.empty()
45 && m_track_gain.empty()
46 && m_track_peak.empty()
47 && m_album_gain.empty()
48 && m_album_peak.empty();
51 const std::string &referenceLoudness() const { return m_reference_loudness; }
52 const std::string &trackGain() const { return m_track_gain; }
53 const std::string &trackPeak() const { return m_track_peak; }
54 const std::string &albumGain() const { return m_album_gain; }
55 const std::string &albumPeak() const { return m_album_peak; }
57 private:
58 std::string m_reference_loudness;
59 std::string m_track_gain;
60 std::string m_track_peak;
61 std::string m_album_gain;
62 std::string m_album_peak;
65 void setAttribute(mpd_song *s, const char *name, const std::string &value);
67 ReplayGainInfo readReplayGain(TagLib::File *f);
69 bool extendedSetSupported(const TagLib::File *f);
71 void read(mpd_song *s);
72 bool write(MPD::MutableSong &);
76 #endif // HAVE_TAGLIB_H
78 #endif // NCMPCPP_TAGS_H