-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
1,177 additions
and
448 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// PlaylistPickViewController.h | ||
// TeslaTunes | ||
// | ||
// Created by Rob Arnold on 3/29/15. | ||
// Copyright (c) 2015 Loci Consulting. All rights reserved. | ||
// | ||
|
||
#import <Cocoa/Cocoa.h> | ||
|
||
#import "PlaylistSelections.h" | ||
|
||
|
||
@interface PlaylistPickViewController : NSViewController | ||
|
||
@property (weak) IBOutlet NSOutlineView *playlistTreeView; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// | ||
// PlaylistPickViewController.m | ||
// TeslaTunes | ||
// | ||
// Created by Rob Arnold on 3/29/15. | ||
// Copyright (c) 2015 Loci Consulting. All rights reserved. | ||
// | ||
|
||
#import "PlaylistPickViewController.h" | ||
#import "AppDelegate.h" | ||
|
||
|
||
|
||
@interface PlaylistPickViewController () | ||
|
||
@end | ||
|
||
@implementation PlaylistPickViewController { | ||
AppDelegate *theApp; | ||
} | ||
|
||
- (void)viewDidLoad { | ||
[super viewDidLoad]; | ||
theApp = [[NSApplication sharedApplication] delegate]; | ||
self.playlistTreeView.dataSource = theApp.playlists; | ||
self.playlistTreeView.delegate = theApp.playlists; | ||
[self.playlistTreeView reloadData]; | ||
[self.playlistTreeView expandItem:nil expandChildren:YES]; | ||
} | ||
|
||
|
||
- (void) viewDidDisappear { | ||
[theApp.playlists saveSelected]; | ||
} | ||
|
||
- (IBAction)checkmarkButtonClicked:(NSButton *)sender { | ||
NSInteger row = [self.playlistTreeView rowForView:sender]; | ||
[theApp.playlists setNode: [self.playlistTreeView itemAtRow:row] toSelectedState: sender.state]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// PlaylistSelections.h | ||
// TeslaTunes | ||
// | ||
// Created by Rob Arnold on 3/29/15. | ||
// Copyright (c) 2015 Loci Consulting. All rights reserved. | ||
// | ||
|
||
#import <Cocoa/Cocoa.h> | ||
|
||
#import <iTunesLibrary/ITLibrary.h> | ||
#import <iTunesLibrary/ITLibMediaItem.h> | ||
#import <iTunesLibrary/ITLibPlaylist.h> | ||
#import <iTunesLibrary/ITLibArtist.h> | ||
#import <iTunesLibrary/ITLibAlbum.h> | ||
|
||
|
||
@interface PlaylistNode : NSObject | ||
@property ITLibPlaylist *playlist; | ||
@property NSMutableArray *children; | ||
@property NSNumber *selectedState; | ||
- (BOOL) enumerateTreeUsingBlock: (void(^)(PlaylistNode* node, BOOL *stop)) block; | ||
@end | ||
|
||
|
||
@interface PlaylistSelections : NSObject <NSOutlineViewDataSource, NSOutlineViewDelegate> | ||
- (void) setNode:(PlaylistNode*) node toSelectedState: (NSInteger) state; | ||
- (void) saveSelected; | ||
- (PlaylistNode*) getTree; | ||
- (ITLibrary*) getLibrary; | ||
@end |
Oops, something went wrong.