~ubuntu-branches/ubuntu/feisty/kdetv/feisty

« back to all changes in this revision

Viewing changes to kdetv/libkdetv/vbimanager.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2005-09-17 23:25:16 UTC
  • Revision ID: james.westby@ubuntu.com-20050917232516-9wdsn3ckagbqieh8
Tags: upstream-0.8.8
ImportĀ upstreamĀ versionĀ 0.8.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- c++ -*-
 
2
/***************************************************************************
 
3
                           vbimanager.h
 
4
                           ------------
 
5
    begin                : Fri Oct 31 2003
 
6
    copyright            : (C) 2003 by Dirk Ziegelmeier
 
7
    email                : dziegel@gmx.de
 
8
 ***************************************************************************/
 
9
 
 
10
/*
 
11
 * This library is free software; you can redistribute it and/or
 
12
 * modify it under the terms of the GNU Library General Public
 
13
 * License as published by the Free Software Foundation; either
 
14
 * version 2 of the License, or (at your option) any later version.
 
15
 *
 
16
 * This library is distributed in the hope that it will be useful,
 
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
19
 * Library General Public License for more details.
 
20
 *
 
21
 * You should have received a copy of the GNU Library General Public License
 
22
 * along with this library; see the file COPYING.LIB.  If not, write to
 
23
 * the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
 
24
 * Boston, MA 02110-1301, USA.
 
25
 */
 
26
 
 
27
#ifndef VBIMANAGER_H
 
28
#define VBIMANAGER_H
 
29
 
 
30
#include <qobject.h>
 
31
 
 
32
class KdetvVbiPlugin;
 
33
class PluginFactory;
 
34
 
 
35
// ---------------------------------------------- Manager
 
36
 
 
37
/**
 
38
 * Provides access to the current VBI decoder
 
39
 */
 
40
class VbiManager : public QObject
 
41
{
 
42
    Q_OBJECT
 
43
 
 
44
public:
 
45
    /// Scans for VBI plugins
 
46
    void scanPlugins();
 
47
 
 
48
    /// Restart plugins
 
49
    void restartPlugin();
 
50
 
 
51
    /// Returns whether decoder is _running_ (!= receiving data)
 
52
    virtual bool decoding() const;
 
53
 
 
54
    /// Returns whether decoder receives data
 
55
    virtual bool tuned() const;
 
56
 
 
57
    /// Returns pointer to internal decoder data. Platform specific!!!
 
58
    void* internalData() const;
 
59
 
 
60
    /// Call this before you are going to use the decoder
 
61
    void addClient();
 
62
 
 
63
    /// Call if you stop using the decoder
 
64
    void removeClient();
 
65
 
 
66
    /// Suspends the sending of VBI data
 
67
    void suspend();
 
68
    
 
69
    /// Resumes the sending of VBI data
 
70
    void resume();
 
71
 
 
72
signals:
 
73
    /// New network identification received
 
74
    void networkId(const QString& name, int& id, const QString& call);
 
75
 
 
76
    /// Closed caption data received
 
77
    void caption(int pgno);
 
78
 
 
79
    /// Teletext page received
 
80
    void ttxPage(int pgno, int subno, int pno, bool roll, bool header, bool clock);
 
81
 
 
82
    /// Aspect ratio changed
 
83
    void aspect(int fline, int lline, double ratio, bool mode, int subtitles);
 
84
 
 
85
    /// Program title info received
 
86
    void progTitle(const QString& title);
 
87
 
 
88
    /// Program rating information changed
 
89
    void ratingChanged(const QString& rating);
 
90
 
 
91
    /// Decoder state changed. If true, reinit your client. If false, don't touch internal data pointer!
 
92
    void running(bool);
 
93
 
 
94
 
 
95
protected:
 
96
    friend class Kdetv;
 
97
    VbiManager(PluginFactory* pf);
 
98
    ~VbiManager();
 
99
 
 
100
private:
 
101
    void customEvent(QCustomEvent* e);
 
102
 
 
103
    PluginFactory*  _pf;
 
104
    KdetvVbiPlugin* _plugin;
 
105
    int             _clients;
 
106
    int             _suspendCount;
 
107
};
 
108
 
 
109
// ---------------------------------------------- Events the manager understands
 
110
 
 
111
enum { 
 
112
    EventIdStationName = QEvent::User,
 
113
    EventIdCaption,
 
114
    EventIdTtx,
 
115
    EventIdAspect,
 
116
    EventIdProgTitle,
 
117
    EventIdRating,
 
118
    EventIdRunning
 
119
};
 
120
 
 
121
class EventStationName : public QCustomEvent
 
122
{
 
123
public:
 
124
    EventStationName(const QString& name, int id, const QString& call);
 
125
    virtual ~EventStationName();
 
126
 
 
127
    QString  _name;
 
128
    int      _id;
 
129
    QString  _call;
 
130
};
 
131
 
 
132
class EventCaption : public QCustomEvent
 
133
{
 
134
public:
 
135
    EventCaption(int pgno);
 
136
    virtual ~EventCaption();
 
137
 
 
138
    int _pgno;
 
139
};
 
140
 
 
141
class EventTtx : public QCustomEvent
 
142
{
 
143
public:
 
144
    EventTtx(int pgno, int subno, int pno, 
 
145
             bool roll, bool header, bool clock);
 
146
    virtual ~EventTtx();
 
147
 
 
148
    int            _pgno;
 
149
    int            _subno;
 
150
    int            _pno;
 
151
    bool           _roll;
 
152
    bool           _header;
 
153
    bool           _clock;
 
154
};
 
155
 
 
156
class EventAspect : public QCustomEvent
 
157
{
 
158
public:
 
159
    EventAspect(int fline, int lline, double ratio, bool mode, int subtitles);
 
160
    virtual ~EventAspect();
 
161
 
 
162
    int    _fline;
 
163
    int    _lline;
 
164
    double _ratio;
 
165
    bool   _mode;
 
166
    int    _subtitles;
 
167
};
 
168
 
 
169
class EventProgTitle : public QCustomEvent
 
170
{
 
171
public:
 
172
    EventProgTitle(const QString& title);
 
173
    virtual ~EventProgTitle();
 
174
 
 
175
    QString  _title;
 
176
};
 
177
 
 
178
class EventRating : public QCustomEvent
 
179
{
 
180
public:
 
181
    EventRating(const QString& rating);
 
182
    virtual ~EventRating();
 
183
 
 
184
    QString _rating;
 
185
};
 
186
 
 
187
class EventRunning : public QCustomEvent
 
188
{
 
189
public:
 
190
    EventRunning(bool running);
 
191
    virtual ~EventRunning();
 
192
 
 
193
    bool _running;
 
194
};
 
195
 
 
196
#endif