4
* Copyright (C) 2003-2007 Christophe Thommeret <hftom@free.fr>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
21
#ifndef KAFFEINEDVBEVENTS_H
22
#define KAFFEINEDVBEVENTS_H
29
#include <kparts/part.h>
31
#include "kaffeinedvbsection.h"
63
unsigned char running;
64
QDateTime startDateTime;
66
QPtrList<ShortEvent> shortEvents;
67
QPtrList<QString> extEvents;
80
int getSid() { return sid; }
81
void lock() { mutex.lock(); }
82
void unlock() { mutex.unlock(); }
83
QPtrList<EventDesc> *getEvents() { return &events; }
84
EventDesc *getEventDesc( int n );
85
int getNDesc() { return events.count(); }
86
void remove( EventDesc *d );
90
QPtrList<EventDesc> events;
98
EventTsid( int n, int t );
100
int getTsid() { return tsid; }
101
int getNid() { return nid; }
102
EventSid *getEventSid( int sid );
103
EventSid *getNEventSid( int n );
104
int getNSid() { return sidList.count(); }
105
EventDesc *getEventDesc( int sid, int n );
109
QPtrList<EventSid> sidList;
117
EventSource( QString src );
119
EventSid *getEventSid( int nid, int tsid, int sid );
120
EventTsid *getNEventTsid( int n );
121
int getNTsid() { return tsidList.count(); }
122
EventDesc *getEventDesc( int nid, int tsid, int sid, int n );
123
QString getSource() { return source; }
127
QPtrList<EventTsid> tsidList;
132
class EventTable : public QObject, public QThread
138
EventSource *getEventSource( QString src );
139
EventDesc *getEventDesc( QString src, int nid, int tsid, int sid, int n );
140
EventSource *getNEventSource( int n );
141
int getNSource() { return srcList.count(); }
142
void doClean( bool b );
148
bool validString( QFile &f, EventDesc *d, int len, int buflen, int nev );
150
QPtrList<EventSource> srcList;
159
class KDE_EXPORT KaffeineEpgPlugin : public KParts::Part, public KaffeineDVBsection
163
KaffeineEpgPlugin( QObject* parent, const char* name );
164
virtual ~KaffeineEpgPlugin();
165
virtual bool go( QString /*src*/, int /*freqKhz*/ ) { return false; }
166
virtual void stop() {}
167
void setTable( EventTable *table ) { events = table; }
170
bool safeLen( unsigned char* buf );
172
unsigned char secbuf[4096];
177
#endif /* KAFFEINEDVBEVENTS_H */