Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
182ddef2
Commit
182ddef2
authored
Jul 15, 2012
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: CAS: enable drag and drop from playlist
parent
68889de9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
4 deletions
+32
-4
modules/gui/macosx/ConvertAndSave.m
modules/gui/macosx/ConvertAndSave.m
+32
-4
No files found.
modules/gui/macosx/ConvertAndSave.m
View file @
182ddef2
...
...
@@ -23,6 +23,7 @@
#import "ConvertAndSave.h"
#import "intf.h"
#import "playlist.h"
#import <vlc_common.h>
#import <vlc_url.h>
...
...
@@ -340,7 +341,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
-
(
BOOL
)
performDragOperation
:(
id
<
NSDraggingInfo
>
)
sender
{
NSPasteboard
*
paste
=
[
sender
draggingPasteboard
];
NSArray
*
types
=
[
NSArray
arrayWithObject
:
NSFilenamesPboardType
];
NSArray
*
types
=
[
NSArray
arrayWithObject
s
:
NSFilenamesPboardType
,
@"VLCPlaylistItemPboardType"
,
nil
];
NSString
*
desired_type
=
[
paste
availableTypeFromArray
:
types
];
NSData
*
carried_data
=
[
paste
dataForType
:
desired_type
];
...
...
@@ -354,6 +355,33 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
[
self
updateDropView
];
return
YES
;
}
}
else
if
(
[
desired_type
isEqualToString
:
@"VLCPlaylistItemPboardType"
]
)
{
NSArray
*
array
=
[[[
VLCMain
sharedInstance
]
playlist
]
draggedItems
];
NSUInteger
count
=
[
array
count
];
if
(
count
>
0
)
{
playlist_t
*
p_playlist
=
pl_Get
(
VLCIntf
);
playlist_item_t
*
p_item
=
NULL
;
PL_LOCK
;
/* let's look for the first proper input item */
for
(
NSUInteger
x
=
0
;
x
<
count
;
x
++
)
{
p_item
=
[[
array
objectAtIndex
:
x
]
pointerValue
];
if
(
p_item
)
{
if
(
p_item
->
p_input
)
{
if
(
p_item
->
p_input
->
psz_uri
!=
nil
)
{
[
self
setMRL
:
[
NSString
stringWithFormat
:
@"%s"
,
p_item
->
p_input
->
psz_uri
]];
[
self
updateDropView
];
[
self
updateOKButton
];
PL_UNLOCK
;
return
YES
;
}
}
}
}
PL_UNLOCK
;
}
}
}
return
NO
;
...
...
@@ -569,7 +597,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
-
(
void
)
awakeFromNib
{
[
self
registerForDraggedTypes
:[
NSArray
arrayWithObject
:
NSFilenamesPboardType
]];
[
self
registerForDraggedTypes
:[
NSArray
arrayWithObject
s
:
NSFilenamesPboardType
,
@"VLCPlaylistItemPboardType"
,
nil
]];
}
-
(
NSDragOperation
)
draggingEntered
:(
id
<
NSDraggingInfo
>
)
sender
...
...
@@ -601,7 +629,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
-
(
void
)
awakeFromNib
{
[
self
registerForDraggedTypes
:[
NSArray
arrayWithObject
:
NSFilenamesPboardType
]];
[
self
registerForDraggedTypes
:[
NSArray
arrayWithObject
s
:
NSFilenamesPboardType
,
@"VLCPlaylistItemPboardType"
,
nil
]];
}
-
(
NSDragOperation
)
draggingEntered
:(
id
<
NSDraggingInfo
>
)
sender
...
...
@@ -633,7 +661,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
-
(
void
)
awakeFromNib
{
[
self
registerForDraggedTypes
:[
NSArray
arrayWithObject
:
NSFilenamesPboardType
]];
[
self
registerForDraggedTypes
:[
NSArray
arrayWithObject
s
:
NSFilenamesPboardType
,
@"VLCPlaylistItemPboardType"
,
nil
]];
}
-
(
NSDragOperation
)
draggingEntered
:(
id
<
NSDraggingInfo
>
)
sender
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment