コード例 #1
0
 def ptz_get_sensitivity(self):
     if self.camera_type == FOSCAM_HD or self.camera_type == FOSCAM_HD_OVERRIDE:
         return settings.getSetting_float(
             'ptz_hd_sensitivity%s' % self.camera_number) / 10
     elif self.camera_type == FOSCAM_SD:
         return self.camera.ptz_set_sensitivity(
             settings.getSetting('ptz_sd_sensitivity%s' %
                                 self.camera_number))
コード例 #2
0
    def __init__(self, camera, monitor):
        self.camera = camera
        self.monitor = monitor
        self.cond_service = settings.getSetting_int('cond_service', self.camera.number)
        self.cond_manual = settings.getSetting_int('cond_manual', self.camera.number)
        self.dur_service = settings.getSetting_int('dur_service', self.camera.number)
        self.dur_manual = settings.getSetting_int('dur_manual', self.camera.number)
        self.prefix = 'Preview'
        self.buttons = []
        
        # Positioning of the window       
        WIDTH = 320
        HEIGHT = 180
        
        scaling = settings.getSetting_float('scaling', self.camera.number)
        
        width = int(float(WIDTH * scaling))
        height = int(float(HEIGHT * scaling))
        
        button_scaling = 0.5 * scaling
        button_width = int(round(Button.WIDTH * button_scaling))
        
        position = settings.getSetting('position', self.camera.number).lower()
        if 'bottom' in position:
            y = 720 - height
        else:
            y = 0

        if 'left' in position:
            x = 0
            start = - width
        else:
            x = 1280 - width
            start = width

        animations = [('WindowOpen', ("effect=slide start={0:d} time=1300 tween=cubic easing=out").format(start)),
                      ('WindowClose', ("effect=slide end={0:d} time=900 tween=back easing=inout").format(start))]

        self.black = xbmcgui.ControlImage(x, y, width, height, _black)
        self.addControl(self.black)
        self.black.setAnimations(animations)
        
        self.img1 = xbmcgui.ControlImage(x, y, width, height, '')
        self.img2 = xbmcgui.ControlImage(x, y, width, height, '')
        self.addControl(self.img1)
        self.addControl(self.img2)
        self.img1.setAnimations(animations)
        self.img2.setAnimations(animations)

        self.close_button = Button(self, 'close', x + width - button_width - 10, y + 10, scaling=button_scaling)
        self.addControl(self.close_button)
        self.close_button.setAnimations(animations)                    
           
        self.setProperty('zorder', "99")

        self.playFullscreen = False
        self.stop() #Initializes state and makes ready to be used
コード例 #3
0
 def ptz_get_sensitivity(self):
     if self.camera_type == FOSCAM_HD or self.camera_type == FOSCAM_HD_OVERRIDE:
         return settings.getSetting_float('ptz_hd_sensitivity%s' %self.camera_number) / 10
     elif self.camera_type == FOSCAM_SD:
         return self.camera.ptz_set_sensitivity(settings.getSetting('ptz_sd_sensitivity%s' %self.camera_number))
コード例 #4
0
    def __init__(self, camera, monitor):
        self.camera = camera
        self.monitor = monitor
        self.cond_service = settings.getSetting_int('cond_service',
                                                    self.camera.number)
        self.cond_manual = settings.getSetting_int('cond_manual',
                                                   self.camera.number)
        self.dur_service = settings.getSetting_int('dur_service',
                                                   self.camera.number)
        self.dur_manual = settings.getSetting_int('dur_manual',
                                                  self.camera.number)
        self.prefix = 'Preview'
        self.buttons = []

        # Positioning of the window
        WIDTH = 320
        HEIGHT = 180

        scaling = settings.getSetting_float('scaling', self.camera.number)

        width = int(float(WIDTH * scaling))
        height = int(float(HEIGHT * scaling))

        button_scaling = 0.5 * scaling
        button_width = int(round(Button.WIDTH * button_scaling))

        position = settings.getSetting('position', self.camera.number).lower()
        if 'bottom' in position:
            y = 720 - height
        else:
            y = 0

        if 'left' in position:
            x = 0
            start = -width
        else:
            x = 1280 - width
            start = width

        animations = [
            ('WindowOpen',
             ("effect=slide start={0:d} time=1300 tween=cubic easing=out"
              ).format(start)),
            ('WindowClose',
             ("effect=slide end={0:d} time=900 tween=back easing=inout"
              ).format(start))
        ]

        self.black = xbmcgui.ControlImage(x, y, width, height, _black)
        self.addControl(self.black)
        self.black.setAnimations(animations)

        self.img1 = xbmcgui.ControlImage(x, y, width, height, '')
        self.img2 = xbmcgui.ControlImage(x, y, width, height, '')
        self.addControl(self.img1)
        self.addControl(self.img2)
        self.img1.setAnimations(animations)
        self.img2.setAnimations(animations)

        self.close_button = Button(self,
                                   'close',
                                   x + width - button_width - 10,
                                   y + 10,
                                   scaling=button_scaling)
        self.addControl(self.close_button)
        self.close_button.setAnimations(animations)

        self.setProperty('zorder', "99")

        self.playFullscreen = False
        self.stop()  #Initializes state and makes ready to be used