1 /*****************************************************************************
2 * playlist.h: MacOS X interface module
3 *****************************************************************************
4 * Copyright (C) 2002-2012 VLC authors and VideoLAN
7 * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
8 * Derk-Jan Hartman <hartman at videolan dot org>
9 * Felix Paul Kühne <fkuehne at videolan dot org>
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24 *****************************************************************************/
26 #import "PXSourceList.h"
28 /* playlist column definitions */
29 #define TRACKNUM_COLUMN @"tracknumber"
30 #define TITLE_COLUMN @"name"
31 #define ARTIST_COLUMN @"artist"
32 #define DURATION_COLUMN @"duration"
33 #define GENRE_COLUMN @"genre"
34 #define ALBUM_COLUMN @"album"
35 #define DESCRIPTION_COLUMN @"description"
36 #define DATE_COLUMN @"date"
37 #define LANGUAGE_COLUMN @"language"
38 #define URI_COLUMN @"uri"
40 /*****************************************************************************
41 * VLCPlaylistView interface
42 *****************************************************************************/
43 @interface VLCPlaylistView : NSOutlineView
49 /*****************************************************************************
50 * VLCPlaylistCommon interface
51 *****************************************************************************/
52 @interface VLCPlaylistCommon : NSObject <NSOutlineViewDataSource, NSOutlineViewDelegate>
54 IBOutlet VLCPlaylistView* o_outline_view;
56 IBOutlet id o_tc_name_other;
57 IBOutlet id o_tc_author_other;
58 IBOutlet id o_tc_duration_other;
59 IBOutlet VLCPlaylistView* o_outline_view_other;
61 NSMutableDictionary *o_outline_dict;
62 playlist_item_t * p_current_root_item;
65 - (void)setPlaylistRoot: (playlist_item_t *)root_item;
66 - (playlist_item_t *)currentPlaylistRoot;
67 - (playlist_item_t *)selectedPlaylistItem;
68 - (NSOutlineView *)outlineView;
71 /*****************************************************************************
72 * VLCPlaylistWizard interface
73 *****************************************************************************/
74 @interface VLCPlaylistWizard : VLCPlaylistCommon
78 - (IBAction)reloadOutlineView;
82 /*****************************************************************************
83 * VLCPlaylist interface
84 *****************************************************************************/
85 @interface VLCPlaylist : VLCPlaylistCommon
87 IBOutlet id o_controller;
88 IBOutlet id o_playlist_wizard;
90 IBOutlet id o_btn_playlist;
91 IBOutlet id o_playlist_view;
92 IBOutlet id o_search_field;
93 IBOutlet id o_search_field_other;
94 IBOutlet id o_mi_save_playlist;
95 IBOutlet id o_ctx_menu;
97 IBOutlet id o_mi_play;
98 IBOutlet id o_mi_delete;
99 IBOutlet id o_mi_info;
100 IBOutlet id o_mi_preparse;
101 IBOutlet id o_mi_revealInFinder;
102 IBOutlet id o_mm_mi_revealInFinder;
103 IBOutlet id o_mi_dl_cover_art;
104 IBOutlet id o_mi_selectall;
105 IBOutlet id o_mi_sort_name;
106 IBOutlet id o_mi_sort_author;
107 IBOutlet id o_mi_recursive_expand;
109 IBOutlet id o_save_accessory_view;
110 IBOutlet id o_save_accessory_popup;
111 IBOutlet id o_save_accessory_text;
114 NSImage *o_descendingSortingImage;
115 NSImage *o_ascendingSortingImage;
117 NSMutableArray *o_nodes_array;
118 NSMutableArray *o_items_array;
120 BOOL b_selected_item_met;
121 BOOL b_isSortDescending;
125 - (void)searchfieldChanged:(NSNotification *)o_notification;
126 - (NSMenu *)menuForEvent:(NSEvent *)o_event;
128 - (IBAction)searchItem:(id)sender;
130 - (void)playlistUpdated;
131 - (void)outlineViewSelectionDidChange:(NSNotification *)notification;
132 - (void)sortNode:(int)i_mode;
133 - (void)updateRowSelection;
135 - (BOOL)isSelectionEmpty;
137 - (IBAction)playItem:(id)sender;
138 - (IBAction)revealItemInFinder:(id)sender;
139 - (IBAction)preparseItem:(id)sender;
140 - (IBAction)downloadCoverArt:(id)sender;
141 - (IBAction)savePlaylist:(id)sender;
142 - (IBAction)deleteItem:(id)sender;
143 - (IBAction)selectAll:(id)sender;
144 - (IBAction)sortNodeByName:(id)sender;
145 - (IBAction)sortNodeByAuthor:(id)sender;
146 - (IBAction)recursiveExpandNode:(id)sender;
149 - (NSArray *)draggedItems;
151 - (void)appendArray:(NSArray*)o_array atPos:(int)i_position enqueue:(BOOL)b_enqueue;
152 - (void)appendNodeArray:(NSArray*)o_array inNode:(playlist_item_t *)p_node atPos:(int)i_position enqueue:(BOOL)b_enqueue;
154 - (void)setColumn: (NSString *)o_column state: (NSInteger)i_state;