1 /*****************************************************************************
2 * playlist.h: MacOS X interface module
3 *****************************************************************************
4 * Copyright (C) 2002-2006 VLC authors and VideoLAN
7 * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
8 * Derk-Jan Hartman <hartman at videolan dot org>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 #import "PXSourceList.h"
27 /*****************************************************************************
28 * VLCPlaylistView interface
29 *****************************************************************************/
30 @interface VLCPlaylistView : NSOutlineView
36 /*****************************************************************************
37 * VLCPlaylistCommon interface
38 *****************************************************************************/
39 @interface VLCPlaylistCommon : NSObject <NSOutlineViewDataSource, NSOutlineViewDelegate>
41 IBOutlet id o_tc_name;
42 IBOutlet id o_tc_author;
43 IBOutlet id o_tc_duration;
44 IBOutlet VLCPlaylistView* o_outline_view;
46 IBOutlet id o_tc_name_other;
47 IBOutlet id o_tc_author_other;
48 IBOutlet id o_tc_duration_other;
49 IBOutlet VLCPlaylistView* o_outline_view_other;
51 NSMutableDictionary *o_outline_dict;
55 - (playlist_item_t *)selectedPlaylistItem;
56 - (NSOutlineView *)outlineView;
57 - (void)swapPlaylists:(id)newList;
60 /*****************************************************************************
61 * VLCPlaylistWizard interface
62 *****************************************************************************/
63 @interface VLCPlaylistWizard : VLCPlaylistCommon
67 - (IBAction)reloadOutlineView;
71 /*****************************************************************************
72 * VLCPlaylist interface
73 *****************************************************************************/
74 @interface VLCPlaylist : VLCPlaylistCommon
76 IBOutlet id o_controller;
77 IBOutlet id o_playlist_wizard;
79 IBOutlet id o_btn_playlist;
80 IBOutlet id o_playlist_view;
81 IBOutlet id o_search_field;
82 IBOutlet id o_search_field_other;
83 IBOutlet id o_mi_save_playlist;
84 IBOutlet id o_ctx_menu;
86 IBOutlet id o_mi_play;
87 IBOutlet id o_mi_delete;
88 IBOutlet id o_mi_info;
89 IBOutlet id o_mi_preparse;
90 IBOutlet id o_mi_revealInFinder;
91 IBOutlet id o_mm_mi_revealInFinder;
92 IBOutlet id o_mi_dl_cover_art;
93 IBOutlet id o_mi_selectall;
94 IBOutlet id o_mi_sort_name;
95 IBOutlet id o_mi_sort_author;
96 IBOutlet id o_mi_recursive_expand;
98 /* "services discovery" menu in the playlist menu */
99 IBOutlet id o_mi_services;
100 IBOutlet id o_mu_services;
102 /* "services discovery" menu in the main menu */
103 IBOutlet id o_mm_mi_services;
104 IBOutlet id o_mm_mu_services;
106 IBOutlet id o_save_accessory_view;
107 IBOutlet id o_save_accessory_popup;
108 IBOutlet id o_save_accessory_text;
111 NSImage *o_descendingSortingImage;
112 NSImage *o_ascendingSortingImage;
114 NSMutableArray *o_nodes_array;
115 NSMutableArray *o_items_array;
117 BOOL b_selected_item_met;
118 BOOL b_isSortDescending;
122 - (void)searchfieldChanged:(NSNotification *)o_notification;
123 - (NSMenu *)menuForEvent:(NSEvent *)o_event;
125 - (IBAction)searchItem:(id)sender;
127 - (void)playlistUpdated;
128 - (void)outlineViewSelectionDidChange:(NSNotification *)notification;
129 - (void)sortNode:(int)i_mode;
130 - (void)updateRowSelection;
132 - (BOOL)isSelectionEmpty;
134 - (IBAction)servicesChange:(id)sender;
135 - (IBAction)playItem:(id)sender;
136 - (IBAction)revealItemInFinder:(id)sender;
137 - (IBAction)preparseItem:(id)sender;
138 - (IBAction)downloadCoverArt:(id)sender;
139 - (IBAction)savePlaylist:(id)sender;
140 - (IBAction)deleteItem:(id)sender;
141 - (IBAction)selectAll:(id)sender;
142 - (IBAction)sortNodeByName:(id)sender;
143 - (IBAction)sortNodeByAuthor:(id)sender;
144 - (IBAction)recursiveExpandNode:(id)sender;
148 - (void)appendArray:(NSArray*)o_array atPos:(int)i_position enqueue:(BOOL)b_enqueue;
149 - (void)appendNodeArray:(NSArray*)o_array inNode:(playlist_item_t *)p_node atPos:(int)i_position enqueue:(BOOL)b_enqueue;