aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2009-03-05 00:12:07 +0100
committerFelix Domke <tmbinc@elitedvb.net>2009-03-05 00:12:07 +0100
commit2f95f50608f64e18a0513ac2e1b713a603db0498 (patch)
tree8abf2ab9d5ab247462a3743c4ef7626bc7013d5b /lib
parent7d31919c4447cbe8220b511d15659e164a4bc55b (diff)
parent8632fc87741200695d2726b689853b6b550a4b06 (diff)
downloadenigma2-2f95f50608f64e18a0513ac2e1b713a603db0498.tar.gz
enigma2-2f95f50608f64e18a0513ac2e1b713a603db0498.zip
Merge branch 'master' of git.opendreambox.org:/git/enigma2
Diffstat (limited to 'lib')
-rw-r--r--lib/dvb/db.cpp5
-rw-r--r--lib/dvb/dvbtime.cpp35
-rw-r--r--lib/dvb/dvbtime.h3
-rw-r--r--lib/dvb_ci/dvbci.cpp15
-rw-r--r--lib/python/Components/TuneTest.py4
-rw-r--r--lib/python/Plugins/Extensions/DVDBurn/ProjectSettings.py67
-rw-r--r--lib/python/Plugins/Extensions/DVDBurn/TitleList.py15
-rw-r--r--lib/python/Plugins/SystemPlugins/DiseqcTester/plugin.py8
-rw-r--r--lib/python/Screens/InfoBarGenerics.py4
-rw-r--r--lib/service/servicemp3.cpp4
10 files changed, 114 insertions, 46 deletions
diff --git a/lib/dvb/db.cpp b/lib/dvb/db.cpp
index 110cedd8..e4d9ad22 100644
--- a/lib/dvb/db.cpp
+++ b/lib/dvb/db.cpp
@@ -839,7 +839,7 @@ PyObject *eDVBDB::readSatellites(ePyObject sat_list, ePyObject sat_dict, ePyObje
PyDict_SetItem(tp_dict, sat_pos, tplist);
for (ElementConstIterator it(sat_elements.begin()); it != sat_elements.end(); ++it)
{
-// eDebug("\telement: %s", (*it)->name().c_str());
+ //eDebug("\telement: %s", (*it)->name().c_str());
const AttributeList &tp_attributes = (*it)->getAttributeList();
AttributeConstIterator end = tp_attributes.end();
modulation = eDVBFrontendParametersSatellite::Modulation_QPSK;
@@ -856,8 +856,8 @@ PyObject *eDVBDB::readSatellites(ePyObject sat_list, ePyObject sat_dict, ePyObje
for (AttributeConstIterator it(tp_attributes.begin()); it != end; ++it)
{
- //eDebug("\t\tattr: %s", at->name().c_str());
at = *it;
+ //eDebug("\t\tattr: %s", at->name().c_str());
name = at->name();
if (name == "modulation") dest = &modulation;
else if (name == "system") dest = &system;
@@ -872,6 +872,7 @@ PyObject *eDVBDB::readSatellites(ePyObject sat_list, ePyObject sat_dict, ePyObje
else if (name == "onid") dest = &onid;
if (dest)
{
+ //eDebug("\t\t\tvalue: %s", at->value().c_str());
tmp = strtol(at->value().c_str(), &end_ptr, 10);
if (!*end_ptr)
*dest = tmp;
diff --git a/lib/dvb/dvbtime.cpp b/lib/dvb/dvbtime.cpp
index 89650f25..03847ecb 100644
--- a/lib/dvb/dvbtime.cpp
+++ b/lib/dvb/dvbtime.cpp
@@ -145,7 +145,7 @@ eDVBLocalTimeHandler *eDVBLocalTimeHandler::instance;
DEFINE_REF(eDVBLocalTimeHandler);
eDVBLocalTimeHandler::eDVBLocalTimeHandler()
- :m_updateNonTunedTimer(eTimer::create(eApp)), m_time_ready(false)
+ :m_use_dvb_time(false), m_updateNonTunedTimer(eTimer::create(eApp)), m_time_ready(false)
{
if ( !instance )
instance=this;
@@ -214,6 +214,33 @@ void eDVBLocalTimeHandler::writeTimeOffsetData( const char* filename )
}
}
+void eDVBLocalTimeHandler::setUseDVBTime(bool b)
+{
+ if (m_use_dvb_time != b) {
+ if (m_use_dvb_time) {
+ eDebug("[eDVBLocalTimeHandler] disable sync local time with transponder time!");
+ std::map<iDVBChannel*, channel_data>::iterator it =
+ m_knownChannels.begin();
+ for (; it != m_knownChannels.end(); ++it) {
+ if (it->second.m_prevChannelState == iDVBChannel::state_ok)
+ it->second.tdt = 0;
+ }
+ }
+ else {
+ eDebug("[eDVBLocalTimeHandler] enable sync local time with transponder time!");
+ std::map<iDVBChannel*, channel_data>::iterator it =
+ m_knownChannels.begin();
+ for (; it != m_knownChannels.end(); ++it) {
+ if (it->second.m_prevChannelState == iDVBChannel::state_ok) {
+ it->second.tdt = new TDT(it->second.channel);
+ it->second.tdt->start();
+ }
+ }
+ }
+ m_use_dvb_time = b;
+ }
+}
+
void eDVBLocalTimeHandler::updateNonTuned()
{
updateTime(-1, 0, 0);
@@ -440,8 +467,10 @@ void eDVBLocalTimeHandler::DVBChannelStateChanged(iDVBChannel *chan)
case iDVBChannel::state_ok:
eDebug("[eDVBLocalTimerHandler] channel %p running", chan);
m_updateNonTunedTimer->stop();
- it->second.tdt = new TDT(it->second.channel);
- it->second.tdt->start();
+ if (m_use_dvb_time) {
+ it->second.tdt = new TDT(it->second.channel);
+ it->second.tdt->start();
+ }
break;
case iDVBChannel::state_release:
eDebug("[eDVBLocalTimerHandler] remove channel %p", chan);
diff --git a/lib/dvb/dvbtime.h b/lib/dvb/dvbtime.h
index 3f8d9b7d..3afff75e 100644
--- a/lib/dvb/dvbtime.h
+++ b/lib/dvb/dvbtime.h
@@ -54,6 +54,7 @@ class eDVBLocalTimeHandler: public Object
ePtr<eConnection> m_stateChangedConn;
int m_prevChannelState;
};
+ bool m_use_dvb_time;
ePtr<eTimer> m_updateNonTunedTimer;
friend class TDT;
std::map<iDVBChannel*, channel_data> m_knownChannels;
@@ -78,6 +79,8 @@ public:
eDVBLocalTimeHandler();
~eDVBLocalTimeHandler();
#endif
+ bool getUseDVBTime() { return m_use_dvb_time; }
+ void setUseDVBTime(bool b);
PSignal0<void> m_timeUpdated;
bool ready() const { return m_time_ready; }
static eDVBLocalTimeHandler *getInstance() { return instance; }
diff --git a/lib/dvb_ci/dvbci.cpp b/lib/dvb_ci/dvbci.cpp
index c34ea0c0..a68edea8 100644
--- a/lib/dvb_ci/dvbci.cpp
+++ b/lib/dvb_ci/dvbci.cpp
@@ -332,6 +332,20 @@ void eDVBCIInterfaces::recheckPMTHandlers()
eDebug("'%s' is in service list of slot %d... so use it", ref.toString().c_str(), ci_it->getSlotID());
useThis = true;
}
+ else // check parent
+ {
+ eServiceReferenceDVB parent_ref = ref.getParentServiceReference();
+ if (parent_ref)
+ {
+ it = ci_it->possible_services.find(ref);
+ if (it != ci_it->possible_services.end())
+ {
+ eDebug("parent '%s' of '%s' is in service list of slot %d... so use it",
+ parent_ref.toString().c_str(), ref.toString().c_str(), ci_it->getSlotID());
+ useThis = true;
+ }
+ }
+ }
}
if (!useThis && !ci_it->possible_providers.empty())
{
@@ -354,6 +368,7 @@ void eDVBCIInterfaces::recheckPMTHandlers()
}
if (!useThis && !ci_it->possible_caids.empty())
{
+ mask |= 4;
for (CAID_LIST::iterator ca(caids.begin()); ca != caids.end(); ++ca)
{
caidSet::iterator it = ci_it->possible_caids.find(*ca);
diff --git a/lib/python/Components/TuneTest.py b/lib/python/Components/TuneTest.py
index 8e8644e3..e3b7d9e3 100644
--- a/lib/python/Components/TuneTest.py
+++ b/lib/python/Components/TuneTest.py
@@ -140,7 +140,7 @@ class TuneTest:
# check for tsid != -1 and onid != -1
print "index:", index
print "len(self.transponderlist):", len(self.transponderlist)
- while (index < len(self.transponderlist) and (self.transponderlist[index][8] == -1 or self.transponderlist[index][9] == -1)):
+ while (index < len(self.transponderlist) and (self.transponderlist[index][10] == -1 or self.transponderlist[index][11] == -1)):
index += 1
print "FirstTransponder final index:", index
return index
@@ -153,7 +153,7 @@ class TuneTest:
# check for tsid != -1 and onid != -1
print "index:", index
print "len(self.transponderlist):", len(self.transponderlist)
- while (index < len(self.transponderlist) and (self.transponderlist[index][8] == -1 or self.transponderlist[index][9] == -1)):
+ while (index < len(self.transponderlist) and (self.transponderlist[index][10] == -1 or self.transponderlist[index][11] == -1)):
index += 1
print "next transponder index:", index
diff --git a/lib/python/Plugins/Extensions/DVDBurn/ProjectSettings.py b/lib/python/Plugins/Extensions/DVDBurn/ProjectSettings.py
index e97961b4..a8888da3 100644
--- a/lib/python/Plugins/Extensions/DVDBurn/ProjectSettings.py
+++ b/lib/python/Plugins/Extensions/DVDBurn/ProjectSettings.py
@@ -18,11 +18,12 @@ class FileBrowser(Screen, HelpableScreen):
<screen name="FileBrowser" position="100,100" size="520,376" title="DVD File Browser" >
<widget name="filelist" position="0,0" size="520,376" scrollbarMode="showOnDemand" />
</screen>"""
- def __init__(self, session, scope, settings):
+ def __init__(self, session, scope, configRef):
Screen.__init__(self, session)
HelpableScreen.__init__(self)
self.scope = scope
pattern = ""
+ self.configRef = configRef
currDir = "/"
if self.scope == "project":
currDir = self.getDir()
@@ -31,19 +32,19 @@ class FileBrowser(Screen, HelpableScreen):
currDir = self.getDir()
pattern = "(?i)^.*\.(ddvdm\.xml)"
if self.scope == "menubg":
- currDir = self.getDir(settings.menubg)
+ currDir = self.getDir(configRef.getValue())
pattern = "(?i)^.*\.(jpeg|jpg|jpe|png|bmp)"
elif self.scope == "menuaudio":
- currDir = self.getDir(settings.menuaudio)
+ currDir = self.getDir(configRef.getValue())
pattern = "(?i)^.*\.(mp2|m2a|ac3)"
elif self.scope == "vmgm":
- currDir = self.getDir(settings.vmgm)
+ currDir = self.getDir(configRef.getValue())
pattern = "(?i)^.*\.(mpg|mpeg)"
elif self.scope == "font_face":
- currDir = self.getDir(settings.font_face, resolveFilename(SCOPE_FONTS))
+ currDir = self.getDir(configRef.getValue(), resolveFilename(SCOPE_FONTS))
pattern = "(?i)^.*\.(ttf)"
elif self.scope == "isopath":
- currDir = settings.isopath.getValue()
+ currDir = configRef.getValue()
elif self.scope == "image":
currDir = resolveFilename(SCOPE_HDD)
pattern = "(?i)^.*\.(iso)"
@@ -57,11 +58,9 @@ class FileBrowser(Screen, HelpableScreen):
"cancel": self.exit
})
- def getDir(self, key=None, defaultDir=None):
- if key:
- settingDir = key.getValue()
- if len(settingDir) > 1:
- return (settingDir.rstrip("/").rsplit("/",1))[0]
+ def getDir(self, currentVal=None, defaultDir=None):
+ if currentVal:
+ return (currentVal.rstrip("/").rsplit("/",1))[0]
return defaultDir or (resolveFilename(SCOPE_PLUGINS)+"Extensions/DVDBurn/")
def ok(self):
@@ -70,15 +69,15 @@ class FileBrowser(Screen, HelpableScreen):
if self.scope == "image":
path = self["filelist"].getCurrentDirectory() or ""
if fileExists(path+"VIDEO_TS"):
- self.close(path,self.scope)
+ self.close(path,self.scope,self.configRef)
else:
ret = self["filelist"].getCurrentDirectory() + '/' + self["filelist"].getFilename()
- self.close(ret,self.scope)
+ self.close(ret,self.scope,self.configRef)
def exit(self):
if self.scope == "isopath":
- self.close(self["filelist"].getCurrentDirectory(),self.scope)
- self.close(None,False)
+ self.close(self["filelist"].getCurrentDirectory(),self.scope,self.configRef)
+ self.close(None,False,None)
class ProjectSettings(Screen,ConfigListScreen):
skin = """
@@ -113,13 +112,10 @@ class ProjectSettings(Screen,ConfigListScreen):
infotext = ""
self["info"] = StaticText(infotext)
+ self.keydict = {}
self.settings = project.settings
ConfigListScreen.__init__(self, [])
self.initConfigList()
-
- self.keydict = {}
- for key, val in self.settings.dict().iteritems():
- self.keydict[val] = key
self["setupActions"] = ActionMap(["SetupActions", "ColorActions"],
{
@@ -167,6 +163,11 @@ class ProjectSettings(Screen,ConfigListScreen):
self.list.append(getConfigListEntry(("DVD data format"), self.settings.dataformat))
self["config"].setList(self.list)
+ self.keydict = {}
+ for key, val in self.settings.dict().iteritems():
+ self.keydict[val] = key
+ for key, val in self.project.menutemplate.settings.dict().iteritems():
+ self.keydict[val] = key
def keyLeft(self):
ConfigListScreen.keyLeft(self)
@@ -190,8 +191,9 @@ class ProjectSettings(Screen,ConfigListScreen):
def ok(self):
key = self.keydict[self["config"].getCurrent()[1]]
- if key in self.project.filekeys:
- self.session.openWithCallback(self.FileBrowserClosed, FileBrowser, key, self.settings)
+ from DVDProject import ConfigFilename
+ if type(self["config"].getCurrent()[1]) == ConfigFilename:
+ self.session.openWithCallback(self.FileBrowserClosed, FileBrowser, key, self["config"].getCurrent()[1])
def cancel(self):
self.close(False)
@@ -210,17 +212,20 @@ class ProjectSettings(Screen,ConfigListScreen):
text = _("Save")+' '+_('Error')
self.session.open(MessageBox,text,type = MessageBox.TYPE_ERROR)
- def FileBrowserClosed(self, path, scope):
+ def FileBrowserClosed(self, path, scope, configRef):
if scope == "menutemplate":
- if not self.project.menutemplate.loadTemplate(path):
- self.session.open(MessageBox,self.project.error,MessageBox.TYPE_ERROR)
- else:
+ if self.project.menutemplate.loadTemplate(path):
print "[ProjectSettings] menu template loaded"
-
- if scope in self.project.filekeys:
- self.settings.dict()[scope].setValue(path)
- elif scope == "project":
- if not self.project.loadProject(path):
- self.session.open(MessageBox,self.project.error,MessageBox.TYPE_ERROR)
+ configRef.setValue(path)
+ self.initConfigList()
else:
+ self.session.open(MessageBox,self.project.error,MessageBox.TYPE_ERROR)
+ elif scope == "project":
+ if self.project.loadProject(path):
+ configRef.setValue(path)
self.initConfigList()
+ else:
+ self.session.open(MessageBox,self.project.error,MessageBox.TYPE_ERROR)
+ elif scope:
+ configRef.setValue(path)
+ self.initConfigList()
diff --git a/lib/python/Plugins/Extensions/DVDBurn/TitleList.py b/lib/python/Plugins/Extensions/DVDBurn/TitleList.py
index 7e736f9f..fd4c7134 100644
--- a/lib/python/Plugins/Extensions/DVDBurn/TitleList.py
+++ b/lib/python/Plugins/Extensions/DVDBurn/TitleList.py
@@ -44,7 +44,7 @@ class TitleList(Screen, HelpableScreen):
"titleProperties": (self.titleProperties, _("Properties of current title"), _("Title properties")),
"removeCurrentTitle": (self.removeCurrentTitle, _("Remove currently selected title"), _("Remove title")),
"settings": (self.settings, _("Collection settings"), _("Settings")),
- "burnProject": (self.burnProject, _("Burn DVD"), _("Burn DVD")),
+ "burnProject": (self.askBurnProject, _("Burn DVD"), _("Burn DVD")),
})
self["MovieSelectionActions"] = HelpableActionMap(self, "MovieSelectionActions",
@@ -94,7 +94,8 @@ class TitleList(Screen, HelpableScreen):
menu.append((_("DVD media toolbox"), self.toolbox))
menu.append((_("Preview menu"), self.previewMenu))
if self.project.settings.output.getValue() == "dvd":
- menu.append((_("Burn DVD"), self.burnProject))
+ if len(self["titles"].list):
+ menu.append((_("Burn DVD"), self.burnProject))
elif self.project.settings.output.getValue() == "iso":
menu.append((_("Create DVD-ISO"), self.burnProject))
menu.append((_("Burn existing image to DVD"), self.selectImage))
@@ -196,7 +197,13 @@ class TitleList(Screen, HelpableScreen):
self["error_label"].show()
return False
- def burnProject(self):
+ def askBurnProject(self):
+ if len(self["titles"].list):
+ self.session.openWithCallback(self.burnProject,MessageBox,text = _("Do you want to burn this collection to DVD medium?"), type = MessageBox.TYPE_YESNO)
+
+ def burnProject(self, answer=True):
+ if not answer:
+ return
if self.project.settings.authormode.getValue() == "data_ts":
job = Process.DVDdataJob(self.project)
job_manager.AddJob(job)
@@ -208,7 +215,7 @@ class TitleList(Screen, HelpableScreen):
job_manager.in_background = False
self.session.openWithCallback(self.JobViewCB, JobView, job)
- def burnISO(self, path, scope):
+ def burnISO(self, path, scope, configRef):
if path:
job = Process.DVDisoJob(self.project, path)
job_manager.AddJob(job)
diff --git a/lib/python/Plugins/SystemPlugins/DiseqcTester/plugin.py b/lib/python/Plugins/SystemPlugins/DiseqcTester/plugin.py
index a4793949..bb4df74a 100644
--- a/lib/python/Plugins/SystemPlugins/DiseqcTester/plugin.py
+++ b/lib/python/Plugins/SystemPlugins/DiseqcTester/plugin.py
@@ -78,6 +78,14 @@ class ResultParser:
text += " ==> "
text += str(transponder[0])
text += "\n"
+ if reason == "pids_failed":
+ text += "(tsid, onid): "
+ text += str(transponder[3]['real'])
+ text += "(read from sat) != "
+ text += str(transponder[3]['expected'])
+ text += "(read from file)"
+ text += "\n"
+ text += "\n"
if countsuccessful > 0:
text += "\n"
text += "Successfully tuned transponders' previous planes:\n"
diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py
index 20a239a2..64ed35f7 100644
--- a/lib/python/Screens/InfoBarGenerics.py
+++ b/lib/python/Screens/InfoBarGenerics.py
@@ -1525,7 +1525,7 @@ class InfoBarInstantRecord:
print "after:\n", self.recording
def setEndtime(self, entry):
- if entry is not None:
+ if entry is not None and entry >= 0:
self.selectedEntry = entry
self.endtime=ConfigClock(default = self.recording[self.selectedEntry].end)
dlg = self.session.openWithCallback(self.TimeDateInputClosed, TimeDateInput, self.endtime)
@@ -1542,7 +1542,7 @@ class InfoBarInstantRecord:
self.session.nav.RecordTimer.timeChanged(self.recording[self.selectedEntry])
def changeDuration(self, entry):
- if entry is not None:
+ if entry is not None and entry >= 0:
self.selectedEntry = entry
self.session.openWithCallback(self.inputCallback, InputBox, title=_("How many minutes do you want to record?"), text="5", maxSize=False, type=Input.NUMBER)
diff --git a/lib/service/servicemp3.cpp b/lib/service/servicemp3.cpp
index d90186a5..569272b0 100644
--- a/lib/service/servicemp3.cpp
+++ b/lib/service/servicemp3.cpp
@@ -321,11 +321,11 @@ eServiceMP3::eServiceMP3(const char *filename): m_filename(filename), m_pump(eAp
switch (sourceinfo.containertype)
{
case ctMPEGTS:
- demux_type = "flutsdemux";
+ demux_type = "mpegtsdemux";
break;
case ctMPEGPS:
case ctVCD:
- demux_type = "flupsdemux";
+ demux_type = "mpegpsdemux";
break;
case ctMKV:
demux_type = "matroskademux";