jdahlin - in flumotion/trunk: . data/glade flumotion/component/producers/audiotest flumotion/component/producers/videotest flumotion/wizard po

flumotion-commit at lists.fluendo.com flumotion-commit at lists.fluendo.com
Wed Jan 9 18:03:12 CET 2008


Author: jdahlin
Date: Wed Jan  9 18:01:33 2008
New Revision: 6082

Added:
   flumotion/trunk/flumotion/component/producers/audiotest/audiotest-wizard.glade
   flumotion/trunk/flumotion/component/producers/audiotest/audiotest_wizard.py   (contents, props changed)
   flumotion/trunk/flumotion/component/producers/videotest/videotest-wizard.glade
   flumotion/trunk/flumotion/component/producers/videotest/videotest_wizard.py   (contents, props changed)
Removed:
   flumotion/trunk/data/glade/wizard_audiotest.glade
   flumotion/trunk/data/glade/wizard_testsource.glade
Modified:
   flumotion/trunk/ChangeLog
   flumotion/trunk/flumotion/component/producers/audiotest/Makefile.am
   flumotion/trunk/flumotion/component/producers/audiotest/audiotest.xml
   flumotion/trunk/flumotion/component/producers/videotest/Makefile.am
   flumotion/trunk/flumotion/component/producers/videotest/videotest.xml
   flumotion/trunk/flumotion/wizard/configurationwizard.py
   flumotion/trunk/flumotion/wizard/productionsteps.py
   flumotion/trunk/po/POTFILES.in
Log:
2008-01-09  Johan Dahlin  <johan at gnome.org>

	* data/glade/wizard_audiotest.glade:
	* data/glade/wizard_testsource.glade:
	* flumotion/component/producers/audiotest/Makefile.am:
	* flumotion/component/producers/audiotest/audiotest-wizard.glade:
	* flumotion/component/producers/audiotest/audiotest.xml:
	* flumotion/component/producers/audiotest/audiotest_wizard.py:
	* flumotion/component/producers/videotest/Makefile.am:
	* flumotion/component/producers/videotest/videotest-wizard.glade:
	* flumotion/component/producers/videotest/videotest.xml:
	* flumotion/component/producers/videotest/videotest_wizard.py:
	* flumotion/wizard/configurationwizard.py:
	* flumotion/wizard/productionsteps.py:
	* po/POTFILES.in:

	Make the productionstep of the wizard pluggable. Move the
	audiotest and videotest steps to the component and put them in
	separate bundles.
	Add a new method to the configuration wizard to fetch a wizard bundle.



Modified: flumotion/trunk/ChangeLog
==============================================================================
--- flumotion/trunk/ChangeLog	(original)
+++ flumotion/trunk/ChangeLog	Wed Jan  9 18:01:33 2008
@@ -1,5 +1,26 @@
 2008-01-09  Johan Dahlin  <johan at gnome.org>
 
+	* data/glade/wizard_audiotest.glade:
+	* data/glade/wizard_testsource.glade:
+	* flumotion/component/producers/audiotest/Makefile.am:
+	* flumotion/component/producers/audiotest/audiotest-wizard.glade:
+	* flumotion/component/producers/audiotest/audiotest.xml:
+	* flumotion/component/producers/audiotest/audiotest_wizard.py:
+	* flumotion/component/producers/videotest/Makefile.am:
+	* flumotion/component/producers/videotest/videotest-wizard.glade:
+	* flumotion/component/producers/videotest/videotest.xml:
+	* flumotion/component/producers/videotest/videotest_wizard.py:
+	* flumotion/wizard/configurationwizard.py:
+	* flumotion/wizard/productionsteps.py:
+	* po/POTFILES.in:
+
+	Make the productionstep of the wizard pluggable. Move the
+	audiotest and videotest steps to the component and put them in
+	separate bundles.
+	Add a new method to the configuration wizard to fetch a wizard bundle.
+
+2008-01-09  Johan Dahlin  <johan at gnome.org>
+
 	* flumotion/manager/admin.py (AdminAvatar.perspective_getEntryByType): 
 	Remove, in favor of getEntry.
 	* flumotion/manager/admin.py (AdminAvatar.perspective_getEntry): 

Modified: flumotion/trunk/flumotion/component/producers/audiotest/Makefile.am
==============================================================================
--- flumotion/trunk/flumotion/component/producers/audiotest/Makefile.am	(original)
+++ flumotion/trunk/flumotion/component/producers/audiotest/Makefile.am	Wed Jan  9 18:01:33 2008
@@ -1,8 +1,16 @@
 include $(top_srcdir)/common/python.mk
 
-component_PYTHON = __init__.py audiotest.py admin_gtk.py
+component_PYTHON = 		\
+	__init__.py		\
+	audiotest.py		\
+	admin_gtk.py		\
+	audiotest_wizard.py
+
 componentdir = $(libdir)/flumotion/python/flumotion/component/producers/audiotest
-component_DATA = audiotest.xml audiotest.glade
+component_DATA = 		\
+	audiotest.xml		\
+	audiotest.glade		\
+	audiotest-wizard.glade
 
 clean-local:
 	rm -rf *.pyc *.pyo

Added: flumotion/trunk/flumotion/component/producers/audiotest/audiotest-wizard.glade
==============================================================================
--- (empty file)
+++ flumotion/trunk/flumotion/component/producers/audiotest/audiotest-wizard.glade	Wed Jan  9 18:01:33 2008
@@ -0,0 +1,180 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
+
+<glade-interface>
+
+<widget class="GtkWindow" id="window1">
+  <property name="title" translatable="yes">window1</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">False</property>
+  <property name="resizable">True</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="decorated">True</property>
+  <property name="skip_taskbar_hint">False</property>
+  <property name="skip_pager_hint">False</property>
+  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+  <property name="focus_on_map">True</property>
+  <property name="urgency_hint">False</property>
+
+  <child>
+    <widget class="GtkTable" id="table1">
+      <property name="visible">True</property>
+      <property name="n_rows">3</property>
+      <property name="n_columns">2</property>
+      <property name="homogeneous">False</property>
+      <property name="row_spacing">6</property>
+      <property name="column_spacing">12</property>
+
+      <child>
+	<widget class="GtkLabel" id="label1">
+	  <property name="visible">True</property>
+	  <property name="label" translatable="yes">_Volume:</property>
+	  <property name="use_underline">True</property>
+	  <property name="use_markup">False</property>
+	  <property name="justify">GTK_JUSTIFY_LEFT</property>
+	  <property name="wrap">False</property>
+	  <property name="selectable">False</property>
+	  <property name="xalign">1</property>
+	  <property name="yalign">0.5</property>
+	  <property name="xpad">0</property>
+	  <property name="ypad">0</property>
+	  <property name="mnemonic_widget">volume</property>
+	  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	  <property name="width_chars">-1</property>
+	  <property name="single_line_mode">False</property>
+	  <property name="angle">0</property>
+	</widget>
+	<packing>
+	  <property name="left_attach">0</property>
+	  <property name="right_attach">1</property>
+	  <property name="top_attach">1</property>
+	  <property name="bottom_attach">2</property>
+	  <property name="x_options">fill</property>
+	  <property name="y_options"></property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkLabel" id="label2">
+	  <property name="visible">True</property>
+	  <property name="label" translatable="yes">_Sample rate:</property>
+	  <property name="use_underline">True</property>
+	  <property name="use_markup">False</property>
+	  <property name="justify">GTK_JUSTIFY_LEFT</property>
+	  <property name="wrap">False</property>
+	  <property name="selectable">False</property>
+	  <property name="xalign">1</property>
+	  <property name="yalign">0.5</property>
+	  <property name="xpad">0</property>
+	  <property name="ypad">0</property>
+	  <property name="mnemonic_widget">combobox_samplerate</property>
+	  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	  <property name="width_chars">-1</property>
+	  <property name="single_line_mode">False</property>
+	  <property name="angle">0</property>
+	</widget>
+	<packing>
+	  <property name="left_attach">0</property>
+	  <property name="right_attach">1</property>
+	  <property name="top_attach">2</property>
+	  <property name="bottom_attach">3</property>
+	  <property name="x_options">fill</property>
+	  <property name="y_options"></property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkLabel" id="label6">
+	  <property name="visible">True</property>
+	  <property name="label" translatable="yes">F_requency:</property>
+	  <property name="use_underline">True</property>
+	  <property name="use_markup">False</property>
+	  <property name="justify">GTK_JUSTIFY_LEFT</property>
+	  <property name="wrap">False</property>
+	  <property name="selectable">False</property>
+	  <property name="xalign">1</property>
+	  <property name="yalign">0.5</property>
+	  <property name="xpad">0</property>
+	  <property name="ypad">0</property>
+	  <property name="mnemonic_widget">frequency</property>
+	  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	  <property name="width_chars">-1</property>
+	  <property name="single_line_mode">False</property>
+	  <property name="angle">0</property>
+	</widget>
+	<packing>
+	  <property name="left_attach">0</property>
+	  <property name="right_attach">1</property>
+	  <property name="top_attach">0</property>
+	  <property name="bottom_attach">1</property>
+	  <property name="x_options">fill</property>
+	  <property name="y_options"></property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkSpinButton" id="volume">
+	  <property name="visible">True</property>
+	  <property name="can_focus">True</property>
+	  <property name="climb_rate">1</property>
+	  <property name="digits">2</property>
+	  <property name="numeric">False</property>
+	  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+	  <property name="snap_to_ticks">False</property>
+	  <property name="wrap">False</property>
+	  <property name="adjustment">1 0 4 0.1 0.5 1</property>
+	</widget>
+	<packing>
+	  <property name="left_attach">1</property>
+	  <property name="right_attach">2</property>
+	  <property name="top_attach">1</property>
+	  <property name="bottom_attach">2</property>
+	  <property name="x_options">fill</property>
+	  <property name="y_options"></property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkSpinButton" id="frequency">
+	  <property name="visible">True</property>
+	  <property name="can_focus">True</property>
+	  <property name="climb_rate">1</property>
+	  <property name="digits">0</property>
+	  <property name="numeric">False</property>
+	  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+	  <property name="snap_to_ticks">False</property>
+	  <property name="wrap">False</property>
+	  <property name="adjustment">440 50 20000 10 100 10</property>
+	</widget>
+	<packing>
+	  <property name="left_attach">1</property>
+	  <property name="right_attach">2</property>
+	  <property name="top_attach">0</property>
+	  <property name="bottom_attach">1</property>
+	  <property name="x_options">fill</property>
+	  <property name="y_options"></property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkComboBox" id="rate">
+	  <property name="visible">True</property>
+	  <property name="add_tearoffs">False</property>
+	  <property name="focus_on_click">True</property>
+	</widget>
+	<packing>
+	  <property name="left_attach">1</property>
+	  <property name="right_attach">2</property>
+	  <property name="top_attach">2</property>
+	  <property name="bottom_attach">3</property>
+	  <property name="x_options">fill</property>
+	  <property name="y_options">fill</property>
+	</packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
+</glade-interface>

Modified: flumotion/trunk/flumotion/component/producers/audiotest/audiotest.xml
==============================================================================
--- flumotion/trunk/flumotion/component/producers/audiotest/audiotest.xml	(original)
+++ flumotion/trunk/flumotion/component/producers/audiotest/audiotest.xml	Wed Jan  9 18:01:33 2008
@@ -13,6 +13,8 @@
                function="AudioTest" />
         <entry type="admin/gtk" location="admin_gtk.py"
                function="AudioTestAdminGtk" />
+        <entry type="wizard" location="audiotest_wizard.py"
+               function="AudioTestWizardPlugin" />
       </entries>
 
       <!-- priority to this clock so that when testing, clock choice is
@@ -75,6 +77,20 @@
       </directories>
     </bundle>
 
+    <bundle name="audiotest-wizard">
+        <dependencies>
+            <dependency name="audiotest-base" />
+            <dependency name="component" />
+        </dependencies>
+
+        <directories>
+            <directory name="flumotion/component/producers/audiotest">
+                <filename location="audiotest-wizard.glade" />
+                <filename location="audiotest_wizard.py" />
+            </directory>
+        </directories>
+    </bundle>
+
   </bundles>
 
 </registry> 

Added: flumotion/trunk/flumotion/component/producers/audiotest/audiotest_wizard.py
==============================================================================
--- (empty file)
+++ flumotion/trunk/flumotion/component/producers/audiotest/audiotest_wizard.py	Wed Jan  9 18:01:33 2008
@@ -0,0 +1,69 @@
+# -*- Mode: Python -*-
+# vi:si:et:sw=4:sts=4:ts=4
+#
+# Flumotion - a streaming media server
+# Copyright (C) 2008 Fluendo, S.L. (www.fluendo.com).
+# All rights reserved.
+
+# This file may be distributed and/or modified under the terms of
+# the GNU General Public License version 2 as published by
+# the Free Software Foundation.
+# This file is distributed without any warranty; without even the implied
+# warranty of merchantability or fitness for a particular purpose.
+# See "LICENSE.GPL" in the source distribution for more information.
+
+# Licensees having purchased or holding a valid Flumotion Advanced
+# Streaming Server license may use this file in accordance with the
+# Flumotion Advanced Streaming Server Commercial License Agreement.
+# See "LICENSE.Flumotion" in the source distribution for more information.
+
+# Headers in this file shall remain intact.
+
+import gettext
+import os
+
+from flumotion.wizard.basesteps import AudioSourceStep
+
+__version__ = "$Rev$"
+_ = gettext.gettext
+
+
+class TestAudioSourceStep(AudioSourceStep):
+    name = _('Test Audio Source')
+    glade_file = os.path.join(os.path.dirname(os.path.abspath(__file__)),
+                              'audiotest-wizard.glade')
+    icon = 'soundcard.png'
+
+    # WizardStep
+
+    def setup(self):
+        self.rate.data_type = str
+        self.volume.data_type = float
+
+        self.rate.prefill(['8000',
+                           '16000',
+                           '32000',
+                           '44100'])
+
+        self.model.properties.rate = '44100'
+
+        self.add_proxy(self.model.properties,
+                       ['frequency', 'volume', 'rate'])
+
+        self.rate.set_sensitive(True)
+
+    def worker_changed(self):
+        self.model.worker = self.worker
+        self.wizard.require_elements(self.worker, 'audiotestsrc')
+
+    def get_next(self):
+        return None
+
+
+class AudioTestWizardPlugin(object):
+    def __init__(self, wizard):
+        self.wizard = wizard
+
+    def get_production_step(self):
+        return TestAudioSourceStep
+

Modified: flumotion/trunk/flumotion/component/producers/videotest/Makefile.am
==============================================================================
--- flumotion/trunk/flumotion/component/producers/videotest/Makefile.am	(original)
+++ flumotion/trunk/flumotion/component/producers/videotest/Makefile.am	Wed Jan  9 18:01:33 2008
@@ -1,8 +1,16 @@
 include $(top_srcdir)/common/python.mk
 
-component_PYTHON = __init__.py videotest.py admin_gtk.py admin_text.py
+component_PYTHON = 		\
+	__init__.py		\
+	admin_gtk.py		\
+	admin_text.py		\
+	videotest.py		\
+	videotest_wizard.py
+
 componentdir = $(libdir)/flumotion/python/flumotion/component/producers/videotest
-component_DATA = videotest.xml
+component_DATA = \
+	videotest.xml		\
+	videotest-wizard.glade
 
 clean-local:
 	rm -rf *.pyc *.pyo

Added: flumotion/trunk/flumotion/component/producers/videotest/videotest-wizard.glade
==============================================================================
--- (empty file)
+++ flumotion/trunk/flumotion/component/producers/videotest/videotest-wizard.glade	Wed Jan  9 18:01:33 2008
@@ -0,0 +1,276 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
+
+<glade-interface>
+
+<widget class="GtkWindow" id="window1">
+  <property name="title" translatable="yes">window1</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">False</property>
+  <property name="resizable">True</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="decorated">True</property>
+  <property name="skip_taskbar_hint">False</property>
+  <property name="skip_pager_hint">False</property>
+  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+  <property name="focus_on_map">True</property>
+  <property name="urgency_hint">False</property>
+
+  <child>
+    <widget class="GtkTable" id="table1">
+      <property name="visible">True</property>
+      <property name="n_rows">5</property>
+      <property name="n_columns">2</property>
+      <property name="homogeneous">False</property>
+      <property name="row_spacing">6</property>
+      <property name="column_spacing">12</property>
+
+      <child>
+	<widget class="GtkLabel" id="label1">
+	  <property name="visible">True</property>
+	  <property name="label" translatable="yes">_Width:</property>
+	  <property name="use_underline">True</property>
+	  <property name="use_markup">False</property>
+	  <property name="justify">GTK_JUSTIFY_LEFT</property>
+	  <property name="wrap">False</property>
+	  <property name="selectable">False</property>
+	  <property name="xalign">1</property>
+	  <property name="yalign">0.5</property>
+	  <property name="xpad">0</property>
+	  <property name="ypad">0</property>
+	  <property name="mnemonic_widget">spinbutton_width</property>
+	  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	  <property name="width_chars">-1</property>
+	  <property name="single_line_mode">False</property>
+	  <property name="angle">0</property>
+	</widget>
+	<packing>
+	  <property name="left_attach">0</property>
+	  <property name="right_attach">1</property>
+	  <property name="top_attach">0</property>
+	  <property name="bottom_attach">1</property>
+	  <property name="x_options">fill</property>
+	  <property name="y_options"></property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkLabel" id="label2">
+	  <property name="visible">True</property>
+	  <property name="label" translatable="yes">_Height:</property>
+	  <property name="use_underline">True</property>
+	  <property name="use_markup">False</property>
+	  <property name="justify">GTK_JUSTIFY_LEFT</property>
+	  <property name="wrap">False</property>
+	  <property name="selectable">False</property>
+	  <property name="xalign">1</property>
+	  <property name="yalign">0.5</property>
+	  <property name="xpad">0</property>
+	  <property name="ypad">0</property>
+	  <property name="mnemonic_widget">spinbutton_height</property>
+	  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	  <property name="width_chars">-1</property>
+	  <property name="single_line_mode">False</property>
+	  <property name="angle">0</property>
+	</widget>
+	<packing>
+	  <property name="left_attach">0</property>
+	  <property name="right_attach">1</property>
+	  <property name="top_attach">1</property>
+	  <property name="bottom_attach">2</property>
+	  <property name="x_options">fill</property>
+	  <property name="y_options"></property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkLabel" id="label3">
+	  <property name="visible">True</property>
+	  <property name="label" translatable="yes">F_ramerate:</property>
+	  <property name="use_underline">True</property>
+	  <property name="use_markup">False</property>
+	  <property name="justify">GTK_JUSTIFY_LEFT</property>
+	  <property name="wrap">False</property>
+	  <property name="selectable">False</property>
+	  <property name="xalign">1</property>
+	  <property name="yalign">0.5</property>
+	  <property name="xpad">0</property>
+	  <property name="ypad">0</property>
+	  <property name="mnemonic_widget">spinbutton_framerate</property>
+	  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	  <property name="width_chars">-1</property>
+	  <property name="single_line_mode">False</property>
+	  <property name="angle">0</property>
+	</widget>
+	<packing>
+	  <property name="left_attach">0</property>
+	  <property name="right_attach">1</property>
+	  <property name="top_attach">2</property>
+	  <property name="bottom_attach">3</property>
+	  <property name="x_options">fill</property>
+	  <property name="y_options"></property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkLabel" id="label4">
+	  <property name="visible">True</property>
+	  <property name="label" translatable="yes">F_ormat:</property>
+	  <property name="use_underline">True</property>
+	  <property name="use_markup">False</property>
+	  <property name="justify">GTK_JUSTIFY_LEFT</property>
+	  <property name="wrap">False</property>
+	  <property name="selectable">False</property>
+	  <property name="xalign">1</property>
+	  <property name="yalign">0.5</property>
+	  <property name="xpad">0</property>
+	  <property name="ypad">0</property>
+	  <property name="mnemonic_widget">format</property>
+	  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	  <property name="width_chars">-1</property>
+	  <property name="single_line_mode">False</property>
+	  <property name="angle">0</property>
+	</widget>
+	<packing>
+	  <property name="left_attach">0</property>
+	  <property name="right_attach">1</property>
+	  <property name="top_attach">3</property>
+	  <property name="bottom_attach">4</property>
+	  <property name="x_options">fill</property>
+	  <property name="y_options"></property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkLabel" id="label5">
+	  <property name="visible">True</property>
+	  <property name="label" translatable="yes">_Pattern:</property>
+	  <property name="use_underline">True</property>
+	  <property name="use_markup">False</property>
+	  <property name="justify">GTK_JUSTIFY_LEFT</property>
+	  <property name="wrap">False</property>
+	  <property name="selectable">False</property>
+	  <property name="xalign">1</property>
+	  <property name="yalign">0.5</property>
+	  <property name="xpad">0</property>
+	  <property name="ypad">0</property>
+	  <property name="mnemonic_widget">pattern</property>
+	  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	  <property name="width_chars">-1</property>
+	  <property name="single_line_mode">False</property>
+	  <property name="angle">0</property>
+	</widget>
+	<packing>
+	  <property name="left_attach">0</property>
+	  <property name="right_attach">1</property>
+	  <property name="top_attach">4</property>
+	  <property name="bottom_attach">5</property>
+	  <property name="x_options">fill</property>
+	  <property name="y_options"></property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkComboBox" id="pattern">
+	  <property name="visible">True</property>
+	  <property name="add_tearoffs">False</property>
+	  <property name="focus_on_click">True</property>
+	</widget>
+	<packing>
+	  <property name="left_attach">1</property>
+	  <property name="right_attach">2</property>
+	  <property name="top_attach">4</property>
+	  <property name="bottom_attach">5</property>
+	  <property name="x_options">fill</property>
+	  <property name="y_options">fill</property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkSpinButton" id="width">
+	  <property name="visible">True</property>
+	  <property name="can_focus">True</property>
+	  <property name="climb_rate">1</property>
+	  <property name="digits">0</property>
+	  <property name="numeric">False</property>
+	  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+	  <property name="snap_to_ticks">False</property>
+	  <property name="wrap">False</property>
+	  <property name="adjustment">320 16 1024 1 16 10</property>
+	</widget>
+	<packing>
+	  <property name="left_attach">1</property>
+	  <property name="right_attach">2</property>
+	  <property name="top_attach">0</property>
+	  <property name="bottom_attach">1</property>
+	  <property name="x_options">fill</property>
+	  <property name="y_options"></property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkSpinButton" id="height">
+	  <property name="visible">True</property>
+	  <property name="can_focus">True</property>
+	  <property name="climb_rate">1</property>
+	  <property name="digits">0</property>
+	  <property name="numeric">False</property>
+	  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+	  <property name="snap_to_ticks">False</property>
+	  <property name="wrap">False</property>
+	  <property name="adjustment">240 16 768 1 16 10</property>
+	</widget>
+	<packing>
+	  <property name="left_attach">1</property>
+	  <property name="right_attach">2</property>
+	  <property name="top_attach">1</property>
+	  <property name="bottom_attach">2</property>
+	  <property name="x_options">fill</property>
+	  <property name="y_options"></property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkSpinButton" id="framerate">
+	  <property name="visible">True</property>
+	  <property name="can_focus">True</property>
+	  <property name="climb_rate">1</property>
+	  <property name="digits">4</property>
+	  <property name="numeric">False</property>
+	  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+	  <property name="snap_to_ticks">False</property>
+	  <property name="wrap">False</property>
+	  <property name="adjustment">5 0 100 0.1 1 10</property>
+	</widget>
+	<packing>
+	  <property name="left_attach">1</property>
+	  <property name="right_attach">2</property>
+	  <property name="top_attach">2</property>
+	  <property name="bottom_attach">3</property>
+	  <property name="x_options">fill</property>
+	  <property name="y_options"></property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkComboBox" id="format">
+	  <property name="visible">True</property>
+	  <property name="add_tearoffs">False</property>
+	  <property name="focus_on_click">True</property>
+	</widget>
+	<packing>
+	  <property name="left_attach">1</property>
+	  <property name="right_attach">2</property>
+	  <property name="top_attach">3</property>
+	  <property name="bottom_attach">4</property>
+	  <property name="x_options">fill</property>
+	  <property name="y_options">fill</property>
+	</packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
+</glade-interface>

Modified: flumotion/trunk/flumotion/component/producers/videotest/videotest.xml
==============================================================================
--- flumotion/trunk/flumotion/component/producers/videotest/videotest.xml	(original)
+++ flumotion/trunk/flumotion/component/producers/videotest/videotest.xml	Wed Jan  9 18:01:33 2008
@@ -16,6 +16,8 @@
                function="GUIClass" />
         <entry type="admin/text" location="admin_text.py"
                function="UIClass" />
+        <entry type="wizard" location="videotest_wizard.py"
+               function="VideoTestWizardPlugin" />
       </entries>
 
       <properties>
@@ -89,6 +91,20 @@
         </directories>
     </bundle>
 
-  </bundles>
+    <bundle name="videotest-wizard">
+        <dependencies>
+            <dependency name="videotest-producer-base" />
+            <dependency name="component" />
+        </dependencies>
+
+        <directories>
+            <directory name="flumotion/component/producers/videotest">
+                <filename location="videotest-wizard.glade" />
+                <filename location="videotest_wizard.py" />
+            </directory>
+        </directories>
+    </bundle>
 
+  </bundles>
+  
 </registry> 

Added: flumotion/trunk/flumotion/component/producers/videotest/videotest_wizard.py
==============================================================================
--- (empty file)
+++ flumotion/trunk/flumotion/component/producers/videotest/videotest_wizard.py	Wed Jan  9 18:01:33 2008
@@ -0,0 +1,73 @@
+# -*- Mode: Python -*-
+# vi:si:et:sw=4:sts=4:ts=4
+#
+# Flumotion - a streaming media server
+# Copyright (C) 2008 Fluendo, S.L. (www.fluendo.com).
+# All rights reserved.
+
+# This file may be distributed and/or modified under the terms of
+# the GNU General Public License version 2 as published by
+# the Free Software Foundation.
+# This file is distributed without any warranty; without even the implied
+# warranty of merchantability or fitness for a particular purpose.
+# See "LICENSE.GPL" in the source distribution for more information.
+
+# Licensees having purchased or holding a valid Flumotion Advanced
+# Streaming Server license may use this file in accordance with the
+# Flumotion Advanced Streaming Server Commercial License Agreement.
+# See "LICENSE.Flumotion" in the source distribution for more information.
+
+# Headers in this file shall remain intact.
+
+import gettext
+import os
+
+from flumotion.wizard.basesteps import VideoSourceStep
+
+__version__ = "$Rev$"
+_ = gettext.gettext
+
+
+class TestVideoSourceStep(VideoSourceStep):
+    name = _('Test Video Source')
+    glade_file = os.path.join(os.path.dirname(os.path.abspath(__file__)),
+                              'videotest-wizard.glade')
+    component_type = 'videotestsrc'
+    icon = 'testsource.png'
+
+    # WizardStep
+
+    def setup(self):
+        self.pattern.data_type = int
+        self.format.data_type = str
+        self.framerate.data_type = float
+
+        self.pattern.prefill([
+            (_('SMPTE Color bars'), 0),
+            (_('Random (television snow)'), 1),
+            (_('Totally black'), 2)])
+        self.format.prefill([
+            (_('YUV'), 'video/x-raw-yuv'),
+            (_('RGB'), 'video/x-raw-rgb')])
+
+        self.model.properties.pattern = 0
+        self.model.properties.format = 'video/x-raw-yuv'
+
+        self.add_proxy(self.model.properties,
+                       ['pattern', 'width', 'height',
+                        'framerate', 'format'])
+
+    def before_show(self):
+        self.wizard.require_elements(self.worker, 'videotestsrc')
+
+    def worker_changed(self):
+        self.model.worker = self.worker
+
+
+class VideoTestWizardPlugin(object):
+    def __init__(self, wizard):
+        self.wizard = wizard
+
+    def get_production_step(self):
+        return TestVideoSourceStep
+

Modified: flumotion/trunk/flumotion/wizard/configurationwizard.py
==============================================================================
--- flumotion/trunk/flumotion/wizard/configurationwizard.py	(original)
+++ flumotion/trunk/flumotion/wizard/configurationwizard.py	Wed Jan  9 18:01:33 2008
@@ -28,6 +28,7 @@
 from twisted.internet import defer
 
 from flumotion.common import errors, messages
+from flumotion.common.common import pathToModuleName
 from flumotion.common.messages import N_, ngettext
 from flumotion.common.pygobject import gsignal
 from flumotion.ui.wizard import SectionWizard, WizardStep
@@ -348,6 +349,26 @@
         d.addCallback(callback)
         return d
 
+    def get_wizard_entry(self, component_type):
+        """
+        Fetches a wizard bundle from a specific kind of component
+        @param component_type: the component type to get the wizard entry
+          bundle from.
+        @returns: a deferred returning either::
+          - factory of the component
+          - noBundle error: if the component lacks a wizard bundle
+        """
+        def got_entry_point((filename, procname)):
+            modname = pathToModuleName(filename)
+            d = self._admin.getBundledFunction(modname, procname)
+            self.clear_msg('wizard-bundle')
+            return d
+
+        self.clear_msg('wizard-bundle')
+        d = self._admin.callRemote('getEntry', component_type, 'wizard')
+        d.addCallback(got_entry_point)
+        return d
+
     # Private
 
     def _setup_worker(self, step, worker):

Modified: flumotion/trunk/flumotion/wizard/productionsteps.py
==============================================================================
--- flumotion/trunk/flumotion/wizard/productionsteps.py	(original)
+++ flumotion/trunk/flumotion/wizard/productionsteps.py	Wed Jan  9 18:01:33 2008
@@ -25,8 +25,10 @@
 import math
 
 import gtk
+from twisted.internet.defer import Deferred
 
 from flumotion.common import errors, messages
+from flumotion.common.errors import NoBundleError
 from flumotion.common.messages import N_
 from flumotion.common.python import sorted
 from flumotion.wizard.basesteps import WorkerWizardStep, \
@@ -82,6 +84,9 @@
         @rtype: a L{VideoSourceStep} subclass
         """
         step_class = self._get_video_step_class()
+        if isinstance(step_class, Deferred):
+            return self._load_step(step_class, self._video_producer)
+
         return step_class(self.wizard, self._video_producer)
 
     def get_audio_step(self):
@@ -91,6 +96,9 @@
         @rtype: a L{AudioSourceStep} subclass
         """
         step_class = self._get_audio_step_class()
+        if isinstance(step_class, Deferred):
+            return self._load_step(step_class, self._audio_producer)
+
         return step_class(self.wizard, self._audio_producer)
 
     # WizardStep
@@ -107,18 +115,18 @@
             raise AssertionError
 
     def worker_changed(self):
-        if not isinstance(self._get_audio_step_class(), WorkerWizardStep):
-            self._audio_producer.worker = self.worker
-        if not isinstance(self._get_video_step_class(), WorkerWizardStep):
-            self._video_producer.worker = self.worker
+        if self.audio.get_selected() not in ['audiotest-producer']:
+            if not isinstance(self._get_audio_step_class(), WorkerWizardStep):
+                self._audio_producer.worker = self.worker
+        if self.video.get_selected() not in ['videotest-producer']:
+            if not isinstance(self._get_video_step_class(), WorkerWizardStep):
+                self._video_producer.worker = self.worker
 
     # Private API
 
     def _get_audio_step_class(self):
         source = self.audio.get_selected()
-        if source == 'audiotest-producer':
-            step_class = TestAudioSourceStep
-        elif source == 'soundcard-producer':
+        if source == 'soundcard-producer':
             step_class = SoundcardStep
         elif source == 'firewire-producer':
             # Only show firewire audio if we're using firewire video
@@ -126,21 +134,19 @@
                 return
             step_class = FireWireAudioStep
         else:
-            raise AssertionError(source)
+            step_class = self._load_plugin(source)
         return step_class
 
     def _get_video_step_class(self):
         source = self.video.get_selected()
-        if source == 'videotest-producer':
-            step_class = TestVideoSourceStep
-        elif source == 'webcam-producer':
+        if source == 'webcam-producer':
             step_class = WebcamStep
         elif source == 'tvcard-producer':
             step_class = TVCardStep
         elif source == 'firewire-producer':
             step_class = FireWireStep
         else:
-            raise AssertionError(source)
+            step_class = self._load_plugin(source)
         return step_class
 
     def _setup(self):
@@ -151,8 +157,11 @@
 
         self.audio.data_type = object
         self.video.data_type = object
+        # We want to save the audio/video attributes as
+        # component_type in the respective models
         self.audio.model_attribute = 'component_type'
         self.video.model_attribute = 'component_type'
+
         tips = gtk.Tooltips()
         tips.set_tip(self.has_video,
                      _('If you want to stream video'))
@@ -173,6 +182,30 @@
             (_('Firewire audio'), 'firewire-producer'),
             ])
 
+    def _load_plugin(self, component_type):
+        def got_factory(factory):
+            plugin = factory(self.wizard)
+            return plugin.get_production_step()
+
+        def noBundle(failure):
+            failure.trap(NoBundleError)
+
+        d = self.wizard.get_wizard_entry(component_type)
+        d.addCallback(got_factory)
+        d.addErrback(noBundle)
+
+        return d
+
+    def _load_step(self, d, producer):
+        def get_step_class(step_class):
+            step = step_class(self.wizard, producer)
+            if isinstance(step, WorkerWizardStep):
+                step.worker = self.worker
+                step.worker_changed()
+            return step
+        d.addCallback(get_step_class)
+        return d
+
     def _verify(self):
         # FIXME: We should wait for the first worker to connect before
         #        opening the wizard or so
@@ -220,39 +253,6 @@
         self._verify()
 
 
-class TestVideoSourceStep(VideoSourceStep):
-    name = _('Test Video Source')
-    glade_file = 'wizard_testsource.glade'
-    component_type = 'videotestsrc'
-    icon = 'testsource.png'
-
-    def __init__(self, wizard, model):
-        VideoSourceStep.__init__(self, wizard, model)
-
-    # WizardStep
-
-    def setup(self):
-        self.pattern.data_type = int
-        self.format.data_type = str
-        self.framerate.data_type = float
-
-        self.pattern.prefill([
-            (_('SMPTE Color bars'), 0),
-            (_('Random (television snow)'), 1),
-            (_('Totally black'), 2)])
-        self.format.prefill([
-            (_('YUV'), 'video/x-raw-yuv'),
-            (_('RGB'), 'video/x-raw-rgb')])
-
-        self.model.properties.pattern = 0
-        self.model.properties.format = 'video/x-raw-yuv'
-
-        self.add_proxy(self.model.properties,
-                       ['pattern', 'width', 'height',
-                        'framerate', 'format'])
-
-    def before_show(self):
-        self.wizard.require_elements(self.worker, 'videotestsrc')
 
 
 class WebcamStep(VideoSourceStep):
@@ -498,34 +498,6 @@
         self._run_checks()
 
 
-class TestAudioSourceStep(AudioSourceStep):
-    name = _('Test Audio Source')
-    glade_file = 'wizard_audiotest.glade'
-    icon = 'soundcard.png'
-
-    # WizardStep
-
-    def setup(self):
-        self.rate.data_type = str
-        self.volume.data_type = float
-
-        self.rate.prefill(['8000',
-                           '16000',
-                           '32000',
-                           '44100'])
-
-        self.model.properties.rate = '44100'
-
-        self.add_proxy(self.model.properties,
-                       ['frequency', 'volume', 'rate'])
-
-        self.rate.set_sensitive(True)
-
-    def worker_changed(self):
-        self.wizard.require_elements(self.worker, 'audiotestsrc')
-
-    def get_next(self):
-        return None
 
 
 OSS_DEVICES = ["/dev/dsp",

Modified: flumotion/trunk/po/POTFILES.in
==============================================================================
--- flumotion/trunk/po/POTFILES.in	(original)
+++ flumotion/trunk/po/POTFILES.in	Wed Jan  9 18:01:33 2008
@@ -68,6 +68,7 @@
 flumotion/component/producers/audiotest/audiotest.py
 flumotion/component/producers/audiotest/__init__.py
 flumotion/component/producers/audiotest/admin_gtk.py
+flumotion/component/producers/audiotest/audiotest_wizard.py
 flumotion/component/producers/soundcard/soundcard.py
 flumotion/component/producers/soundcard/__init__.py
 flumotion/component/producers/soundcard/admin_gtk.py
@@ -108,6 +109,7 @@
 flumotion/component/producers/videotest/videotest.py
 flumotion/component/producers/videotest/__init__.py
 flumotion/component/producers/videotest/admin_gtk.py
+flumotion/component/producers/videotest/videotest_wizard.py
 flumotion/component/combiners/composite/composite.py
 flumotion/component/combiners/composite/__init__.py
 flumotion/component/combiners/switch/basicwatchdog.py
@@ -392,16 +394,16 @@
 data/glade/wizard_consumption.glade
 data/glade/greeter-authenticate.glade
 data/glade/wizard_jpeg.glade
-data/glade/wizard_testsource.glade
 data/glade/greeter-connect_to_existing.glade
 data/glade/wizard_disk.glade
-data/glade/wizard_audiotest.glade
 data/glade/wizard_shout2.glade
 data/glade/wizard_firewire.glade
 flumotion/component/producers/audiotest/audiotest.glade
+flumotion/component/producers/audiotest/audiotest-wizard.glade
 flumotion/component/producers/bttv/colorbalance.glade
 flumotion/component/producers/looper/flufileinfo.glade
 flumotion/component/producers/looper/looper.glade
+flumotion/component/producers/videotest/videotest-wizard.glade
 flumotion/component/misc/httpfile/httpfile.glade
 flumotion/component/consumers/disker/disker.glade
 flumotion/component/consumers/httpstreamer/http.glade


More information about the flumotion-commit mailing list