444
445
FLAC_API FLAC__bool FLAC__metadata_simple_iterator_prev(FLAC__Metadata_SimpleIterator *iterator);
447
/** Returns a flag telling if the current metadata block is the last.
449
* \param iterator A pointer to an existing initialized iterator.
451
* \code iterator != NULL \endcode
452
* \a iterator has been successfully initialized with
453
* FLAC__metadata_simple_iterator_init()
455
* \c true if the current metadata block is the last in the file,
458
FLAC_API FLAC__bool FLAC__metadata_simple_iterator_is_last(const FLAC__Metadata_SimpleIterator *iterator);
460
/** Get the offset of the metadata block at the current position. This
461
* avoids reading the actual block data which can save time for large
464
* \param iterator A pointer to an existing initialized iterator.
466
* \code iterator != NULL \endcode
467
* \a iterator has been successfully initialized with
468
* FLAC__metadata_simple_iterator_init()
470
* The offset of the metadata block at the current iterator position.
471
* This is the byte offset relative to the beginning of the file of
472
* the current metadata block's header.
474
FLAC_API off_t FLAC__metadata_simple_iterator_get_block_offset(const FLAC__Metadata_SimpleIterator *iterator);
446
476
/** Get the type of the metadata block at the current position. This
447
477
* avoids reading the actual block data which can save time for large
455
485
* \retval FLAC__MetadataType
456
486
* The type of the metadata block at the current iterator position.
459
488
FLAC_API FLAC__MetadataType FLAC__metadata_simple_iterator_get_block_type(const FLAC__Metadata_SimpleIterator *iterator);
490
/** Get the length of the metadata block at the current position. This
491
* avoids reading the actual block data which can save time for large
494
* \param iterator A pointer to an existing initialized iterator.
496
* \code iterator != NULL \endcode
497
* \a iterator has been successfully initialized with
498
* FLAC__metadata_simple_iterator_init()
500
* The length of the metadata block at the current iterator position.
501
* The is same length as that in the
502
* <a href="http://flac.sourceforge.net/format.html#metadata_block_header">metadata block header</a>,
503
* i.e. the length of the metadata body that follows the header.
505
FLAC_API unsigned FLAC__metadata_simple_iterator_get_block_length(const FLAC__Metadata_SimpleIterator *iterator);
507
/** Get the application ID of the \c APPLICATION block at the current
508
* position. This avoids reading the actual block data which can save
509
* time for large blocks.
511
* \param iterator A pointer to an existing initialized iterator.
512
* \param id A pointer to a buffer of at least \c 4 bytes where
513
* the ID will be stored.
515
* \code iterator != NULL \endcode
516
* \code id != NULL \endcode
517
* \a iterator has been successfully initialized with
518
* FLAC__metadata_simple_iterator_init()
520
* \c true if the ID was successfully read, else \c false, in which
521
* case you should check FLAC__metadata_simple_iterator_status() to
522
* find out why. If the status is
523
* \c FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ILLEGAL_INPUT, then the
524
* current metadata block is not an \c APPLICATION block. Otherwise
526
* \c FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR or
527
* \c FLAC__METADATA_SIMPLE_ITERATOR_STATUS_SEEK_ERROR, an I/O error
528
* occurred and the iterator can no longer be used.
530
FLAC_API FLAC__bool FLAC__metadata_simple_iterator_get_application_id(FLAC__Metadata_SimpleIterator *iterator, FLAC__byte *id);
461
532
/** Get the metadata block at the current position. You can modify the
462
533
* block but must use FLAC__metadata_simple_iterator_set_block() to
463
534
* write it back to the FLAC file.
471
542
* \a iterator has been successfully initialized with
472
543
* FLAC__metadata_simple_iterator_init()
473
544
* \retval FLAC__StreamMetadata*
474
* The current metadata block.
545
* The current metadata block, or \c NULL if there was a memory
476
548
FLAC_API FLAC__StreamMetadata *FLAC__metadata_simple_iterator_get_block(FLAC__Metadata_SimpleIterator *iterator);
760
832
FLAC_API FLAC__bool FLAC__metadata_chain_read(FLAC__Metadata_Chain *chain, const char *filename);
762
/*@@@@ add to unit tests*/
763
834
/** Read all metadata from an Ogg FLAC file into the chain.
765
836
* \note Ogg FLAC metadata data writing is not supported yet and
800
871
FLAC_API FLAC__bool FLAC__metadata_chain_read_with_callbacks(FLAC__Metadata_Chain *chain, FLAC__IOHandle handle, FLAC__IOCallbacks callbacks);
802
/*@@@@ add to unit tests*/
803
873
/** Read all metadata from an Ogg FLAC stream into the chain via I/O callbacks.
805
875
* The \a handle need only be open for reading, but must be seekable.
2001
2071
FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_is_legal(const FLAC__StreamMetadata *object, FLAC__bool check_cd_da_subset, const char **violation);
2003
/* @@@@ add to unit tests */
2004
2073
/** Calculate and return the CDDB/freedb ID for a cue sheet. The function
2005
2074
* assumes the cue sheet corresponds to a CD; the result is undefined
2006
2075
* if the cuesheet's is_cd bit is not set.