Debian Codegraph @

src/playlist/navigators/FavoredRandomTrackNavigator.h

raw
1 /****************************************************************************************
2 * Copyright (c) 2009 Edward Toroshchin <[email protected]> *
3 * Copyright (c) 2010 Nanno Langstraat <[email protected]> *
4 * *
5 * This program is free software; you can redistribute it and/or modify it under *
6 * the terms of the GNU General Public License as published by the Free Software *
7 * Foundation; either version 2 of the License, or (at your option) version 3 or *
8 * any later version accepted by the membership of KDE e.V. (or its successor approved *
9 * by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of *
10 * version 3 of the license. *
11 * *
12 * This program is distributed in the hope that it will be useful, but WITHOUT ANY *
13 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A *
14 * PARTICULAR PURPOSE. See the GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License along with *
17 * this program. If not, see <http://www.gnu.org/licenses/>. *
18 ****************************************************************************************/
19
20 #ifndef FAVOREDRANDOMTRACKNAVIGATOR_H
21 #define FAVOREDRANDOMTRACKNAVIGATOR_H
22
23 #include "NonlinearTrackNavigator.h"
24
25 namespace Playlist
26 {
27
28 class FavoredRandomTrackNavigator : public NonlinearTrackNavigator
29 {
30 public:
31 FavoredRandomTrackNavigator();
32
33 static const int AVOID_RECENTLY_PLAYED_MAX = 512; //!< Try to avoid the 'N' most recently played items.
34
35 private:
36 //! Override from 'NonlinearTrackNavigator'
37 void planOne() override;
38 void notifyItemsInserted( const QSet<quint64> &insertedItems ) override { Q_UNUSED( insertedItems ); }
39 void notifyItemsRemoved( const QSet<quint64> &removedItems ) override { Q_UNUSED( removedItems ); }
40
41 QList<qreal> rowWeights( const QSet<quint64> &avoidSet );
42 QSet<quint64> getRecentHistory( int size );
43 };
44
45 }
46
47 #endif