1 /* CustomPlaylistSkeleton.cpp */ 2 3 /* Copyright (C) 2011-2020 Michael Lugmair (Lucio Carreras) 4 * 5 * This file is part of sayonara player 6 * 7 * This program is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 17 * You should have received a copy of the GNU General Public License 18 * along with this program. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 21 #include "CustomPlaylistSkeleton.h" 22 #include <QString> CustomPlaylist()23 24 struct CustomPlaylistSkeleton::Private 25 { 26 QString name; 27 int id; 28 int num_tracks; 29 bool is_temporary; 30 31 Private() : 32 id(-1), 33 num_tracks(0), 34 is_temporary(false) 35 {} 36 37 Private(const Private& other) : 38 CASSIGN(name), 39 CASSIGN(id), 40 CASSIGN(num_tracks), 41 CASSIGN(is_temporary) 42 {} 43 44 Private& operator=(const Private& other) 45 { 46 ASSIGN(name); 47 ASSIGN(id); 48 ASSIGN(num_tracks); 49 ASSIGN(is_temporary); 50 51 return *this; 52 } 53 }; 54 55 56 CustomPlaylistSkeleton::CustomPlaylistSkeleton() 57 { 58 m = Pimpl::make<Private>(); 59 } 60 61 CustomPlaylistSkeleton::CustomPlaylistSkeleton(const CustomPlaylistSkeleton& other) 62 { 63 m = Pimpl::make<Private>(*(other.m)); 64 } 65 66 CustomPlaylistSkeleton& CustomPlaylistSkeleton::operator=(const CustomPlaylistSkeleton &other) 67 { 68 *m = *(other.m); 69 70 return *this; 71 } 72 73 CustomPlaylistSkeleton::~CustomPlaylistSkeleton() {} 74 75 int CustomPlaylistSkeleton::id() const 76 { 77 return m->id; 78 } 79 80 void CustomPlaylistSkeleton::setId(int id) 81 { 82 m->id = id; 83 } 84 85 QString CustomPlaylistSkeleton::name() const 86 { 87 return m->name; 88 } 89 90 void CustomPlaylistSkeleton::setName(const QString& name) 91 { 92 m->name = name; 93 } 94 95 bool CustomPlaylistSkeleton::temporary() const 96 { 97 return m->is_temporary; 98 } 99 100 101 void CustomPlaylistSkeleton::setTemporary(bool temporary) 102 { 103 m->is_temporary = temporary; 104 } 105 106 int CustomPlaylistSkeleton::trackCount() const 107 { 108 return m->num_tracks; 109 } 110 111 void CustomPlaylistSkeleton::setTrackCount(int num_tracks) 112 { 113 m->num_tracks = num_tracks; 114 } 115 116 117