RhythmGame 1.4.3
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Member Functions | Properties | List of all members
gameplay_logic::ChartData Class Reference

Metadata and basic stats of a chart. More...

#include <ChartData.h>

Inheritance diagram for gameplay_logic::ChartData:
Inheritance graph
[legend]
Collaboration diagram for gameplay_logic::ChartData:
Collaboration graph
[legend]

Classes

struct  DTO
 
struct  PreparedData
 

Public Types

enum class  Keymode { K5 = 5 , K7 = 7 , K10 = 10 , K14 = 14 }
 
enum class  HistogramNoteType {
  Normal , Scratch , LongNote , BssNote ,
  Landmine , Invisible
}
 

Public Member Functions

auto clone (QObject *parent=nullptr) const -> std::unique_ptr< ChartData >
 
 ChartData (QString title, QString artist, QString subtitle, QString subartist, QString genre, QString stageFile, QString banner, QString backBmp, double rank, double total, int playLevel, int difficulty, bool isRandom, QList< qint64 > randomSequence, int normalNoteCount, int scratchCount, int lnCount, int bssCount, int mineCount, int64_t length, double initialBpm, double maxBpm, double minBpm, double mainBpm, double avgBpm, double peakDensity, double avgDensity, double endDensity, QString path, int64_t directory, QString sha256, QString md5, Keymode keymode, QList< QList< qint64 > > histogramData, QList< BpmChange > bpmChanges, quint64 gameVersion, QObject *parent=nullptr)
 
auto getTitle () const -> const QString &
 
auto getArtist () const -> const QString &
 
auto getSubtitle () const -> const QString &
 
auto getSubartist () const -> const QString &
 
auto getGenre () const -> const QString &
 
auto getStageFile () const -> const QString &
 
auto getBanner () const -> const QString &
 
auto getBackBmp () const -> const QString &
 
auto getStageFileSource () const -> QString
 
auto getBannerSource () const -> QString
 
auto getBackBmpSource () const -> QString
 
Q_INVOKABLE QString assetSource (const QString &relativePath) const
 
auto getNormalNoteCount () const -> int
 
auto getScratchCount () const -> int
 
auto getLnCount () const -> int
 
auto getBssCount () const -> int
 
auto getMineCount () const -> int
 
auto getLength () const -> int64_t
 
auto getInitialBpm () const -> double
 
auto getMaxBpm () const -> double
 
auto getMinBpm () const -> double
 
auto getMainBpm () const -> double
 
auto getAvgBpm () const -> double
 
auto getPeakDensity () const -> double
 
auto getAvgDensity () const -> double
 
auto getEndDensity () const -> double
 
auto getPath () const -> QString
 
auto getRank () const -> double
 
auto getTotal () const -> double
 
auto getPlayLevel () const -> int
 
auto getDifficulty () const -> int
 
auto getSha256 () const -> const QString &
 
auto getMd5 () const -> const QString &
 
auto getIsRandom () const -> bool
 
auto getRandomSequence () const -> const QList< qint64 > &
 
auto getKeymode () const -> Keymode
 
auto getDirectory () const -> QString
 
auto getChartDirectory () const -> QString
 
auto getHistogramData () -> QList< QList< qint64 > > &
 
auto getBpmChanges () -> QList< BpmChange > &
 
auto getGameVersion () const -> quint64
 
auto getTimingWindows () const -> QVariantList
 
auto getTimingWindowsHash () const -> QHash< Judgement, QPair< qint64, qint64 > >
 
auto hasNotes () const -> bool
 
auto prepareSave () const -> PreparedData
 
auto save (db::SqliteCppDb &db) const -> void
 
auto save (db::SqliteCppDb &db, int64_t directory) const -> void
 
void save (db::SqliteCppDb &db, int64_t directory, const PreparedData &prepared) const
 
auto toJson () const -> QJsonObject
 

Static Public Member Functions

static auto load (const DTO &chartDataDto) -> std::unique_ptr< ChartData >
 

Properties

QString title
 The title of the chart.
 
QString artist
 The artist of the chart.
 
QString subtitle
 The subtitle of the chart.
 
QString subartist
 The subartist of the chart.
 
QString genre
 The genre of the chart.
 
QString stageFile
 The path to the chart's stagefile.
 
QString banner
 The path to the chart's banner.
 
QString backBmp
 The path to the chart's backbmp.
 
QString stageFileSource
 A directly usable Image source for the chart's stagefile.
 
QString bannerSource
 A directly usable Image source for the chart's banner.
 
QString backBmpSource
 A directly usable Image source for the chart's backbmp.
 
double rank
 The rank of the chart, converted to defexrank format.
 
double total
 The total value of the chart.
 
int playLevel
 The play level of the chart.
 
int difficulty
 The difficulty of the chart.
 
int normalNoteCount
 The number of normal notes in the chart.
 
int scratchCount
 The number of scratch notes in the chart.
 
int lnCount
 The number of long notes in the chart excluding BSS (scratch lns).
 
int bssCount
 The number of BSS (scratch long notes) in the chart.
 
int mineCount
 The number of mines (landmines) in the chart.
 
int64_t length
 The length of the chart in nanoseconds.
 
QString path
 The path to the chart file.
 
QString directory
 The parent directory of the directory containing the chart file.
 
QString chartDirectory
 The directory containing the chart file.
 
QString sha256
 The SHA-256 hash of the chart file, in hexadecimal upper-case format.
 
QString md5
 The MD5 hash of the chart file, in hexadecimal upper-case format.
 
bool isRandom
 Whether the chart uses #RANDOM.
 
QList< qint64 > randomSequence
 The random sequence used for parsing the chart.
 
Keymode keymode
 The keymode of the chart, i.e. how many keys/columns it has. If the DP option "Battle" is enabled, an SP chart will have 14 keys regardless, so pay attention to that.
 
double initialBpm
 The initial BPM of the chart.
 
double maxBpm
 The maximum BPM of the chart.
 
double minBpm
 The minimum BPM of the chart.
 
double mainBpm
 The main BPM of the chart.
 
double avgBpm
 The average BPM of the chart.
 
double peakDensity
 The peak density of the chart.
 
double avgDensity
 The average density of the chart.
 
double endDensity
 The ending density of the chart.
 
QListQList< qint64 > histogramData
 The histogram data representing the distribution of notes, grouped by note type.
 
QList< BpmChange > bpmChanges
 The list of BPM changes in the chart.
 
quint64 gameVersion
 The game version where the chart was parsed.
 
QVariantList timingWindows
 The timing windows for the chart based on its rank.
 

Detailed Description

Metadata and basic stats of a chart.

When loading a chart, the ChartData might be different than what was cached in the database, because the chart file might have changed or it contained #RANDOM, which generates a different chart each time the chart is parsed. In the latter case you can use the randomSequence property to recreate the same chart.

Member Enumeration Documentation

◆ HistogramNoteType

Enumerator
Normal 
Scratch 
LongNote 
BssNote 
Landmine 
Invisible 

◆ Keymode

The keymode of the chart, i.e. how many keys/columns it has. If the DP option "Battle" is enabled, an SP chart will have 14 keys regardless, so pay attention to that.

Enumerator
K5 
K7 
K10 
K14 

Constructor & Destructor Documentation

◆ ChartData()

gameplay_logic::ChartData::ChartData ( QString  title,
QString  artist,
QString  subtitle,
QString  subartist,
QString  genre,
QString  stageFile,
QString  banner,
QString  backBmp,
double  rank,
double  total,
int  playLevel,
int  difficulty,
bool  isRandom,
QList< qint64 >  randomSequence,
int  normalNoteCount,
int  scratchCount,
int  lnCount,
int  bssCount,
int  mineCount,
int64_t  length,
double  initialBpm,
double  maxBpm,
double  minBpm,
double  mainBpm,
double  avgBpm,
double  peakDensity,
double  avgDensity,
double  endDensity,
QString  path,
int64_t  directory,
QString  sha256,
QString  md5,
Keymode  keymode,
QList< QList< qint64 > >  histogramData,
QList< BpmChange >  bpmChanges,
quint64  gameVersion,
QObject *  parent = nullptr 
)

Member Function Documentation

◆ assetSource()

auto gameplay_logic::ChartData::assetSource ( const QString &  relativePath) const

◆ clone()

auto gameplay_logic::ChartData::clone ( QObject *  parent = nullptr) const -> std::unique_ptr<ChartData>

◆ getArtist()

auto gameplay_logic::ChartData::getArtist ( ) const -> const QString&

◆ getAvgBpm()

auto gameplay_logic::ChartData::getAvgBpm ( ) const -> double

◆ getAvgDensity()

auto gameplay_logic::ChartData::getAvgDensity ( ) const -> double

◆ getBackBmp()

auto gameplay_logic::ChartData::getBackBmp ( ) const -> const QString&

◆ getBackBmpSource()

auto gameplay_logic::ChartData::getBackBmpSource ( ) const -> QString

◆ getBanner()

auto gameplay_logic::ChartData::getBanner ( ) const -> const QString&

◆ getBannerSource()

auto gameplay_logic::ChartData::getBannerSource ( ) const -> QString

◆ getBpmChanges()

auto gameplay_logic::ChartData::getBpmChanges ( ) -> QList<BpmChange>&

◆ getBssCount()

auto gameplay_logic::ChartData::getBssCount ( ) const -> int

◆ getChartDirectory()

auto gameplay_logic::ChartData::getChartDirectory ( ) const -> QString

◆ getDifficulty()

auto gameplay_logic::ChartData::getDifficulty ( ) const -> int

◆ getDirectory()

auto gameplay_logic::ChartData::getDirectory ( ) const -> QString

◆ getEndDensity()

auto gameplay_logic::ChartData::getEndDensity ( ) const -> double

◆ getGameVersion()

auto gameplay_logic::ChartData::getGameVersion ( ) const -> quint64

◆ getGenre()

auto gameplay_logic::ChartData::getGenre ( ) const -> const QString&

◆ getHistogramData()

auto gameplay_logic::ChartData::getHistogramData ( ) -> QList<QList<qint64>>&

◆ getInitialBpm()

auto gameplay_logic::ChartData::getInitialBpm ( ) const -> double

◆ getIsRandom()

auto gameplay_logic::ChartData::getIsRandom ( ) const -> bool

◆ getKeymode()

auto gameplay_logic::ChartData::getKeymode ( ) const -> Keymode

◆ getLength()

auto gameplay_logic::ChartData::getLength ( ) const -> int64_t

◆ getLnCount()

auto gameplay_logic::ChartData::getLnCount ( ) const -> int

◆ getMainBpm()

auto gameplay_logic::ChartData::getMainBpm ( ) const -> double

◆ getMaxBpm()

auto gameplay_logic::ChartData::getMaxBpm ( ) const -> double

◆ getMd5()

auto gameplay_logic::ChartData::getMd5 ( ) const -> const QString&

◆ getMinBpm()

auto gameplay_logic::ChartData::getMinBpm ( ) const -> double

◆ getMineCount()

auto gameplay_logic::ChartData::getMineCount ( ) const -> int

◆ getNormalNoteCount()

auto gameplay_logic::ChartData::getNormalNoteCount ( ) const -> int

◆ getPath()

auto gameplay_logic::ChartData::getPath ( ) const -> QString

◆ getPeakDensity()

auto gameplay_logic::ChartData::getPeakDensity ( ) const -> double

◆ getPlayLevel()

auto gameplay_logic::ChartData::getPlayLevel ( ) const -> int

◆ getRandomSequence()

auto gameplay_logic::ChartData::getRandomSequence ( ) const -> const QList<qint64>&

◆ getRank()

auto gameplay_logic::ChartData::getRank ( ) const -> double

◆ getScratchCount()

auto gameplay_logic::ChartData::getScratchCount ( ) const -> int

◆ getSha256()

auto gameplay_logic::ChartData::getSha256 ( ) const -> const QString&

◆ getStageFile()

auto gameplay_logic::ChartData::getStageFile ( ) const -> const QString&

◆ getStageFileSource()

auto gameplay_logic::ChartData::getStageFileSource ( ) const -> QString

◆ getSubartist()

auto gameplay_logic::ChartData::getSubartist ( ) const -> const QString&

◆ getSubtitle()

auto gameplay_logic::ChartData::getSubtitle ( ) const -> const QString&

◆ getTimingWindows()

auto gameplay_logic::ChartData::getTimingWindows ( ) const -> QVariantList

◆ getTimingWindowsHash()

auto gameplay_logic::ChartData::getTimingWindowsHash ( ) const -> QHash<Judgement, QPair<qint64, qint64>>

◆ getTitle()

auto gameplay_logic::ChartData::getTitle ( ) const -> const QString&

◆ getTotal()

auto gameplay_logic::ChartData::getTotal ( ) const -> double

◆ hasNotes()

auto gameplay_logic::ChartData::hasNotes ( ) const -> bool

◆ load()

auto gameplay_logic::ChartData::load ( const DTO &  chartDataDto) -> std::unique_ptr<ChartData>
static

◆ prepareSave()

auto gameplay_logic::ChartData::prepareSave ( ) const -> PreparedData

◆ save() [1/3]

auto gameplay_logic::ChartData::save ( db::SqliteCppDb &  db) const -> void

◆ save() [2/3]

auto gameplay_logic::ChartData::save ( db::SqliteCppDb &  db,
int64_t  directory 
) const -> void

◆ save() [3/3]

void gameplay_logic::ChartData::save ( db::SqliteCppDb &  db,
int64_t  directory,
const PreparedData &  prepared 
) const

◆ toJson()

auto gameplay_logic::ChartData::toJson ( ) const -> QJsonObject

Property Documentation

◆ artist

QString gameplay_logic::ChartData::artist
read

The artist of the chart.

◆ avgBpm

double gameplay_logic::ChartData::avgBpm
read

The average BPM of the chart.

The average BPM is the time-weighted average BPM of the chart.

◆ avgDensity

double gameplay_logic::ChartData::avgDensity
read

The average density of the chart.

The average note density throughout the chart.

◆ backBmp

QString gameplay_logic::ChartData::backBmp
read

The path to the chart's backbmp.

◆ backBmpSource

QString gameplay_logic::ChartData::backBmpSource
read

A directly usable Image source for the chart's backbmp.

◆ banner

QString gameplay_logic::ChartData::banner
read

The path to the chart's banner.

◆ bannerSource

QString gameplay_logic::ChartData::bannerSource
read

A directly usable Image source for the chart's banner.

◆ bpmChanges

QList< BpmChange > gameplay_logic::ChartData::bpmChanges
read

The list of BPM changes in the chart.

◆ bssCount

int gameplay_logic::ChartData::bssCount
read

The number of BSS (scratch long notes) in the chart.

A BSS consists of an ln start and ln end. Such a pair counts as one BSS.

◆ chartDirectory

QString gameplay_logic::ChartData::chartDirectory
read

The directory containing the chart file.

This is an absolute path.

◆ difficulty

int gameplay_logic::ChartData::difficulty
read

The difficulty of the chart.

This is purely visual. How you display it is up to you.

See also
https://hitkey.nekokan.dyndns.info/cmds.htm#DIFFICULTY

◆ directory

QString gameplay_logic::ChartData::directory
read

The parent directory of the directory containing the chart file.

This is an absolute path.

◆ endDensity

double gameplay_logic::ChartData::endDensity
read

The ending density of the chart.

The note density at the end of the chart.

◆ gameVersion

quint64 gameplay_logic::ChartData::gameVersion
read

The game version where the chart was parsed.

◆ genre

QString gameplay_logic::ChartData::genre
read

The genre of the chart.

◆ histogramData

QListQList<qint64> gameplay_logic::ChartData::histogramData
read

The histogram data representing the distribution of notes, grouped by note type.

Each sublist represents a different note type.

See also
HistogramNoteType

◆ initialBpm

double gameplay_logic::ChartData::initialBpm
read

The initial BPM of the chart.

This is the BPM at the start of the chart, before any BPM changes.

◆ isRandom

bool gameplay_logic::ChartData::isRandom
read

Whether the chart uses #RANDOM.

If true, the randomSequence property can be used to recreate the same chart.

◆ keymode

Keymode gameplay_logic::ChartData::keymode
read

The keymode of the chart, i.e. how many keys/columns it has. If the DP option "Battle" is enabled, an SP chart will have 14 keys regardless, so pay attention to that.

See also
Keymode

◆ length

int64_t gameplay_logic::ChartData::length
read

The length of the chart in nanoseconds.

This property indicates the total duration of the chart from start to finish, measured in nanoseconds.

Note
This is based on the timestamp of the last visible note.

◆ lnCount

int gameplay_logic::ChartData::lnCount
read

The number of long notes in the chart excluding BSS (scratch lns).

A long note consists of an LN start and LN end. Such a pair counts as one long note.

◆ mainBpm

double gameplay_logic::ChartData::mainBpm
read

The main BPM of the chart.

The main BPM is the BPM that is active for the longest time during the chart.

◆ maxBpm

double gameplay_logic::ChartData::maxBpm
read

The maximum BPM of the chart.

◆ md5

QString gameplay_logic::ChartData::md5
read

The MD5 hash of the chart file, in hexadecimal upper-case format.

This can be used to uniquely identify a chart file.

◆ minBpm

double gameplay_logic::ChartData::minBpm
read

The minimum BPM of the chart.

◆ mineCount

int gameplay_logic::ChartData::mineCount
read

The number of mines (landmines) in the chart.

◆ normalNoteCount

int gameplay_logic::ChartData::normalNoteCount
read

The number of normal notes in the chart.

Normal means not long notes, not mines, not invisible notes, not scratches

◆ path

QString gameplay_logic::ChartData::path
read

The path to the chart file.

This is an absolute path.

◆ peakDensity

double gameplay_logic::ChartData::peakDensity
read

The peak density of the chart.

The maximum note density within any time window.

◆ playLevel

int gameplay_logic::ChartData::playLevel
read

The play level of the chart.

This is purely visual. How you display it is up to you.

See also
https://hitkey.nekokan.dyndns.info/cmds.htm#PLAYLEVEL

◆ randomSequence

QList< qint64 > gameplay_logic::ChartData::randomSequence
read

The random sequence used for parsing the chart.

If the chart uses #RANDOM, this property provides the sequence of random values used to determine the contents of the chart. If the chart does not use randomization, this list will be empty.

◆ rank

double gameplay_logic::ChartData::rank
read

The rank of the chart, converted to defexrank format.

Determines the timing windows for judgements. 25=veryhard, 50=hard, 75=normal, 100=easy, like in lr2oraja. Interpolated linearly.

See also
https://hitkey.nekokan.dyndns.info/cmds.htm#RANK
https://hitkey.nekokan.dyndns.info/cmds.htm#DEFEXRANK
rules::lr2_timing_windows::Lr2TimingWindows::getTimingWindows()

◆ scratchCount

int gameplay_logic::ChartData::scratchCount
read

The number of scratch notes in the chart.

Scratch notes are normal notes on scratch columns.

◆ sha256

QString gameplay_logic::ChartData::sha256
read

The SHA-256 hash of the chart file, in hexadecimal upper-case format.

This can be used to uniquely identify a chart file.

◆ stageFile

QString gameplay_logic::ChartData::stageFile
read

The path to the chart's stagefile.

◆ stageFileSource

QString gameplay_logic::ChartData::stageFileSource
read

A directly usable Image source for the chart's stagefile.

◆ subartist

QString gameplay_logic::ChartData::subartist
read

The subartist of the chart.

◆ subtitle

QString gameplay_logic::ChartData::subtitle
read

The subtitle of the chart.

◆ timingWindows

QVariantList gameplay_logic::ChartData::timingWindows
read

The timing windows for the chart based on its rank.

Returns a list of maps, each with "judgement" (string) and "earlyNs"/"lateNs" (qint64) keys. The list is ordered from widest window (Bad) to narrowest (Perfect). Window values are symmetric half-widths in nanoseconds. Based on LR2 timing window specification.

◆ title

QString gameplay_logic::ChartData::title
read

The title of the chart.

◆ total

double gameplay_logic::ChartData::total
read

The total value of the chart.

RhythmGame's gauges use the same total value system as LR2.

See also
https://iidx.org/misc/iidx_lr2_beatoraja_diff#gauge-types

The documentation for this class was generated from the following files: