Skip to content

Commit

Permalink
Add accessor to file list
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzoua committed Feb 11, 2010
1 parent 3ce61eb commit a0f35f5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion AudioFileList.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
- (void) addFile:(NSString*)fileName;
- (void) addFilesInDirectory:(NSString*)dirName;
- (void) deleteSelected;

- (NSArray*) files;
// NSOutlineView data source methods
- (NSInteger)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item;
- (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item;
Expand Down
10 changes: 7 additions & 3 deletions AudioFileList.m
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ - (void) addFile:(NSString*)fileName
[file release];
}

- (NSArray*) files
{
NSArray *result = [[NSArray arrayWithArray:_files] retain];
return result;
}

- (void) addFilesInDirectory:(NSString*)dirName
{
NSString *currentFile;
Expand Down Expand Up @@ -113,7 +119,6 @@ - (NSInteger)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id

- (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item
{
NSLog(@"isExpandable?");
return FALSE;
}

Expand All @@ -130,13 +135,12 @@ - (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTabl
{
id objectValue = nil;

NSLog(@"objectValue %@/%@/%@", item, tableColumn, [tableColumn identifier]);
if (item != nil)
{
AudioFile *file = item;

if ([tableColumn.identifier isEqualToString:COLUMNID_NAME])
objectValue = file.filePath;
objectValue = file.name;
else {
int hours = file.duration / 3600;
int minutes = (file.duration - (hours * 3600)) / 60;
Expand Down

0 comments on commit a0f35f5

Please sign in to comment.