Commit 66845c94 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* Fix display of playlist on OSX. Looks briljant :)

parent 3a674c57
...@@ -402,10 +402,17 @@ ...@@ -402,10 +402,17 @@
SUPERCLASS = NSObject; SUPERCLASS = NSObject;
}, },
{ {
ACTIONS = {};
CLASS = VLCPlaylist; CLASS = VLCPlaylist;
LANGUAGE = ObjC; LANGUAGE = ObjC;
OUTLETS = {}; OUTLETS = {
"o_btn_playlist" = id;
"o_outline_view" = id;
"o_search_field" = id;
"o_status_field" = id;
"o_tc_author" = id;
"o_tc_duration" = id;
"o_tc_name" = id;
};
SUPERCLASS = NSObject; SUPERCLASS = NSObject;
}, },
{CLASS = VLCPlaylistView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; }, {CLASS = VLCPlaylistView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; },
......
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>IBDocumentLocation</key> <key>IBDocumentLocation</key>
<string>726 239 505 517 0 0 1280 938 </string> <string>852 421 505 517 0 0 1280 938 </string>
<key>IBEditorPositions</key> <key>IBEditorPositions</key>
<dict> <dict>
<key>1617</key> <key>1617</key>
<string>542 480 104 149 0 0 1024 746 </string> <string>542 480 104 149 0 0 1024 746 </string>
<key>2197</key> <key>2197</key>
<string>9 51 596 368 0 0 1280 938 </string> <string>150 134 596 368 0 0 1280 938 </string>
<key>29</key> <key>29</key>
<string>58 849 419 44 0 0 1280 938 </string> <string>58 849 419 44 0 0 1280 938 </string>
<key>915</key> <key>915</key>
...@@ -24,13 +24,12 @@ ...@@ -24,13 +24,12 @@
<integer>2206</integer> <integer>2206</integer>
<integer>2208</integer> <integer>2208</integer>
<integer>2202</integer> <integer>2202</integer>
<integer>2204</integer>
<integer>2203</integer> <integer>2203</integer>
</array> </array>
<key>IBOpenObjects</key> <key>IBOpenObjects</key>
<array> <array>
<integer>2197</integer>
<integer>21</integer> <integer>21</integer>
<integer>2197</integer>
</array> </array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
<string>7R28</string> <string>7R28</string>
......
...@@ -836,7 +836,7 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -836,7 +836,7 @@ static VLCMain *_o_sharedMainInstance = nil;
if ( p_intf->p_sys->b_playlist_update ) if ( p_intf->p_sys->b_playlist_update )
{ {
[o_playlist playlistUpdated]; [o_playlist playlistUpdated];
p_intf->p_sys->b_playlist_update = VLC_FALSE; p_intf->p_sys->b_playlist_update = VLC_FALSE;
} }
...@@ -867,16 +867,14 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -867,16 +867,14 @@ static VLCMain *_o_sharedMainInstance = nil;
{ {
return; return;
} }
#if 0
vlc_mutex_lock( &p_playlist->object_lock );
o_temp = [NSString stringWithUTF8String: o_temp = [NSString stringWithUTF8String:
p_playlist->p_input.psz_name]; p_playlist->p_input.psz_name];
if( o_temp == NULL ) if( o_temp == NULL )
o_temp = [NSString stringWithCString: o_temp = [NSString stringWithCString:
p_playlist->p_input.psz_name]; p_playlist->p_input.psz_name];
vlc_mutex_unlock( &p_playlist->object_lock );
[o_scrollfield setStringValue: o_temp ]; [o_scrollfield setStringValue: o_temp ];
#endif
p_vout = vlc_object_find( p_intf, VLC_OBJECT_VOUT, p_vout = vlc_object_find( p_intf, VLC_OBJECT_VOUT,
FIND_ANYWHERE ); FIND_ANYWHERE );
...@@ -894,7 +892,7 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -894,7 +892,7 @@ static VLCMain *_o_sharedMainInstance = nil;
} }
vlc_object_release( (vlc_object_t *)p_vout ); vlc_object_release( (vlc_object_t *)p_vout );
} }
[o_playlist updateRowSelection]; //[o_playlist updateRowSelection];
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
p_intf->p_sys->b_current_title_update = FALSE; p_intf->p_sys->b_current_title_update = FALSE;
} }
......
...@@ -38,10 +38,20 @@ ...@@ -38,10 +38,20 @@
{ {
IBOutlet id o_btn_playlist; IBOutlet id o_btn_playlist;
IBOutlet id o_outline_view; IBOutlet id o_outline_view;
IBOutlet id o_tc_name;
IBOutlet id o_tc_author;
IBOutlet id o_tc_duration;
IBOutlet id o_status_field;
IBOutlet id o_search_field;
NSImage *o_descendingSortingImage;
NSImage *o_ascendingSortingImage;
} }
- (void)initStrings; - (void)initStrings;
- (void)playlistUpdated;
- (void)appendArray:(NSArray*)o_array atPos:(int)i_position enqueue:(BOOL)b_enqueue; - (void)appendArray:(NSArray*)o_array atPos:(int)i_position enqueue:(BOOL)b_enqueue;
@end @end
...@@ -138,7 +138,7 @@ ...@@ -138,7 +138,7 @@
self = [super init]; self = [super init];
if ( self !=nil ) if ( self !=nil )
{ {
i_moveRow = -1; //i_moveRow = -1;
} }
return self; return self;
} }
...@@ -158,18 +158,18 @@ ...@@ -158,18 +158,18 @@
/* We need to check whether _defaultTableHeaderSortImage exists, since it /* We need to check whether _defaultTableHeaderSortImage exists, since it
belongs to an Apple hidden private API, and then can "disapear" at any time*/ belongs to an Apple hidden private API, and then can "disapear" at any time*/
if( [[NSTableView class] respondsToSelector:@selector(_defaultTableHeaderSortImage)] ) if( [[NSOutlineView class] respondsToSelector:@selector(_defaultTableHeaderSortImage)] )
{ {
o_ascendingSortingImage = [[NSTableView class] _defaultTableHeaderSortImage]; o_ascendingSortingImage = [[NSOutlineView class] _defaultTableHeaderSortImage];
} }
else else
{ {
o_ascendingSortingImage = nil; o_ascendingSortingImage = nil;
} }
if( [[NSTableView class] respondsToSelector:@selector(_defaultTableHeaderReverseSortImage)] ) if( [[NSOutlineView class] respondsToSelector:@selector(_defaultTableHeaderReverseSortImage)] )
{ {
o_descendingSortingImage = [[NSTableView class] _defaultTableHeaderReverseSortImage]; o_descendingSortingImage = [[NSOutlineView class] _defaultTableHeaderReverseSortImage];
} }
else else
{ {
...@@ -177,13 +177,12 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -177,13 +177,12 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
} }
[self initStrings]; [self initStrings];
[self playlistUpdated]; //[self playlistUpdated];
} }
- (void)initStrings - (void)initStrings
{ {
#if 0 #if 0
[o_window setTitle: _NS("Playlist")];
[o_mi_save_playlist setTitle: _NS("Save Playlist...")]; [o_mi_save_playlist setTitle: _NS("Save Playlist...")];
[o_mi_play setTitle: _NS("Play")]; [o_mi_play setTitle: _NS("Play")];
[o_mi_delete setTitle: _NS("Delete")]; [o_mi_delete setTitle: _NS("Delete")];
...@@ -192,19 +191,26 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -192,19 +191,26 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
[o_mi_enableGroup setTitle: _NS("Enable all group items")]; [o_mi_enableGroup setTitle: _NS("Enable all group items")];
[o_mi_disableGroup setTitle: _NS("Disable all group items")]; [o_mi_disableGroup setTitle: _NS("Disable all group items")];
[o_mi_info setTitle: _NS("Properties")]; [o_mi_info setTitle: _NS("Properties")];
#endif
[[o_tc_name headerCell] setStringValue:_NS("Name")]; [[o_tc_name headerCell] setStringValue:_NS("Name")];
[[o_tc_author headerCell] setStringValue:_NS("Author")]; [[o_tc_author headerCell] setStringValue:_NS("Author")];
[[o_tc_duration headerCell] setStringValue:_NS("Duration")]; [[o_tc_duration headerCell] setStringValue:_NS("Duration")];
#if 0
[o_random_ckb setTitle: _NS("Random")]; [o_random_ckb setTitle: _NS("Random")];
[o_search_button setTitle: _NS("Search")]; [o_search_button setTitle: _NS("Search")];
#endif
[o_btn_playlist setToolTip: _NS("Playlist")]; [o_btn_playlist setToolTip: _NS("Playlist")];
#if 0
[[o_loop_popup itemAtIndex:0] setTitle: _NS("Standard Play")]; [[o_loop_popup itemAtIndex:0] setTitle: _NS("Standard Play")];
[[o_loop_popup itemAtIndex:1] setTitle: _NS("Repeat One")]; [[o_loop_popup itemAtIndex:1] setTitle: _NS("Repeat One")];
[[o_loop_popup itemAtIndex:2] setTitle: _NS("Repeat All")]; [[o_loop_popup itemAtIndex:2] setTitle: _NS("Repeat All")];
#endif #endif
} }
- (void)playlistUpdated
{
[o_outline_view reloadData];
}
- (void)appendArray:(NSArray*)o_array atPos:(int)i_position enqueue:(BOOL)b_enqueue - (void)appendArray:(NSArray*)o_array atPos:(int)i_position enqueue:(BOOL)b_enqueue
...@@ -315,7 +321,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -315,7 +321,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
{ {
/* root object */ /* root object */
playlist_view_t *p_view; playlist_view_t *p_view;
p_view = playlist_ViewFind( p_playlist, VIEW_CATEGORY ); p_view = playlist_ViewFind( p_playlist, VIEW_SIMPLE );
if( p_view && p_view->p_root ) if( p_view && p_view->p_root )
i_return = p_view->p_root->i_children; i_return = p_view->p_root->i_children;
} }
...@@ -327,23 +333,24 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -327,23 +333,24 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
} }
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
if( i_return == -1 ) i_return = 0; if( i_return == -1 ) i_return = 0;
msg_Dbg( p_playlist, "I have %d children", i_return );
return i_return; return i_return;
} }
/* return the child at index for the Obj-C pointer item */ /* DONE */ /* return the child at index for the Obj-C pointer item */ /* DONE */
- (id)outlineView:(NSOutlineView *)outlineView child:(int)index ofItem:(id)item - (id)outlineView:(NSOutlineView *)outlineView child:(int)index ofItem:(id)item
{ {
playlist_item *p_return = NULL; playlist_item_t *p_return = NULL;
playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE ); FIND_ANYWHERE );
if( p_playlist == NULL ) if( p_playlist == NULL )
return 0; return nil;
if( item == nil ) if( item == nil )
{ {
/* root object */ /* root object */
playlist_view_t *p_view; playlist_view_t *p_view;
p_view = playlist_ViewFind( p_playlist, VIEW_CATEGORY ); p_view = playlist_ViewFind( p_playlist, VIEW_SIMPLE );
if( p_view && index < p_view->p_root->i_children ) if( p_view && index < p_view->p_root->i_children )
p_return = p_view->p_root->pp_children[index]; p_return = p_view->p_root->pp_children[index];
} }
...@@ -357,7 +364,8 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -357,7 +364,8 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
} }
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
return [NSValue valueWithPointer: p_return]; msg_Dbg( p_playlist, "childitem with index %d", index );
return [[NSValue valueWithPointer: p_return] retain];
} }
/* is the item expandable */ /* is the item expandable */
...@@ -367,13 +375,13 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -367,13 +375,13 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE ); FIND_ANYWHERE );
if( p_playlist == NULL ) if( p_playlist == NULL )
return 0; return NO;
if( item == nil ) if( item == nil )
{ {
/* root object */ /* root object */
playlist_view_t *p_view; playlist_view_t *p_view;
p_view = playlist_ViewFind( p_playlist, VIEW_CATEGORY ); p_view = playlist_ViewFind( p_playlist, VIEW_SIMPLE );
if( p_view && p_view->p_root ) if( p_view && p_view->p_root )
i_return = p_view->p_root->i_children; i_return = p_view->p_root->i_children;
} }
...@@ -385,24 +393,24 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -385,24 +393,24 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
} }
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
if( i_return == -1 ) if( i_return == -1 || i_return == 0 )
return NO; return NO;
else else
return YES; return YES;
} }
/* retrieve the string values for the cells */ /* retrieve the string values for the cells */
- (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item - (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)o_tc byItem:(id)item
{ {
id o_value = nil; id o_value = nil;
intf_thread_t * p_intf = VLCIntf; intf_thread_t * p_intf = VLCIntf;
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE ); FIND_ANYWHERE );
playlist_item_t * p_item = [item pointerValue]; playlist_item_t *p_item = (playlist_item_t *)[item pointerValue];
if( p_playlist == NULL || p_item == NULL ) if( p_playlist == NULL || p_item == NULL )
{ {
return( nil ); return( @"error" );
} }
if( [[o_tc identifier] isEqualToString:@"1"] ) if( [[o_tc identifier] isEqualToString:@"1"] )
...@@ -416,7 +424,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -416,7 +424,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
else if( [[o_tc identifier] isEqualToString:@"2"] ) else if( [[o_tc identifier] isEqualToString:@"2"] )
{ {
char *psz_temp; char *psz_temp;
psz_temp = playlist_GetInfo( p_item ,_("Meta-information"),_("Artist") ); psz_temp = playlist_ItemGetInfo( p_item ,_("Meta-information"),_("Artist") );
if( psz_temp == NULL ) if( psz_temp == NULL )
o_value = @""; o_value = @"";
......
...@@ -349,7 +349,7 @@ ...@@ -349,7 +349,7 @@
vlc_mutex_lock( &p_playlist->object_lock ); vlc_mutex_lock( &p_playlist->object_lock );
o_title = [NSMutableString stringWithUTF8String: o_title = [NSMutableString stringWithUTF8String:
p_playlist->p_input.psz_uri]; p_playlist->status.p_item->input.psz_uri];
vlc_mutex_unlock( &p_playlist->object_lock ); vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment