1 Index: enigma2/lib/python/Components/UsageConfig.py
2 ===================================================================
3 --- enigma2/lib/python/Components/UsageConfig.py (revision 5639)
4 +++ enigma2/lib/python/Components/UsageConfig.py (working copy)
6 from Components.Harddisk import harddiskmanager
7 from config import ConfigSubsection, ConfigYesNo, config, ConfigSelection, ConfigText, ConfigNumber, ConfigSet
8 -from enigma import Misc_Options, setTunerTypePriorityOrder;
9 +from enigma import Misc_Options, setTunerTypePriorityOrder, setEnableTtCachingOnOff;
10 from SystemInfo import SystemInfo
14 config.usage.show_infobar_on_zap = ConfigYesNo(default = True)
15 config.usage.show_infobar_on_skip = ConfigYesNo(default = True)
16 config.usage.show_infobar_on_event_change = ConfigYesNo(default = True)
17 + config.usage.enable_tt_caching = ConfigYesNo(default = True)
18 config.usage.hdd_standby = ConfigSelection(default = "120", choices = [
19 ("0", _("no standby")), ("2", "10 " + _("seconds")), ("6", "30 " + _("seconds")),
20 ("12", "1 " + _("minute")), ("24", "2 " + _("minutes")),
23 config.usage.blinking_display_clock_during_recording = ConfigYesNo(default = False)
24 config.usage.load_length_of_movies_in_moviellist = ConfigYesNo(default = True)
27 + def EnableTtCachingChanged(configElement):
28 + setEnableTtCachingOnOff(int(configElement.value))
29 + config.usage.enable_tt_caching.addNotifier(EnableTtCachingChanged)
31 def TunerTypePriorityOrderChanged(configElement):
32 setTunerTypePriorityOrder(int(configElement.value))
33 config.usage.alternatives_priority.addNotifier(TunerTypePriorityOrderChanged)
34 Index: enigma2/lib/python/enigma_python.i
35 ===================================================================
36 --- enigma2/lib/python/enigma_python.i (revision 5639)
37 +++ enigma2/lib/python/enigma_python.i (working copy)
39 #include <lib/dvb/pmt.h>
40 #include <lib/components/scan.h>
41 #include <lib/components/file_eraser.h>
42 +#include <lib/components/tuxtxtapp.h>
43 #include <lib/driver/avswitch.h>
44 #include <lib/driver/rfmod.h>
45 #include <lib/driver/misc_options.h>
47 %immutable eAVSwitch::vcr_sb_notifier;
48 %immutable ePythonMessagePump::recv_msg;
49 %immutable eDVBLocalTimeHandler::m_timeUpdated;
50 +%immutable eTuxtxtApp::appClosed;
51 +%immutable eTuxtxtApp::dataAvail;
52 +%immutable eTuxtxtApp::dataSent;
53 %include <lib/base/message.h>
54 %include <lib/base/console.h>
55 %include <lib/base/nconfig.h>
57 %include <lib/dvb/pmt.h>
58 %include <lib/components/scan.h>
59 %include <lib/components/file_eraser.h>
60 +%include <lib/components/tuxtxtapp.h>
61 %include <lib/driver/avswitch.h>
62 %include <lib/driver/rfmod.h>
63 %include <lib/driver/misc_options.h>
68 +void setEnableTtCachingOnOff(int);
70 +void setEnableTtCachingOnOff(int onoff)
72 + eTuxtxtApp *tt = eTuxtxtApp::getInstance();
73 + if (tt) tt->setEnableTtCachingOnOff(onoff);
77 /************** temp *****************/
79 /* need a better place for this, i agree. */
80 Index: enigma2/lib/components/Makefile.am
81 ===================================================================
82 --- enigma2/lib/components/Makefile.am (revision 5639)
83 +++ enigma2/lib/components/Makefile.am (working copy)
86 noinst_LIBRARIES = libenigma_components.a
88 -libenigma_components_a_SOURCES = scan.cpp file_eraser.cpp
89 +libenigma_components_a_SOURCES = scan.cpp file_eraser.cpp tuxtxtapp.cpp
90 Index: enigma2/lib/dvb/decoder.cpp
91 ===================================================================
92 --- enigma2/lib/dvb/decoder.cpp (revision 5639)
93 +++ enigma2/lib/dvb/decoder.cpp (working copy)
95 #include <lib/base/ebase.h>
96 #include <lib/base/eerror.h>
97 #include <lib/dvb/decoder.h>
98 +#include <lib/components/tuxtxtapp.h>
99 #if HAVE_DVB_API_VERSION < 3
100 #define audioStatus audio_status
101 #define videoStatus video_status
102 @@ -880,14 +881,24 @@
103 if (m_changed & changeText)
108 + if ( m_decoder == 0 ) // Tuxtxt caching actions only on primary decoder
109 + eTuxtxtApp::getInstance()->stopCaching();
112 if ((m_textpid >= 0) && (m_textpid < 0x1FFF) && !nott)
114 m_text = new eDVBTText(m_demux);
115 if (m_text->startPid(m_textpid))
118 + if ( m_decoder == 0 ) // Tuxtxt caching actions only on primary decoder
119 + eTuxtxtApp::getInstance()->startCaching(m_textpid);
121 + else if ( m_decoder == 0 ) // Tuxtxt caching actions only on primary decoder
122 + eTuxtxtApp::getInstance()->resetPid();
124 m_changed &= ~changeText;
127 @@ -938,10 +949,16 @@
128 demux->connectEvent(slot(*this, &eTSMPEGDecoder::demux_event), m_demux_event_conn);
129 CONNECT(m_showSinglePicTimer.timeout, eTSMPEGDecoder::finishShowSinglePic);
130 m_is_ff = m_is_sm = m_is_trickmode = 0;
132 + if ( m_decoder == 0 ) // Tuxtxt caching actions only on primary decoder
133 + eTuxtxtApp::getInstance()->initCache();
136 eTSMPEGDecoder::~eTSMPEGDecoder()
138 + if ( m_decoder == 0 ) // Tuxtxt caching actions only on primary decoder
139 + eTuxtxtApp::getInstance()->freeCache();
141 finishShowSinglePic();
142 m_vpid = m_apid = m_pcrpid = m_textpid = pidNone;
144 Index: data/setup.xml
145 ===================================================================
146 RCS file: /cvs/enigma2/data/setup.xml,v
147 retrieving revision 1.48
148 diff -u -r1.48 setup.xml
149 --- enigma2/data/setup.xml 5 Oct 2008 22:37:19 -0000 1.48
150 +++ enigma2/data/setup.xml 21 Oct 2008 22:54:10 -0000
152 <item level="0" text="Margin after record">config.recording.margin_after</item>
153 <item level="0" text="Show blinking clock in display during recording">config.usage.blinking_display_clock_during_recording</item>
154 <item level="2" text="Load Length of Movies in Movielist">config.usage.load_length_of_movies_in_moviellist</item>
155 + <item level="1" text="Enable teletext caching">config.usage.enable_tt_caching</item>
156 <item level="1" text="Show positioner movement">config.usage.showdish</item>
157 <item level="1" text="Enable multiple bouquets">config.usage.multibouquet</item>
158 <item level="1" text="Change bouquets in quickzap">config.usage.quickzap_bouquet_change</item>
159 Index: enigma2/main/Makefile.am
160 ===================================================================
161 --- enigma2/main/Makefile.am (revision 5639)
162 +++ enigma2/main/Makefile.am (working copy)
167 - -ldl -lpthread -lcrypt -lresolv -lrt
168 + -ldl -lpthread -lcrypt -lresolv -lrt -ltuxtxt32bpp
170 enigma2$(EXEEXT): $(enigma2_OBJECTS) $(enigma2_DEPENDENCIES) $(enigma2_LDADD_WHOLE)
171 # @rm -f enigma2$(EXEEXT)
172 --- enigma2_orig/lib/components/tuxtxtapp.cpp 1970-01-01 00:00:00.000000000 +0000
173 +++ enigma2/lib/components/tuxtxtapp.cpp 2008-10-04 18:26:04.000000000 +0200
175 +#include <lib/components/tuxtxtapp.h>
176 +#include <lib/base/init.h>
177 +#include <lib/base/init_num.h>
178 +#include <lib/driver/rc.h>
179 +#include <lib/gdi/lcd.h>
180 +#include <lib/gdi/fb.h>
182 +extern "C" int tuxtxt_run_ui(int pid);
183 +extern "C" int tuxtxt_init();
184 +extern "C" void tuxtxt_start(int tpid);
185 +extern "C" int tuxtxt_stop();
186 +extern "C" void tuxtxt_close();
188 +eAutoInitP0<eTuxtxtApp> init_eTuxtxtApp(eAutoInitNumbers::lowlevel, "Tuxtxt");
189 +eTuxtxtApp *eTuxtxtApp::instance;
191 +eTuxtxtApp::eTuxtxtApp() : pid(0), enableTtCaching(false), uiRunning(false)
193 + pthread_mutex_init( &cacheChangeLock, 0 );
198 +eTuxtxtApp::~eTuxtxtApp()
200 + if (instance==this)
203 + pthread_mutex_destroy( &cacheChangeLock );
206 +int eTuxtxtApp::startUi()
210 + pthread_mutex_lock( &cacheChangeLock );
212 + pthread_mutex_unlock( &cacheChangeLock );
213 + eDBoxLCD::getInstance()->lock();
214 + eRCInput::getInstance()->lock();
215 + fbClass::getInstance()->lock();
221 +void eTuxtxtApp::thread()
224 + tuxtxt_run_ui(pid);
227 +void eTuxtxtApp::thread_finished()
230 + fbClass::getInstance()->unlock();
231 + eRCInput::getInstance()->unlock();
232 + eDBoxLCD::getInstance()->unlock();
235 +void eTuxtxtApp::initCache()
237 + if (enableTtCaching)
241 +void eTuxtxtApp::freeCache()
243 + pthread_mutex_lock( &cacheChangeLock );
249 + pthread_mutex_unlock( &cacheChangeLock );
252 +void eTuxtxtApp::startCaching( int tpid )
255 + if (enableTtCaching)
256 + tuxtxt_start(tpid);
259 +void eTuxtxtApp::stopCaching()
261 + pthread_mutex_lock( &cacheChangeLock );
265 + pthread_mutex_unlock( &cacheChangeLock );
268 +void eTuxtxtApp::setEnableTtCachingOnOff( int onoff )
270 + if (onoff && !enableTtCaching) // Switch caching on
272 + enableTtCaching = true;
279 + else if (!onoff && enableTtCaching) // Switch caching off
281 + enableTtCaching = false;
287 --- enigma2_orig/lib/components/tuxtxtapp.h 1970-01-01 00:00:00.000000000 +0000
288 +++ enigma2/lib/components/tuxtxtapp.h 2008-10-04 18:26:04.000000000 +0200
290 +#ifndef __LIB_COMPONENTS_TUXTXTAPP_H__
291 +#define __LIB_COMPONENTS_TUXTXTAPP_H__
294 +#include <lib/base/ebase.h>
295 +#include <lib/base/thread.h>
297 +class eTuxtxtApp: private eThread, public Object
301 + bool enableTtCaching, uiRunning;
302 + static eTuxtxtApp *instance;
303 + pthread_mutex_t cacheChangeLock;
306 + void thread_finished();
311 + static eTuxtxtApp *getInstance() { return instance; }
315 + void startCaching( int tpid );
316 + void stopCaching();
317 + void resetPid() { pid = 0; }
318 + void setEnableTtCachingOnOff( int onoff );
321 +#endif // __LIB_COMPONENTS_TUXTXTAPP_H__