Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions includes/RhythmGameUtilities/Audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

#include "Audio.h"

namespace RhythmGameUtilities
{

int **ConvertSamplesToWaveform(float *samples, int size, int width, int height)
{
auto waveform = new int *[width];
Expand Down Expand Up @@ -46,3 +49,5 @@ int **ConvertSamplesToWaveform(float *samples, int size, int width, int height)

return waveform;
}

} // namespace RhythmGameUtilities
5 changes: 5 additions & 0 deletions includes/RhythmGameUtilities/Audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@
#define PACKAGE_API
#endif

namespace RhythmGameUtilities
{

extern "C"
{
PACKAGE_API int **ConvertSamplesToWaveform(float *samples, int size,
int width, int height);
}

} // namespace RhythmGameUtilities

#endif
5 changes: 5 additions & 0 deletions includes/RhythmGameUtilities/Enums/Difficulty.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#pragma once

namespace RhythmGameUtilities
{

enum Difficulty
{

Expand All @@ -12,3 +15,5 @@ enum Difficulty
Expert

};

} // namespace RhythmGameUtilities
5 changes: 5 additions & 0 deletions includes/RhythmGameUtilities/Enums/NamedSection.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

#include <string>

namespace RhythmGameUtilities
{

namespace NamedSection
{
typedef std::string Type;
Expand All @@ -22,3 +25,5 @@ Type SyncTrack = "SyncTrack";
Type Events = "Events";

}; // namespace NamedSection

} // namespace RhythmGameUtilities
5 changes: 5 additions & 0 deletions includes/RhythmGameUtilities/Enums/TypeCode.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

#include <string>

namespace RhythmGameUtilities
{

namespace TypeCode
{
typedef std::string Type;
Expand All @@ -27,3 +30,5 @@ Type Note = "N";
Type Event = "E";

} // namespace TypeCode

} // namespace RhythmGameUtilities
5 changes: 5 additions & 0 deletions includes/RhythmGameUtilities/Parsers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
#include "Utilities.h"
#include <iostream>

namespace RhythmGameUtilities
{

std::regex CHART_SECTION_PATTERN("\\[([a-z]+)\\]\\s*\\{([^\\}]+)\\}",
std::regex_constants::icase);

Expand Down Expand Up @@ -109,3 +112,5 @@ ChartSectionInternal *ParseSectionsFromChartInternal(const char *contents,

return sections;
}

} // namespace RhythmGameUtilities
5 changes: 5 additions & 0 deletions includes/RhythmGameUtilities/Parsers.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
#define PACKAGE_API
#endif

namespace RhythmGameUtilities
{

typedef struct
{
char *key;
Expand Down Expand Up @@ -35,3 +38,5 @@ extern "C"
PACKAGE_API ChartSectionInternal *
ParseSectionsFromChartInternal(const char *contents, int *outSize);
}

} // namespace RhythmGameUtilities
5 changes: 5 additions & 0 deletions includes/RhythmGameUtilities/Structs/BeatBar.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
#pragma once

namespace RhythmGameUtilities
{

struct BeatBar
{

int Position;

int BPM;
};

} // namespace RhythmGameUtilities
5 changes: 5 additions & 0 deletions includes/RhythmGameUtilities/Structs/Note.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#pragma once

namespace RhythmGameUtilities
{

struct Note
{

Expand All @@ -9,3 +12,5 @@ struct Note

int Length;
};

} // namespace RhythmGameUtilities
5 changes: 5 additions & 0 deletions includes/RhythmGameUtilities/Structs/TrackEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

#include <string>

namespace RhythmGameUtilities
{

struct TrackEvent
{

Expand All @@ -11,3 +14,5 @@ struct TrackEvent

std::vector<std::string> *Values;
};

} // namespace RhythmGameUtilities
5 changes: 5 additions & 0 deletions includes/RhythmGameUtilities/Utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
#include "Structs/BeatBar.h"
#include "Structs/Note.h"

namespace RhythmGameUtilities
{

const float SECONDS_PER_MINUTE = 60.0f;

float ConvertTickToPosition(float tick, int resolution)
Expand Down Expand Up @@ -228,3 +231,5 @@ std::vector<std::string> FindMatchGroups(const char *contents,

return matches;
}

} // namespace RhythmGameUtilities
5 changes: 5 additions & 0 deletions includes/RhythmGameUtilities/Utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
#define PACKAGE_API
#endif

namespace RhythmGameUtilities
{

extern "C"
{
PACKAGE_API float ConvertTickToPosition(float tick, int resolution);
Expand Down Expand Up @@ -56,3 +59,5 @@ std::vector<std::string> FindAllMatches(const char *contents,

std::vector<std::string> FindMatchGroups(const char *contents,
std::regex pattern);

} // namespace RhythmGameUtilities
2 changes: 2 additions & 0 deletions tests/RhythmGameUtilities/Audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#include "RhythmGameUtilities/Audio.h"

using namespace RhythmGameUtilities;

void testConvertSamplesToWaveform()
{
int size = 5;
Expand Down
2 changes: 2 additions & 0 deletions tests/RhythmGameUtilities/Parsers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "RhythmGameUtilities/Parsers.h"

using namespace RhythmGameUtilities;

auto contents = R"([Song]
{
Name = "Example Song"
Expand Down
2 changes: 2 additions & 0 deletions tests/RhythmGameUtilities/Utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

#include "RhythmGameUtilities/Utilities.h"

using namespace RhythmGameUtilities;

void testConvertTickToPosition()
{
assert(4 == ConvertTickToPosition(768, 192));
Expand Down