Add this file to your /usr/local/freevo/src/video/plugins/ directory and then add plugin.activate('video.copy_to_cd') to your local_conf.py. You might need to change some of the variables in the plugin but I want to add that into the local_conf.py in the near future. You also need cdrecord.
#if 0 /* # ----------------------------------------------------------------------- # copy_to_cd.py - Plugin for copying a movie to a cd # ----------------------------------------------------------------------- # $Id: copy_to_cd.py,v 1.0 2004/01/20 05:44:05 phishman Exp $ # # Notes: Copies the given file to a CD # # ----------------------------------------------------------------------- # $Log: copy_to_cd.py,v $ # Revision 1.0 2004/01/20 05:44:05 phishman # # ----------------------------------------------------------------------- # Freevo - A Home Theater PC framework # Copyright (C) 2002 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 # # ----------------------------------------------------------------------- */ #endif
import os
import menu
import config
import plugin
import re
import time
import item
from gui.AlertBox import AlertBox
from gui.PopupBox import PopupBox
class PluginInterface(plugin.ItemPlugin):
def actions(self, item):
self.item = item
if item.type == 'video':
return [ ( self.copy_to_cd, _('Copy this file to CD'),
'copy_to_cd') ]
return []
"""
def config(self):
return (('temp_file', config.TEMP_FILE , '' )
('record_speed', config.RECORD_SPEED , '' )
('block_dev', config.BLOCK_DEV , '' ))
"""
def copy_to_cd(self, arg=None, menuw=None):
"""
copy this file onto a CD
"""
name = self.item.filename
temp_file = '/opt/media/movies/image.img'
record_speed = '32'
block_dev = '0,0,0'
make_cd_image = 'mkisofs -r -o %s %s' % (temp_file,name)
burn_cd_image = 'cdrecord -v speed=%s dev=%s %s' %
(record_speed,block_dev,temp_file)
box = PopupBox(text=_('Making the disc image.'))
box.show()
os.system(make_cd_image)
box.destroy()
box = PopupBox(text=_('Copying image to disc.'))
box.show()
os.system(burn_cd_image)
box.destroy()
os.system('rm %s' % temp_file)
return
