Skip to content

Commit

Permalink
Merge pull request #2 from ericpinet/CurrentPlayingSongToolbar
Browse files Browse the repository at this point in the history
CurrentPlayingSongToolbar
  • Loading branch information
ericpinet committed Jan 11, 2018
2 parents c36dd80 + ff1f55a commit d2cc4f5
Show file tree
Hide file tree
Showing 79 changed files with 3,071 additions and 2,262 deletions.
2 changes: 2 additions & 0 deletions MusicPutt.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1167,6 +1167,7 @@
CLANG_WARN_DOCUMENTATION_COMMENTS = NO;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = NU5E6U97UG;
FRAMEWORK_SEARCH_PATHS = "";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "MusicPutt/MusicPutt-Prefix.pch";
Expand Down Expand Up @@ -1209,6 +1210,7 @@
CLANG_WARN_DOCUMENTATION_COMMENTS = NO;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = NU5E6U97UG;
FRAMEWORK_SEARCH_PATHS = "";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "MusicPutt/MusicPutt-Prefix.pch";
Expand Down
608 changes: 385 additions & 223 deletions MusicPutt/Base.lproj/Main.storyboard

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion MusicPutt/MPDataManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
@class CMMotionManager;
@class Playlist;
@class BFNavigationBarDrawer;
@class iToolbar;

/**
* MPDataManager is the main application data manager. This class maintain all data for
Expand All @@ -36,7 +37,7 @@
/**
* Toolbar displayed when playlist is editing.
*/
@property (strong, nonatomic) BFNavigationBarDrawer* currentEditingPlaylistToolbar;
@property (strong, nonatomic) iToolbar* currentEditingPlaylistToolbar;

/**
* Current selected itunes playlist select in the playlist navigation bar.
Expand Down
3 changes: 2 additions & 1 deletion MusicPutt/MPDataManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#import "ITunesSearchApi.h"
#import "MusicPuttApi.h"
#import "MPListening.h"
#import <BFNavigationBarDrawer.h>

#import <MediaPlayer/MPMusicPlayerController.h>
#import <CoreMotion/CoreMotion.h>
Expand Down Expand Up @@ -57,7 +58,7 @@ -(bool) initialise
currentPlayingToolbarMustBeHidden = false;

// init current editing playlist toolbar
_currentEditingPlaylistToolbar = [[BFNavigationBarDrawer alloc] init];
_currentEditingPlaylistToolbar = [[iToolbar alloc] init];

// the initial state of playlist editing mode is FALSE:
playlistEditing = false;
Expand Down
20 changes: 11 additions & 9 deletions MusicPutt/MusicPutt-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,31 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.0</string>
<string>2.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>2.0</string>
<string>2.1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>NSAppleMusicUsageDescription</key>
<string>Play your music</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UIRequiresFullScreen</key>
<false/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>NSAppleMusicUsageDescription</key>
<string>Play your music</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
</dict>
</plist>
2 changes: 1 addition & 1 deletion MusicPutt/REFrostedViewControllerMain.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ @implementation REFrostedViewControllerMain
- (void)awakeFromNib
{
// setup app delegate
self.del = [[UIApplication sharedApplication] delegate];
self.del = (AppDelegate*)[[UIApplication sharedApplication]delegate];

//self.liveBlur = TRUE;

Expand Down
4 changes: 2 additions & 2 deletions MusicPutt/UICurrentPlayingToolBar.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright (c) 2014 Eric Pinet. All rights reserved.
//

#import "BFNavigationBarDrawer.h"
#import <iToolbar.h>

#import "UIViewCurrentToolBar.h"

Expand All @@ -16,7 +16,7 @@
* This toolbar can display current playing song.
* @see UIViewCurrentToolBar.h
*/
@interface UICurrentPlayingToolBar : BFNavigationBarDrawer
@interface UICurrentPlayingToolBar : iToolbar
{
UIViewCurrentToolBar *view;
}
Expand Down
61 changes: 14 additions & 47 deletions MusicPutt/UICurrentPlayingToolBar.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,12 @@ - (id)initWithFrame:(CGRect)frame
// Initialization code

// setup app delegate
self.del = [[UIApplication sharedApplication] delegate];
self.del = (AppDelegate*)[[UIApplication sharedApplication]delegate];

NSMutableArray *barItems = [[NSMutableArray alloc] init];
UIBarButtonItem *flexSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self action:nil];
[barItems addObject:flexSpace];

UINib *nib = [UINib nibWithNibName:@"UIViewCurrentPlayingToolBar" bundle:nil];
view = [[nib instantiateWithOwner:self options:nil] objectAtIndex:0];
[view setBackgroundColor:[UIColor clearColor]];
UIBarButtonItem *customViewContainer = [[UIBarButtonItem alloc] initWithCustomView:view];

[barItems addObject:customViewContainer];

UIBarButtonItem *flexSpace2 = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self action:nil];
[barItems addObject:flexSpace2];

[self setItems:barItems animated:YES];
view = [[[NSBundle mainBundle] loadNibNamed:@"UIViewCurrentPlayingToolBar" owner:nil options:nil] objectAtIndex:0];
[view setBackgroundColor:UIColor.clearColor];
[self setContentView:view];
[self layoutIfNeeded];
}
return self;
}
Expand All @@ -57,7 +46,8 @@ -(void)dealloc {
- (void) setNavigationController:(UINavigationController*) controller;
{
self->navController = controller;
[view setNavigationController:navController];
[view setNavigationController:self->navController];
[self setParentNavbar:(iNavigationBar*)controller.navigationBar];
}

- (id)init
Expand All @@ -66,34 +56,11 @@ - (id)init
return self;
}

- (void)setupConstraintsWithNavigationBar:(UINavigationBar *)bar {
NSLayoutConstraint *constraint;
constraint = [NSLayoutConstraint constraintWithItem:self
attribute:NSLayoutAttributeLeft
relatedBy:NSLayoutRelationEqual
toItem:bar
attribute:NSLayoutAttributeLeft
multiplier:1
constant:0];
[self.superview addConstraint:constraint];

constraint = [NSLayoutConstraint constraintWithItem:self
attribute:NSLayoutAttributeRight
relatedBy:NSLayoutRelationEqual
toItem:bar
attribute:NSLayoutAttributeRight
multiplier:1
constant:0];
[self.superview addConstraint:constraint];

constraint = [NSLayoutConstraint constraintWithItem:self
attribute:NSLayoutAttributeHeight
relatedBy:NSLayoutRelationEqual
toItem:nil
attribute:NSLayoutAttributeNotAnAttribute
multiplier:1
constant:60];
[self addConstraint:constraint];
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
// Triggered when touch is released
[self hideAnimated:false];
[view viewPressed];
}

/**
Expand All @@ -105,7 +72,7 @@ - (void)setupConstraintsWithNavigationBar:(UINavigationBar *)bar {
- (void)showFromNavigationBar:(UINavigationBar *)bar animated:(BOOL)animated
{
[view updateCurrentPlayingItem];
[super showFromNavigationBar:bar animated:animated];
[super show:animated];
[view startNotificationCapture];
}

Expand All @@ -116,7 +83,7 @@ - (void)showFromNavigationBar:(UINavigationBar *)bar animated:(BOOL)animated
*/
- (void)hideAnimated:(BOOL)animated
{
[super hideAnimated:animated];
[super hide:animated];
[view stopNotificationCapture];
}

Expand Down
2 changes: 1 addition & 1 deletion MusicPutt/UITabBarControllerMain.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ - (void)viewDidLoad
// Do any additional setup after loading the view.

// setup app delegate
self.del = [[UIApplication sharedApplication] delegate];
self.del = (AppDelegate*)[[UIApplication sharedApplication]delegate];
self.del.mpdatamanager.tabbar = self;

// setup current navigation controller
Expand Down
2 changes: 1 addition & 1 deletion MusicPutt/UITableViewCellAlbum.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
- (void)awakeFromNib
{
// Initialization code
self.del = [[UIApplication sharedApplication] delegate];
self.del = (AppDelegate*)[[UIApplication sharedApplication]delegate];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
Expand Down
2 changes: 1 addition & 1 deletion MusicPutt/UITableViewCellArtist.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
- (void)awakeFromNib
{
// Initialization code
self.del = [[UIApplication sharedApplication] delegate];
self.del = (AppDelegate*)[[UIApplication sharedApplication]delegate];
}

/**
Expand Down
2 changes: 1 addition & 1 deletion MusicPutt/UITableViewCellArtistAlbum.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ - (void)setSelected:(BOOL)selected animated:(BOOL)animated
[super setSelected:selected animated:animated];

// Configure the view for the selected state
self.del = [[UIApplication sharedApplication] delegate];
self.del = (AppDelegate*)[[UIApplication sharedApplication]delegate];
}

/**
Expand Down
2 changes: 1 addition & 1 deletion MusicPutt/UITableViewCellFeature.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ - (void)awakeFromNib
// Initialization code

// setup app delegate
self.del = [[UIApplication sharedApplication] delegate];
self.del = (AppDelegate*)[[UIApplication sharedApplication]delegate];

// active tap gesture on title label
_title.userInteractionEnabled = YES;
Expand Down
4 changes: 2 additions & 2 deletions MusicPutt/UITableViewCellMediaItem.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
// Initialization code

// setup app delegate
self.del = [[UIApplication sharedApplication] delegate];
self.del = (AppDelegate*)[[UIApplication sharedApplication]delegate];
}
return self;
}
Expand All @@ -39,7 +39,7 @@ - (void)awakeFromNib
// Initialization code

// setup app delegate
self.del = [[UIApplication sharedApplication] delegate];
self.del = (AppDelegate*)[[UIApplication sharedApplication]delegate];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
Expand Down
2 changes: 1 addition & 1 deletion MusicPutt/UITableViewCellPlaylist.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ - (void)awakeFromNib
// Initialization code

// setup app delegate
self.del = [[UIApplication sharedApplication] delegate];
self.del = (AppDelegate*)[[UIApplication sharedApplication]delegate];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
Expand Down
2 changes: 1 addition & 1 deletion MusicPutt/UITableViewCellPlaylistSong.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ - (void)awakeFromNib
// Initialization code

// setup app delegate
self.del = [[UIApplication sharedApplication] delegate];
self.del = (AppDelegate*)[[UIApplication sharedApplication]delegate];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
Expand Down
2 changes: 1 addition & 1 deletion MusicPutt/UITableViewControllerMenu.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ - (void)viewDidLoad
[super viewDidLoad];

// setup app delegate
self.del = [[UIApplication sharedApplication] delegate];
self.del = (AppDelegate*)[[UIApplication sharedApplication]delegate];

self.tableView.opaque = NO;
self.tableView.backgroundColor = [UIColor clearColor];
Expand Down
2 changes: 1 addition & 1 deletion MusicPutt/UIViewControllerAbout.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ - (void)viewDidLoad
// Do any additional setup after loading the view.

// setup app delegate
self.del = [[UIApplication sharedApplication] delegate];
self.del = (AppDelegate*)[[UIApplication sharedApplication]delegate];

// setup title
[self setTitle:@"About"];
Expand Down
2 changes: 1 addition & 1 deletion MusicPutt/UIViewControllerAlbum.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ - (void)viewDidLoad
// Do any additional setup after loading the view.

// setup app delegate
self.del = [[UIApplication sharedApplication] delegate];
self.del = (AppDelegate*)[[UIApplication sharedApplication]delegate];

// setup title
[self setTitle:@"Albums"];
Expand Down
2 changes: 1 addition & 1 deletion MusicPutt/UIViewControllerAlbumPage.m
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ - (void)viewDidLoad
// Do any additional setup after loading the view.

// setup app delegate
self.del = [[UIApplication sharedApplication] delegate];
self.del = (AppDelegate*)[[UIApplication sharedApplication]delegate];

// Create blur effect
UIToolbar *blurtoolbar = [[UIToolbar alloc] initWithFrame:self.view.frame];
Expand Down
2 changes: 1 addition & 1 deletion MusicPutt/UIViewControllerAlbumSongs.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ - (void)viewDidLoad
[super viewDidLoad];
// Do any additional setup after loading the view.
// setup app delegate
self.del = [[UIApplication sharedApplication] delegate];
self.del = (AppDelegate*)[[UIApplication sharedApplication]delegate];

albumCollection = [[self.del mpdatamanager] currentAlbumCollection];
songs = [albumCollection items];
Expand Down
2 changes: 1 addition & 1 deletion MusicPutt/UIViewControllerAlbumStore.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ - (void)viewDidLoad {
// Do any additional setup after loading the view.

// setup app delegate
self.del = [[UIApplication sharedApplication] delegate];
self.del = (AppDelegate*)[[UIApplication sharedApplication]delegate];

// setup title
[self setTitle:@"Store"];
Expand Down
2 changes: 1 addition & 1 deletion MusicPutt/UIViewControllerArtist.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ - (void)viewDidLoad
// Do any additional setup after loading the view.

// setup app delegate
self.del = [[UIApplication sharedApplication] delegate];
self.del = (AppDelegate*)[[UIApplication sharedApplication]delegate];

// setup title
[self setTitle:@"Artists"];
Expand Down
2 changes: 1 addition & 1 deletion MusicPutt/UIViewControllerArtistAlbum.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ - (void)viewDidLoad
[super viewDidLoad];
// Do any additional setup after loading the view.
// setup app delegate
self.del = [[UIApplication sharedApplication] delegate];
self.del = (AppDelegate*)[[UIApplication sharedApplication]delegate];

artistCollection = [[self.del mpdatamanager] currentArtistCollection];

Expand Down
5 changes: 2 additions & 3 deletions MusicPutt/UIViewControllerFeature.m
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ - (void)viewDidLoad
// Do any additional setup after loading the view.

// setup app delegate
self.del = [[UIApplication sharedApplication] delegate];
self.del = (AppDelegate*)[[UIApplication sharedApplication]delegate];

// setup title
[self setTitle:@"Feature"];
Expand Down Expand Up @@ -129,8 +129,6 @@ - (void)viewDidLoad

if (musicPuttTracks.count>=4) {
results = musicPuttTracks;


UITableViewCellFeature* cell = (UITableViewCellFeature*)[_tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:_MUSICPUTT_CELL_INDEX_ inSection:0]];
if(cell)
{
Expand Down Expand Up @@ -165,6 +163,7 @@ - (void)viewDidLoad
}
}
failure:^(NSError* error){
musicPuttReadyToFlip = true;
NSLog(@" %s - %@\n", __PRETTY_FUNCTION__, @"MusicPutt request failed");
}];

Expand Down
Loading

0 comments on commit d2cc4f5

Please sign in to comment.