diff --git a/ChangeLog b/ChangeLog index ad59d7f0..4bfcd693 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15107,3 +15107,6 @@ 2016-04-27 Fred Gleason * Fixed a bug in 'lib/rdcut.cpp' that caused the cut 'Description' field to be applied as a cut Title. +2016-04-29 Fred Gleason + * Implemented export for marker data in WAV files in + 'lib/rdwavefile.cpp' and 'lib/rdwavefile.h'. diff --git a/lib/rdwavefile.cpp b/lib/rdwavefile.cpp index 4bc914ac..4429bc76 100644 --- a/lib/rdwavefile.cpp +++ b/lib/rdwavefile.cpp @@ -1741,14 +1741,14 @@ QString RDWaveFile::getCartTimerLabel(int index) const return QString(""); } - +/* void RDWaveFile::setCartTimerLabel(int index,QString label) { if(indexsegueStartPos()>=0)&& + (wave_data->segueEndPos()>wave_data->segueStartPos())) { + sprintf((char *)cart_chunk_data+684+timer*MAX_TIMERS,"SEGs"); + WriteDword(cart_chunk_data,688+timer*MAX_TIMERS, + FrameOffset(wave_data->segueStartPos())); + timer++; + sprintf((char *)cart_chunk_data+684+timer*MAX_TIMERS,"SEGe"); + WriteDword(cart_chunk_data,688+timer*MAX_TIMERS, + FrameOffset(wave_data->segueEndPos())); + timer++; + } + if((wave_data->introStartPos()>=0)&& + (wave_data->introEndPos()>wave_data->introStartPos())) { + sprintf((char *)cart_chunk_data+684+timer*MAX_TIMERS,"INTs"); + WriteDword(cart_chunk_data,688+timer*MAX_TIMERS, + FrameOffset(wave_data->introStartPos())); + timer++; + sprintf((char *)cart_chunk_data+684+timer*MAX_TIMERS,"INTe"); + WriteDword(cart_chunk_data,688+timer*MAX_TIMERS, + FrameOffset(wave_data->introEndPos())); + timer++; + } + if((wave_data->startPos()>=0)&& + (wave_data->endPos()>wave_data->startPos())) { + sprintf((char *)cart_chunk_data+684+timer*MAX_TIMERS,"AUDs"); + WriteDword(cart_chunk_data,688+timer*MAX_TIMERS, + FrameOffset(wave_data->startPos())); + timer++; + sprintf((char *)cart_chunk_data+684+timer*MAX_TIMERS,"AUDe"); + WriteDword(cart_chunk_data,688+timer*MAX_TIMERS, + FrameOffset(wave_data->endPos())); + timer++; } } if(!cart_url.isEmpty()) { @@ -4615,3 +4644,12 @@ int RDWaveFile::WriteOggBuffer(char *buf,int size) #endif // HAVE_VORBIS return 0; } + + +unsigned RDWaveFile::FrameOffset(int msecs) const +{ + if(msecs<0) { + return 0; + } + return (unsigned)((double)msecs*(double)samples_per_sec/1000.0); +} diff --git a/lib/rdwavefile.h b/lib/rdwavefile.h index c8532383..2f516cca 100644 --- a/lib/rdwavefile.h +++ b/lib/rdwavefile.h @@ -643,13 +643,6 @@ class RDWaveFile **/ QString getCartTimerLabel(int index) const; - /** - * Set the label for one of the eight CartChunk timers. - * @param index The index number of the timer to access (0 - 7). - * @param label the label of the corresponding timer. - **/ - void setCartTimerLabel(int index,QString label); - /** * Retrieve the sample value for one of the eight CartChunk timers. * @param index The index number of the timer to access (0 - 7). @@ -657,13 +650,6 @@ class RDWaveFile **/ unsigned getCartTimerSample(int index) const; - /** - * Set the sample value for one of the eight CartChunk timers. - * @param index The index number of the timer to access (0 - 7). - * @param sample the sample value of the corresponding timer. - **/ - void setCartTimerSample(int index,unsigned sample); - /** * Returns the contents of the URL field in the WAV file's CART chunk. **/ @@ -1082,6 +1068,7 @@ class RDWaveFile int WriteOggPage(ogg_page *page); #endif // HAVE_VORBIS int WriteOggBuffer(char *buf,int size); + unsigned FrameOffset(int msecs) const; QFile wave_file; RDWaveData *wave_data; bool recordable; // Allow DATA chunk writes? @@ -1196,7 +1183,6 @@ class RDWaveFile unsigned char *cook_buffer; int cook_buffer_size; - // RDWaveFile::Encoding cook_encoding; float encode_quality; int serial_number; int atx_offset;