Commit 6a6539f9 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: when opening subtitles while playing a movie, try to add them to the...

macosx: when opening subtitles while playing a movie, try to add them to the clip instead of the playlist
parent 36746327
......@@ -870,6 +870,22 @@ static VLCMain *_o_sharedMainInstance = nil;
if( !psz_uri )
return( FALSE );
input_thread_t * p_input = pl_CurrentInput( VLCIntf );
BOOL b_returned = NO;
if (p_input)
{
b_returned = input_AddSubtitle( p_input, psz_uri, true );
vlc_object_release( p_input );
if(!b_returned)
{
free( psz_uri );
return YES;
}
}
else if( p_input )
vlc_object_release( p_input );
NSDictionary *o_dic = [NSDictionary dictionaryWithObject:[NSString stringWithCString:psz_uri encoding:NSUTF8StringEncoding] forKey:@"ITEM_URL"];
free( psz_uri );
......
......@@ -425,6 +425,19 @@ static NSMutableArray *blackoutWindows = NULL;
NSArray *o_values = [[o_paste propertyListForType: NSFilenamesPboardType] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
NSUInteger count = [o_values count];
input_thread_t * p_input = pl_CurrentInput( VLCIntf );
BOOL b_returned = NO;
if (count == 1 && p_input)
{
b_returned = input_AddSubtitle( p_input, make_URI([[o_values objectAtIndex:0] UTF8String], NULL), true );
vlc_object_release( p_input );
if(!b_returned)
return YES;
}
else if( p_input )
vlc_object_release( p_input );
for( NSUInteger i = 0; i < count; i++)
{
NSDictionary *o_dic;
......@@ -512,6 +525,19 @@ static NSMutableArray *blackoutWindows = NULL;
NSArray *o_values = [[o_paste propertyListForType: NSFilenamesPboardType] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
NSUInteger count = [o_values count];
input_thread_t * p_input = pl_CurrentInput( VLCIntf );
BOOL b_returned = NO;
if (count == 1 && p_input)
{
b_returned = input_AddSubtitle( p_input, make_URI([[o_values objectAtIndex:0] UTF8String], NULL), true );
vlc_object_release( p_input );
if(!b_returned)
return YES;
}
else if( p_input )
vlc_object_release( p_input );
for( NSUInteger i = 0; i < count; i++)
{
NSDictionary *o_dic;
......
......@@ -1542,6 +1542,7 @@
- (BOOL)outlineView:(NSOutlineView *)outlineView acceptDrop:(id <NSDraggingInfo>)info item:(id)item childIndex:(NSInteger)index
{
NSLog( @"- (BOOL)outlineView:(NSOutlineView *)outlineView acceptDrop:(id <NSDraggingInfo>)info item:(id)item childIndex:(NSInteger)index" );
playlist_t * p_playlist = pl_Get( VLCIntf );
NSPasteboard *o_pasteboard = [info draggingPasteboard];
......@@ -1629,12 +1630,25 @@
else if( [[o_pasteboard types] containsObject: NSFilenamesPboardType] )
{
NSLog( @"NSFilenamesPboardType" );
playlist_item_t *p_node = [item pointerValue];
NSArray *o_values = [[o_pasteboard propertyListForType: NSFilenamesPboardType]
sortedArrayUsingSelector: @selector(caseInsensitiveCompare:)];
NSUInteger count = [o_values count];
NSMutableArray *o_array = [NSMutableArray arrayWithCapacity:count];
input_thread_t * p_input = pl_CurrentInput( VLCIntf );
BOOL b_returned = NO;
if (count == 1 && p_input)
{
b_returned = input_AddSubtitle( p_input, make_URI([[o_values objectAtIndex:0] UTF8String], NULL), true );
vlc_object_release( p_input );
if(!b_returned)
return YES;
}
else if( p_input )
vlc_object_release( p_input );
for( NSUInteger i = 0; i < count; i++)
{
......
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