Debian Codegraph @

src/playlist/navigators/RepeatTrackNavigator.h

raw
1 /****************************************************************************************
2 * Copyright (c) 2007 Dan Meltzer <[email protected]> *
3 * Copyright (c) 2008 Soren Harward <[email protected]> *
4 * Copyright (c) 2010 Nanno Langstraat <[email protected]> *
5 * *
6 * This program is free software; you can redistribute it and/or modify it under *
7 * the terms of the GNU General Public License as published by the Free Software *
8 * Foundation; either version 2 of the License, or (at your option) any later *
9 * version. *
10 * *
11 * This program is distributed in the hope that it will be useful, but WITHOUT ANY *
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A *
13 * PARTICULAR PURPOSE. See the GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License along with *
16 * this program. If not, see <http://www.gnu.org/licenses/>. *
17 ****************************************************************************************/
18
19 #ifndef REPEATTRACKNAVIGATOR_H
20 #define REPEATTRACKNAVIGATOR_H
21
22 #include "StandardTrackNavigator.h"
23
24 namespace Playlist
25 {
26 /**
27 * Repeats the selected track over and over, unless the user intervenes
28 */
29 class RepeatTrackNavigator : public StandardTrackNavigator
30 {
31 Q_OBJECT
32
33 public:
34 RepeatTrackNavigator();
35
36 quint64 likelyNextTrack() override { return m_trackid ? m_trackid : bestFallbackItem(); }
37 // likelyLastTrack(): The user explicitly asks for change. Let parent 'StandardTrackNavigator' handle that.
38 quint64 requestNextTrack() override { return likelyNextTrack(); }
39 quint64 requestUserNextTrack() override { return StandardTrackNavigator::requestNextTrack(); } // The user explicitly asks for change. Use the 'next' behaviour of parent 'StandardTrackNavigator'.
40 // requestLastTrack(): The user explicitly asks for change. Let parent 'StandardTrackNavigator' handle that.
41
42 private Q_SLOTS:
43 void recvActiveTrackChanged( const quint64 id ) { m_trackid = id; }
44
45 private:
46 quint64 m_trackid;
47 };
48
49 }
50
51 #endif