]> git.vomp.tv Git - vompclient-marten.git/blob - tfeed.cc
Remove unnecessary dependencies
[vompclient-marten.git] / tfeed.cc
1 /*\r
2     Copyright 2008 Marten Richter\r
3     This file is part of VOMP.\r
4     VOMP is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.\r
8     VOMP is distributed in the hope that it will be useful,
9     but WITHOUT ANY WARRANTY; without even the implied warranty of
10     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11     GNU General Public License for more details.\r
12     You should have received a copy of the GNU General Public License
13     along with VOMP; if not, write to the Free Software
14     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
15 */\r
16 \r
17 #include "tfeed.h"\r
18 #include "log.h"\r#include "demuxer.h"\r#include "callback.h"\r
19 \r
20 TFeed::TFeed(Callback* tcb)\r: cb(*tcb)\r{\r  teletextEnabled = 1;\r}\r
21 \r
22 int TFeed::init()\r{\r  return 1;\r}\r
23 \r
24 int TFeed::shutdown()\r{\r
25   // FIXME\r  return 1;\r}\r
26 \r
27 void TFeed::disable()\r
28 {\r  teletextEnabled = 0;
29 }\r
30 \r
31 void TFeed::enable()
32 {\r      teletextEnabled = 1;\r
33 }\r
34 \r
35 int TFeed::start()
36 {
37   teletextEnabled = 1;
38   return threadStart();
39 }\r
40 \r
41 void TFeed::stop()
42 {
43   threadCancel();
44 }\r
45 \r
46 void TFeed::threadMethod()
47 {
48   bool tlen;\r
49   while(1)\r  {
50     threadCheckExit();
51     tlen = Demuxer::getInstance()->writeTeletext();\r
52     if (tlen)
53     {
54       cb.call(this);
55 //        Log::getInstance()->log("Tfeed", Log::DEBUG, "written");
56     }
57     else
58     {
59       //MILLISLEEP(100);
60         MILLISLEEP(20); //Performance Issue Marten
61     }
62   }
63 }
64 \r