]> git.plutz.net Git - viper/blob - plugins/f_custom.py
moved from svn.imp.fu-berlin.de/viper rev33
[viper] / plugins / f_custom.py
1 #encoding: utf-8
2 #Copyright 2009 Paul Hänsch
3
4 #This file is part of Viper.
5
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.
10
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.
15
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/>
18
19 from plugin import *
20
21 class F_Custom(F_Plugin):
22     def build_dialog(self):
23         self.subgets['desc'] = Label(self, text = 'Enter a piece of mplayer command line\n'+
24                                      'specifying a video filter. I.e.:\n' +
25                                      '"-vf-add rectangle=300:200"')
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)
29
30     def name(self):
31         return 'Custom'
32
33     def subcommand(self):
34         return self.subgets['line'].get().split(' ')
35
36 class F_Test(F_Plugin):
37     def build_dialog(self):
38         self.subgets['desc'] = Label(self, text = 'Choose a Filter string to apply')
39         self.subgets['desc'].pack(side = TOP, expand = True, fill = BOTH)
40         self.subgets['filter'] = Pmw.OptionMenu(self, initialitem = 0,
41                                                 items = ['-vf-add rectangle=80:60',
42                                                          '-vf-add rectangle=120:90'
43                                                          ])
44         self.subgets['filter'].pack(side = TOP, expand = True, fill = X)
45
46     def name(self):
47         return 'Test'
48
49     def is_available(self):
50         return False
51
52     def subcommand(self):
53         return self.subgets['filter'].getvalue().split(' ')