Commit 66845c94 authored by hartman's avatar hartman
Browse files

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

parent 3a674c57
......@@ -402,10 +402,17 @@
SUPERCLASS = NSObject;
},
{
ACTIONS = {};
CLASS = VLCPlaylist;
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;
},
{CLASS = VLCPlaylistView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; },
......
......@@ -3,13 +3,13 @@
<plist version="1.0">
<dict>
<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>
<dict>
<key>1617</key>
<string>542 480 104 149 0 0 1024 746 </string>
<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>
<string>58 849 419 44 0 0 1280 938 </string>
<key>915</key>
......@@ -24,13 +24,12 @@
<integer>2206</integer>
<integer>2208</integer>
<integer>2202</integer>
<integer>2204</integer>
<integer>2203</integer>
</array>
<key>IBOpenObjects</key>
<array>
<integer>2197</integer>
<integer>21</integer>
<integer>2197</integer>
</array>
<key>IBSystem Version</key>
<string>7R28</string>
......
......@@ -836,7 +836,7 @@ static VLCMain *_o_sharedMainInstance = nil;
if ( p_intf->p_sys->b_playlist_update )
{
[o_playlist playlistUpdated];
[o_playlist playlistUpdated];
p_intf->p_sys->b_playlist_update = VLC_FALSE;
}
......@@ -867,16 +867,14 @@ static VLCMain *_o_sharedMainInstance = nil;
{
return;
}
vlc_mutex_lock( &p_playlist->object_lock );
#if 0
o_temp = [NSString stringWithUTF8String:
p_playlist->p_input.psz_name];
if( o_temp == NULL )
o_temp = [NSString stringWithCString:
p_playlist->p_input.psz_name];
vlc_mutex_unlock( &p_playlist->object_lock );
[o_scrollfield setStringValue: o_temp ];
#endif
p_vout = vlc_object_find( p_intf, VLC_OBJECT_VOUT,
FIND_ANYWHERE );
......@@ -894,7 +892,7 @@ static VLCMain *_o_sharedMainInstance = nil;
}
vlc_object_release( (vlc_object_t *)p_vout );
}
[o_playlist updateRowSelection];
//[o_playlist updateRowSelection];
vlc_object_release( p_playlist );
p_intf->p_sys->b_current_title_update = FALSE;
}
......
......@@ -38,10 +38,20 @@
{
IBOutlet id o_btn_playlist;
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)playlistUpdated;
- (void)appendArray:(NSArray*)o_array atPos:(int)i_position enqueue:(BOOL)b_enqueue;
@end
......@@ -138,7 +138,7 @@
self = [super init];
if ( self !=nil )
{
i_moveRow = -1;
//i_moveRow = -1;
}
return self;
}
......@@ -158,18 +158,18 @@
/* We need to check whether _defaultTableHeaderSortImage exists, since it
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
{
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
{
......@@ -177,13 +177,12 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
}
[self initStrings];
[self playlistUpdated];
//[self playlistUpdated];
}
- (void)initStrings
{
#if 0
[o_window setTitle: _NS("Playlist")];
[o_mi_save_playlist setTitle: _NS("Save Playlist...")];
[o_mi_play setTitle: _NS("Play")];
[o_mi_delete setTitle: _NS("Delete")];
......@@ -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_disableGroup setTitle: _NS("Disable all group items")];
[o_mi_info setTitle: _NS("Properties")];
#endif
[[o_tc_name headerCell] setStringValue:_NS("Name")];
[[o_tc_author headerCell] setStringValue:_NS("Author")];
[[o_tc_duration headerCell] setStringValue:_NS("Duration")];
#if 0
[o_random_ckb setTitle: _NS("Random")];
[o_search_button setTitle: _NS("Search")];
#endif
[o_btn_playlist setToolTip: _NS("Playlist")];
#if 0
[[o_loop_popup itemAtIndex:0] setTitle: _NS("Standard Play")];
[[o_loop_popup itemAtIndex:1] setTitle: _NS("Repeat One")];
[[o_loop_popup itemAtIndex:2] setTitle: _NS("Repeat All")];
#endif
}
- (void)playlistUpdated
{
[o_outline_view reloadData];
}
- (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*/
{
/* root object */
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 )
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*/
}
vlc_object_release( p_playlist );
if( i_return == -1 ) i_return = 0;
msg_Dbg( p_playlist, "I have %d children", i_return );
return i_return;
}
/* return the child at index for the Obj-C pointer item */ /* DONE */
- (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,
FIND_ANYWHERE );
if( p_playlist == NULL )
return 0;
return nil;
if( item == nil )
{
/* root object */
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 )
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*/
}
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 */
......@@ -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,
FIND_ANYWHERE );
if( p_playlist == NULL )
return 0;
return NO;
if( item == nil )
{
/* root object */
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 )
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*/
}
vlc_object_release( p_playlist );
if( i_return == -1 )
if( i_return == -1 || i_return == 0 )
return NO;
else
return YES;
}
/* 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;
intf_thread_t * p_intf = VLCIntf;
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
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 )
{
return( nil );
return( @"error" );
}
if( [[o_tc identifier] isEqualToString:@"1"] )
......@@ -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"] )
{
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 )
o_value = @"";
......
......@@ -349,7 +349,7 @@
vlc_mutex_lock( &p_playlist->object_lock );
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_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