Debian Codegraph @

src/devedeng/mpv.py

raw
1 #!/usr/bin/env python3
2
3 # Copyright 2014 (C) Raster Software Vigo (Sergio Costas)
4 #
5 # This file is part of DeVeDe-NG
6 #
7 # DeVeDe-NG is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License version 3
9 # as published by the Free Software Foundation.
10 #
11 # DeVeDe-NG is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>
18
19 import subprocess
20 import devedeng.configuration_data
21 import devedeng.executor
22
23
24 class mpv(devedeng.executor.executor):
25
26 supports_analize = False
27 supports_play = True
28 supports_convert = False
29 supports_menu = False
30 supports_mkiso = False
31 supports_burn = False
32 display_name = "MPV"
33
34 @staticmethod
35 def check_is_installed():
36 try:
37 handle = subprocess.Popen(
38 ["mpv", "-v"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
39 (stdout, stderr) = handle.communicate()
40 if 0 == handle.wait():
41 return True
42 else:
43 return False
44 except:
45 return False
46
47 def __init__(self):
48
49 devedeng.executor.executor.__init__(self)
50 self.config = devedeng.configuration_data.configuration.get_config()
51
52 def play_film(self, file_name):
53
54 command_line = ["mpv", file_name]
55 self.launch_process(command_line)
56
57 def process_stdout(self, data):
58 return
59
60 def process_stderr(self, data):
61 return