1 /*
2    Project: MPDCon
3 
4    Copyright (C) 2004
5 
6    Author: Daniel Luederwald
7 
8    Created: 2004-05-12 17:59:14 +0200 by flip
9 
10    Playlist Controller
11 
12    This application is free software; you can redistribute it and/or
13    modify it under the terms of the GNU General Public
14    License as published by the Free Software Foundation; either
15    version 2 of the License, or (at your option) any later version.
16 
17    This application is distributed in the hope that it will be useful,
18    but WITHOUT ANY WARRANTY; without even the implied warranty of
19    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20    Library General Public License for more details.
21 
22    You should have received a copy of the GNU General Public
23    License along with this library; if not, write to the Free
24    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
25 */
26 
27 #ifndef _PCAPPPROJ_PLAYLISTCONTROLLER_H
28 #define _PCAPPPROJ_PLAYLISTCONTROLLER_H
29 
30 #include <AppKit/AppKit.h>
31 #include "MPDController.h"
32 #include "PlaylistItem.h"
33 #include "CollectionController.h"
34 #include "PlaylistsManagerController.h"
35 #include "Strings.h"
36 
37 @interface PlaylistController : NSWindowController
38 {
39   IBOutlet NSTableView *playlistTable;
40   IBOutlet NSTextField *lengthView;
41   IBOutlet NSPopUpButton *playlistSelector;
42   IBOutlet NSPopUpButton *removeSelector;
43   IBOutlet NSWindow *window;
44   IBOutlet NSTextField *filterField;
45 
46   MPDController *mpdController;
47 
48   NSArray *playlist;
49   NSMutableArray *playlistTimes;
50 
51   NSTableColumn *ratingCol;
52 
53   int currentSong;
54 }
55 
56 
57 
58 // Initialization Methods
59 + (id) sharedPlaylistController;
60 
61 // GUI Methods
62 - (void) removeSongs: (id)sender;
63 - (void) managePlaylists: (id)sender;
64 - (void) doubleClicked: (id)sender;
65 - (void) showCurrentSong: (id)sender;
66 - (void) shuffleList: (id)sender;
67 - (void) browseCollection: (id)sender;
68 - (void) filterList: (id)sender;
69 - (void) clearFilter: (id)sender;
70 
71 // some convenience methods
72 - (NSString *) playlistLength;
73 
74 // TableView dataSource Methods
75 - (NSInteger) numberOfRowsInTableView: (NSTableView *)tableView;
76 
77 -           (id) tableView: (NSTableView *)tableView
78  objectValueForTableColumn: (NSTableColumn *)tableColumn
79                        row:(NSInteger) row;
80 
81 // TableView dragging Methods
82 - (NSDragOperation) tableView: (NSTableView *)tv
83                  validateDrop: (id <NSDraggingInfo>)info
84                   proposedRow: (NSInteger)row
85         proposedDropOperation: (NSTableViewDropOperation)dropOperation;
86 
87 - (BOOL) tableView: (NSTableView *)tv
88         acceptDrop: (id <NSDraggingInfo>)info
89                row: (NSInteger)row
90      dropOperation: (NSTableViewDropOperation)dropOperation;
91 
92 - (BOOL) tableView: (NSTableView *)tv
93          writeRows: (NSArray *)rows
94       toPasteboard: (NSPasteboard*)pboard;
95 
96 // Notification Methods
97 - (void) songChanged: (NSNotification *)aNotif;
98 - (void) playlistChanged: (NSNotification *)aNotif;
99 - (void) didNotConnect: (NSNotification *)aNotif;
100 @end
101 
102 #endif
103