1743 |
void File::Save(const String& Path) { |
void File::Save(const String& Path) { |
1744 |
UpdateChunks(); |
UpdateChunks(); |
1745 |
pRIFF->Save(Path); |
pRIFF->Save(Path); |
1746 |
__UpdateWavePoolTableChunk(); |
UpdateFileOffsets(); |
1747 |
} |
} |
1748 |
|
|
1749 |
/** @brief Save changes to same file. |
/** @brief Save changes to same file. |
1758 |
void File::Save() { |
void File::Save() { |
1759 |
UpdateChunks(); |
UpdateChunks(); |
1760 |
pRIFF->Save(); |
pRIFF->Save(); |
1761 |
|
UpdateFileOffsets(); |
1762 |
|
} |
1763 |
|
|
1764 |
|
/** @brief Updates all file offsets stored all over the file. |
1765 |
|
* |
1766 |
|
* This virtual method is called whenever the overall file layout has been |
1767 |
|
* changed (i.e. file or individual RIFF chunks have been resized). It is |
1768 |
|
* then the responsibility of this method to update all file offsets stored |
1769 |
|
* in the file format. For example samples are referenced by instruments by |
1770 |
|
* file offsets. The gig format also stores references to instrument |
1771 |
|
* scripts as file offsets, and thus it overrides this method to update |
1772 |
|
* those file offsets as well. |
1773 |
|
*/ |
1774 |
|
void File::UpdateFileOffsets() { |
1775 |
__UpdateWavePoolTableChunk(); |
__UpdateWavePoolTableChunk(); |
1776 |
} |
} |
1777 |
|
|