Etterna 0.74.4
Loading...
Searching...
No Matches
NotesLoaderSSC.h
1
2#ifndef NotesLoaderSSC_H
3#define NotesLoaderSSC_H
4
5#include "NotesLoaderSM.h"
6
7class MsdFile;
8class Song;
9class Steps;
10class TimingData;
11struct SSCLoader;
15enum SSCLoadingStates
16{
17 GETTING_SONG_INFO,
18 GETTING_STEP_INFO,
19 NUM_SSCLoadingStates
20};
21
22// LoadNoteDataFromSimfile uses LoadNoteDataTagIDs because its parts operate
23// on state variables internal to the function.
24namespace SSC {
25enum LoadNoteDataTagIDs
26{
27 LNDID_version,
28 LNDID_stepstype,
29 LNDID_chartname,
30 LNDID_description,
31 LNDID_difficulty,
32 LNDID_meter,
33 LNDID_credit,
34 LNDID_notes,
35 LNDID_notes2,
36 LNDID_notedata
37};
38
39// LoadNoteDataFromSimfile uses LoadNoteDataTagIDs because its parts operate
40// on state variables internal to the function.struct StepsTagInfo
42{
43 SSCLoader* loader;
44 Song* song;
45 Steps* steps;
46 TimingData* timing;
47 const MsdFile::value_t* params;
48 const std::string& path;
49 bool has_own_timing;
50 bool ssc_format;
51 bool from_cache;
52 bool for_load_edit;
53 StepsTagInfo(SSCLoader* l, Song* s, const std::string& p, bool fc)
54 : loader(l)
55 , song(s)
56 , steps(nullptr)
57 , timing(nullptr)
58 , path(p)
59 , has_own_timing(false)
60 , ssc_format(false)
61 , from_cache(fc)
62 , for_load_edit(false)
63 {
64 params = nullptr;
65 }
66};
68{
69 SSCLoader* loader;
70 Song* song;
71 const MsdFile::value_t* params{ nullptr };
72 const std::string& path;
73 bool from_cache;
74 SongTagInfo(SSCLoader* l, Song* s, const std::string& p, bool fc)
75 : loader(l)
76 , song(s)
77 , path(p)
78 , from_cache(fc)
79 {
80 }
81};
82std::vector<float>
83msdsplit(const std::string& s);
84}
86const float VERSION_RADAR_FAKE = 0.53f;
88const float VERSION_WARP_SEGMENT = 0.56f;
90const float VERSION_SPLIT_TIMING = 0.7f;
92const float VERSION_OFFSET_BEFORE_ATTACK = 0.72f;
94const float VERSION_CHART_NAME_TAG = 0.74f;
96const float VERSION_CACHE_SWITCH_TAG = 0.77f;
98const float VERSION_RADAR_NOTECOUNT = 0.83f;
99
103struct SSCLoader : public SMLoader
104{
105 SSCLoader()
106 : SMLoader(".ssc")
107 {
108 }
109
119 bool LoadFromSimfile(const std::string& sPath,
120 Song& out,
121 bool bFromCache = false) override;
122
128 bool LoadNoteDataFromSimfile(const std::string& cachePath,
129 Steps& out) override;
130
131 static void ProcessBPMs(TimingData&,
132 const std::string& sParam,
133 const std::string& songName);
134 static void ProcessStops(TimingData&,
135 const std::string& sParam,
136 const std::string& songName);
137 static void ProcessWarps(TimingData&,
138 const std::string& sParam,
139 const float,
140 const std::string& songName);
141 static void ProcessLabels(TimingData& out,
142 const std::string& sParam,
143 const std::string& songName);
144 static void ProcessCombos(TimingData&,
145 const std::string& line,
146 const std::string& songName,
147 const int = -1);
148 void ProcessCombos(TimingData&,
149 const std::string& line,
150 const int = -1) override;
151 static void ProcessScrolls(TimingData&,
152 const std::string sParam,
153 const std::string& songName);
154};
155
156#endif
The class that reads the various .SSC, .SM, .SMA, .DWI, and .MSD files.
Definition MsdFile.h:10
Holds all music metadata and steps for one song.
Definition Song.h:65
Holds note information for a Song.
Definition Steps.h:42
Holds data for translating beats<->seconds.
Definition TimingData.h:54
The list of params found in the files.
Definition MsdFile.h:17
Reads a Song from an .SM file.
Definition NotesLoaderSM.h:24
The SSCLoader handles all of the parsing needed for .ssc files.
Definition NotesLoaderSSC.h:104
bool LoadNoteDataFromSimfile(const std::string &cachePath, Steps &out) override
Retrieve the specific NoteData from the file.
Definition NotesLoaderSSC.cpp:915
bool LoadFromSimfile(const std::string &sPath, Song &out, bool bFromCache=false) override
Attempt to load the specified ssc file.
Definition NotesLoaderSSC.cpp:1020
Definition NotesLoaderSSC.h:68
Definition NotesLoaderSSC.h:42