@@ -56,28 +56,22 @@ -(instancetype)init
5656 // Add observers
5757 [self addObservers ];
5858
59-
60-
6159 // Load ui layout
6260 [player ().layout load ];
6361
6462 [self setUpHotkeys ];
6563
66-
6764 // Load and maintain main window controller
6865 NSStoryboard *storyboard = [NSStoryboard storyboardWithName: @" Main" bundle: nil ];
6966
7067 self.mainWindowController = [storyboard instantiateControllerWithIdentifier: @" IDMainWindow" ];
7168
72-
7369 [self setUpStatusBar ];
7470
7571 // Load document and notify the window
7672 [self loadDocument ];
77-
7873
7974 [_mainWindowController showWindow: nil ];
80-
8175 }
8276
8377 return self;
@@ -163,7 +157,7 @@ - (IBAction)cmdOpenDirectory:(id)sender
163157 NSString * fileName =[(NSURL *)(files.firstObject) path ];
164158
165159 PlayerDocument *document = player ().document ;
166- PlayerList *list = document.playerlList . selectItem ;
160+ const PlayerList *list = [ document.playerlList getSelectedItem ] ;
167161
168162 dojobInBkgnd (
169163 ^{
@@ -182,7 +176,7 @@ - (IBAction)cmdOpenDirectory:(id)sender
182176
183177-(void )reloadiTunesMedia
184178{
185- PlayerList *selected = player ().document .playerlList . selectItem ;
179+ const PlayerList *selected = [ player ().document.playerlList getSelectedItem ] ;
186180 [selected removeAll ];
187181 postEvent (EventID_to_reload_tracklist, selected);
188182
@@ -237,21 +231,21 @@ - (IBAction)cmdPrevPlaylist:(id)sender
237231{
238232 PlayerlList *llist = player ().document .playerlList ;
239233
240- PlayerList *currList = llist. selectItem ;
234+ const PlayerList *currList = [ llist getSelectedItem ] ;
241235
242- PlayerList *prevList = [llist getPreviousItem: [llist getIndex: currList]];
236+ PlayerList *prevList = [llist getPreviousItem: [llist getIndex: (PlayerList*) currList]];
243237
244238 if (prevList)
245239 postEvent (EventID_to_reload_playlist, prevList);
246240}
247241
248242- (IBAction )cmdNextPlaylist : (id )sender
249243{
250- PlayerlList *llist = player ().document .playerlList ;
244+ PlayerlList *llist = player ().document .playerlList ;
251245
252- PlayerList *currList = llist. selectItem ;
246+ const PlayerList *currList = [ llist getSelectedItem ] ;
253247
254- PlayerList *nextList = [llist getNextItem: [llist getIndex: currList]];
248+ PlayerList *nextList = [llist getNextItem: [llist getIndex: (PlayerList*) currList]];
255249
256250 if (nextList)
257251 postEvent (EventID_to_reload_playlist, nextList);
@@ -326,7 +320,7 @@ -(void)loadDocument
326320{
327321 PlayerDocument *d = player ().document ;
328322
329- [player () load ];
323+ // [player() load];
330324// if( [d load] )
331325// {
332326 postEvent (EventID_to_reload_tracklist, nil );
@@ -378,7 +372,7 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
378372 [self cmdNewPlayerList: nil ];
379373
380374 // add ~/music to a default playerlist, if is none.
381- if ( [d.playerlList count ] == 1 && d.playerlList . selectItem .count == 0 )
375+ if ( [d.playerlList count ] == 1 && [ d.playerlList getSelectedItem ] .count == 0 )
382376 {
383377 [self loadiTunesMedia ];
384378 }
@@ -396,7 +390,7 @@ -(void)loadiTunesMedia
396390
397391 userMusic = [userMusic stringByAppendingPathComponent: @" iTunes/iTunes Media/Music" ];
398392
399- PlayerList *list = d.playerlList . selectItem ;
393+ const PlayerList *list = [ d.playerlList getSelectedItem ] ;
400394
401395 dojobInBkgnd (
402396 ^{
@@ -411,7 +405,7 @@ -(void)loadiTunesMedia
411405
412406-(void )track_state_changed
413407{
414- PlayerTrack *track = player (). playing ;
408+ PlayerTrack *track = Playing () ;
415409
416410 BOOL stopped = [player ().engine isStopped ];
417411 BOOL paused = [player ().engine isPaused ];
@@ -486,7 +480,7 @@ -(void)scrobbler:(NSNotification*)n
486480 LFUser *user = lastFmUser ();
487481 if (user->isConnected )
488482 {
489- TrackInfo *info = player (). playing .info ;
483+ TrackInfo *info = Playing () .info ;
490484
491485 dojobInBkgnd (^{
492486 string artist (info.artist .UTF8String );
@@ -519,7 +513,7 @@ -(void)playerErrorHandler:(NSNotification*)n
519513
520514-(BOOL )importDirectoryEnabled
521515{
522- return player ().document .playerlList . selectItem .type != type_temporary ;
516+ return [ player ().document.playerlList getSelectedItem ] .type != type_temporary ;
523517}
524518
525519
@@ -532,7 +526,7 @@ -(void)lastFm_loveTrack:(NSNotification*)n
532526{
533527 PlayerTrack *track = n.object ;
534528 if (track == nil )
535- track = player (). playing ;
529+ track = Playing () ;
536530
537531 lastFm_loveTrack ( track );
538532}
0 commit comments