Update of /cvsroot/freevo/freevo/src/input/plugins
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16459
Added Files:
netremote.py
Log Message:
A network remote control plugin for freevo: plugin.activate('input.netremote') -
untested.
--- NEW FILE: netremote.py ---
# -*- coding: iso-8859-1 -*-
# -----------------------------------------------------------------------
# netremote.py - A network remote control plugin for Freevo.
# -----------------------------------------------------------------------
# $Id: netremote.py,v 1.1 2004/09/25 04:40:03 rshortt Exp $
#
# Notes:
# Todo:
#
# -----------------------------------------------------------------------
# $Log: netremote.py,v $
# Revision 1.1 2004/09/25 04:40:03 rshortt
# A network remote control plugin for freevo: plugin.activate('input.netremote') -
untested.
#
#
#
# -----------------------------------------------------------------------
# Freevo - A Home Theater PC framework
# Copyright (C) 2003 Krister Lagerstrom, et al.
# 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
#
# ----------------------------------------------------------------------- */
import socket
import config
import eventhandler
import rc
rc = rc.get_singleton()
class PluginInterface(plugin.Plugin):
def __init__(self):
plugin.Plugin.__init__(self)
self.plugin_name = 'NETREMOTE'
self.port = config.NETREMOTE_PORT
self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
self.sock.setblocking(0)
self.sock.bind(('', self.port))
rc.inputs.append(self)
def config(self):
return [
('NETREMOTE_PORT', 16310, 'Network port to listen on.'),
]
def poll(self):
"""
return next event
"""
try:
return self.sock.recv(100)
except:
# No data available
return None
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog