3
# -----------------------------------------------------------------------
4
# $Id: __init__.py 382 2004-10-15 09:02:11Z dischi $
5
# -----------------------------------------------------------------------
7
# Revision 1.35 2004/10/15 09:02:11 dischi
10
# Revision 1.34 2004/05/20 15:55:08 dischi
11
# add xml file detection
13
# Revision 1.33 2004/05/02 08:28:20 dischi
16
# Revision 1.32 2004/04/18 09:11:36 dischi
17
# improved lsdvd support
19
# Revision 1.31 2004/04/17 18:38:54 dischi
20
# add lsdvd parser to avoid problems with our own
22
# Revision 1.30 2004/01/31 12:24:39 dischi
23
# add basic matroska info
25
# Revision 1.29 2004/01/27 20:27:52 dischi
26
# remove cache, it does not belong in mmpython
28
# Revision 1.28 2004/01/03 17:44:04 dischi
29
# catch OSError in case the file is removed file scanning
31
# Revision 1.27 2003/11/24 20:30:17 dischi
32
# fix again, dvd may fail, but datadir may not
34
# Revision 1.26 2003/11/24 20:29:26 dischi
35
# resort to let dvd work again
37
# Revision 1.25 2003/11/07 13:58:52 dischi
40
# Revision 1.24 2003/09/22 16:24:58 the_krow
42
# o try-except block around ioctl since it is not avaiable in all OS
44
# Revision 1.23 2003/09/14 13:50:42 dischi
45
# make it possible to scan extention based only
47
# Revision 1.22 2003/09/10 18:41:44 dischi
48
# add USE_NETWORK, maybe there is no network connection
50
# Revision 1.20 2003/08/26 13:16:41 outlyer
53
# Revision 1.19 2003/07/10 11:17:35 the_krow
54
# ogminfo is used to parse ogg files
56
# Revision 1.18 2003/07/01 21:07:42 dischi
57
# switch back to eyed3info
59
# Revision 1.17 2003/06/30 13:17:18 the_krow
60
# o Refactored mediainfo into factory, synchronizedobject
61
# o Parsers now register directly at mmpython not at mmpython.mediainfo
62
# o use mmpython.Factory() instead of mmpython.mediainfo.get_singleton()
63
# o Bugfix in PNG parser
64
# o Renamed disc.AudioInfo into disc.AudioDiscInfo
65
# o Renamed disc.DataInfo into disc.DataDiscInfo
67
# -----------------------------------------------------------------------
68
# MMPython - Media Metadata for Python
69
# Copyright (C) 2003 Thomas Schueppel, Dirk Meyer
71
# This program is free software; you can redistribute it and/or modify
72
# it under the terms of the GNU General Public License as published by
73
# the Free Software Foundation; either version 3 of the License, or
74
# (at your option) any later version.
76
# This program is distributed in the hope that it will be useful, but
77
# WITHOUT ANY WARRANTY; without even the implied warranty of MER-
78
# CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
79
# Public License for more details.
81
# You should have received a copy of the GNU General Public License along
82
# with this program; if not, write to the Free Software Foundation, Inc.,
83
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
85
# -----------------------------------------------------------------------
88
# Do this stuff before importing the info instances since they
89
# depend on this function
92
from synchronizedobject import SynchronizedObject
94
_factory = SynchronizedObject(factory.Factory())
101
# if _factory == None:
102
# _factory = SynchronizedObject(factory.Factory())
106
def registertype(mimetype,extensions,type,c):
108
_factory.register(mimetype,extensions,type,c)
110
def gettype(mimetype,extensions):
112
return _factory.get(mimetype,extensions)
116
def parse(filename, ext_only = 0):
120
return _factory.create(filename, ext_only)
122
# Okay Regular imports and code follow
127
import video.riffinfo
128
import video.mpeginfo
132
import video.realinfo
136
registertype( 'video/asf', ('asf','wmv','wma'), mediainfo.TYPE_AV, video.asfinfo.AsfInfo )
137
registertype( 'application/mkv', ('mkv', 'mka',), mediainfo.TYPE_AV, video.mkvinfo.MkvInfo )
138
registertype( 'video/quicktime', ('mov', 'qt'), mediainfo.TYPE_AV, video.movinfo.MovInfo )
139
registertype( 'video/mpeg', ('mpeg','mpg','mp4', 'ts'), mediainfo.TYPE_AV, video.mpeginfo.MpegInfo )
140
registertype( 'application/ogg', ('ogm', 'ogg',), mediainfo.TYPE_AV, video.ogminfo.OgmInfo )
141
registertype( 'video/real', ('rm', 'ra', 'ram'), mediainfo.TYPE_AV, video.realinfo.RealInfo )
142
registertype( 'video/avi', ('avi',), mediainfo.TYPE_AV, video.riffinfo.RiffInfo )
143
registertype( 'video/vcd', ('cue',), mediainfo.TYPE_AV, video.vcdinfo.VCDInfo )
144
#import audio.ogginfo
145
#import audio.pcminfo
146
#import audio.m4ainfo
147
#import audio.ac3info
148
#import image.jpginfo
149
#import image.pnginfo
150
#import image.tiffinfo
151
#import image.ImageInfo
153
# import some disc modules (may fail)
155
# import disc.discinfo
156
# import disc.vcdinfo
157
# import disc.audioinfo
161
# find the best working DVD module
168
# import disc.dvdinfo
172
# use fallback disc module
174
# import disc.datainfo
178
#import audio.eyed3info
179
#import audio.mp3info
180
#import audio.webradioinfo
181
#import audio.flacinfo