Parent: [ef14c6] (diff)

Child: [1d3ef3] (diff)

Download this file

randplayer.h    63 lines (51 with data), 2.0 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/* Copyright (C) 2014 J.F.Dockes
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef _RANDPLAY_H_INCLUDED_
#define _RANDPLAY_H_INCLUDED_
#include <vector>
#include <algorithm>
#include <QObject>
#include <QString>
#include <libupnpp/config.h>
#include <libupnpp/control/cdirectory.hxx>
#include "HelperStructs/Helper.h"
class RandPlayer : public QObject {
Q_OBJECT;
public:
enum PlayMode {PM_TRACKS, PM_GROUPS};
RandPlayer(PlayMode mode,
const std::vector<UPnPClient::UPnPDirObject>& entries,
QObject *parent = 0);
virtual ~RandPlayer();
public slots:
void playNextSlice();
signals:
void sig_randplay_done();
void sig_tracks_to_playlist(const MetaDataList&);
// While playing by groups: preview of next to play. May be
// connected to the playlist clear tooltip (as this is what will
// be played if the current playlist is cleared)
void sig_next_group_html(QString);
private:
PlayMode m_playmode;
std::vector<UPnPClient::UPnPDirObject> m_entries;
// Next group to play, for preview
std::vector<UPnPClient::UPnPDirObject> m_nextgroup;
void selectNextGroup();
QString groupHtml(std::vector<UPnPClient::UPnPDirObject>& ents);
};
#endif /* _RANDPLAY_H_INCLUDED_ */