mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 06:44:57 +01:00
libptformat: Add ability to reuse object && add path to ptf to api
This commit is contained in:
parent
b60e9f7df9
commit
feb2763a8a
2 changed files with 21 additions and 3 deletions
|
|
@ -76,13 +76,27 @@ hexdump(uint8_t *data, int len)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PTFFormat::PTFFormat() : version(0), product(NULL) {
|
PTFFormat::PTFFormat() : version(0), product(NULL), ptfunxored(NULL) {
|
||||||
}
|
}
|
||||||
|
|
||||||
PTFFormat::~PTFFormat() {
|
PTFFormat::~PTFFormat() {
|
||||||
|
cleanup();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
PTFFormat::cleanup(void) {
|
||||||
if (ptfunxored) {
|
if (ptfunxored) {
|
||||||
free(ptfunxored);
|
free(ptfunxored);
|
||||||
|
ptfunxored = NULL;
|
||||||
}
|
}
|
||||||
|
audiofiles.clear();
|
||||||
|
regions.clear();
|
||||||
|
midiregions.clear();
|
||||||
|
compounds.clear();
|
||||||
|
tracks.clear();
|
||||||
|
miditracks.clear();
|
||||||
|
version = 0;
|
||||||
|
product = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t
|
int64_t
|
||||||
|
|
@ -236,7 +250,10 @@ PTFFormat::unxor(std::string path) {
|
||||||
-1 could not parse pt session
|
-1 could not parse pt session
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
PTFFormat::load(std::string path, int64_t targetsr) {
|
PTFFormat::load(std::string ptf, int64_t targetsr) {
|
||||||
|
cleanup();
|
||||||
|
path = ptf;
|
||||||
|
|
||||||
if (unxor(path))
|
if (unxor(path))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,7 @@ public:
|
||||||
int64_t targetrate;
|
int64_t targetrate;
|
||||||
uint8_t version;
|
uint8_t version;
|
||||||
uint8_t *product;
|
uint8_t *product;
|
||||||
|
std::string path;
|
||||||
|
|
||||||
unsigned char c0;
|
unsigned char c0;
|
||||||
unsigned char c1;
|
unsigned char c1;
|
||||||
|
|
@ -163,6 +163,7 @@ private:
|
||||||
bool parse_version();
|
bool parse_version();
|
||||||
uint8_t gen_xor_delta(uint8_t xor_value, uint8_t mul, bool negative);
|
uint8_t gen_xor_delta(uint8_t xor_value, uint8_t mul, bool negative);
|
||||||
void setrates(void);
|
void setrates(void);
|
||||||
|
void cleanup(void);
|
||||||
void parse5header(void);
|
void parse5header(void);
|
||||||
void parse7header(void);
|
void parse7header(void);
|
||||||
void parse8header(void);
|
void parse8header(void);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue