Skip to content
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

review ADLFile #285

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
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);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another program reported 200 tracks. so i am not reading exactly right. in fact i am missing sounds.... so here we go.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure neither 200 tracks is right.. but the "hidden" sounds are played there, even though there are at least half empty tracks.

EXPECT_EQ(f.getNumTrackOffsets(), 52);
EXPECT_EQ(f.getNumInstrumentOffsets(), 63);
EXPECT_EQ(f.parentSize(), 14473);
Expand Down
Loading