Logo Search packages:      
Sourcecode: madman version File versions  Download package

info_mac.h

Go to the documentation of this file.
/********************************************************************
*    
* Copyright (c) 2002 Artur Polaczynski (Ar't)  All rights reserved.
*            <artii@o2.pl>        LGPL-2.1
*       $ArtId: info_mac.h,v 1.6 2003/04/13 11:24:10 art Exp $
********************************************************************/
/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as 
 * published by the Free Software Foundation; either version 2.1 
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */


#ifndef INFO_MAC_H
#define INFO_MAC_H

/** \file info_mac.h 
    \brief Get information from MonkeyAudio file.

    Usage:
    \code
    StreamInfoMac Info;
    
    if (info_mac_read(fn, &Info)) {
        printf("File \"%s\" not found or is read protected!\n", fn);
        return;
    }
    printf("%",Info.fields...);
    \endcode
*/

/** 
    \name Compression level
*/
/*\{*/
00046 #define COMPRESSION_LEVEL_FAST        1000 /**< fast */
00047 #define COMPRESSION_LEVEL_NORMAL      2000 /**< optimal average time/compression ratio */
00048 #define COMPRESSION_LEVEL_HIGH        3000 /**< higher compression ratio */
00049 #define COMPRESSION_LEVEL_EXTRA_HIGH  4000 /**< very slowly */
00050 #define COMPRESSION_LEVEL_INSANE      5000 /**< ??? */
/*\}*/

/**    All information from mac file
 *    \struct StreamInfoMac 
**/
00056 typedef struct 
{
00058     unsigned int ByteLength;        /**< file length - tags size */
00059     unsigned int FileSize;          /**< real file size */
00060     int          SampleFreq;        /**< sample frequency */
00061     unsigned int Channels;          /**< number of chanels */
00062     int          Duration;          /**< duratiom in ms */
    
00064     unsigned int Version;           /**< version of current file */
00065     unsigned int Bitrate;           /**< bitrate of current file (bps) */
00066     unsigned int Compresion;        /**< compresion profile */
00067     unsigned int Flags;             /**< flags */
    
00069     unsigned int Frames;            /**< number of frames */
00070     unsigned int SamplesPerFrame;   /**< samples per frame */
00071     unsigned int Samples;           /**< number of samples */
00072     unsigned int BitsPerSample;     /**< bits per sample */
00073     unsigned int UncompresedSize;   /**< uncomprese size of file */
00074     float        CompresionRatio;   /**< compresion ratio */
    
00076     unsigned int PeakLevel;         /**< peak level */
00077     float        PeakRatio;         /**< peak ratio */
    
00079     const char  *CompresionName;    /**< compresion profile as string */
    
00081     unsigned int EncoderVersion;    /**< version of encoder used */
} StreamInfoMac;

/**
    Read all mac info from filename 

    \param fn File name 
    \param Info StreamInfoMac Structure for all information
    \retval 0 ok
    \retval 1 file not found or write protected
    \retval 2 not monkey's audio file
*/
int
info_mac_read(const char *fn, StreamInfoMac * Info);

#endif /* INFO_MAC_H */

Generated by  Doxygen 1.6.0   Back to index