Commit 9c2a011d authored by Josh Coalson's avatar Josh Coalson
Browse files

add ..._get_resolved_state_string() convenience function

parent d9b6e335
......@@ -451,6 +451,9 @@ FLAC_API FLAC__SeekableStreamDecoderState FLAC__file_decoder_get_seekable_stream
*/
FLAC_API FLAC__StreamDecoderState FLAC__file_decoder_get_stream_decoder_state(const FLAC__FileDecoder *decoder);
/*@@@@ document */
FLAC_API const char *FLAC__file_decoder_get_resolved_state_string(const FLAC__FileDecoder *decoder);
/** Get the "MD5 signature checking" flag.
* This is inherited from FLAC__SeekableStreamDecoder; see
* FLAC__seekable_stream_decoder_get_md5_checking().
......
......@@ -542,6 +542,9 @@ FLAC_API FLAC__StreamEncoderState FLAC__file_encoder_get_stream_encoder_state(co
*/
FLAC_API FLAC__StreamDecoderState FLAC__file_encoder_get_verify_decoder_state(const FLAC__FileEncoder *encoder);
/*@@@@ document */
FLAC_API const char *FLAC__file_encoder_get_resolved_state_string(const FLAC__FileEncoder *encoder);
/** Get relevant values about the nature of a verify decoder error.
* Inherited from FLAC__seekable_stream_encoder_get_verify_decoder_error_stats().
* Useful when the file encoder state is
......
......@@ -684,6 +684,9 @@ FLAC_API FLAC__SeekableStreamDecoderState FLAC__seekable_stream_decoder_get_stat
*/
FLAC_API FLAC__StreamDecoderState FLAC__seekable_stream_decoder_get_stream_decoder_state(const FLAC__SeekableStreamDecoder *decoder);
/*@@@@ document */
FLAC_API const char *FLAC__seekable_stream_decoder_get_resolved_state_string(const FLAC__SeekableStreamDecoder *decoder);
/** Get the "MD5 signature checking" flag.
* This is the value of the setting, not whether or not the decoder is
* currently checking the MD5 (remember, it can be turned off automatically
......
......@@ -597,6 +597,9 @@ FLAC_API FLAC__StreamEncoderState FLAC__seekable_stream_encoder_get_stream_encod
*/
FLAC_API FLAC__StreamDecoderState FLAC__seekable_stream_encoder_get_verify_decoder_state(const FLAC__SeekableStreamEncoder *encoder);
/*@@@@ document */
FLAC_API const char *FLAC__seekable_stream_encoder_get_resolved_state_string(const FLAC__SeekableStreamEncoder *encoder);
/** Get relevant values about the nature of a verify decoder error.
* Inherited from FLAC__stream_encoder_get_verify_decoder_error_stats().
* Useful when the seekable stream encoder state is
......
......@@ -377,6 +377,14 @@ FLAC_API FLAC__StreamDecoderState FLAC__file_decoder_get_stream_decoder_state(co
return FLAC__seekable_stream_decoder_get_stream_decoder_state(decoder->private_->seekable_stream_decoder);
}
FLAC_API const char *FLAC__file_decoder_get_resolved_state_string(const FLAC__FileDecoder *decoder)
{
if(decoder->protected_->state != FLAC__FILE_DECODER_SEEKABLE_STREAM_DECODER_ERROR)
return FLAC__FileDecoderStateString[decoder->protected_->state];
else
return FLAC__seekable_stream_decoder_get_resolved_state_string(decoder->private_->seekable_stream_decoder);
}
FLAC_API FLAC__bool FLAC__file_decoder_get_md5_checking(const FLAC__FileDecoder *decoder)
{
FLAC__ASSERT(0 != decoder);
......
......@@ -453,6 +453,14 @@ FLAC_API FLAC__StreamDecoderState FLAC__seekable_stream_decoder_get_stream_decod
return FLAC__stream_decoder_get_state(decoder->private_->stream_decoder);
}
FLAC_API const char *FLAC__seekable_stream_decoder_get_resolved_state_string(const FLAC__SeekableStreamDecoder *decoder)
{
if(decoder->protected_->state != FLAC__SEEKABLE_STREAM_DECODER_STREAM_DECODER_ERROR)
return FLAC__SeekableStreamDecoderStateString[decoder->protected_->state];
else
return FLAC__StreamDecoderStateString[FLAC__stream_decoder_get_state(decoder->private_->stream_decoder)];
}
FLAC_API FLAC__bool FLAC__seekable_stream_decoder_get_md5_checking(const FLAC__SeekableStreamDecoder *decoder)
{
FLAC__ASSERT(0 != decoder);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment