Commit graph

311 commits

Author SHA1 Message Date
mewmew 69c05ea659 meta: Return error is seek table order isn't ascending, based on SampleNumber. 2012-11-04 23:05:04 +01:00
mewmew ed11fb8d6e meta: Minor changes to NewSeekTable, such as error handling and comments. 2012-11-04 20:49:59 +01:00
mewmew 3f825a3133 rsf: Changes to NewApplication, more details below:
- Moved RegisteredApplications closer to NewApplication
   - Changed from Signature to ID in Application.
   - Added additional error checking.
2012-11-04 19:45:30 +01:00
mewmew c0d1919d3a meta: Changes related to NewStreamInfo, more detail below:
* Corrected parsing of MinFrameSize in NewStreamInfo (shift 24 bits right
     instead of 32 bits).
   * Move constant definitions closer to their intended use in NewStreamInfo.
   * Simplified some error handling in NewStreamInfo:
      - MinBlockSize
      - MaxBlockSize
   * Corrected error handling of SampleRate.
   * Corrected error message for MaxBlockSize ("< 65535" was replaced with
     "<= 65535").
   * Change order of bits and mask.
      - before: NumSamplesMask & bits.
      - after: bits & NumSamplesMask.
   * Simplify some expressions based on operator precedence, removing some
     parentheses.
      - before: uint8((BitsPerSampleMask&bits)>>36) + 1
      - after: uint8(bits&BitsPerSampleMask>>36) + 1
   * Add comments to the memers of BlockHeader and StreamInfo.
rsf: Minor alteration of newStream comment.
2012-11-04 19:35:02 +01:00
mewmew c4011d9b32 all: Refacturing and updating of comments. More details below:
meta:
   * Replace the parse method for all metadata block types with a function that
     handles both allocation and parsing.
      - before:
         v = new(T)
         func (v *T) parse(buf []byte) (err error)
      - after:
         func NewT(buf []byte) (v *T, err error)
   * Move type definitions closer to the first function using them.
      - For instance place the type definition of StreamInfo above the
        NewStreamInfo function.
   * Rewrite comments for exported identifiers according to godoc conventions.
   * Rename DataHeader to BlockHeader.
   * Add the type definition Type which is used to identify metadata block
     types.
   * Make BlockHeader.Length usage more convenient, by changing it's type from
     uint32 to int.
   * Rename buf (bytes.Buffer) to b, and rename block ([]byte) to buf.
   * Use errors.New() instead of fmt.Errorf for errors that doesn't require
     formatted output.
   * Rename IsAllZero to isAllZero, since it doesn't have to be exported. Return
     a bool instead of an error.
rsf:
   * Renamed Stream.Metadata to Stream.MetaBlocks.
   * Replace the parse method for all metadata block types with a function that
     handles both allocation and parsing.
      - before:
         v = new(T)
         func (v *T) parse(buf []byte) (err error)
      - after:
         func NewT(buf []byte) (v *T, err error)
   * Replace headerTypes[header.BlockType].(type) switch statement with a
     header.BlockType statement.
2012-11-02 13:26:09 +01:00
mewmew 8bc470ebb4 rsf: Rewrite comments for exported identifiers according to godoc conventions.
Remove HasSignature from the Stream structure. If no signature is found, an error will be returned which is sufficient.
2012-11-01 23:52:26 +01:00
mewmew f7dc94499f Fixed links in readme. 2012-11-01 21:31:11 +01:00
mewmew a33d492044 Minor edit to readme. 2012-11-01 21:30:13 +01:00
mewmew 7f4ae89623 rsf: Updated readme. 2012-11-01 21:29:26 +01:00
mewmew debfe1fcd3 rsf: Added readme. Updated import paths. 2012-11-01 21:27:51 +01:00
forsoki c540818b3f Initial commit 2012-11-01 21:15:38 +01:00