| 1 | /* |
| 2 | Copyright (C) 2005-2014 Mario Stephan <[email protected]> |
| 3 | |
| 4 | This library is free software; you can redistribute it and/or modify |
| 5 | it under the terms of the GNU Lesser General Public License as published |
| 6 | by the Free Software Foundation; either version 2.1 of the License, or |
| 7 | (at your option) any later version. |
| 8 | |
| 9 | This program is distributed in the hope that it will be useful, |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | GNU General Public License for more details. |
| 13 | |
| 14 | You should have received a copy of the GNU Lesser General Public License |
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | */ |
| 17 | |
| 18 | #ifndef DJSESSION_H |
| 19 | #define DJSESSION_H |
| 20 | |
| 21 | |
| 22 | #include "dj.h" |
| 23 | #include "collectiondb.h" |
| 24 | |
| 25 | #include <QObject> |
| 26 | |
| 27 | class Track; |
| 28 | |
| 29 | class DjSession : public QObject |
| 30 | { |
| 31 | Q_OBJECT |
| 32 | |
| 33 | public: |
| 34 | DjSession(); |
| 35 | ~DjSession(); |
| 36 | Dj mainDJ; |
| 37 | int minCount(); |
| 38 | void setMinCount(int value); |
| 39 | void setIsEnabledAutoDJCount(bool value); |
| 40 | bool isEnabledAutoDJCount(); |
| 41 | Track* getRandomTrack(); |
| 42 | Dj* currentDj(); |
| 43 | |
| 44 | Q_SIGNALS: |
| 45 | void foundTracks_Playlist1(QList<Track*>); |
| 46 | void foundTracks_Playlist2(QList<Track*>); |
| 47 | void changed_Playlist1(QPair<int,int>); |
| 48 | void changed_Playlist2(QPair<int,int>); |
| 49 | void savedPlaylists(); |
| 50 | |
| 51 | public slots: |
| 52 | void updatePlaylists(); |
| 53 | void playDefaultList(); |
| 54 | void onTracksChanged_Playlist1(QList<Track*> tracks); |
| 55 | void onTracksChanged_Playlist2(QList<Track*> tracks); |
| 56 | void onTrackFinished(Track *track); |
| 57 | void forceTracks(QList<Track*> tracks); |
| 58 | void on_dj_filterChanged(Filter* f); |
| 59 | void onResetStats(); |
| 60 | void onTrackPropertyChanged(Track* track); |
| 61 | void savePlaylists( const QString &filename ); |
| 62 | void storePlaylists(const QString &name , bool replace=false); |
| 63 | void setCurrentDj(Dj*); |
| 64 | |
| 65 | private: |
| 66 | struct DjSessionPrivate *p; |
| 67 | void searchTracks(); |
| 68 | void summariseCount(); |
| 69 | |
| 70 | |
| 71 | |
| 72 | }; |
| 73 | |
| 74 | #endif // DJSESSION_H |