Changeset 403 for libreplaygain/include


Ignore:
Timestamp:
04/25/08 17:03:53 (17 years ago)
Author:
r2d
Message:
  • reduced libreplaygain symbol exports
  • prefixed API function names with gain_
  • moved API info in header
  • added -fpic to compilation flags
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libreplaygain/include/replaygain/gain_analysis.h

    r230 r403  
    2626 */
    2727
     28/**
     29 * Pseudo-code to process an album:
     30 *
     31 *    Float_t       l_samples [4096];
     32 *    Float_t       r_samples [4096];
     33 *    size_t        num_samples;
     34 *    unsigned int  num_songs;
     35 *    unsigned int  i;
     36 *
     37 *    gain_init_analysis ( 44100 );
     38 *    for ( i = 1; i <= num_songs; i++ ) {
     39 *        while ( ( num_samples = getSongSamples ( song[i], left_samples, right_samples ) ) > 0 )
     40 *            gain_analyze_samples ( left_samples, right_samples, num_samples, 2 );
     41 *        fprintf ("Recommended dB change for song %2d: %+6.2f dB\n", i, gain_get_title() );
     42 *    }
     43 *    fprintf ("Recommended dB change for whole album: %+6.2f dB\n", gain_get_album() );
     44 */
     45
    2846#ifndef GAIN_ANALYSIS_H
    2947#define GAIN_ANALYSIS_H
     
    4462typedef double  Float_t;         // Type used for filtering
    4563
    46 int     InitGainAnalysis ( long samplefreq );
    47 int     AnalyzeSamples   ( const Float_t* left_samples, const Float_t* right_samples, size_t num_samples, int num_channels );
    48 int     ResetSampleFrequency ( long samplefreq );
    49 Float_t   GetTitleGain     ( void );
    50 Float_t   GetAlbumGain     ( void );
     64/// Here's the deal : Call
     65int gain_init_analysis ( long samplefreq );
     66/// to initialize everything. Call
     67int gain_analyze_samples ( const Float_t* left_samples, const Float_t* right_samples, size_t num_samples, int num_channels );
     68/// as many times as you want, with as many or as few samples as you want.
     69/// If mono, pass the sample buffer in through left_samples, leave
     70/// right_samples NULL, and make sure num_channels = 1.
     71
     72Float_t gain_get_title ( void );
     73/// will return the recommended dB level change for all samples analyzed
     74/// SINCE THE LAST TIME you called gain_get_title() OR gain_init_analysis().
     75
     76Float_t gain_get_album ( void );
     77/// will return the recommended dB level change for all samples analyzed
     78/// since gain_init_analysis() was called and finalized with gain_get_title().
    5179
    5280#ifdef __cplusplus
Note: See TracChangeset for help on using the changeset viewer.