Skip to content

Commit

Permalink
• Improved design of progress panel
Browse files Browse the repository at this point in the history
• Implemented filtering via search field
• Added metadata for image and audio folder parsers
  • Loading branch information
peterb180369 committed Sep 7, 2009
1 parent 035e629 commit 8db3c3b
Show file tree
Hide file tree
Showing 14 changed files with 1,094 additions and 197 deletions.
33 changes: 32 additions & 1 deletion IMBAudioFolderParser.m
Expand Up @@ -79,7 +79,38 @@ - (id) initWithMediaType:(NSString*)inMediaType

- (NSDictionary*) metadataForFileAtPath:(NSString*)inPath
{
return nil;
NSMutableDictionary* metadata = [NSMutableDictionary dictionary];
MDItemRef item = MDItemCreate(NULL,(CFStringRef)inPath);

if (item)
{
CFNumberRef seconds = MDItemCopyAttribute(item,kMDItemDurationSeconds);
CFArrayRef authors = MDItemCopyAttribute(item,kMDItemAuthors);
CFStringRef album = MDItemCopyAttribute(item,kMDItemAlbum);

if (seconds)
{
[metadata setObject:(NSNumber*)seconds forKey:@"duration"];
CFRelease(seconds);
}

if (authors)
{
NSArray* artists = (NSArray*)authors;
if (artists.count > 0)[metadata setObject:[artists objectAtIndex:0] forKey:@"artist"];
CFRelease(authors);
}

if (album)
{
[metadata setObject:(NSString*)album forKey:@"album"];
CFRelease(album);
}

CFRelease(item);
}

return metadata;
}


Expand Down
948 changes: 824 additions & 124 deletions IMBAudioView.xib

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions IMBAudioViewController.m
Expand Up @@ -51,6 +51,7 @@ of this software and associated documentation files (the "Software"), to deal

#import "IMBAudioViewController.h"
#import "IMBNodeViewController.h"
#import "IMBObjectArrayController.h"
#import "IMBCommon.h"
#import "IMBObject.h"
#import "IMBNode.h"
Expand All @@ -72,6 +73,18 @@ @implementation IMBAudioViewController
//----------------------------------------------------------------------------------------------------------------------


- (void) awakeFromNib
{
[super awakeFromNib];

ibObjectArrayController.searchableProperties = [NSArray arrayWithObjects:
@"name",
@"metadata.artist",
@"metadata.album",
nil];
}


- (void) dealloc
{
IMBRelease(_playingAudio);
Expand Down
25 changes: 24 additions & 1 deletion IMBImageFolderParser.m
Expand Up @@ -79,7 +79,30 @@ - (id) initWithMediaType:(NSString*)inMediaType

- (NSDictionary*) metadataForFileAtPath:(NSString*)inPath
{
return nil;
NSMutableDictionary* metadata = [NSMutableDictionary dictionary];
MDItemRef item = MDItemCreate(NULL,(CFStringRef)inPath);

if (item)
{
CFNumberRef width = MDItemCopyAttribute(item,kMDItemPixelWidth);
CFNumberRef height = MDItemCopyAttribute(item,kMDItemPixelHeight);

if (width)
{
[metadata setObject:(NSNumber*)width forKey:@"width"];
CFRelease(width);
}

if (height)
{
[metadata setObject:(NSNumber*)width forKey:@"height"];
CFRelease(height);
}

CFRelease(item);
}

return metadata;
}


Expand Down
40 changes: 10 additions & 30 deletions IMBImageView.xib
Expand Up @@ -21,8 +21,8 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="575"/>
<integer value="660"/>
<integer value="565"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
Expand Down Expand Up @@ -1036,14 +1036,6 @@
</object>
<int key="connectionID">628</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">search:</string>
<reference key="source" ref="918073312"/>
<reference key="destination" ref="796568742"/>
</object>
<int key="connectionID">629</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">delegate</string>
Expand Down Expand Up @@ -1262,22 +1254,6 @@
</object>
<int key="connectionID">659</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">ibProgressWindow</string>
<reference key="source" ref="1021"/>
<reference key="destination" ref="608690772"/>
</object>
<int key="connectionID">665</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">ibProgressBar</string>
<reference key="source" ref="1021"/>
<reference key="destination" ref="804250920"/>
</object>
<int key="connectionID">666</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">dataSource</string>
Expand All @@ -1286,6 +1262,14 @@
</object>
<int key="connectionID">667</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">search:</string>
<reference key="source" ref="918073312"/>
<reference key="destination" ref="796568742"/>
</object>
<int key="connectionID">668</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
Expand Down Expand Up @@ -1751,7 +1735,7 @@
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">667</int>
<int key="maxID">668</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
Expand Down Expand Up @@ -1813,8 +1797,6 @@
<string>ibIconView</string>
<string>ibListView</string>
<string>ibObjectArrayController</string>
<string>ibProgressBar</string>
<string>ibProgressWindow</string>
<string>ibTabView</string>
</object>
<object class="NSMutableArray" key="dict.values">
Expand All @@ -1823,8 +1805,6 @@
<string>IKImageBrowserView</string>
<string>NSTableView</string>
<string>IMBObjectArrayController</string>
<string>NSProgressIndicator</string>
<string>NSWindow</string>
<string>NSTabView</string>
</object>
</object>
Expand Down
14 changes: 14 additions & 0 deletions IMBImageViewController.m
Expand Up @@ -50,6 +50,7 @@ of this software and associated documentation files (the "Software"), to deal
#pragma mark HEADERS

#import "IMBImageViewController.h"
#import "IMBObjectArrayController.h"
#import "IMBCommon.h"
#import "NSWorkspace+iMedia.h"

Expand All @@ -65,6 +66,19 @@ @implementation IMBImageViewController
//----------------------------------------------------------------------------------------------------------------------


- (void) awakeFromNib
{
[super awakeFromNib];

ibObjectArrayController.searchableProperties = [NSArray arrayWithObjects:
@"name",
nil];
}


//----------------------------------------------------------------------------------------------------------------------


+ (NSString*) mediaType
{
return kIMBMediaTypeImage;
Expand Down
81 changes: 63 additions & 18 deletions IMBMovieView.xib
Expand Up @@ -21,7 +21,7 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="570"/>
<integer value="565"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
Expand All @@ -40,7 +40,7 @@
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1048">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSCustomObject" id="1021">
<string key="NSClassName">IMBPhotosViewController</string>
<string key="NSClassName">IMBImageViewController</string>
</object>
<object class="NSCustomObject" id="1014">
<string key="NSClassName">FirstResponder</string>
Expand Down Expand Up @@ -1017,14 +1017,6 @@
</object>
<int key="connectionID">628</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">search:</string>
<reference key="source" ref="918073312"/>
<reference key="destination" ref="796568742"/>
</object>
<int key="connectionID">629</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">delegate</string>
Expand Down Expand Up @@ -1198,6 +1190,14 @@
</object>
<int key="connectionID">657</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">search:</string>
<reference key="source" ref="918073312"/>
<reference key="destination" ref="796568742"/>
</object>
<int key="connectionID">658</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
Expand Down Expand Up @@ -1603,17 +1603,17 @@
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">657</int>
<int key="maxID">658</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">IKImageBrowserView</string>
<string key="superclassName">NSView</string>
<string key="className">IMBImageViewController</string>
<string key="superclassName">IMBObjectViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">IMBImageKit.h</string>
<string key="minorKey">IMBImageViewController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
Expand Down Expand Up @@ -1653,6 +1653,10 @@
<object class="IBPartialClassDescription">
<string key="className">IMBObjectViewController</string>
<string key="superclassName">NSViewController</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">openSelectedObjects:</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
Expand All @@ -1678,18 +1682,17 @@
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">IMBPhotosViewController</string>
<string key="superclassName">IMBObjectViewController</string>
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">IMBPhotosViewController.h</string>
<string key="minorKey">NSString+iMedia.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">NSString+iMedia.h</string>
<string key="minorKey">QLPreviewPanel.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
Expand Down Expand Up @@ -2127,6 +2130,48 @@
<string key="minorKey">Print.framework/Headers/PDEPluginInterface.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">QTKit.framework/Headers/QTCaptureDecompressedVideoOutput.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">QTKit.framework/Headers/QTCaptureFileOutput.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">QTKit.framework/Headers/QTCaptureVideoPreviewOutput.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">QTKit.framework/Headers/QTCaptureView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">QTKit.framework/Headers/QTMovie.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">QTKit.framework/Headers/QTMovieView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
Expand Down
14 changes: 14 additions & 0 deletions IMBMovieViewController.m
Expand Up @@ -50,6 +50,7 @@ of this software and associated documentation files (the "Software"), to deal
#pragma mark HEADERS

#import "IMBMovieViewController.h"
#import "IMBObjectArrayController.h"
#import "IMBCommon.h"
#import "NSWorkspace+iMedia.h"

Expand All @@ -65,6 +66,19 @@ @implementation IMBMovieViewController
//----------------------------------------------------------------------------------------------------------------------


- (void) awakeFromNib
{
[super awakeFromNib];

ibObjectArrayController.searchableProperties = [NSArray arrayWithObjects:
@"name",
nil];
}


//----------------------------------------------------------------------------------------------------------------------


+ (NSString*) mediaType
{
return kIMBMediaTypeMovie;
Expand Down

0 comments on commit 8db3c3b

Please sign in to comment.