autogen.sh : Test for required programs.
[platform/upstream/flac.git] / include / FLAC++ / decoder.h
index 9d18ed7..a9f2655 100644 (file)
@@ -1,5 +1,5 @@
 /* libFLAC++ - Free Lossless Audio Codec library
- * Copyright (C) 2002,2003,2004,2005,2006 Josh Coalson
+ * Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009  Josh Coalson
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -67,7 +67,7 @@
  *
  * Second, there are two stream decoder classes.  FLAC::Decoder::Stream
  * is used for the same cases that FLAC__stream_decoder_init_stream() /
- * FLAC__stream_decoder_init_ogg_stream() is used, and FLAC::Decoder::File
+ * FLAC__stream_decoder_init_ogg_stream() are used, and FLAC::Decoder::File
  * is used for the same cases that
  * FLAC__stream_decoder_init_FILE() and FLAC__stream_decoder_init_file() /
  * FLAC__stream_decoder_init_ogg_FILE() and FLAC__stream_decoder_init_ogg_file()
@@ -139,11 +139,12 @@ namespace FLAC {
                        virtual unsigned get_bits_per_sample() const;                     ///< See FLAC__stream_decoder_get_bits_per_sample()
                        virtual unsigned get_sample_rate() const;                         ///< See FLAC__stream_decoder_get_sample_rate()
                        virtual unsigned get_blocksize() const;                           ///< See FLAC__stream_decoder_get_blocksize()
+                       virtual bool get_decode_position(FLAC__uint64 *position) const;   ///< See FLAC__stream_decoder_get_decode_position()
 
                        virtual ::FLAC__StreamDecoderInitStatus init();      ///< Seek FLAC__stream_decoder_init_stream()
                        virtual ::FLAC__StreamDecoderInitStatus init_ogg();  ///< Seek FLAC__stream_decoder_init_ogg_stream()
 
-                       virtual void finish(); ///< See FLAC__stream_decoder_finish()
+                       virtual bool finish(); ///< See FLAC__stream_decoder_finish()
 
                        virtual bool flush(); ///< See FLAC__stream_decoder_flush()
                        virtual bool reset(); ///< See FLAC__stream_decoder_reset()
@@ -156,7 +157,7 @@ namespace FLAC {
                        virtual bool seek_absolute(FLAC__uint64 sample); ///< See FLAC__stream_decoder_seek_absolute()
                protected:
                        /// see FLAC__StreamDecoderReadCallback
-                       virtual ::FLAC__StreamDecoderReadStatus read_callback(FLAC__byte buffer[], unsigned *bytes) = 0;
+                       virtual ::FLAC__StreamDecoderReadStatus read_callback(FLAC__byte buffer[], size_t *bytes) = 0;
 
                        /// see FLAC__StreamDecoderSeekCallback
                        virtual ::FLAC__StreamDecoderSeekStatus seek_callback(FLAC__uint64 absolute_byte_offset);
@@ -179,16 +180,13 @@ namespace FLAC {
                        /// see FLAC__StreamDecoderErrorCallback
                        virtual void error_callback(::FLAC__StreamDecoderErrorStatus status) = 0;
 
-#if (defined _MSC_VER) || (defined __GNUG__ && (__GNUG__ < 2 || (__GNUG__ == 2 && __GNUC_MINOR__ < 96))) || (defined __SUNPRO_CC)
+#if (defined _MSC_VER) || (defined __BORLANDC__) || (defined __GNUG__ && (__GNUG__ < 2 || (__GNUG__ == 2 && __GNUC_MINOR__ < 96))) || (defined __SUNPRO_CC)
                        // lame hack: some MSVC/GCC versions can't see a protected decoder_ from nested State::resolved_as_cstring()
                        friend State;
 #endif
-                       // hackery solely for the use of libOggFLAC++
-                       Stream(::FLAC__StreamDecoder *);
-
                        ::FLAC__StreamDecoder *decoder_;
 
-                       static ::FLAC__StreamDecoderReadStatus read_callback_(const ::FLAC__StreamDecoder *decoder, FLAC__byte buffer[], unsigned *bytes, void *client_data);
+                       static ::FLAC__StreamDecoderReadStatus read_callback_(const ::FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data);
                        static ::FLAC__StreamDecoderSeekStatus seek_callback_(const ::FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data);
                        static ::FLAC__StreamDecoderTellStatus tell_callback_(const ::FLAC__StreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data);
                        static ::FLAC__StreamDecoderLengthStatus length_callback_(const ::FLAC__StreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data);
@@ -234,7 +232,7 @@ namespace FLAC {
                        virtual ::FLAC__StreamDecoderInitStatus init_ogg(const std::string &filename); ///< See FLAC__stream_decoder_init_ogg_file()
                protected:
                        // this is a dummy implementation to satisfy the pure virtual in Stream that is actually supplied internally by the C layer
-                       virtual ::FLAC__StreamDecoderReadStatus read_callback(FLAC__byte buffer[], unsigned *bytes);
+                       virtual ::FLAC__StreamDecoderReadStatus read_callback(FLAC__byte buffer[], size_t *bytes);
                private:
                        // Private and undefined so you can't use them:
                        File(const File &);