示例#1
0
 def visualize(self, replays, beatmap_id, result):
     # only run one instance at a time
     if self.visualizer is not None:
         self.visualizer.close()
     snaps = []
     if isinstance(result, CorrectionResult):
         snaps = [snap.time for snap in result.snaps]
     beatmap_info = BeatmapInfo(map_id=beatmap_id)
     if not get_setting("render_beatmap"):
         # don't give the visualizer any beatmap info if the user doesn't
         # want it rendered
         beatmap_info = BeatmapInfo()
     self.visualizer = CGVisualizer(beatmap_info, replays, snaps, self.library)
     self.visualizer.show()
示例#2
0
    def show_visualizer(self):
        from circlevis import BeatmapInfo
        from circleguard import InvalidKeyException

        loadables = self.all_loadables()
        try:
            map_ids = [loadable.map_id for loadable in loadables]

            # if there are any duplicate maps, warn the user and don't proceed
            if len(set(map_ids)) > 1:
                message = (
                    "You can only visualize replays from the same map. "
                    f"The map ids present are {', '.join(str(map_id) for map_id in map_ids)}."
                )
                self.show_exception_signal.emit(message)
                return

            beatmap_info = BeatmapInfo(map_id=loadables[0].map_id)
            CGVisualizer = get_visualizer()

            # TODO reuse global library here
            self.visualizer = CGVisualizer(beatmap_info, loadables)
            self.visualizer.show()
        except InvalidKeyException as e:
            message = ("Please enter a valid api key in the settings before "
                       "visualizing replays.")
            self.show_exception_signal.emit(message)
        except Exception as e:
            self.set_progressbar_signal.emit(-1)
            self.update_label_signal.emit("Idle")
            self.show_exception_signal.emit(str(e))
示例#3
0
 def visualize(self):
     if self.visualizer is not None:
         self.visualizer.close()
     beatmap_info = BeatmapInfo(path=self.beatmaptest.file_chooser.path)
     # TODO pass the library we define in MainTab to CGVIsualizer,
     # probably will have to rework some things entirely
     self.visualizer = CGVisualizer(beatmap_info)
     self.visualizer.show()
示例#4
0
 def visualize(self, replays, beatmap_id, result, start_at=0):
     from circlevis import BeatmapInfo
     # only run one instance at a time
     if self.visualizer is not None:
         self.visualizer.close()
     snaps = []
     if isinstance(result, CorrectionResult):
         snaps = [snap.time for snap in result.snaps]
     beatmap_info = BeatmapInfo(map_id=beatmap_id)
     CGVisualizer = get_visualizer()
     self.visualizer = CGVisualizer(beatmap_info, replays, snaps, self.library)
     self.visualizer.show()
     if start_at != 0:
         self.visualizer.seek_to(start_at)
         self.visualizer.pause()
示例#5
0
    def show_visualizer(self):
        from circlevis import BeatmapInfo
        loadables = self.all_loadables()
        map_ids = [loadable.map_id for loadable in loadables]

        # if there are any duplicate maps, warn the user and don't proceed
        if len(set(map_ids)) > 1:
            message_box = QMessageBox()
            message_box.setText(
                f"You can only visualize replays from the same "
                f"map. The map ids present are {', '.join(str(map_id) for map_id in map_ids)}."
            )
            message_box.exec()
            return

        beatmap_info = BeatmapInfo(map_id=loadables[0].map_id)
        CGVisualizer = get_visualizer()

        # TODO reuse global library here
        self.visualizer = CGVisualizer(beatmap_info, loadables)
        self.visualizer.show()