Package flumotion :: Package component :: Package encoders :: Package speex :: Module wizard_gtk
[hide private]

Source Code for Module flumotion.component.encoders.speex.wizard_gtk

 1  # -*- Mode: Python -*- 
 2  # vi:si:et:sw=4:sts=4:ts=4 
 3  # 
 4  # Flumotion - a streaming media server 
 5  # Copyright (C) 2004,2005,2006,2007,2008 Fluendo, S.L. (www.fluendo.com). 
 6  # All rights reserved. 
 7   
 8  # This file may be distributed and/or modified under the terms of 
 9  # the GNU General Public License version 2 as published by 
10  # the Free Software Foundation. 
11  # This file is distributed without any warranty; without even the implied 
12  # warranty of merchantability or fitness for a particular purpose. 
13  # See "LICENSE.GPL" in the source distribution for more information. 
14   
15  # Licensees having purchased or holding a valid Flumotion Advanced 
16  # Streaming Server license may use this file in accordance with the 
17  # Flumotion Advanced Streaming Server Commercial License Agreement. 
18  # See "LICENSE.Flumotion" in the source distribution for more information. 
19   
20  # Headers in this file shall remain intact. 
21   
22  import gettext 
23   
24  from zope.interface import implements 
25   
26  from flumotion.wizard.basesteps import AudioEncoderStep 
27  from flumotion.wizard.interfaces import IEncoderPlugin 
28  from flumotion.wizard.models import AudioEncoder 
29   
30  __version__ = "$Rev: 6916 $" 
31  _ = gettext.gettext 
32   
33   
34 -class SpeexAudioEncoder(AudioEncoder):
35 componentType = 'speex-encoder' 36
37 - def __init__(self):
38 super(SpeexAudioEncoder, self).__init__() 39 40 self.properties.bitrate = 11
41
42 - def getProperties(self):
43 properties = super(SpeexAudioEncoder, self).getProperties() 44 properties.bitrate *= 1000 45 return properties
46 47
48 -class SpeexStep(AudioEncoderStep):
49 name = 'Speex encoder' 50 title = _('Speex encoder') 51 sidebarName = _('Speex') 52 componentType = 'speex' 53 icon = 'xiphfish.png' 54 55 # WizardStep 56
57 - def setup(self):
58 # Should be 2150 instead of 3 -> 3000 59 self.bitrate.set_range(3, 30) 60 self.bitrate.set_value(11) 61 62 self.bitrate.data_type = int 63 64 self.add_proxy(self.model.properties, ['bitrate'])
65
66 - def workerChanged(self, worker):
67 self.model.worker = worker 68 self.wizard.requireElements(worker, 'speexenc')
69 70
71 -class SpeexWizardPlugin(object):
72 implements(IEncoderPlugin)
73 - def __init__(self, wizard):
74 self.wizard = wizard 75 self.model = SpeexAudioEncoder()
76
77 - def getConversionStep(self):
78 return SpeexStep(self.wizard, self.model)
79