Changeset 318


Ignore:
Timestamp:
05/10/07 15:58:05 (17 years ago)
Author:
r2d
Message:

Use getopt.h

Location:
libmpc/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libmpc/trunk/mpccut/mpccut.c

    r317 r318  
    3434#include <stdio.h>
    3535#include <stdlib.h>
    36 #include <unistd.h>
     36#include <getopt.h>
    3737
    3838#include <mpc/mpcdec.h>
     
    7575        mpc_uint32_t beg_silence, start_block, block_num, i;
    7676        int c;
    77         extern char * optarg;
    78         extern int optind;
    7977        FILE * in_file;
    8078
  • libmpc/trunk/mpcdec/mpcdec.c

    r317 r318  
    3737#include <mpc/mpcdec.h>
    3838#include <libwaveformat.h>
    39 #include <unistd.h>
     39#include <getopt.h>
    4040
    4141#ifdef WIN32
     
    6363        printf("file: %s\n", filename);
    6464        printf("stream version %d\n", info->stream_version);
    65         printf("encoder: \%s\n", info->encoder);
    66         printf("profile: \%s (q=%0.2f)\n", info->profile_name, info->profile - 5);
    67         printf("PNS: \%s\n", info->pns == 0xFF ? "unknow" : info->pns ? "on" : "off");
     65        printf("encoder: %s\n", info->encoder);
     66        printf("profile: %s (q=%0.2f)\n", info->profile_name, info->profile - 5);
     67        printf("PNS: %s\n", info->pns == 0xFF ? "unknow" : info->pns ? "on" : "off");
    6868        printf("mid/side stereo: %s\n", info->ms ? "on" : "off");
    69         printf("gapless: \%s\n", info->is_true_gapless ? "on" : "off");
    70         printf("average bitrate: \%6.1f kbps\n", info->average_bitrate * 1.e-3);
    71         printf("samplerate: \%d Hz\n", info->sample_freq);
    72         printf("channels: \%d\n", info->channels);
    73         printf("length: \%d:\%.2d (%u samples)\n", minutes, seconds, (mpc_uint32_t)mpc_streaminfo_get_length_samples(info));
    74         printf("file size: \%d Bytes\n", info->total_file_length);
    75         printf("track peak: \%2.2f dB\n", info->peak_title / 256.);
    76         printf("track gain: \%2.2f dB / %2.2f dB\n", info->gain_title / 256., info->gain_title == 0 ? 0 : 65. - info->gain_title / 256.);
    77         printf("album peak: \%2.2f dB\n", info->peak_album / 256.);
    78         printf("album gain: \%2.2f dB / %2.2f dB\n", info->gain_album / 256., info->gain_album == 0 ? 0 : 65. - info->gain_album / 256.);
     69        printf("gapless: %s\n", info->is_true_gapless ? "on" : "off");
     70        printf("average bitrate: %6.1f kbps\n", info->average_bitrate * 1.e-3);
     71        printf("samplerate: %d Hz\n", info->sample_freq);
     72        printf("channels: %d\n", info->channels);
     73        printf("length: %d:%.2d (%u samples)\n", minutes, seconds, (mpc_uint32_t)mpc_streaminfo_get_length_samples(info));
     74        printf("file size: %d Bytes\n", info->total_file_length);
     75        printf("track peak: %2.2f dB\n", info->peak_title / 256.);
     76        printf("track gain: %2.2f dB / %2.2f dB\n", info->gain_title / 256., info->gain_title == 0 ? 0 : 65. - info->gain_title / 256.);
     77        printf("album peak: %2.2f dB\n", info->peak_album / 256.);
     78        printf("album gain: %2.2f dB / %2.2f dB\n", info->gain_album / 256., info->gain_album == 0 ? 0 : 65. - info->gain_album / 256.);
    7979        printf("\n");
    8080
     
    101101        mpc_bool_t is_wav_output;
    102102        int c;
    103         extern char * optarg;
    104         extern int optind;
    105103
    106104    printf("mpcdec - musepack (mpc) decoder sample application\n");
Note: See TracChangeset for help on using the changeset viewer.