File indexing completed on 2024-05-19 04:50:22
0001 /**************************************************************************************** 0002 * Copyright (c) 2007 Casey Link <unnamedrambler@gmail.com> * 0003 * * 0004 * This program is free software; you can redistribute it and/or modify it under * 0005 * the terms of the GNU General Public License as published by the Free Software * 0006 * Foundation; either version 2 of the License, or (at your option) any later * 0007 * version. * 0008 * * 0009 * This program is distributed in the hope that it will be useful, but WITHOUT ANY * 0010 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * 0011 * PARTICULAR PURPOSE. See the GNU General Public License for more details. * 0012 * * 0013 * You should have received a copy of the GNU General Public License along with * 0014 * this program. If not, see <http://www.gnu.org/licenses/>. * 0015 ****************************************************************************************/ 0016 0017 #ifndef MP3TUNESLOCKERMETA_H 0018 #define MP3TUNESLOCKERMETA_H 0019 0020 /** 0021 * These are the c++ wrappers for the libmp3tunes meta types: 0022 * artist, album, track, playlist 0023 */ 0024 0025 extern "C" { 0026 // Get libmp3tunes declarations 0027 #include "libmp3tunes/locker.h" 0028 } 0029 0030 #include <QString> 0031 #include <QList> 0032 0033 class Mp3tunesLockerPlaylist { 0034 public: 0035 explicit Mp3tunesLockerPlaylist( mp3tunes_locker_playlist_t *playlist ); 0036 ~Mp3tunesLockerPlaylist(); 0037 0038 QString playlistId() const; 0039 QString playlistTitle() const; 0040 QString title() const; 0041 QString fileName() const; 0042 int fileCount() const; 0043 int playlistSize() const; 0044 private: 0045 mp3tunes_locker_playlist_t *m_playlist; 0046 }; 0047 0048 class Mp3tunesLockerArtist { 0049 public: 0050 explicit Mp3tunesLockerArtist( mp3tunes_locker_artist_t *artist ); 0051 ~Mp3tunesLockerArtist(); 0052 0053 int artistId() const; 0054 QString artistName() const; 0055 int artistSize() const; 0056 int albumCount() const; 0057 int trackCount() const; 0058 private: 0059 int m_artistId; 0060 QString m_artistName; 0061 int m_artistSize; 0062 int m_albumCount; 0063 int m_trackCount; 0064 }; 0065 0066 class Mp3tunesLockerAlbum { 0067 public: 0068 explicit Mp3tunesLockerAlbum( mp3tunes_locker_album_t *album ); 0069 ~Mp3tunesLockerAlbum(); 0070 int albumId() const; 0071 QString albumTitle() const; 0072 int artistId() const; 0073 QString artistName() const; 0074 int trackCount() const; 0075 int albumSize() const; 0076 bool hasArt() const; 0077 private: 0078 int m_albumId; 0079 QString m_albumTitle; 0080 int m_artistId; 0081 QString m_artistName; 0082 int m_trackCount; 0083 int m_albumSize; 0084 bool m_hasArt; 0085 }; 0086 0087 class Mp3tunesLockerTrack { 0088 public: 0089 explicit Mp3tunesLockerTrack( mp3tunes_locker_track_t *track = 0 ); 0090 ~Mp3tunesLockerTrack(); 0091 0092 int trackId() const; 0093 QString trackTitle() const; 0094 int trackNumber() const; 0095 float trackLength() const; 0096 QString trackFileName() const; 0097 QString trackFileKey() const; 0098 int trackFileSize() const; 0099 QString downloadUrl() const; 0100 QString playUrl() const; 0101 int albumId() const; 0102 QString albumTitle() const; 0103 int albumYear() const; 0104 QString artistName() const; 0105 int artistId() const; 0106 private: 0107 int m_trackId; 0108 QString m_trackTitle; 0109 int m_trackNumber; 0110 float m_trackLength; 0111 QString m_trackFileName; 0112 QString m_trackFileKey; 0113 int m_trackFileSize; 0114 QString m_downloadUrl; 0115 QString m_playUrl; 0116 int m_albumId; 0117 QString m_albumTitle; 0118 int m_albumYear; 0119 QString m_artistName; 0120 int m_artistId; 0121 }; 0122 #endif