diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-07-11 00:12:50 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-07-11 21:14:02 +0200 |
| commit | aa646c58267a6bd2580f3cb30674f4ebd0ed6db7 (patch) | |
| tree | 2abc9a3123bf4f2470b093f0332ddeccb1390b0d /src/sound_asset.cc | |
| parent | 1b6f847eddca54ed223b22858c19c987aa61c2df (diff) | |
Allow creation of ATMOS sync on channel 14.atmos
Diffstat (limited to 'src/sound_asset.cc')
| -rw-r--r-- | src/sound_asset.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/sound_asset.cc b/src/sound_asset.cc index c28a33fe..7f2bf5e3 100644 --- a/src/sound_asset.cc +++ b/src/sound_asset.cc @@ -193,10 +193,13 @@ SoundAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, NoteHand } shared_ptr<SoundAssetWriter> -SoundAsset::start_write (boost::filesystem::path file) +SoundAsset::start_write (boost::filesystem::path file, bool atmos_sync) { - /* XXX: can't we use a shared_ptr here? */ - return shared_ptr<SoundAssetWriter> (new SoundAssetWriter (this, file)); + if (atmos_sync && _channels < 14) { + throw MiscError ("Insufficient channels to write ATMOS sync (there must be at least 14)"); + } + + return shared_ptr<SoundAssetWriter> (new SoundAssetWriter(this, file, atmos_sync)); } shared_ptr<SoundAssetReader> |
