Author: dmeyer
Date: Sat Oct 15 19:19:00 2005
New Revision: 7707
Modified:
trunk/freevo-tvdev/src/control.py
trunk/freevo-tvdev/src/devices.py
Log:
add some doc
Modified: trunk/freevo-tvdev/src/control.py
==============================================================================
--- trunk/freevo-tvdev/src/control.py (original)
+++ trunk/freevo-tvdev/src/control.py Sat Oct 15 19:19:00 2005
@@ -1,10 +1,10 @@
# -*- coding: iso-8859-1 -*-
# -----------------------------------------------------------------------------
-# recorder.py - external recorder based on kaa.record for Freevo
+# control.py - Control prohram for recorder based on kaa.record for Freevo
# -----------------------------------------------------------------------------
# $Id$
#
-# This program is the recorder for the Freevo recordserver. The server can't
+# This file is the mbus interface of a tv device for Freevo. The server can't
# do any recordings, it uses recorder like this on in the LAN based on mbus
# to do the real recording. This file doesn't know anything about timeshifting
# or conflicts, it will record what the server wants.
@@ -12,9 +12,7 @@
# A global for Freevo 2.0 is that this file is independed of Freevo. This
# module is the only one that needs to detect tv cards and the only one doing
# the mapping between internal channel id and the channel id know to the
-# device (dvb names or frequencies for analog tv). Right now it uses the Freevo
-# card detection code and the epg to do the mapping (which needs to be changed
-# in the future).
+# device (dvb names or frequencies for analog tv).
#
# The module reacts on the following mbus commands (they may change in the
# future):
@@ -81,7 +79,7 @@
# mbus support
from freevo.mcomm import RPCServer, RPCError, RPCReturn
-# detect tv cards and channels
+# the devices used for recording
import devices
# get logging object
@@ -90,7 +88,7 @@
class Controller(RPCServer):
"""
- Recorder handling the different devices.
+ Controller for mbus.
"""
def __init__(self):
RPCServer.__init__(self, 'tvdev')
@@ -162,7 +160,7 @@
def send_event(self, event, id):
"""
- Send events.
+ Send events about recordings atrt and stop.
"""
if not self.server:
return
Modified: trunk/freevo-tvdev/src/devices.py
==============================================================================
--- trunk/freevo-tvdev/src/devices.py (original)
+++ trunk/freevo-tvdev/src/devices.py Sat Oct 15 19:19:00 2005
@@ -1,11 +1,49 @@
+# -*- coding: iso-8859-1 -*-
+# -----------------------------------------------------------------------------
+# devices.py - wrapper for kaa.record devices
+# -----------------------------------------------------------------------------
+# $Id: recorder.py 7679 2005-09-14 19:25:39Z rshortt $
+#
+# TODO: move more logic to kaa.record so this file is not needed anymore
+#
+# -----------------------------------------------------------------------------
+# Freevo - A Home Theater PC framework
+# Copyright (C) 2002-2005 Krister Lagerstrom, Dirk Meyer, et al.
+#
+# First Edition: Dirk Meyer <[EMAIL PROTECTED]>
+# Maintainer: Dirk Meyer <[EMAIL PROTECTED]>
+#
+# Please see the file freevo/Docs/CREDITS for a complete list of authors.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MER-
+# CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# -----------------------------------------------------------------------------
+
+# python imports
import logging
+# kaa.record imports
import kaa.record
+
+# freevo.tvdev imports
import tvcards
# get logging object
log = logging.getLogger()
+
class Device(object):
"""
Base class for all devices. All devices need to inherit from this class
@@ -27,6 +65,7 @@
def __init__(self, id, card):
kaa.record.DvbDevice.__init__(self, card.adapter, card.channels_conf)
Device.__init__(self, id, card)
+ self.bouquets = self.get_bouquet_list()
def start_recording(self, channel, output):
@@ -76,24 +115,34 @@
chain.append(output)
return kaa.record.IVTVDevice.start_recording(self, channel, chain)
+
+# list of all active devices
DEVICES = []
def detect(cfgfile):
-
+ """
+ Detect active devices and connect the config to kaa.record devices.
+ """
if DEVICES:
+ # already detected something
return
+ # detect the tv cards
tvcards.detect(cfgfile)
for id, card in tvcards.TV_CARDS.items():
if not card.active:
+ # card is not working or should not be used
if not card.configured:
log.info('skipping %s, not configured' % id)
else:
log.info('skipping %s' % id)
continue
+
if id.startswith('dvb'):
+ # a dvb device
DEVICES.append(DvbDevice(id, card))
elif id.startswith('ivtv'):
+ # an ivtv device
DEVICES.append(IVTVDevice(id, card))
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog