Skip to content

Commit

Permalink
Small changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ilia3101 authored Jul 15, 2017
1 parent 25a341e commit 8b2a138
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
1 change: 1 addition & 0 deletions platform/cocoa/gui_stuff/gui_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ NSTextField * labelName = [ \
initWithFrame: NSMakeRect( RIGHT_SIDEBAR_LABEL(slotNumber, ELEMENT_HEIGHT, offset) ) \
]; \
[labelName setLabelStyle]; /* From useful_methods.h */ \
/*[labelName setFont:[NSFont fontWithName:@"Helvetica" size:12.7]];*/ \
[labelName anchorTop: YES]; \
[labelName anchorRight: YES]; \
[labelName setStringValue: labelString]; \
Expand Down
12 changes: 7 additions & 5 deletions platform/cocoa/main.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
int frameChanged;
/* What frame we r on */
int currentFrameIndex;
double frameSliderPosition;
/* To pause frame drawing, above 0 = paused */
int dontDraw;

Expand Down Expand Up @@ -182,7 +183,7 @@ int NSApplicationMain(int argc, const char * argv[])
processingSetExposureStops(processingSettings, 1.2);
/* Link video with processing settings */
setMlvProcessing(videoMLV, processingSettings);
/* Limit frame cache to suitable amount of RAM (~33% at 8GB and below ~50% at 16GB and up and up) */
/* Limit frame cache to suitable amount of RAM (~33% at 8GB and below, ~50% at 16GB, then up and up) */
cacheSizeMB = (int)(0.66666f * (float)(MAC_RAM - 4000));
if (MAC_RAM < 7500) cacheSizeMB = MAC_RAM * 0.33;
NSLog(@"Cache size = %iMB, or %i percent of RAM", cacheSizeMB, (int)((float)cacheSizeMB / (float)MAC_RAM * 100));
Expand All @@ -196,10 +197,11 @@ int NSApplicationMain(int argc, const char * argv[])

/* ...lets start at 5D2 resolution because that's my camera */

int imageSize = 1880 * 1056 * 3;

/* This will be freed and allocated soo many times */
rawImage = malloc( imageSize );
{
int imageSize = 1880 * 1056 * 3;
/* This will be freed and allocated soo many times */
rawImage = malloc( imageSize );
}

/* NSBitmapImageRep lets you display bitmap data n stuff in CrApple things like NSImageView */
rawBitmap = [ [NSBitmapImageRep alloc]
Expand Down
6 changes: 4 additions & 2 deletions platform/cocoa/main_methods.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@

/* What frame we r on */
extern int currentFrameIndex;
extern double frameSliderPosition;

/* We always set MLV object to this amount of cache */
extern int cacheSizeMB;
Expand Down Expand Up @@ -137,8 +138,8 @@ -(void)openMlvDialog

/* Allow drawing frames */
dontDraw = 0;
/* All MLV frames have at least one frame, so this should be safe */
currentFrameIndex = 0;
/* Set current frame where slider is at */
currentFrameIndex = (int)( frameSliderPosition * (getMlvFrames(videoMLV)-1) );
/* So view updates and shows new clip */
frameChanged++;

Expand Down Expand Up @@ -189,6 +190,7 @@ @implementation NSSlider (mainMethods)
-(void)timelineSliderMethod
{
currentFrameIndex = (int)( [self doubleValue] * (getMlvFrames(videoMLV)-1) );
frameSliderPosition = [self doubleValue];

frameChanged++;
}
Expand Down
2 changes: 1 addition & 1 deletion src/mlv/video_mlv.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,4 +478,4 @@ void printMlvInfo(mlvObject_t * video)
printf(" Black Level: %i\n", video->RAWI.raw_info.black_level);
printf(" White Level: %i\n", video->RAWI.raw_info.white_level);
printf(" Bits / Pixel: %i\n\n", video->RAWI.raw_info.bits_per_pixel);
}
}

0 comments on commit 8b2a138

Please sign in to comment.