Skip to main content

A Qt Widget that displays a beatmap, and an arbitrary amount of replays.

Project description

Circlevis

Circlevis is the replay viewer (aka visualizer) in Circleguard. It was split off into its own repository to allow other projects to use it, should they so choose.

Circlevis is a Qt widget, and will only work if you are using the Qt (or pyqt, as we are) GUI framwork.

Installation

Circlevis can be installed from pip:

pip install circlevis

Usage

Circlevis can be used in two ways:

VisualizerApp

The easiest way is to instantiate a VisualizerApp, which subclasses QApplication so you don't have to create a main application yourself. This is best for quick visualization, when you only want to open circlevis and nothing else.

from circleguard import *
from circlevis import VisualizerApp, BeatmapInfo

cg = Circleguard("key")
r = ReplayMap(509610, 6304246)
# replays must be loaded before passed to the visualizer
cg.load(r)

# BeatmapInfo tells circlevis how it should load the beatmap before it displays
# it. You can pass either a map id (in which case circlevis will download the map
# from osu!'s servers) or a path to a .osu file (in which case circlevis will
# load the beatmap from that file).
# If you don't want any beatmap to be displayed, instantiate an empty BeatmapInfo
# (bm = BeatmapInfo()) and pass that to the visualizer.
bm = BeatmapInfo(map_id=r.map_id)
app = VisualizerApp(bm, replays=[r])
# this calls qt's `exec` function, which shows the application and enters the
# gui run loop, blocking any code after this call.
app.exec()

You can also visualize only a map, without any replay:

from circlevis import VisualizerApp, BeatmapInfo

bm = BeatmapInfo(map_id=509610)
app = VisualizerApp(bm)
app.exec()

Visualizer

If you want to integrate the visualizer into an existing project (which already has its own QApplication), you should instead instantiate the Visualizer class, which is a normal Qt widget and can be added to a layout like any other widget.

from circleguard import *
from circlevis import Visualizer, BeatmapInfo

cg = Circleguard("key")
r = ReplayMap(509610, 6304246)
cg.load(r)

bm = BeatmapInfo(map_id=r.map_id)
visualizer_widget = Visualizer(bm, replays=[r])

# add visualizer_widget to your layout here

Advanced Usage

You may have noticed that both VisualizerApp and Visualizer take several arguments beyond just a BeatmapInfo and list of Replays. A short explanation of each follows:

  • events - a list of timestamps (in ms). If a frame with that timestamp is found in the replay, it is colored gold
  • library - A slider Library class, which will be used instead of creating a new one if passed
  • speeds - a list of possible speeds the visualizer can play at. These can be switched between in real time with the speed up or speed down icons on the visualizer, or by pressing the up or down keys
  • start_speed - which speed to start playback at. This value must be in speeds
  • paint_info - whether to draw information about the map and replays in the upper left hand corner

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

circlevis-1.0.0.tar.gz (114.7 kB view details)

Uploaded Source

Built Distribution

circlevis-1.0.0-py3-none-any.whl (132.0 kB view details)

Uploaded Python 3

File details

Details for the file circlevis-1.0.0.tar.gz.

File metadata

  • Download URL: circlevis-1.0.0.tar.gz
  • Upload date:
  • Size: 114.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.2

File hashes

Hashes for circlevis-1.0.0.tar.gz
Algorithm Hash digest
SHA256 4e6f7ecbbf76a21c38a8cf575d307cee8176ca502dd34e43d129036f99b6fd6c
MD5 c1074e3e03d3cb37e4813fdff904a159
BLAKE2b-256 b0ce31aaded57fd68416584e78e63a2867138d62d8e1a9af86e26348786fbe3c

See more details on using hashes here.

File details

Details for the file circlevis-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: circlevis-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 132.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.2

File hashes

Hashes for circlevis-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8c52d10dc20db144b4b925c90ee49b892321c0a0f1f072d5ad363922b58769e3
MD5 3a1eba540880458ff1a5b135b1c966a1
BLAKE2b-256 3371bdfbd2ebf1b94aa087f133592b8a9fd711baefeb5df0f5dfb8ea878a53f8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page