~ubuntu-branches/ubuntu/wily/kid3/wily

« back to all changes in this revision

Viewing changes to src/plugins/taglibmetadata/taglibext/wavpack/combinedtag.h

  • Committer: Package Import Robot
  • Author(s): Mark Purcell, Patrick Matthäi, Mark Purcell
  • Date: 2013-11-30 15:44:59 UTC
  • mfrom: (1.1.16) (2.1.18 sid)
  • Revision ID: package-import@ubuntu.com-20131130154459-s6lpalx8yy2zq7gx
Tags: 3.0.2-1
* New upstream release 

[ Patrick Matthäi ]
* New upstream release.
  - Add new libreadline-dev build dependency.
* Don't explicitly request xz compression - dpkg 1.17 does this by default.
* Bump Standards-Version to 3.9.5 (no changes needed).
* Fix Vcs-Browser control field.

[ Mark Purcell ]
* Switch to dh - reduce debian/rules bloat
* kid3 Replaces kid3-qt - low popcon, reduce archive bloat
* Fix vcs-field-not-canonical
* debian/compat -> 9
* Update Description:

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
    copyright            : (C) 2004 by Allan Sandfeld Jensen
 
3
    email                : kde@carewolf.org
 
4
 ***************************************************************************/
 
5
 
 
6
/***************************************************************************
 
7
 *   This library is free software; you can redistribute it and/or modify  *
 
8
 *   it  under the terms of the GNU Lesser General Public License version  *
 
9
 *   2.1 as published by the Free Software Foundation.                     *
 
10
 *                                                                         *
 
11
 *   This library is distributed in the hope that it will be useful, but   *
 
12
 *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
 
13
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
 
14
 *   Lesser General Public License for more details.                       *
 
15
 *                                                                         *
 
16
 *   You should have received a copy of the GNU Lesser General Public      *
 
17
 *   License along with this library; if not, write to the Free Software   *
 
18
 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,            *
 
19
 *   MA  02110-1301  USA                                                   *
 
20
 ***************************************************************************/
 
21
 
 
22
#ifndef DO_NOT_DOCUMENT // Tell Doxygen not to document this header
 
23
 
 
24
#ifndef TAGLIB_COMBINEDTAG_H
 
25
#define TAGLIB_COMBINEDTAG_H
 
26
 
 
27
////////////////////////////////////////////////////////////////////////////////
 
28
// Note that this header is not installed.
 
29
////////////////////////////////////////////////////////////////////////////////
 
30
 
 
31
#include <tag.h>
 
32
 
 
33
namespace TagLib {
 
34
 
 
35
  /*!
 
36
   * A union of two TagLib::Tags.
 
37
   */
 
38
  class CombinedTag : public TagLib::Tag
 
39
  {
 
40
  public:
 
41
    explicit CombinedTag(Tag *tag1 = 0, Tag *tag2 = 0)
 
42
               : TagLib::Tag(),
 
43
                 tag1(tag1), tag2(tag2) {}
 
44
 
 
45
    virtual String title() const {
 
46
      if(tag1 && !tag1->title().isEmpty())
 
47
          return tag1->title();
 
48
 
 
49
      if(tag2)
 
50
          return tag2->title();
 
51
 
 
52
      return String::null;
 
53
    }
 
54
 
 
55
    virtual String artist() const {
 
56
      if(tag1 && !tag1->artist().isEmpty())
 
57
          return tag1->artist();
 
58
 
 
59
      if(tag2)
 
60
          return tag2->artist();
 
61
 
 
62
      return String::null;
 
63
    }
 
64
 
 
65
    virtual String album() const {
 
66
      if(tag1 && !tag1->album().isEmpty())
 
67
          return tag1->album();
 
68
 
 
69
      if(tag2)
 
70
          return tag2->album();
 
71
 
 
72
      return String::null;
 
73
    }
 
74
 
 
75
    virtual String comment() const {
 
76
      if(tag1 && !tag1->comment().isEmpty())
 
77
          return tag1->comment();
 
78
 
 
79
      if(tag2)
 
80
          return tag2->comment();
 
81
 
 
82
      return String::null;
 
83
    }
 
84
 
 
85
    virtual String genre() const {
 
86
      if(tag1 && !tag1->genre().isEmpty())
 
87
          return tag1->genre();
 
88
 
 
89
      if(tag2)
 
90
          return tag2->genre();
 
91
 
 
92
      return String::null;
 
93
    }
 
94
 
 
95
    virtual TagLib::uint year() const {
 
96
      if(tag1 && tag1->year() > 0)
 
97
          return tag1->year();
 
98
 
 
99
      if(tag2)
 
100
          return tag2->year();
 
101
 
 
102
      return 0;
 
103
    }
 
104
 
 
105
    virtual TagLib::uint track() const {
 
106
      if(tag1 && tag1->track() > 0)
 
107
          return tag1->track();
 
108
 
 
109
      if(tag2)
 
110
          return tag2->track();
 
111
 
 
112
      return 0;
 
113
    }
 
114
 
 
115
    virtual void setTitle(const String &s) {
 
116
      if(tag1)
 
117
          tag1->setTitle(s);
 
118
      if(tag2)
 
119
          tag2->setTitle(s);
 
120
    }
 
121
 
 
122
    virtual void setArtist(const String &s) {
 
123
      if(tag1)
 
124
          tag1->setArtist(s);
 
125
      if(tag2)
 
126
          tag2->setArtist(s);
 
127
    }
 
128
 
 
129
    virtual void setAlbum(const String &s) {
 
130
      if(tag1)
 
131
          tag1->setAlbum(s);
 
132
      if(tag2)
 
133
          tag2->setAlbum(s);
 
134
    }
 
135
 
 
136
    virtual void setComment(const String &s) {
 
137
      if(tag1)
 
138
          tag1->setComment(s);
 
139
      if(tag2)
 
140
          tag2->setComment(s);
 
141
    }
 
142
 
 
143
    virtual void setGenre(const String &s) {
 
144
      if(tag1)
 
145
          tag1->setGenre(s);
 
146
      if(tag2)
 
147
          tag2->setGenre(s);
 
148
    }
 
149
 
 
150
    virtual void setYear(uint i) {
 
151
      if(tag1)
 
152
          tag1->setYear(i);
 
153
      if(tag2)
 
154
          tag2->setYear(i);
 
155
    }
 
156
 
 
157
    virtual void setTrack(uint i) {
 
158
      if(tag1)
 
159
          tag1->setTrack(i);
 
160
      if(tag2)
 
161
          tag2->setTrack(i);
 
162
    }
 
163
 
 
164
  private:
 
165
      Tag *tag1;
 
166
      Tag *tag2;
 
167
  };
 
168
}
 
169
 
 
170
#endif
 
171
#endif