RhythmGame 1.4.3
Loading...
Searching...
No Matches
ChartFactory.h
Go to the documentation of this file.
1//
2// Created by bobini on 24.08.23.
3//
4
5#ifndef RHYTHMGAME_CHARTFACTORY_H
6#define RHYTHMGAME_CHARTFACTORY_H
7
8#include "ChartDataFactory.h"
9#include "loadBmsSounds.h"
12#include "charts/BmsNotesData.h"
13#include <QThreadPool>
14#include <stop_token>
15namespace sounds {
16class AudioEngine;
17} // namespace sounds
18namespace qml_components {
19class ProfileList;
20} // namespace qml_components
21namespace resource_managers {
22
23class SongAssetStore;
24
25class SoundTask : public QObject
26{
27 Q_OBJECT
28 std::filesystem::path path;
29 std::unordered_map<uint64_t, std::filesystem::path> wavs;
30 sounds::AudioEngine* engine;
31 SongAssetStore* assetStore;
32 std::stop_token stop;
33
34 // bmson-specific (empty for BMS)
35 std::vector<charts::BmsNotesData::BmsonSliceInfo> bmsonSlices;
36 std::unordered_map<uint64_t, std::vector<uint64_t>> bmsonFusions;
37
38 public:
40 SongAssetStore* assetStore,
41 std::filesystem::path path,
42 std::unordered_map<uint64_t, std::filesystem::path> channelPaths,
43 std::vector<charts::BmsNotesData::BmsonSliceInfo> slices,
44 std::unordered_map<uint64_t, std::vector<uint64_t>> fusions,
45 std::stop_token stop);
46 void run();
47 signals:
49 std::unordered_map<uint64_t, std::shared_ptr<sounds::Sound>> sounds);
50};
51
52class ChartFactory : public QObject
53{
54 sounds::AudioEngine* engine;
55 input::InputTranslator* inputTranslator;
56 SongAssetStore* assetStore;
57 QThreadPool loadingPool;
58 QList<std::weak_ptr<std::stop_source>> pendingLoads;
59
60 void cancelLoading();
61
62 public:
77 input::InputTranslator* inputTranslator,
78 SongAssetStore* assetStore);
79 ~ChartFactory() override;
81 PlayerSpecificData player1,
82 std::optional<PlayerSpecificData> player2,
83 double maxHitValue)
84 -> std::unique_ptr<gameplay_logic::ChartRunner>;
85};
86
87} // namespace resource_managers
88
89#endif // RHYTHMGAME_CHARTFACTORY_H
QString path
Definition Lr2SkinParser.cpp:87
The result of playing a chart.
Definition BmsScore.h:16
The class that determines which notes get hit or missed.
Definition HitRules.h:36
Definition InputTranslator.h:178
Definition ChartFactory.h:53
~ChartFactory() override
Definition ChartFactory.cpp:839
auto createChart(ChartDataFactory::ChartComponents chartComponents, PlayerSpecificData player1, std::optional< PlayerSpecificData > player2, double maxHitValue) -> std::unique_ptr< gameplay_logic::ChartRunner >
Definition ChartFactory.cpp:560
Definition SongAssetStore.h:28
Definition ChartFactory.h:26
void soundsLoaded(std::unordered_map< uint64_t, std::shared_ptr< sounds::Sound > > sounds)
void run()
Definition ChartFactory.cpp:787
Definition AudioEngine.h:16
Contains classes that wrap some functionality for use in QML.
Definition ProfileArenaIdentityProvider.h:9
DpOptions
Definition Vars.h:65
Classes and functions related to loading and managing resources such as charts, sounds,...
Definition ProfileArenaIdentityProvider.h:12
The namespace for all sound related classes.
Definition HitRules.h:16
bool autoPlay
Definition ChartFactory.h:73
NoteOrderAlgorithm noteOrderAlgorithmP2
Definition ChartFactory.h:70
QPointer< Profile > profile
Definition ChartFactory.h:65
DpOptions dpOptions
Definition ChartFactory.h:71
uint64_t randomSeed
Definition ChartFactory.h:72
bool usePre130
Definition ChartFactory.h:74
QList< gameplay_logic::rules::BmsGauge * > gauges
Definition ChartFactory.h:66
NoteOrderAlgorithm noteOrderAlgorithm
Definition ChartFactory.h:69
gameplay_logic::BmsScore * replayedScore
Definition ChartFactory.h:68
gameplay_logic::rules::HitRules hitRules
Definition ChartFactory.h:67