[DUG] C code help

Ross Levis ross at stationplaylist.com
Thu Jul 13 21:07:40 NZST 2006


Just to clarify this a bit...

An audio file tag format uses 4 bytes to store a flag to indicate whether text or binary information is stored in the following tag.  The C++ source code uses these definitions

#define TAG_FIELD_FLAG_DATA_TYPE_MASK           (6)
#define TAG_FIELD_FLAG_DATA_TYPE_TEXT_UTF8      (0 << 1)
#define TAG_FIELD_FLAG_DATA_TYPE_BINARY         (1 << 1)
#define TAG_FIELD_FLAG_DATA_TYPE_EXTERNAL_INFO  (2 << 1)
#define TAG_FIELD_FLAG_DATA_TYPE_RESERVED       (3 << 1)

Am I correct in assuming that a Binary flag will appear like this in the file (in Hex).

00 00 00 02

Effectively a big endian value of 02.  Is this correct?

Thanks,
Ross.
  ----- Original Message ----- 
  From: Ross Levis 
  To: NZ Borland Developers Group - Delphi List 
  Sent: Thursday, July 13, 2006 8:17 PM
  Subject: Re: [DUG] C code help


  > So TAG_FIELD_FLAG_DATA_TYPE is a one-bit flag stored in the 2nd-rightmost bit of the word, and its possible values are TEXT_UTF8 (value 0) and BINARY (value 1).

  I see.  Thanks for that.

  Cheers,
  Ross.
    ----- Original Message ----- 
    From: Brian Wrigley 
    To: NZ Borland Developers Group - Delphi List 
    Sent: Thursday, July 13, 2006 7:32 PM
    Subject: Re: [DUG] C code help


    That's the bitwise shift-left operator. So, 0 shifted left 1 bit is still zero, 1 shifted left 1 bit is 2. 1 shifted left 30 bits would be (hex) 40000000.

    Brian


------------------------------------------------------------------------------


  _______________________________________________
  Delphi mailing list
  Delphi at ns3.123.co.nz
  http://ns3.123.co.nz/mailman/listinfo/delphi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ns3.123.co.nz/pipermail/delphi/attachments/20060713/0478d5a2/attachment.html


More information about the Delphi mailing list