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

Rekordbox save all loops and correct AAC timing offset for CoreAudio #2779

Merged
merged 10 commits into from
May 12, 2020
17 changes: 9 additions & 8 deletions src/library/rekordbox/rekordbox_anlz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ rekordbox_anlz_t::song_structure_tag_t::song_structure_tag_t(kaitai::kstream* p_
void rekordbox_anlz_t::song_structure_tag_t::_read() {
m_len_entry_bytes = m__io->read_u4be();
m_len_entries = m__io->read_u2be();
m_style = static_cast<rekordbox_anlz_t::phrase_style_t>(m__io->read_u2be());
m_style = m__io->read_u2be();
m__unnamed3 = m__io->read_bytes(6);
m_end_beat = m__io->read_u2be();
m__unnamed5 = m__io->read_bytes(4);
Expand Down Expand Up @@ -199,7 +199,8 @@ void rekordbox_anlz_t::cue_extended_entry_t::_read() {
m__unnamed5 = m__io->read_bytes(3);
m_time = m__io->read_u4be();
m_loop_time = m__io->read_u4be();
m__unnamed8 = m__io->read_bytes(12);
m_color_id = m__io->read_u1();
m__unnamed9 = m__io->read_bytes(11);
n_len_comment = true;
if (len_entry() > 43) {
n_len_comment = false;
Expand Down Expand Up @@ -230,10 +231,10 @@ void rekordbox_anlz_t::cue_extended_entry_t::_read() {
n_color_blue = false;
m_color_blue = m__io->read_u1();
}
n__unnamed15 = true;
n__unnamed16 = true;
if ((len_entry() - len_comment()) > 48) {
n__unnamed15 = false;
m__unnamed15 = m__io->read_bytes(((len_entry() - 48) - len_comment()));
n__unnamed16 = false;
m__unnamed16 = m__io->read_bytes(((len_entry() - 48) - len_comment()));
}
}

Expand All @@ -250,7 +251,7 @@ rekordbox_anlz_t::cue_extended_entry_t::~cue_extended_entry_t() {
}
if (!n_color_blue) {
}
if (!n__unnamed15) {
if (!n__unnamed16) {
}
}

Expand Down Expand Up @@ -284,11 +285,11 @@ void rekordbox_anlz_t::song_structure_entry_t::_read() {
m_phrase_number = m__io->read_u2be();
m_beat_number = m__io->read_u2be();
switch (_parent()->style()) {
case PHRASE_STYLE_UP_DOWN: {
case 1: {
m_phrase_id = new phrase_up_down_t(m__io, this, m__root);
break;
}
case PHRASE_STYLE_VERSE_BRIDGE: {
case 2: {
m_phrase_id = new phrase_verse_bridge_t(m__io, this, m__root);
break;
}
Expand Down
23 changes: 15 additions & 8 deletions src/library/rekordbox/rekordbox_anlz.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ class rekordbox_anlz_t : public kaitai::kstruct {
private:
uint32_t m_len_entry_bytes;
uint16_t m_len_entries;
phrase_style_t m_style;
uint16_t m_style;
std::string m__unnamed3;
uint16_t m_end_beat;
std::string m__unnamed5;
Expand Down Expand Up @@ -424,7 +424,7 @@ class rekordbox_anlz_t : public kaitai::kstruct {
* bridge-verse style except verses 1-3 are labeled VERSE1 and verses
* 4-6 are labeled VERSE2 in rekordbox.
*/
phrase_style_t style() const { return m_style; }
uint16_t style() const { return m_style; }
std::string _unnamed3() const { return m__unnamed3; }

/**
Expand Down Expand Up @@ -465,7 +465,8 @@ class rekordbox_anlz_t : public kaitai::kstruct {
std::string m__unnamed5;
uint32_t m_time;
uint32_t m_loop_time;
std::string m__unnamed8;
uint8_t m_color_id;
std::string m__unnamed9;
uint32_t m_len_comment;
bool n_len_comment;

Expand Down Expand Up @@ -508,11 +509,11 @@ class rekordbox_anlz_t : public kaitai::kstruct {
bool _is_null_color_blue() { color_blue(); return n_color_blue; };

private:
std::string m__unnamed15;
bool n__unnamed15;
std::string m__unnamed16;
bool n__unnamed16;

public:
bool _is_null__unnamed15() { _unnamed15(); return n__unnamed15; };
bool _is_null__unnamed16() { _unnamed16(); return n__unnamed16; };

private:
rekordbox_anlz_t* m__root;
Expand Down Expand Up @@ -546,7 +547,13 @@ class rekordbox_anlz_t : public kaitai::kstruct {
* back to the cue time if this is a loop.
*/
uint32_t loop_time() const { return m_loop_time; }
std::string _unnamed8() const { return m__unnamed8; }

/**
* References a row in the colors table if the memory cue or loop
* has been assigned a color
*/
uint8_t color_id() const { return m_color_id; }
std::string _unnamed9() const { return m__unnamed9; }
uint32_t len_comment() const { return m_len_comment; }

/**
Expand All @@ -573,7 +580,7 @@ class rekordbox_anlz_t : public kaitai::kstruct {
* The blue component of the color to be displayed.
*/
uint8_t color_blue() const { return m_color_blue; }
std::string _unnamed15() const { return m__unnamed15; }
std::string _unnamed16() const { return m__unnamed16; }
rekordbox_anlz_t* _root() const { return m__root; }
rekordbox_anlz_t::cue_extended_tag_t* _parent() const { return m__parent; }
};
Expand Down
6 changes: 5 additions & 1 deletion src/library/rekordbox/rekordbox_anlz.ksy
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,11 @@ types:
doc: |
The position, in milliseconds, at which the player loops
back to the cue time if this is a loop.
- size: 12 # Loops seem to have some non-zero values in the last four bytes of this.
- id: color_id
type: u1
doc: |
Color ID of memory cues and loops, same color IDs as track colors
- size: 11 # Loops seem to have some non-zero values in the last four bytes of this.
- id: len_comment
type: u4
if: len_entry > 43
Expand Down
Loading