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
0308762a
Commit
0308762a
authored
Aug 23, 2012
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: change media type constants from char* to NSString*
parent
bfcf87fe
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
28 deletions
+28
-28
modules/gui/macosx/open.h
modules/gui/macosx/open.h
+9
-9
modules/gui/macosx/open.m
modules/gui/macosx/open.m
+11
-11
modules/gui/macosx/playlist.m
modules/gui/macosx/playlist.m
+8
-8
No files found.
modules/gui/macosx/open.h
View file @
0308762a
...
...
@@ -24,14 +24,14 @@
* 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"
#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
...
...
@@ -274,7 +274,7 @@
-
(
IBAction
)
openSpecialMediaFolder
:(
id
)
sender
;
-
(
IBAction
)
dvdreadOptionChanged
:(
id
)
sender
;
-
(
IBAction
)
vcdOptionChanged
:(
id
)
sender
;
-
(
char
*
)
getVolumeTypeFromMountPath
:(
NSString
*
)
mountPath
;
-
(
NSString
*
)
getVolumeTypeFromMountPath
:(
NSString
*
)
mountPath
;
-
(
NSString
*
)
getBSDNodeFromMountPath
:(
NSString
*
)
mountPath
;
-
(
void
)
openNet
;
...
...
modules/gui/macosx/open.m
View file @
0308762a
...
...
@@ -893,7 +893,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
return
@""
;
}
-
(
char
*
)
getVolumeTypeFromMountPath
:(
NSString
*
)
mountPath
-
(
NSString
*
)
getVolumeTypeFromMountPath
:(
NSString
*
)
mountPath
{
OSStatus
err
;
FSRef
ref
;
...
...
@@ -930,7 +930,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
matchingDict
=
IOBSDNameMatching
(
kIOMasterPortDefault
,
0
,
volumeParms
.
vMDeviceID
);
service
=
IOServiceGetMatchingService
(
kIOMasterPortDefault
,
matchingDict
);
char
*
returnValue
;
NSString
*
returnValue
;
if
(
IO_OBJECT_NULL
!=
service
)
{
if
(
IOObjectConformsTo
(
service
,
kIOCDMediaClass
))
{
returnValue
=
kVLCMediaAudioCD
;
...
...
@@ -998,14 +998,14 @@ static VLCOpen *_o_sharedMainInstance = nil;
{
NSAutoreleasePool
*
o_pool
=
[[
NSAutoreleasePool
alloc
]
init
];
char
*
diskType
=
[
self
getVolumeTypeFromMountPath
:
o_opticalDevicePath
];
NSString
*
diskType
=
[
self
getVolumeTypeFromMountPath
:
o_opticalDevicePath
];
if
(
diskType
==
kVLCMediaDVD
||
diskType
==
kVLCMediaVideoTSFolder
)
if
(
[
diskType
isEqualToString
:
kVLCMediaDVD
]
||
[
diskType
isEqualToString
:
kVLCMediaVideoTSFolder
]
)
{
[
o_disc_dvd_lbl
setStringValue
:
[[
NSFileManager
defaultManager
]
displayNameAtPath
:
o_opticalDevicePath
]];
[
o_disc_dvdwomenus_lbl
setStringValue
:
[
o_disc_dvd_lbl
stringValue
]];
NSString
*
pathToOpen
;
if
(
diskType
==
kVLCMediaVideoTSFolder
)
if
(
[
diskType
isEqualToString
:
kVLCMediaVideoTSFolder
]
)
pathToOpen
=
o_opticalDevicePath
;
else
pathToOpen
=
[
self
getBSDNodeFromMountPath
:
o_opticalDevicePath
];
...
...
@@ -1017,26 +1017,26 @@ static VLCOpen *_o_sharedMainInstance = nil;
[
self
showOpticalMediaView
:
o_disc_dvdwomenus_view
withIcon
:
[[
NSWorkspace
sharedWorkspace
]
iconForFile
:
o_opticalDevicePath
]];
}
}
else
if
(
diskType
==
kVLCMediaAudioCD
)
else
if
(
[
diskType
isEqualToString
:
kVLCMediaAudioCD
]
)
{
[
o_disc_audiocd_lbl
setStringValue
:
[[
NSFileManager
defaultManager
]
displayNameAtPath
:
o_opticalDevicePath
]];
[
o_disc_audiocd_trackcount_lbl
setStringValue
:
[
NSString
stringWithFormat
:
_NS
(
"%i tracks"
),
[[[
NSFileManager
defaultManager
]
subpathsOfDirectoryAtPath
:
o_opticalDevicePath
error
:
NULL
]
count
]
-
1
]];
// minus .TOC.plist
[
self
showOpticalMediaView
:
o_disc_audiocd_view
withIcon
:
[[
NSWorkspace
sharedWorkspace
]
iconForFile
:
o_opticalDevicePath
]];
[
self
setMRL
:
[
NSString
stringWithFormat
:
@"cdda://%@"
,
[
self
getBSDNodeFromMountPath
:
o_opticalDevicePath
]]];
}
else
if
(
diskType
==
kVLCMediaVCD
)
else
if
(
[
diskType
isEqualToString
:
kVLCMediaVCD
]
)
{
[
o_disc_vcd_lbl
setStringValue
:
[[
NSFileManager
defaultManager
]
displayNameAtPath
:
o_opticalDevicePath
]];
[
self
showOpticalMediaView
:
o_disc_vcd_view
withIcon
:
[[
NSWorkspace
sharedWorkspace
]
iconForFile
:
o_opticalDevicePath
]];
[
self
setMRL
:
[
NSString
stringWithFormat
:
@"vcd://%@#%i:%i"
,
[
self
getBSDNodeFromMountPath
:
o_opticalDevicePath
],
[
o_disc_vcd_title
intValue
],
[
o_disc_vcd_chapter
intValue
]]];
}
else
if
(
diskType
==
kVLCMediaSVCD
)
else
if
(
[
diskType
isEqualToString
:
kVLCMediaSVCD
]
)
{
[
o_disc_vcd_lbl
setStringValue
:
[[
NSFileManager
defaultManager
]
displayNameAtPath
:
o_opticalDevicePath
]];
[
self
showOpticalMediaView
:
o_disc_vcd_view
withIcon
:
[[
NSWorkspace
sharedWorkspace
]
iconForFile
:
o_opticalDevicePath
]];
[
self
setMRL
:
[
NSString
stringWithFormat
:
@"vcd://%@@%i:%i"
,
[
self
getBSDNodeFromMountPath
:
o_opticalDevicePath
],
[
o_disc_vcd_title
intValue
],
[
o_disc_vcd_chapter
intValue
]]];
}
else
if
(
diskType
==
kVLCMediaBD
||
diskType
==
kVLCMediaBDMVFolder
)
else
if
(
[
diskType
isEqualToString
:
kVLCMediaBD
]
||
[
diskType
isEqualToString
:
kVLCMediaBDMVFolder
]
)
{
[
o_disc_bd_lbl
setStringValue
:
[[
NSFileManager
defaultManager
]
displayNameAtPath
:
o_opticalDevicePath
]];
[
self
showOpticalMediaView
:
o_disc_bd_view
withIcon
:
[[
NSWorkspace
sharedWorkspace
]
iconForFile
:
o_opticalDevicePath
]];
...
...
@@ -1117,10 +1117,10 @@ static VLCOpen *_o_sharedMainInstance = nil;
-
(
IBAction
)
dvdreadOptionChanged
:(
id
)
sender
{
NSString
*
o_device_path
=
[
o_opticalDevices
objectAtIndex
:
[
o_disc_selector_pop
indexOfSelectedItem
]];
char
*
diskType
=
[
self
getVolumeTypeFromMountPath
:
o_device_path
];
NSString
*
diskType
=
[
self
getVolumeTypeFromMountPath
:
o_device_path
];
NSString
*
pathToOpen
;
if
(
diskType
==
kVLCMediaVideoTSFolder
)
if
(
[
diskType
isEqualToString
:
kVLCMediaVideoTSFolder
]
)
pathToOpen
=
o_device_path
;
else
pathToOpen
=
[
self
getBSDNodeFromMountPath
:
o_device_path
];
...
...
modules/gui/macosx/playlist.m
View file @
0308762a
...
...
@@ -1085,30 +1085,30 @@
id
o_vlc_open
=
[[
VLCMain
sharedInstance
]
open
];
char
*
diskType
=
[
o_vlc_open
getVolumeTypeFromMountPath
:
o_path
];
msg_Dbg
(
p_intf
,
"detected optical media of type
'%s' in the file input"
,
diskType
);
NSString
*
diskType
=
[
o_vlc_open
getVolumeTypeFromMountPath
:
o_path
];
msg_Dbg
(
p_intf
,
"detected optical media of type
%s in the file input"
,
[
diskType
UTF8String
]
);
if
(
diskType
==
kVLCMediaDVD
)
if
(
[
diskType
isEqualToString
:
kVLCMediaDVD
]
)
{
o_uri
=
[
NSString
stringWithFormat
:
@"dvdnav://%@"
,
[
o_vlc_open
getBSDNodeFromMountPath
:
o_path
]];
}
else
if
(
diskType
==
kVLCMediaVideoTSFolder
)
else
if
(
[
diskType
isEqualToString
:
kVLCMediaVideoTSFolder
]
)
{
o_uri
=
[
NSString
stringWithFormat
:
@"dvdnav://%@"
,
o_path
];
}
else
if
(
diskType
==
kVLCMediaAudioCD
)
else
if
(
[
diskType
isEqualToString
:
kVLCMediaAudioCD
]
)
{
o_uri
=
[
NSString
stringWithFormat
:
@"cdda://%@"
,
[
o_vlc_open
getBSDNodeFromMountPath
:
o_path
]];
}
else
if
(
diskType
==
kVLCMediaVCD
)
else
if
(
[
diskType
isEqualToString
:
kVLCMediaVCD
]
)
{
o_uri
=
[
NSString
stringWithFormat
:
@"vcd://%@#0:0"
,
[
o_vlc_open
getBSDNodeFromMountPath
:
o_path
]];
}
else
if
(
diskType
==
kVLCMediaSVCD
)
else
if
(
[
diskType
isEqualToString
:
kVLCMediaSVCD
]
)
{
o_uri
=
[
NSString
stringWithFormat
:
@"vcd://%@@0:0"
,
[
o_vlc_open
getBSDNodeFromMountPath
:
o_path
]];
}
else
if
(
diskType
==
kVLCMediaBD
||
diskType
==
kVLCMediaBDMVFolder
)
else
if
(
[
diskType
isEqualToString
:
kVLCMediaBD
]
||
[
diskType
isEqualToString
:
kVLCMediaBDMVFolder
]
)
{
o_uri
=
[
NSString
stringWithFormat
:
@"bluray://%@"
,
o_path
];
}
...
...
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