Package flumotion :: Package component :: Package producers :: Package audiotest :: Module wizard_gtk
[hide private]

Source Code for Module flumotion.component.producers.audiotest.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) 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  import os 
24   
25  from zope.interface import implements 
26   
27  from flumotion.wizard.basesteps import AudioProducerStep 
28  from flumotion.wizard.interfaces import IProducerPlugin 
29  from flumotion.wizard.models import AudioProducer 
30   
31  __version__ = "$Rev: 6765 $" 
32  _ = gettext.gettext 
33   
34   
35 -class TestAudioProducer(AudioProducer):
36 componentType = 'audiotest-producer' 37
38 - def __init__(self):
39 super(TestAudioProducer, self).__init__() 40 41 self.properties.rate = '44100'
42 43
44 -class TestAudioProducerStep(AudioProducerStep):
45 name = 'TestAudioProducer' 46 title = _('Test Audio Producer') 47 icon = 'soundcard.png' 48 gladeFile = os.path.join(os.path.dirname(os.path.abspath(__file__)), 49 'wizard.glade') 50 51 # WizardStep 52
53 - def setup(self):
54 self.rate.data_type = str 55 self.volume.data_type = float 56 57 self.rate.prefill(['8000', 58 '16000', 59 '32000', 60 '44100']) 61 62 self.add_proxy(self.model.properties, 63 ['frequency', 'volume', 'rate']) 64 65 self.rate.set_sensitive(True)
66
67 - def workerChanged(self, worker):
68 self.model.worker = worker 69 self.wizard.requireElements(worker, 'audiotestsrc')
70
71 - def getNext(self):
72 return None
73 74
75 -class AudioTestWizardPlugin(object):
76 implements(IProducerPlugin)
77 - def __init__(self, wizard):
78 self.wizard = wizard 79 self.model = TestAudioProducer()
80
81 - def getProductionStep(self, type):
82 return TestAudioProducerStep(self.wizard, self.model)
83