]> git.vomp.tv Git - vompclient.git/blob - tfeed.cc
Compile fix for MVP re: location change of hmsf
[vompclient.git] / tfeed.cc
1 /*
2
3     Copyright 2008 Marten Richter
4     
5     This file is part of VOMP.
6     
7     VOMP is free software; you can redistribute it and/or modify
8     it under the terms of the GNU General Public License as published by
9     the Free Software Foundation; either version 2 of the License, or
10     (at your option) any later version.
11     VOMP 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.
15     
16     You should have received a copy of the GNU General Public License
17     along with VOMP; if not, write to the Free Software
18     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19     */
20
21
22 #include "tfeed.h"
23 #include "log.h"
24 #include "demuxer.h"
25 #include "callback.h"
26
27
28 TFeed::TFeed(Callback* tcb): cb(*tcb)
29 {
30   teletextEnabled = 1;
31 }
32   
33
34 int TFeed::init()
35 {
36    return 1;
37 }
38
39 int TFeed::shutdown()
40 {
41   // FIXME  
42   return 1;
43 }
44
45 void TFeed::disable()
46 {
47    teletextEnabled = 0;
48 }
49
50 void TFeed::enable()
51 {
52         teletextEnabled = 1;
53 }
54
55 int TFeed::start()
56 {
57   teletextEnabled = 1;
58   return threadStart();
59 }
60
61 void TFeed::stop()
62 {
63   threadCancel();
64 }
65
66 void TFeed::threadMethod()
67 {
68   bool tlen;
69   
70   while(1){
71     threadCheckExit();
72     tlen = Demuxer::getInstance()->writeTeletext();
73     
74     if (tlen)
75     {
76       cb.call(this);
77 //        Log::getInstance()->log("Tfeed", Log::DEBUG, "written");
78     }
79     else
80     {
81       //MILLISLEEP(100);
82         MILLISLEEP(20); //Performance Issue Marten
83     }
84   }
85 }
86