Skip to content

Commit

Permalink
Cosmetic refactoring
Browse files Browse the repository at this point in the history
- Update copyright header
- Move private variables to .m file
  • Loading branch information
gonzoua committed May 1, 2016
1 parent f2e212e commit 44b079b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
15 changes: 5 additions & 10 deletions MP4Atom.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2009, Oleksandr Tymoshenko <[email protected]>
// Copyright (c) 2009-2016 Oleksandr Tymoshenko <[email protected]>
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -32,16 +32,11 @@
#define ITUNES_METADATA_IMAGE_CLASS 0x0e
#define ITUNES_METADATA_UINT8_CLASS 0x15

@interface MP4Atom : NSObject {
NSString *name;
UInt32 length;
NSArray *children;
UInt64 offset;
}
@interface MP4Atom : NSObject

@property(readwrite, copy) NSString *name;
@property(readwrite, assign) UInt32 length;
@property(readwrite, assign) UInt64 offset;
@property (copy) NSString *name;
@property (assign) UInt32 length;
@property (assign) UInt64 offset;

-(id) initWithName:(NSString*)atom andLength:(UInt32)length;
-(id) initWithHeaderData:(NSData*)data andOffset: (UInt64)offset;
Expand Down
13 changes: 7 additions & 6 deletions MP4Atom.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2009, Oleksandr Tymoshenko <[email protected]>
// Copyright (c) 2009-2016 Oleksandr Tymoshenko <[email protected]>
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -27,12 +27,13 @@

#import "MP4Atom.h"

@interface MP4Atom() {
NSArray *children;
}

@implementation MP4Atom
@end

@synthesize length;
@synthesize offset;
@synthesize name;
@implementation MP4Atom

-(id) initWithName: (NSString*)atom andLength:(UInt32)len;
{
Expand Down Expand Up @@ -76,7 +77,7 @@ -(NSData*)encode
} hdr;

hdr.beLength = htonl(self.length);
NSAssert([name getCString:hdr.name maxLength:5 encoding:NSMacOSRomanStringEncoding],
NSAssert([self.name getCString:hdr.name maxLength:5 encoding:NSMacOSRomanStringEncoding],
@"Failed to convert tag name");
NSData *data = [NSData dataWithBytes:&hdr length:8];
return data;
Expand Down

0 comments on commit 44b079b

Please sign in to comment.