# Path: flumotion/component/common/avproducer/admin_gtk.py
# class AVProducerAdminGtk(admin_gtk.BaseAdminGtk):
# 
#     def setup(self):
#         volume = VolumeAdminGtkNode(self.state, self.admin,
#                                     'inputVolume', 'Input Volume')
#         self.nodes['Volume'] = volume
#         deinterlace = DeinterlaceAdminGtkNode(self.state, self.admin,
#                                     'deinterlace', 'Deinterlacing')
#         self.nodes['Deinterlace'] = deinterlace
#         if 'FLU_VIDEOSCALE_DEBUG' in os.environ:
#             videoscale = VideoscaleAdminGtkNode(self.state, self.admin,
#                 'videoscale', 'Video scaling')
#             self.nodes['Videoscale'] = videoscale
#         return admin_gtk.BaseAdminGtk.setup(self)
# 
#     def component_volumeChanged(self, channel, rms, peak, decay):
#         volume = self.nodes['Volume']
#         volume.volumeChanged(channel, rms, peak, decay)
# 
#     def component_effectVolumeSet(self, effect, volume):
#         """
#         @param volume: volume multiplier between 0.0 and 4.0
#         @type  volume: float
#         """
#         if effect != 'inputVolume':
#             self.warning('Unknown effect %s in %r' % (effect, self))
#             return
#         v = self.nodes['Volume']
#         v.volumeSet(volume)
# 
#     def component_effectModeSet(self, effect, mode):
#         """
#         @param mode: deinterlace mode
#         @type  volume: string
#         """
#         if effect != 'deinterlace':
#             self.warning('Unknown effect %s in %r' % (effect, self))
#             return
#         v = self.nodes['Deinterlace']
#         v.modeSet(mode)
# 
#     def component_effectMethodSet(self, effect, mode):
#         """
#         @param mode: deinterlace method
#         @type  volume: string
#         """
#         if effect != 'deinterlace':
#             self.warning('Unknown effect %s in %r' % (effect, self))
#             return
#         v = self.nodes['Deinterlace']
#         v.methodSet(mode)
# 
#     def component_effectWidthSet(self, effect, width):
#         if effect != 'videoscale':
#             self.warning('Unknown effect %s in %r' % (effect, self))
#             return
#         v = self.nodes['Videoscale']
#         v.widthSet(width)


import os
import gettext
import gst
from flumotion.component.base.baseadminnode import BaseAdminGtkNode
from flumotion.component.common.avproducer.admin_gtk import AVProducerAdminGtk
from flumotion.ui.glade import GladeWidget
                time_to_string(newposition % self.fileinfowidget.duration))

    def numIterationsSet(self, numIterations):
        self.numiterlabel.set_text(str(numIterations))

    def _restart_callback(self, result):
        pass

    def _restart_failed(self, failure):
        self.warning("Failure %s getting pattern: %s" % (
            failure.type, failure.getErrorMessage()))
        return None

    def _reset_button_clicked(self, button):
        d = self.callRemote("gimme5", "ooooh yeah")
        d.addCallback(self._restart_callback)
        d.addErrback(self._restart_failed)

    def stateSet(self, state, key, value):
        handler = self.uiStateHandlers.get(key, None)
        if handler:
            handler(value)


class LooperAdminGtk(AVProducerAdminGtk):

    def setup(self):
        looper = LooperNode(self.state, self.admin, title=_("Looper"))
        self.nodes['Looper'] = looper


# Path: flumotion/component/common/avproducer/admin_gtk.py
# class AVProducerAdminGtk(admin_gtk.BaseAdminGtk):
# 
#     def setup(self):
#         volume = VolumeAdminGtkNode(self.state, self.admin,
#                                     'inputVolume', 'Input Volume')
#         self.nodes['Volume'] = volume
#         deinterlace = DeinterlaceAdminGtkNode(self.state, self.admin,
#                                     'deinterlace', 'Deinterlacing')
#         self.nodes['Deinterlace'] = deinterlace
#         if 'FLU_VIDEOSCALE_DEBUG' in os.environ:
#             videoscale = VideoscaleAdminGtkNode(self.state, self.admin,
#                 'videoscale', 'Video scaling')
#             self.nodes['Videoscale'] = videoscale
#         return admin_gtk.BaseAdminGtk.setup(self)
# 
#     def component_volumeChanged(self, channel, rms, peak, decay):
#         volume = self.nodes['Volume']
#         volume.volumeChanged(channel, rms, peak, decay)
# 
#     def component_effectVolumeSet(self, effect, volume):
#         """
#         @param volume: volume multiplier between 0.0 and 4.0
#         @type  volume: float
#         """
#         if effect != 'inputVolume':
#             self.warning('Unknown effect %s in %r' % (effect, self))
#             return
#         v = self.nodes['Volume']
#         v.volumeSet(volume)
# 
#     def component_effectModeSet(self, effect, mode):
#         """
#         @param mode: deinterlace mode
#         @type  volume: string
#         """
#         if effect != 'deinterlace':
#             self.warning('Unknown effect %s in %r' % (effect, self))
#             return
#         v = self.nodes['Deinterlace']
#         v.modeSet(mode)
# 
#     def component_effectMethodSet(self, effect, mode):
#         """
#         @param mode: deinterlace method
#         @type  volume: string
#         """
#         if effect != 'deinterlace':
#             self.warning('Unknown effect %s in %r' % (effect, self))
#             return
#         v = self.nodes['Deinterlace']
#         v.methodSet(mode)
# 
#     def component_effectWidthSet(self, effect, width):
#         if effect != 'videoscale':
#             self.warning('Unknown effect %s in %r' % (effect, self))
#             return
#         v = self.nodes['Videoscale']
#         v.widthSet(width)


# Path: flumotion/component/producers/looper/admin_gtk.py
import os
import gettext
import gst
from flumotion.component.base.baseadminnode import BaseAdminGtkNode
from flumotion.component.common.avproducer.admin_gtk import AVProducerAdminGtk
from flumotion.ui.glade import GladeWidget

                time_to_string(newposition % self.fileinfowidget.duration))

    def numIterationsSet(self, numIterations):
        self.numiterlabel.set_text(str(numIterations))

    def _restart_callback(self, result):
        pass

    def _restart_failed(self, failure):
        self.warning("Failure %s getting pattern: %s" % (
            failure.type, failure.getErrorMessage()))
        return None

    def _reset_button_clicked(self, button):
        d = self.callRemote("gimme5", "ooooh yeah")
        d.addCallback(self._restart_callback)
        d.addErrback(self._restart_failed)

    def stateSet(self, state, key, value):
        handler = self.uiStateHandlers.get(key, None)
        if handler:
            handler(value)


class LooperAdminGtk(AVProducerAdminGtk):

    def setup(self):
        looper = LooperNode(self.state, self.admin, title=_("Looper"))
        self.nodes['Looper'] = looper


        return AVProducerAdminGtk.setup(self)