Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
tattwamasi committed Apr 13, 2015
2 parents e197497 + 018d1f6 commit c3287b4
Show file tree
Hide file tree
Showing 20 changed files with 1,177 additions and 448 deletions.
186 changes: 56 additions & 130 deletions TeslaTunes.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions TeslaTunes/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
//

#import <Cocoa/Cocoa.h>
#import "PlaylistSelections.h"

@interface AppDelegate : NSObject <NSApplicationDelegate>
@property PlaylistSelections *playlists;
- (BOOL)setIdleSleepEnabled:(BOOL) enable;


Expand Down
2 changes: 2 additions & 0 deletions TeslaTunes/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ @implementation AppDelegate {

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// Insert code here to initialize your application



//[[NSUserDefaultsController sharedUserDefaultsController] setInitialValues:defaults];

}

- (void)applicationWillTerminate:(NSNotification *)aNotification {
Expand Down
314 changes: 235 additions & 79 deletions TeslaTunes/Base.lproj/Main.storyboard

Large diffs are not rendered by default.

14 changes: 11 additions & 3 deletions TeslaTunes/CopyConvertDirs.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

#import <Foundation/Foundation.h>

#include "PlaylistSelections.h"




typedef NS_ENUM(NSUInteger, DirOperation) {
Expand All @@ -19,8 +22,8 @@ typedef NS_ENUM(NSUInteger, DirOperation) {

@interface FileOp : NSObject{
@public
NSURL *sourceURL;
NSURL *destinationURL;
const NSURL *sourceURL;
const NSURL *destinationURL;
}
@end

Expand All @@ -33,10 +36,15 @@ typedef NS_ENUM(NSUInteger, DirOperation) {
@property (readonly) unsigned filesCopyConverted;
@property (readonly) BOOL isProcessing;
@property (readonly) BOOL scanReady;

@property BOOL hackGenre;

- (CopyConvertDirs*) init;

// Uses NSOperationQueue and NSOperation to concurrently run. TODO: delegate or something to indicate when finished,etc.
- (void) startOperationOnDir: (DirOperation) opType withSourceDir: (const NSURL *)src andDestDir: (const NSURL *)dst;
- (void) startOperationOnDir: (DirOperation) opType
withPlaylistSelections: (const PlaylistSelections*) playlistSelections
andSourceDir: (const NSURL *)src toDestDir: (const NSURL *)dst;
- (void) cancelOngoingOperations;

@end
451 changes: 329 additions & 122 deletions TeslaTunes/CopyConvertDirs.m

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions TeslaTunes/PlaylistPickViewController.h
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
41 changes: 41 additions & 0 deletions TeslaTunes/PlaylistPickViewController.m
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
31 changes: 31 additions & 0 deletions TeslaTunes/PlaylistSelections.h
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
Loading

0 comments on commit c3287b4

Please sign in to comment.