Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
Places where there were tabs instead of spaces and vice versa.
  • Loading branch information
dlublin committed Feb 20, 2015
1 parent bce0815 commit db2cece
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
26 changes: 13 additions & 13 deletions GifToSyphon/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
NSLog(@"%s",__func__);
// create the shared context and a buffer pool, set them up
sharedContext = [[NSOpenGLContext alloc] initWithFormat:[GLScene defaultPixelFormat] shareContext:nil];
VVBufferPool *bp = [[VVBufferPool alloc] initWithSharedContext:sharedContext pixelFormat:[GLScene defaultPixelFormat] sized:NSMakeSize(640,480)];
VVBufferPool *bp = [[VVBufferPool alloc] initWithSharedContext:sharedContext pixelFormat:[GLScene defaultPixelFormat] sized:NSMakeSize(640,480)];
[VVBufferPool setGlobalVVBufferPool:bp];
[VVBufferCopier createGlobalVVBufferCopierWithSharedContext:sharedContext];

Expand Down Expand Up @@ -222,19 +222,19 @@ - (IBAction)randomFromGiphyButtonUsed:(id)sender {

- (void) openDocument:(id)sender {
//NSLog(@"%s ... %@",__func__,sender);
NSOpenPanel *openPanel = [[NSOpenPanel openPanel] retain];
NSUserDefaults *def = [NSUserDefaults standardUserDefaults];
NSString *openPanelDir = [def objectForKey:@"openPanelDir"];
NSOpenPanel *openPanel = [[NSOpenPanel openPanel] retain];
NSUserDefaults *def = [NSUserDefaults standardUserDefaults];
NSString *openPanelDir = [def objectForKey:@"openPanelDir"];
if (openPanelDir==nil)
openPanelDir = [@"~/" stringByExpandingTildeInPath];
[openPanel setDirectoryURL:[NSURL fileURLWithPath:openPanelDir]];
[openPanel setAllowedFileTypes:OBJARRAY(@"gif")];
[openPanel
beginSheetModalForWindow:window
completionHandler:^(NSInteger result) {
NSString *path = (result!=NSFileHandlingPanelOKButton) ? nil : [[openPanel URL] path];
NSString *path = (result!=NSFileHandlingPanelOKButton) ? nil : [[openPanel URL] path];
if (path != nil) {
NSUserDefaults *def = [NSUserDefaults standardUserDefaults];
NSUserDefaults *def = [NSUserDefaults standardUserDefaults];
[def setObject:[path stringByDeletingLastPathComponent] forKey:@"openPanelDir"];
[def synchronize];
}
Expand Down Expand Up @@ -333,7 +333,7 @@ - (void)_startRandomDownloadForTerm:(NSString *)term {
// replace this with your own in production code if you don't want rate limits

// note that the term can be nil, just do a search all
if ((term == nil)||([term length] < 1)) {
if ((term == nil) || ([term length] < 1)) {
searchAddress = [NSString stringWithFormat:@"https://api.giphy.com/v1/gifs/random?api_key=%@",GIFToSyphonGiphyAPIKey];
}
else {
Expand Down Expand Up @@ -428,7 +428,7 @@ - (void) dlFinished:(id)h {
if ([jsonObject isKindOfClass:[NSDictionary class]]) {
//NSLog(@"\t\t\t%@",jsonObject);
NSDictionary *jsonDataDict = [jsonObject objectForKey:@"data"];
if ((jsonDataDict != nil)&&([jsonDataDict isKindOfClass:[NSDictionary class]])) {
if ((jsonDataDict != nil) && ([jsonDataDict isKindOfClass:[NSDictionary class]])) {
NSString *originalAddress = [jsonDataDict objectForKey:@"image_original_url"];
//NSLog(@"\t\t\tabout to download from %@",originalAddress);
URL = [NSURL URLWithString:originalAddress];
Expand Down Expand Up @@ -459,9 +459,9 @@ - (void) dlFinished:(id)h {
- (void)_renderCallback {
//NSLog(@"%s",__func__);
// get a frame from from the gifPlayer
VVBuffer *tmpBuffer = nil;
float newTime = -1.0;
float newTimeNormalized = -1.0;
VVBuffer *tmpBuffer = nil;
float newTime = -1.0;
float newTimeNormalized = -1.0;

// check to see if there is a GIF player and if it has a new frame get it
@synchronized (self) {
Expand Down Expand Up @@ -516,8 +516,8 @@ - (void)_renderCallback {
}

- (void)_updateTime {
float newTime = -1.0;
float newTimeNormalized = -1.0;
float newTime = -1.0;
float newTimeNormalized = -1.0;

// get the time from the GIF player and then display it if the window is visible
@synchronized (self) {
Expand Down
6 changes: 3 additions & 3 deletions GifToSyphon/VVGIFKit/VVGIFPlayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ - (void)renderUpkeep {
}

// compare the new current time to the end and start times to see if we need to do a loop action
if ((localRate > 0.)&&(CMTimeCompare(currentTime, endTime) != -1)) {
if ((localRate > 0.) && (CMTimeCompare(currentTime, endTime) != -1)) {
//NSLog(@"\t\treached end of movie");
didReachEnd = YES;
}
else if ((localRate < 0.)&&(CMTimeCompare(currentTime, startTime) != 1)) {
else if ((localRate < 0.) && (CMTimeCompare(currentTime, startTime) != 1)) {
//NSLog(@"\t\treached start of movie");
didReachStart = YES;
}
Expand Down Expand Up @@ -153,7 +153,7 @@ - (void)renderUpkeep {
if ((didReachEnd)||(didReachStart)) {
id d = [self delegate];
if (!_reachedEnd) {
if ((d!=nil)&&([(id)d conformsToProtocol:@protocol(VVGIFPlayerDelegate)])) {
if ((d != nil) && ([(id)d conformsToProtocol:@protocol(VVGIFPlayerDelegate)])) {
[d playerDidReachEnd:self];
}
}
Expand Down
10 changes: 5 additions & 5 deletions GifToSyphon/VVGIFKit/VVGIFPlayerItem.m
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ - (void)_preloadFramesFromData:(NSData *)gifData {
NSNumber *tmpNum = nil;

// figure out the frame count
int frameCount = 0;
int frameCount = 0;

tmpNum = [_gifRep valueForProperty:@"NSImageFrameCount"];
if (tmpNum != nil)
Expand All @@ -147,7 +147,7 @@ - (void)_preloadFramesFromData:(NSData *)gifData {
//NSLog(@"\t\tabout to load %d frames for GIF", frameCount);

// now read each frame out as a bitmap image and put it in the array
for(int i=0; i<frameCount; i++ ){
for (int i=0; i<frameCount; i++ ){
// advance to the specified frame #
[_gifRep setProperty:NSImageCurrentFrame withValue:[NSNumber numberWithUnsignedInt:i]];
// figure out how long long this frame is supposed to play for
Expand All @@ -159,7 +159,7 @@ - (void)_preloadFramesFromData:(NSData *)gifData {

// if we're preloading the frames, make a copy that gets stored here
// otherwise only preload the first frame and the frames will get pulled on the fly
if ((cacheAllFrames)||(i==0)) {
if ((cacheAllFrames) || (i == 0)) {
NSData *repData = [_gifRep representationUsingType:NSGIFFileType properties:nil];
frameRep = [NSBitmapImageRep imageRepWithData:repData];
}
Expand Down Expand Up @@ -213,7 +213,7 @@ - (VVGIFFrame *)frameForTime:(CMTime)t {
[self doPreload];
}

long frameIndex = 0;
long frameIndex = 0;

[_framesArray rdlock];

Expand Down Expand Up @@ -243,7 +243,7 @@ - (VVGIFFrame *)frameForTime:(CMTime)t {

// if this frame has a nil image rep because we didn't preload we'll actually want to load it up now
// attach it to the returned frame and it'll be cached for the next loop
if ((returnMe != nil)&&([returnMe imageRep] == nil)&&(_gifRep != nil)) {
if ((returnMe != nil) && ([returnMe imageRep] == nil) && (_gifRep != nil)) {
[_gifRep setProperty:NSImageCurrentFrame withValue:[NSNumber numberWithLong:frameIndex]];
NSData *repData = [_gifRep representationUsingType:NSGIFFileType properties:nil];
NSBitmapImageRep *frameRep = [NSBitmapImageRep imageRepWithData:repData];
Expand Down

0 comments on commit db2cece

Please sign in to comment.