aboutsummaryrefslogtreecommitdiffstats
path: root/lvc/__init__.py
diff options
context:
space:
mode:
authorJesús Eduardo <heckyel@hyperbola.info>2017-09-11 17:47:17 -0500
committerJesús Eduardo <heckyel@hyperbola.info>2017-09-11 17:47:17 -0500
commit14738704ede6dfa6ac79f362a9c1f7f40f470cdc (patch)
tree31c83bdd188ae7b64d7169974d6f066ccfe95367 /lvc/__init__.py
parenteb1896583afbbb622cadcde1a24e17173f61904f (diff)
downloadlibrevideoconverter-14738704ede6dfa6ac79f362a9c1f7f40f470cdc.tar.lz
librevideoconverter-14738704ede6dfa6ac79f362a9c1f7f40f470cdc.tar.xz
librevideoconverter-14738704ede6dfa6ac79f362a9c1f7f40f470cdc.zip
rename mvc at lvc
Diffstat (limited to 'lvc/__init__.py')
-rw-r--r--lvc/__init__.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/lvc/__init__.py b/lvc/__init__.py
new file mode 100644
index 0000000..1cc637e
--- /dev/null
+++ b/lvc/__init__.py
@@ -0,0 +1,37 @@
+import os
+
+import multiprocessing
+from lvc import converter
+from lvc import conversion
+from lvc import signals
+from lvc import video
+
+VERSION = '1.0.1'
+
+class Application(signals.SignalEmitter):
+
+ def __init__(self, simultaneous=None):
+ signals.SignalEmitter.__init__(self)
+ if simultaneous is None:
+ try:
+ simultaneous = multiprocessing.cpu_count()
+ except NotImplementedError:
+ pass
+ self.converter_manager = converter.ConverterManager()
+ self.conversion_manager = conversion.ConversionManager(simultaneous)
+ self.started = False
+
+ def startup(self):
+ if self.started:
+ return
+ self.converter_manager.startup()
+ self.started = True
+
+ def start_conversion(self, filename, converter_id):
+ self.startup()
+ converter = self.converter_manager.get_by_id(converter_id)
+ v = video.VideoFile(filename)
+ return self.conversion_manager.start_conversion(v, converter)
+
+ def run(self):
+ raise NotImplementedError