Skip to content

review ADLFile #285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Aug 23, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ namespace HyperSonicDrivers::files::westwood

readDataFromFile_(m_meta_version.data_offset, m_meta_version.data_header_size);

// TODO: count_loop_ for version 3 is wrong to be 8 bit i think
m_num_tracks = count_loop_<uint8_t>(0, m_header);
m_num_track_offsets = count_loop_<uint16_t>(m_meta_version.offset_start, m_track_offsets);
m_num_instrument_offsets = count_loop_<uint16_t>(m_meta_version.offset_start, m_instrument_offsets);
Expand Down Expand Up @@ -262,6 +263,8 @@ namespace HyperSonicDrivers::files::westwood
void ADLFile::readHeaderFromFile_(const int header_size, std::function<uint16_t()> read)
{
m_header.resize(header_size);
// TODO: pass the byte size instead of a function read and read at once,
// and do read in LE when is greter than 1, basically if version 3
for (int i = 0; i < header_size; i++)
{
m_header[i] = read();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace HyperSonicDrivers::files::westwood
ADLFileMock f("../fixtures/DUNE0.ADL");

EXPECT_EQ(f.getVersion(), 2);
EXPECT_EQ(f.getNumTracks(), 18);
EXPECT_EQ(f.getNumTracks(), 200);
EXPECT_EQ(f.getNumTrackOffsets(), 52);
EXPECT_EQ(f.getNumInstrumentOffsets(), 63);
EXPECT_EQ(f.parentSize(), 14473);
Expand Down