Hello, Eric.
on 00.6.20 5:27 PM, Erik de Castro Lopo at [EMAIL PROTECTED] wrote:
> Why? What possible benefit does C++ provide?
I think C++ has following merits:
(1) With constructor, we can init member vaules.
(2) With destructor, we can dispose resources, such as memory block which
had been allocated with operator new, or malloc(). Of course, we can close
file, too.
(3) To make member values private, we can check the value is valid range.
(4) We can handle error with exception.
And more. But I know, C++ may little slower than C.
To use LAME as library, I have to remove all exit(), so I want to use C++
exception, i.e.,
#define exit(x) throw(c_exit_exception(x))
>> In LAME 3.83beta, there is many exit(), fprintf(stderr, format, ...), or
>> assert() so I want to make much more reliable for library use.
>
> That is a different matter. Yes, it would be well worthwhile fixing
> these so that LAME can be used as a library.
I agree. But I don't have cvs access, and I don't know about cvs well.
So I must fix many lines when newer version will be released.
> I am the author of libsndfile
>
> http://www.zip.com.au/~erikd/libsndfile/
Oh, is that so? That great! Thanks for your works.
> which can optionally be used as the LAME input file decoder. I have for
> some time thought about added MP3 encoding and decoding to this library
> but a lack of free time has so far prevented this.
That's sound nice, but, encoders are needed patent licence, right?
The free decoders may not be charged according to mp3licences.com.
> If you or someone else is willing to help on this I would be more than
> interested in talking to you and helping in whatever way I could.
I am intersted in that work, though, I wondering if I had enough skill.
Anyway, to add some encorder status value and message buffer to
lame_globas_flas, I think.
struct _lame_internal_flags;
#pragma mark struct lame_globals_floags
typedef struct {
/* input file description */
unsigned long num_samples; /* number of samples. default=2^32-1 */
int num_channels; /* input number of channels. default=2 */
int in_samplerate; /* input_samp_rate. default=44.1kHz */
int out_samplerate; /* output_samp_rate. (usually determined
automatically) */
/* snip */
/************************************************************************/
/* more internal variables, which will not exist after
lame_encode_finish() */
/************************************************************************/
/*void*/struct _lame_internal_flags *internal_flags; /* <- this should be
better style */
int status; /* encoder status, if not zero, we've got an error */
char msg[256]; /* buffer for error status, use sprintf(gf.msg, format,
...) insted for debug */
} lame_global_flags;
--
Osamu Shigematsu
mailto:[EMAIL PROTECTED]
--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )