~ubuntu-branches/ubuntu/hoary/kdemultimedia/hoary

« back to all changes in this revision

Viewing changes to noatun/noatun/modules/tron/mcp.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Schulze
  • Date: 2003-01-22 15:00:51 UTC
  • Revision ID: james.westby@ubuntu.com-20030122150051-uihwkdoxf15mi1tn
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// mcp.h
 
2
//
 
3
// Copyright (C) 2000, 2001 Neil Stevens <multivac@fcmail.com>
 
4
//
 
5
// Permission is hereby granted, free of charge, to any person obtaining a copy
 
6
// of this software and associated documentation files (the "Software"), to deal
 
7
// in the Software without restriction, including without limitation the rights
 
8
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 
9
// copies of the Software, and to permit persons to whom the Software is
 
10
// furnished to do so, subject to the following conditions:
 
11
// 
 
12
// The above copyright notice and this permission notice shall be included in
 
13
// all copies or substantial portions of the Software.
 
14
// 
 
15
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
16
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
17
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
 
18
// THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
 
19
// AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 
20
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
21
// 
 
22
// Except as contained in this notice, the name(s) of the author(s) shall not be
 
23
// used in advertising or otherwise to promote the sale, use or other dealings
 
24
// in this Software without prior written authorization from the author(s).
 
25
 
 
26
#ifndef MCP_H
 
27
#define MCP_H
 
28
 
 
29
#include <kio/global.h>
 
30
#include <qarray.h>
 
31
#include <qdom.h>
 
32
 
 
33
#include "noatunplaylist.h"
 
34
 
 
35
namespace KIO
 
36
{
 
37
class Job;
 
38
}
 
39
 
 
40
class MCPItem;
 
41
 
 
42
class MCP : public Playlist
 
43
{
 
44
Q_OBJECT
 
45
 
 
46
public:
 
47
        MCP(QObject *parent, const char *name = 0);
 
48
        virtual ~MCP();
 
49
 
 
50
        virtual void reset(void);
 
51
        virtual void clear(void);
 
52
 
 
53
        void play(PlaylistItem *);
 
54
        virtual PlaylistItem *next(void);
 
55
        virtual PlaylistItem *current(void);
 
56
        virtual PlaylistItem *previous(void);
 
57
 
 
58
        virtual PlaylistItem *getFirst(void) const;
 
59
        virtual PlaylistItem *getAfter(const PlaylistItem *) const;
 
60
        PlaylistItem *getBefore(const PlaylistItem *) const;
 
61
 
 
62
        void moveAfter(PlaylistItem *item, PlaylistItem *afterThisOne);
 
63
 
 
64
        virtual void addFile(const KURL &, bool = false);
 
65
        PlaylistItem *addFile(const KURL &, PlaylistItem *);
 
66
        PlaylistItem *addDirectory(const KURL & , PlaylistItem * = 0);
 
67
        PlaylistItem *importWindowsPlaylist(const KURL &, PlaylistItem * = 0);
 
68
        PlaylistItem *importPlaylist(const KURL &, PlaylistItem * = 0);
 
69
 
 
70
        virtual bool listVisible(void) const;
 
71
 
 
72
        void setShuffle(bool);
 
73
        void setApplyVolume(bool);
 
74
 
 
75
        /**
 
76
         * Internal
 
77
         *
 
78
         * To be used by MCPItem only
 
79
         */
 
80
        void itemModified(PlaylistItem *);
 
81
 
 
82
public slots:
 
83
        virtual void showList(void);
 
84
        virtual void hideList(void);
 
85
        virtual void toggleList(void);
 
86
        virtual void remove(PlaylistItem *);
 
87
 
 
88
        void load(const KURL &, bool errorFree = false);
 
89
        void save(const KURL &);
 
90
 
 
91
signals:
 
92
        void cleared(void);
 
93
        void loaded(void);
 
94
        void saved(void);
 
95
        void modified(PlaylistItem *);
 
96
        void removed(PlaylistItem *);
 
97
        void moved(PlaylistItem *item, PlaylistItem *afterThis);
 
98
 
 
99
        /**
 
100
         * This is emitted when the current playlist item is set or changed
 
101
         */
 
102
        void current(PlaylistItem *);
 
103
 
 
104
private slots:
 
105
        void setVolume(PlaylistItem *);
 
106
        void getVolume(int);
 
107
 
 
108
        void listFinished(KIO::Job *);
 
109
        void listEntries(KIO::Job *, const KIO::UDSEntryList &);
 
110
private:
 
111
        PlaylistItem *listLastAdded;
 
112
        bool listDone;
 
113
 
 
114
        static const MCPItem *AtBottom;
 
115
 
 
116
        void clearInternal(void);
 
117
        MCPItem *addFileG(const KURL &_url, bool _play = false, MCPItem *_afterThis = const_cast<MCPItem *>(AtBottom));
 
118
 
 
119
        QDomDocument doc;
 
120
        QDomElement cur;
 
121
 
 
122
        bool shuffle;
 
123
        QList<MCPItem> shuffleUnused;
 
124
 
 
125
        bool applyVolume;
 
126
};
 
127
 
 
128
#endif