Beispiel #1
0
    def onChangeThumbFPS(self, event):
        input = gbl.correctType(self.thumbFPS.GetValue(), 'thumbFPS')

        if input <> self.thumbFPS:
            if not (type(input) == int or type(input) == float):
                input = gbl.thumb_fps  # don't change the value if input wasn't a number

            gbl.cfg_dict[self.mon_ID]['thumb_fps'] = gbl.thumb_fps = input

            for mon_ID in range(1, gbl.monitors + 1):
                self.scrolledThumbs.thumbPanels[
                    mon_ID].monitorPanel.interval = 1000 / input
                if self.scrolledThumbs.thumbPanels[
                        mon_ID].monitorPanel.playTimer.IsRunning():
                    self.scrolledThumbs.thumbPanels[
                        mon_ID].monitorPanel.playTimer.Stop()
                    self.scrolledThumbs.thumbPanels[
                        mon_ID].monitorPanel.playTimer.Start(1000 / input)

            self.thumbFPS.ChangeValue(str(input))
            gbl.shouldSaveCfg = True

        self.scrolledThumbs.clearGrid(self.panelType)
        self.scrolledThumbs.refreshGrid(self.panelType)
        self.onScreenUpdate(event)
    def onChangeSourceFPS(self, event):
        input = gbl.correctType(self.sourceFPS.GetValue(), 'source_fps')
        if not (type(input) == int or type(input) == float):
            input = self.source_fps  # don't change the value if input wasn't a number
            self.sourceFPS.SetValue(input)

        gbl.cfg_dict[self.mon_ID][
            'source_fps'] = gbl.source_fps = gbl.source_fps = input  # update self & cfg_dict
        self.startDate.SetFocus()
    def onChangePreviewFPS(self, event):
        input = gbl.correctType(self.previewFPS.GetValue(), 'preview_fps')
        if not (type(input) == int or type(input) == float):
            input = self.preview_fps  # don't change the value if input wasn't a number

        gbl.cfg_dict[self.mon_ID][
            'preview_fps'] = gbl.preview_fps = self.preview_fps = input  # update self & cfg_dict

        self.refreshVideo()  # close and restart video playback
        self.lineThickness.SetFocus()
    def onChangeThumbFPS(self, event):
        input = gbl.correctType(self.thumbFPS.GetValue(), 'thumb_fps')
        if not (type(input) == int or type(input) == float):
            input = gbl.thumb_fps                         # don't change the value if input wasn't a number
            self.thumbSize.SetValue(input)

        gbl.cfg_dict[self.mon_ID]['thumb_fps'] = gbl.thumb_fps = input
        cfg.cfg_nicknames_to_dicts()
        self.scrolledThumbs.refreshThumbGrid()              # refresh thumbnails
        self.thumbSize.SetFocus()
    def onChangePreviewSize(self, event):
        input = gbl.correctType(
            self.previewSize.GetValue(),
            'preview_size')  # keep this incase new value is invalid
        if type(input) != tuple:
            input = self.preview_size

        gbl.cfg_dict[self.mon_ID][
            'preview_size'] = gbl.preview_size = self.preview_size = input  # update self & cfg_dict

        self.refreshVideo()  # close and restart video playback
        self.previewFPS.SetFocus()
Beispiel #6
0
    def getValue(self, section, key):       # ------------- get cfg object string and convert into value of correct type
        """
        get value from config file based on section and keyword
        Do some sanity checking to return tuple, integer and strings, datetimes, as required.
        """
        if  not self.cfg_Obj.has_option(section, key):                       # does option exist?
            r = None
            return r

        r = self.cfg_Obj.get(section, key)

        r = gbl.correctType(r, key)

        return r
Beispiel #7
0
    def getValue(self, section, key):
        """
        get value from config file based on section and keyword
        Do some sanity checking to return tuple, integer and strings, datetimes, as required.
        """
        if not self.cfg_Obj.has_option(section, key):  # does option exist?
            r = None
            return r

        r = self.cfg_Obj.get(section, key)  # get the value from cfg_obj

        r = gbl.correctType(r, key)  # sanity checker

        return r
    def onChangeThumbSize(self, event):
        input = gbl.correctType(self.thumbSize.GetValue(), 'thumb_size')
        if type(input) != tuple:
            input = gbl.preview_size
            self.thumbSize.SetValue(input)

        gbl.cfg_dict[self.mon_ID]['thumb_size'] = gbl.thumb_size = input           # update self & cfg_dict
        cfg.cfg_nicknames_to_dicts()
        try:
            self.scrolledThumbs.thumbPanels[1].monitorPanel
            self.scrolledThumbs.refreshThumbGrid()              # refresh thumbnails
        except:
            self.scrolledThumbs.thumbPanels[1].trackedMonitor
            self.scrolledThumbs[0].refreshConsoleGrid()              # refresh consoles

        self.thumbFPS.SetFocus()
Beispiel #9
0
    def onChangeThumbSize(self, event):
        gbl.shouldSaveCfg = True
        input = gbl.correctType(self.thumbSize.GetValue(), 'thumbSize')
        if type(input) != tuple:
            input = gbl.preview_size  # don't change anything if input was not a tuple

        self.thumbSize.ChangeValue(str(input))
        gbl.cfg_dict[self.mon_ID][
            'thumb_size'] = gbl.thumb_size = input  # update self & cfg_dict
        cfg.cfg_nicknames_to_dicts()

        for mon_ID in range(1, gbl.monitors + 1):
            self.scrolledThumbs.thumbPanels[
                mon_ID].monitorPanel.panelSize = input

        self.scrolledThumbs.clearGrid(self.panelType)
        self.scrolledThumbs.refreshGrid(self.panelType)
        self.onScreenUpdate(event)