Update of /cvsroot/freevo/freevo/src/plugins
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30962
Modified Files:
rom_drives.py
Log Message:
better typoe detection, autostart
Index: rom_drives.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/plugins/rom_drives.py,v
retrieving revision 1.58
retrieving revision 1.59
diff -C2 -d -r1.58 -r1.59
*** rom_drives.py 27 Feb 2004 20:07:28 -0000 1.58
--- rom_drives.py 2 Mar 2004 21:01:52 -0000 1.59
***************
*** 10,13 ****
--- 10,16 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.59 2004/03/02 21:01:52 dischi
+ # better typoe detection, autostart
+ #
# Revision 1.58 2004/02/27 20:07:28 dischi
# add function to check if a media is mounted
***************
*** 201,205 ****
media.item.parent = menuw.menustack[0].selected
if media.item and media.item.actions():
! media.item.actions()[0][0](menuw=menuw)
else:
menuw.refresh()
--- 204,221 ----
media.item.parent = menuw.menustack[0].selected
if media.item and media.item.actions():
! if media.type == 'audio':
! # disc marked as audio, play everything
! if media.item.type == 'dir':
! media.item.play_recursive(menuw=menuw)
! elif media.item.type == 'audiocd':
! media.item.play(menuw=menuw)
! else:
! media.item.actions()[0][0](menuw=menuw)
! elif media.videoitem:
! # disc has one video file, play it
! media.videoitem.actions()[0][0](menuw=menuw)
! else:
! # ok, do whatever this item has to offer
! media.item.actions()[0][0](menuw=menuw)
else:
menuw.refresh()
***************
*** 243,246 ****
--- 259,263 ----
if parent.display_type == 'video' and media.videoitem:
m = media.videoitem
+ # FIXME: how to play video is maybe subdirs?
else:
***************
*** 559,570 ****
util.mount(media.mountdir, force=True)
# Check for movies/audio/images on the disc
! mplayer_files = util.match_files(media.mountdir, config.VIDEO_SUFFIX)
! mp3_files = util.match_files(media.mountdir, config.AUDIO_SUFFIX)
! image_files = util.match_files(media.mountdir, config.IMAGE_SUFFIX)
! _debug_('identifymedia: mplayer = "%s"' % mplayer_files, level = 2)
! _debug_('identifymedia: mp3="%s"' % mp3_files, level = 2)
! _debug_('identifymedia: image="%s"' % image_files, level = 2)
media.item = DirItem(media.mountdir, None, create_metainfo=False)
--- 576,588 ----
util.mount(media.mountdir, force=True)
+
# Check for movies/audio/images on the disc
! num_video = disc_info['disc_num_video']
! num_audio = disc_info['disc_num_audio']
! num_image = disc_info['disc_num_image']
!
! video_files = util.match_files(media.mountdir, config.VIDEO_SUFFIX)
! _debug_('identifymedia: mplayer = "%s"' % video_files, level = 2)
media.item = DirItem(media.mountdir, None, create_metainfo=False)
***************
*** 572,577 ****
util.umount(media.mountdir)
! # Is this a movie disc?
! if mplayer_files and not mp3_files:
media.type = 'video'
--- 590,597 ----
util.umount(media.mountdir)
! # if there is a video file on the root dir of the disc, we guess
! # it's a video disc. There may also be audio files and images, but
! # they only belong to the movie
! if video_files:
media.type = 'video'
***************
*** 584,590 ****
end_ep = 0
! mplayer_files.sort(lambda l, o: cmp(l.upper(), o.upper()))
! for movie in mplayer_files:
if config.VIDEO_SHOW_REGEXP_MATCH(movie):
show =
config.VIDEO_SHOW_REGEXP_SPLIT(os.path.basename(movie))
--- 604,610 ----
end_ep = 0
! video_files.sort(lambda l, o: cmp(l.upper(), o.upper()))
! for movie in video_files:
if config.VIDEO_SHOW_REGEXP_MATCH(movie):
show =
config.VIDEO_SHOW_REGEXP_SPLIT(os.path.basename(movie))
***************
*** 625,630 ****
fxd_file = tvinfo[3]
! elif (not show_name) and len(mplayer_files) == 1:
! movie = mplayer_files[0]
title = os.path.splitext(os.path.basename(movie))[0]
--- 645,650 ----
fxd_file = tvinfo[3]
! elif (not show_name) and len(video_files) == 1:
! movie = video_files[0]
title = os.path.splitext(os.path.basename(movie))[0]
***************
*** 634,649 ****
! # XXX add more intelligence to cds with audio files
! elif (not mplayer_files) and mp3_files:
media.type = 'audio'
title = '%s [%s]' % (media.drivename, label)
! # XXX add more intelligence to cds with image files
! elif (not mplayer_files) and (not mp3_files) and image_files:
media.type = 'image'
title = '%s [%s]' % (media.drivename, label)
# Mixed media?
! elif mplayer_files or image_files or mp3_files:
media.type = None
title = '%s [%s]' % (media.drivename, label)
--- 654,670 ----
! # If there are no videos and only audio files (and maybe images)
! # it is an audio disc (autostart will auto play everything)
! elif not num_video and num_audio:
media.type = 'audio'
title = '%s [%s]' % (media.drivename, label)
! # Only images? OK than, make it an image disc
! elif not num_video and not num_audio and num_image:
media.type = 'image'
title = '%s [%s]' % (media.drivename, label)
# Mixed media?
! elif num_video or num_audio or num_image:
media.type = None
title = '%s [%s]' % (media.drivename, label)
***************
*** 655,683 ****
if title:
media.item.name = title
if image:
media.item.image = image
if more_info:
media.item.info.set_variables(more_info)
if fxd_file and not media.item.fxd_file:
media.item.set_fxd_file(fxd_file)
!
! if len(mplayer_files) == 1:
util.mount(media.mountdir)
if movie_info:
media.videoitem = copy.deepcopy(movie_info)
else:
! media.videoitem = VideoItem(mplayer_files[0], None)
util.umount(media.mountdir)
media.videoitem.media = media
media.videoitem.media_id = media.id
if title:
media.videoitem.name = title
if image:
media.videoitem.image = image
if more_info:
media.videoitem.set_variables(more_info)
if fxd_file:
media.videoitem.fxd_file = fxd_file
--- 676,716 ----
+ # set the infos we have now
if title:
media.item.name = title
+
if image:
media.item.image = image
+
if more_info:
media.item.info.set_variables(more_info)
+
if fxd_file and not media.item.fxd_file:
media.item.set_fxd_file(fxd_file)
!
!
! # One video in the root dir. This sounds like a disc with one
! # movie on it. Save the information about it and autostart will
! # play this.
! if len(video_files) == 1:
util.mount(media.mountdir)
if movie_info:
media.videoitem = copy.deepcopy(movie_info)
else:
! media.videoitem = VideoItem(video_files[0], None)
util.umount(media.mountdir)
media.videoitem.media = media
media.videoitem.media_id = media.id
+ # set the infos we have
if title:
media.videoitem.name = title
+
if image:
media.videoitem.image = image
+
if more_info:
media.videoitem.set_variables(more_info)
+
if fxd_file:
media.videoitem.fxd_file = fxd_file
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog