This file is indexed.

/usr/include/echonest/Song.h is in libechonest-dev 2.1.0-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
/****************************************************************************************
 * Copyright (c) 2010-2012 Leo Franchi <lfranchi@kde.org>                               *
 *                                                                                      *
 * This program is free software; you can redistribute it and/or modify it under        *
 * the terms of the GNU General Public License as published by the Free Software        *
 * Foundation; either version 2 of the License, or (at your option) any later           *
 * version.                                                                             *
 *                                                                                      *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
 * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
 *                                                                                      *
 * You should have received a copy of the GNU General Public License along with         *
 * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
 ****************************************************************************************/


#ifndef ECHONEST_SONG_H
#define ECHONEST_SONG_H

#include "echonest_export.h"
#include "Track.h"
#include "TypeInformation.h"

#include <QSharedData>
#include <QHash>
#include <QVariant>
#include <QDebug>
#include <QVector>
#include "Config.h"

class QNetworkReply;
class SongData;

namespace Echonest{

class DynamicPlaylist; // forward declare for friend declaration
class Catalog;
class AudioSummary;

/**
 * This encapsulates an Echo Nest song---use it if you wish to get information about a song,
 *   search for a song, etc.
 *
 * This class is implicitly shared.
 */
class ECHONEST_EXPORT Song
{

public:

  enum SearchParam {
      Title,
      Artist,
      Combined,
      Description,
      ArtistId,
      Start,
      Results,
      MaxTempo,
      MinTempo,
      MaxDanceability,
      MinDanceability,
      MaxComplexity,
      MinComplexity,
      MaxDuration,
      MinDuration,
      MaxLoudness,
      MinLoudness,
      MaxFamiliarity,
      MinFamiliarity,
      MaxHotttnesss,
      MinHotttnesss,
      MaxLongitude,
      MinLongitude,
      MaxEnergy,
      MinEnergy,
      Mode,
      Key,
      Sort,
      SongType
  };
  typedef QPair< Echonest::Song::SearchParam, QVariant > SearchParamData;
  typedef QVector< SearchParamData > SearchParams;

  enum IdentifyParam {
      Code,
      IdentifyArtist,
      IdentifyTitle,
      IdentifyRelease,
      IdentifyDuration,
      IdentifyGenre
  };
  typedef QPair< Echonest::Song::IdentifyParam, QVariant > IdentifyParamData;
  typedef QVector< IdentifyParamData > IdentifyParams;

  Song();
  Song( const QByteArray& id, const QString& title, const QByteArray& artistId, const QString& artistName );
  Song( const QByteArray& id );
  Song( const Song& other );
  Song& operator=(const Song& song);
  virtual ~Song();

  /**
   * The following pieces of data are present in all Song objects, and do not require
   *   on-demand fetching.
   */
  QByteArray id() const;
  void setId( const QByteArray& id );

  QString title() const;
  void setTitle( const QString& title );

  QString artistName() const;
  void setArtistName( const QString& artistName );

  QByteArray artistId() const;
  void setArtistId( const QByteArray& artistId );

  QString release() const;
  void setRelease( const QString& release );

  /**
   * The following require fetching from The Echo Nest, so call
   *    fetchInformation() with the type of data you want first.
   *
   * If you ask for this information before calling parseInformation()
   *  with the respective data, the result is undefined.
   */

  /**
   * The full audio summary and analysis of this song.
   *
   * NOTE: This will return a copy of the AudioSummary object, which
   *       is implicitly shared. If you make modifications to the returned
   *       summary, for example by calling parseFullAnalysis(), it will detach
   *       and you will have to call setAudioSummary() to save the changes back
   *       to this Song object.
   */
   AudioSummary audioSummary() const;
   void setAudioSummary( const AudioSummary& summary );

  /**
   * The associated Track objects with acoustic track information
   */
  QVector< Track > tracks() const;
  void setTracks( const QVector< Track >& tracks );

  /**
   * The "hotttnesss" metric of this song.
   */
  qreal hotttnesss() const;
  void setHotttnesss( qreal hotttnesss );

  /**
   * The "hotttnesss" metric of this song's artist.
   */
  qreal artistHotttnesss() const;
  void setArtistHotttnesss( qreal artistHotttnesss );

  /**
   * The familiarity metric of this song's artist.
   */
  qreal artistFamiliarity() const;
  void setArtistFamiliarity( qreal artistFamiliarity );

  /**
   * The location of this artist.
   */
  ArtistLocation artistLocation() const;
  void setArtistLocation( const ArtistLocation& artistLocation );
  
  /**
   * The type of the song (atm: christmas, studio, live)
   */
  QList< QString > songTypes() const;
  void setSongTypes( const QList< QString >& songTypes );
  void addSongType( const QString& songType );

  /**
   *  This fetches the data from The Echo Nest for the requested data, so it
   *   returns a QNetworkReply*. When the finished() signal is emitted
   *   from the QNetworkReply object call parseInformation() to save the
   *   data back to this Song object.
   *
   */
  QNetworkReply* fetchInformation( SongInformation information = SongInformation() ) const;

  /**
   * Search for a song from The Echo Nest with the given search parameters. See
   *  http://developer.echonest.com/docs/v4/song.html#search for a description of the
   *  parameters and data types.
   *
   * The result will contain the requested information from the SongInformation flags, and
   *  can be extracted in the parseSearch() function.
   *
   */
  static QNetworkReply* search( const SearchParams& params, SongInformation information = SongInformation()  );

  /**
   * Identify a song from a given Echo Nest fingerprint hash code.
   * NOTE: SongInformation is currently not parsed yet.
   *
   */
  static QNetworkReply* identify( const IdentifyParams& params, const SongInformation& information = SongInformation() );

  /**
   * Identify a song from the Echoprint hash code, this time using the output of the 'echoprint-codegen' command-line
   * tool
   */
//   static QNetworkReply* identify( const QByteArray& jsonData );

  /**
   * Parses the reply of the identify call and returns a list of songs found.
   *
   */
  static QVector< Song > parseIdentify( QNetworkReply* ) throw( ParseError );

  /**
   * Parse the result of the fetchInformation() call.
   * For each requested SongInformationFlag in the original request, the respective
   *  data will be saved to this Song object.
   */
  void parseInformation( QNetworkReply* reply ) throw( ParseError );

  /**
   * Parse the result of the search() call.
   */
  static QVector<Song> parseSearch( QNetworkReply* reply ) throw( ParseError );

  QString toString() const;

  friend class DynamicPlaylist;
  friend class Catalog; // for access to searchParamToString
private:
    static QByteArray searchParamToString( SearchParam param );
    static QByteArray identifyParamToString( IdentifyParam param );
    static void addQueryInformation( QUrl& url, SongInformation information );

  QSharedDataPointer<SongData> d;
};

typedef QVector< Song > SongList;

ECHONEST_EXPORT QDebug operator<<(QDebug d, const Song &song);

} // namespace

Q_DECLARE_METATYPE( Echonest::Song )

#endif