2 #Copyright 2009 Paul Hänsch
4 #This file is part of Viper.
6 #Viper is free software: you can redistribute it and/or modify
7 #it under the terms of the GNU General Public License as published by
8 #the Free Software Foundation, either version 3 of the License, or
9 #(at your option) any later version.
11 #Viper 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.
16 #You should have received a copy of the GNU General Public License
17 #along with Viper. If not, see <http://www.gnu.org/licenses/>
21 class A_Custom(A_Plugin):
22 def build_dialog(self):
23 self.subgets['desc'] = Label(self, text = 'Enter a piece of mplayer command line\n'+
24 'specifying an audio encoder. I.e.:\n' +
26 self.subgets['desc'].pack(side = TOP, expand = True, fill = BOTH)
27 self.subgets['line'] = Entry(self)
28 self.subgets['line'].pack(side = TOP, expand = True, fill = X)
34 return self.line.split(' ')
36 class A_Nosound(A_Plugin):
37 def build_dialog(self):
38 self.subgets['desc'] = Label(self, text = 'This will produce a silent file.\n' +
39 'No audio stream will be stored.')
40 self.subgets['desc'].pack(side = TOP, expand = True, fill = BOTH)
48 class A_Copy(A_Plugin):
49 def build_dialog(self):
50 self.subgets['desc'] = Label(self, text = 'This will copy an existing audio stream.')
51 self.subgets['desc'].pack(side = TOP, expand = True, fill = BOTH)
57 return ['-oac', 'copy']
59 def is_available(self):
61 slave = os.popen2(['mencoder', '-oac', 'help'])
64 line = slave[1].readline()
65 if line.lstrip().find('copy') == 0:
69 class A_Pcm(A_Plugin):
70 def build_dialog(self):
71 self.subgets['desc'] = Label(self,
72 text = 'This will output an uncompressed audio stream '+
73 '(except mpeg2 and ac3).')
74 self.subgets['desc'].grid(row = 0, column = 0, columnspan = 4)
76 self.subgets['l_format'] = Label(self, text = 'Format:')
77 self.subgets['l_format'].grid(row = 1, column = 1)
78 self.subgets['format'] = Pmw.OptionMenu(self, initialitem = 5,
79 items = ['s8', 'u8', 's16be', 's16le',
80 'u16be', 'u16le', 's24be', 's24le',
81 'u24be', 'u24le', 's32be', 's32le',
82 'u32be', 'u32le', 'floatbe', 'floatle',
83 'mulaw', 'alaw', 'mpeg2', 'ac3',
85 self.subgets['format'].grid(row = 1, column = 2)
91 return ['-oac', 'pcm', '-af', 'format='+self.subgets['format'].getvalue()]
93 def is_available(self):
95 slave = os.popen2(['mencoder', '-oac', 'help'])
98 line = slave[1].readline()
99 if line.lstrip().find('pcm') == 0: