Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
c789f858
Commit
c789f858
authored
Apr 08, 2012
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: fixed drag & drop handling of optical media by re-writing it
parent
4a10b45f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
53 deletions
+56
-53
modules/gui/macosx/open.h
modules/gui/macosx/open.h
+11
-0
modules/gui/macosx/open.m
modules/gui/macosx/open.m
+0
-9
modules/gui/macosx/playlist.m
modules/gui/macosx/playlist.m
+45
-44
No files found.
modules/gui/macosx/open.h
View file @
c789f858
...
@@ -24,6 +24,15 @@
...
@@ -24,6 +24,15 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
*****************************************************************************/
#define kVLCMediaAudioCD "AudioCD"
#define kVLCMediaDVD "DVD"
#define kVLCMediaVCD "VCD"
#define kVLCMediaSVCD "SVCD"
#define kVLCMediaBD "Bluray"
#define kVLCMediaVideoTSFolder "VIDEO_TS"
#define kVLCMediaBDMVFolder "BDMV"
#define kVLCMediaUnknown "Unknown"
/*****************************************************************************
/*****************************************************************************
* Intf_Open interface
* Intf_Open interface
*****************************************************************************/
*****************************************************************************/
...
@@ -262,6 +271,8 @@
...
@@ -262,6 +271,8 @@
-
(
IBAction
)
openSpecialMediaFolder
:(
id
)
sender
;
-
(
IBAction
)
openSpecialMediaFolder
:(
id
)
sender
;
-
(
IBAction
)
dvdreadOptionChanged
:(
id
)
sender
;
-
(
IBAction
)
dvdreadOptionChanged
:(
id
)
sender
;
-
(
IBAction
)
vcdOptionChanged
:(
id
)
sender
;
-
(
IBAction
)
vcdOptionChanged
:(
id
)
sender
;
-
(
char
*
)
getVolumeTypeFromMountPath
:(
NSString
*
)
mountPath
;
-
(
NSString
*
)
getBSDNodeFromMountPath
:(
NSString
*
)
mountPath
;
-
(
void
)
openNet
;
-
(
void
)
openNet
;
-
(
IBAction
)
openNetModeChanged
:(
id
)
sender
;
-
(
IBAction
)
openNetModeChanged
:(
id
)
sender
;
...
...
modules/gui/macosx/open.m
View file @
c789f858
...
@@ -59,15 +59,6 @@ NSArray *qtkaudioDevices;
...
@@ -59,15 +59,6 @@ NSArray *qtkaudioDevices;
[o_capture_long_lbl displayIfNeeded]; \
[o_capture_long_lbl displayIfNeeded]; \
[self showCaptureView: o_capture_label_view]
[self showCaptureView: o_capture_label_view]
#define kVLCMediaAudioCD "AudioCD"
#define kVLCMediaDVD "DVD"
#define kVLCMediaVCD "VCD"
#define kVLCMediaSVCD "SVCD"
#define kVLCMediaBD "Bluray"
#define kVLCMediaVideoTSFolder "VIDEO_TS"
#define kVLCMediaBDMVFolder "BDMV"
#define kVLCMediaUnknown "Unknown"
struct
display_info_t
struct
display_info_t
{
{
CGRect
rect
;
CGRect
rect
;
...
...
modules/gui/macosx/playlist.m
View file @
c789f858
...
@@ -48,6 +48,7 @@
...
@@ -48,6 +48,7 @@
#import "playlist.h"
#import "playlist.h"
#import "controls.h"
#import "controls.h"
#import "misc.h"
#import "misc.h"
#import "open.h"
#include <vlc_keys.h>
#include <vlc_keys.h>
#import <vlc_services_discovery.h>
#import <vlc_services_discovery.h>
...
@@ -1028,61 +1029,63 @@
...
@@ -1028,61 +1029,63 @@
playlist_t
*
p_playlist
=
pl_Get
(
p_intf
);
playlist_t
*
p_playlist
=
pl_Get
(
p_intf
);
input_item_t
*
p_input
;
input_item_t
*
p_input
;
BOOL
b_rem
=
FALSE
,
b_dir
=
FALSE
;
BOOL
b_rem
=
FALSE
,
b_dir
=
FALSE
,
b_writable
=
FALSE
;
NSString
*
o_uri
,
*
o_name
;
NSString
*
o_uri
,
*
o_name
,
*
o_path
;
NSURL
*
o_nsurl
;
NSArray
*
o_options
;
NSArray
*
o_options
;
NSURL
*
o_true_file
;
NSURL
*
o_true_file
;
/* Get the item */
/* Get the item */
o_uri
=
(
NSString
*
)[
o_one_item
objectForKey
:
@"ITEM_URL"
];
o_uri
=
(
NSString
*
)[
o_one_item
objectForKey
:
@"ITEM_URL"
];
o_nsurl
=
[
NSURL
URLWithString
:
o_uri
];
o_path
=
[
o_nsurl
path
];
o_name
=
(
NSString
*
)[
o_one_item
objectForKey
:
@"ITEM_NAME"
];
o_name
=
(
NSString
*
)[
o_one_item
objectForKey
:
@"ITEM_NAME"
];
o_options
=
(
NSArray
*
)[
o_one_item
objectForKey
:
@"ITEM_OPTIONS"
];
o_options
=
(
NSArray
*
)[
o_one_item
objectForKey
:
@"ITEM_OPTIONS"
];
/* Find the name for a disc entry (i know, can you believe the trouble?) */
if
(
[[
NSFileManager
defaultManager
]
fileExistsAtPath
:
o_path
isDirectory
:
&
b_dir
]
&&
b_dir
&&
if
(
(
!
o_name
||
[
o_name
isEqualToString
:
@""
]
)
&&
[
o_uri
rangeOfString
:
@"/dev/"
].
location
!=
NSNotFound
)
[[
NSWorkspace
sharedWorkspace
]
getFileSystemInfoForPath
:
o_path
isRemovable
:
&
b_rem
isWritable:
&
b_writable
isUnmountable
:
NULL
description
:
NULL
type
:
NULL
]
&&
b_rem
&&
!
b_writable
&&
[
o_nsurl
isFileURL
]
)
{
{
int
i_count
;
struct
statfs
*
mounts
=
NULL
;
i_count
=
getmntinfo
(
&
mounts
,
MNT_NOWAIT
);
id
o_vlc_open
=
[[
VLCMain
sharedInstance
]
open
];
/* getmntinfo returns a pointer to static data. Do not free. */
for
(
int
i_index
=
0
;
i_index
<
i_count
;
i_index
++
)
char
*
diskType
=
[
o_vlc_open
getVolumeTypeFromMountPath
:
o_path
];
{
msg_Dbg
(
p_intf
,
"detected optical media of type '%s' in the file input"
,
diskType
);
NSMutableString
*
o_temp
,
*
o_temp2
;
o_temp
=
[
NSMutableString
stringWithString
:
o_uri
];
o_temp2
=
[
NSMutableString
stringWithUTF8String
:
mounts
[
i_index
].
f_mntfromname
];
[
o_temp
replaceOccurrencesOfString
:
@"/dev/rdisk"
withString
:
@"/dev/disk"
options
:
NSLiteralSearch
range
:
NSMakeRange
(
0
,
[
o_temp
length
])
];
[
o_temp2
replaceOccurrencesOfString
:
@"s0"
withString
:
@""
options
:
NSLiteralSearch
range
:
NSMakeRange
(
0
,
[
o_temp2
length
])
];
[
o_temp2
replaceOccurrencesOfString
:
@"s1"
withString
:
@""
options
:
NSLiteralSearch
range
:
NSMakeRange
(
0
,
[
o_temp2
length
])
];
if
(
strstr
(
[
o_temp
fileSystemRepresentation
],
[
o_temp2
fileSystemRepresentation
]
)
!=
NULL
)
if
(
diskType
==
kVLCMediaDVD
)
{
{
o_name
=
[[
NSFileManager
defaultManager
]
displayNameAtPath
:
[
NSString
stringWithUTF8String
:
mounts
[
i_index
].
f_mntonname
]];
o_uri
=
[
NSString
stringWithFormat
:
@"dvdnav://%@"
,
[
o_vlc_open
getBSDNodeFromMountPath
:
o_path
]];
}
}
else
if
(
diskType
==
kVLCMediaVideoTSFolder
)
{
o_uri
=
[
NSString
stringWithFormat
:
@"dvdnav://%@"
,
o_path
];
}
}
else
if
(
diskType
==
kVLCMediaAudioCD
)
{
o_uri
=
[
NSString
stringWithFormat
:
@"cdda://%@"
,
[
o_vlc_open
getBSDNodeFromMountPath
:
o_path
]];
}
}
else
if
(
diskType
==
kVLCMediaVCD
)
if
(
[[
NSFileManager
defaultManager
]
fileExistsAtPath
:
o_uri
isDirectory
:
&
b_dir
]
&&
b_dir
&&
[[
NSWorkspace
sharedWorkspace
]
getFileSystemInfoForPath
:
o_uri
isRemovable
:
&
b_rem
isWritable:
NULL
isUnmountable
:
NULL
description
:
NULL
type
:
NULL
]
&&
b_rem
)
{
{
/* All of this is to make sure CD's play when you D&D them on VLC */
o_uri
=
[
NSString
stringWithFormat
:
@"vcd://%@#0:0"
,
[
o_vlc_open
getBSDNodeFromMountPath
:
o_path
]];
/* Converts mountpoint to a /dev file */
}
struct
statfs
*
buf
;
else
if
(
diskType
==
kVLCMediaSVCD
)
char
*
psz_dev
;
{
NSMutableString
*
o_temp
;
o_uri
=
[
NSString
stringWithFormat
:
@"vcd://%@@0:0"
,
[
o_vlc_open
getBSDNodeFromMountPath
:
o_path
]];
}
buf
=
(
struct
statfs
*
)
malloc
(
sizeof
(
struct
statfs
));
else
if
(
diskType
==
kVLCMediaBD
||
diskType
==
kVLCMediaBDMVFolder
)
statfs
(
[
o_uri
fileSystemRepresentation
],
buf
);
{
psz_dev
=
strdup
(
buf
->
f_mntfromname
);
o_uri
=
[
NSString
stringWithFormat
:
@"bluray://%@"
,
o_path
];
o_temp
=
[
NSMutableString
stringWithUTF8String
:
psz_dev
];
}
[
o_temp
replaceOccurrencesOfString
:
@"/dev/disk"
withString
:
@"/dev/rdisk"
options
:
NSLiteralSearch
range
:
NSMakeRange
(
0
,
[
o_temp
length
])
];
else
[
o_temp
replaceOccurrencesOfString
:
@"s0"
withString
:
@""
options
:
NSLiteralSearch
range
:
NSMakeRange
(
0
,
[
o_temp
length
])
];
{
[
o_temp
replaceOccurrencesOfString
:
@"s1"
withString
:
@""
options
:
NSLiteralSearch
range
:
NSMakeRange
(
0
,
[
o_temp
length
])
];
msg_Warn
(
VLCIntf
,
"unknown disk type, treating %s as regular input"
,
[
o_path
UTF8String
]
);
o_uri
=
o_temp
;
}
}
p_input
=
input_item_New
(
[
o_uri
UTF8String
],
[[[
NSFileManager
defaultManager
]
displayNameAtPath
:
o_path
]
UTF8String
]
);
}
else
p_input
=
input_item_New
(
[
o_uri
fileSystemRepresentation
],
o_name
?
[
o_name
UTF8String
]
:
NULL
);
p_input
=
input_item_New
(
[
o_uri
fileSystemRepresentation
],
o_name
?
[
o_name
UTF8String
]
:
NULL
);
if
(
!
p_input
)
if
(
!
p_input
)
return
NULL
;
return
NULL
;
...
@@ -1097,11 +1100,9 @@
...
@@ -1097,11 +1100,9 @@
}
}
/* Recent documents menu */
/* Recent documents menu */
o_true_file
=
[
NSURL
URLWithString
:
o_uri
];
if
(
o_nsurl
!=
nil
&&
(
BOOL
)
config_GetInt
(
p_playlist
,
"macosx-recentitems"
)
==
YES
)
if
(
o_true_file
!=
nil
&&
(
BOOL
)
config_GetInt
(
p_playlist
,
"macosx-recentitems"
)
==
YES
)
{
{
[[
NSDocumentController
sharedDocumentController
]
[[
NSDocumentController
sharedDocumentController
]
noteNewRecentDocumentURL
:
o_nsurl
];
noteNewRecentDocumentURL:
o_true_file
];
}
}
return
p_input
;
return
p_input
;
}
}
...
...
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