[linux-audio-dev] light C++ set for WAV

Lars Luthman lars.luthman at gmail.com
Wed Jul 26 11:21:34 UTC 2006


On Wed, 2006-07-26 at 11:26 +0100, Chris Cannam wrote:
> On Wednesday 26 Jul 2006 11:12, Florian Paul Schmidt wrote:
> > Well, it is very thin though. Which is not a bad thing at all. One could
> > make ue of an arbitrary amount of more advanced C++ features if desired
> > though (i.e. templates parametrized with the type you want to read for
> > example, or operator<< and operator>> for reading and writing, etc.)
> 
> operator<< and >>... ugh.

Operator overloading is lovely. When reading fixed size audio chunks a
function call syntax makes more sense though (how else would you specify
the chunk size? sndfile>>setw(1024)>>my_buffer is a bit too weird).


> > > Secondly, with regard to the method names, which do you prefer:
> > >
> > >     - OpenRead
> > >     - openRead
> > >     - open_read
> >
> > vote++, i never cared for the more java style methodName convention.
> 
> I think if your class is named LikeThis, then your method should be named 
> likeThat (Java-style).  If your method is named like_this, then your class 
> should be named like_that (STL-style).  Either is fine, but don't mix your 
> dialects.

I use ClassNames and function_names all the time. I think it makes it
easier to distinguish between them.


> > > Since you're the only person who actually responded to the real
> > > meat of my email, I have to assume that you are the only person
> > > on this list with a love for C++ and hence the only one who
> > > should have any real input on this issue ;-).
> >
> > Nicely worded :)
> 
> Mmm.  For what it's worth, I write mostly C++ but have no problem with using 
> the libsndfile C API.  I don't really mind whether it has a C++ API as well 
> or not.  So yes, you probably should ignore me.

I agree - the libsndfile API is simple enough to fit into C++ code quite
nicely.

-- 
Lars Luthman - please encrypt any email sent to me if possible
PGP key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x04C77E2E
Fingerprint: FCA7 C790 19B9 322D EB7A E1B3 4371 4650 04C7 7E2E
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.linuxaudio.org/pipermail/linux-audio-dev/attachments/20060726/7b3acae6/attachment.pgp>


More information about the Linux-audio-dev mailing list