Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
2c828226
Commit
2c828226
authored
Aug 15, 2011
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: saved various objc selector dispatches when iterating, additionally fixes #5113
parent
eab70f5d
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
108 additions
and
109 deletions
+108
-109
modules/access/qtcapture.m
modules/access/qtcapture.m
+5
-4
modules/gui/macosx/AppleRemote.m
modules/gui/macosx/AppleRemote.m
+4
-4
modules/gui/macosx/MainMenu.m
modules/gui/macosx/MainMenu.m
+2
-1
modules/gui/macosx/about.m
modules/gui/macosx/about.m
+2
-1
modules/gui/macosx/misc.m
modules/gui/macosx/misc.m
+12
-15
modules/gui/macosx/open.m
modules/gui/macosx/open.m
+9
-7
modules/gui/macosx/output.m
modules/gui/macosx/output.m
+6
-12
modules/gui/macosx/playlist.m
modules/gui/macosx/playlist.m
+46
-51
modules/gui/macosx/prefs.m
modules/gui/macosx/prefs.m
+18
-11
modules/gui/macosx/prefs_widgets.m
modules/gui/macosx/prefs_widgets.m
+2
-2
modules/gui/macosx/simple_prefs.m
modules/gui/macosx/simple_prefs.m
+2
-1
No files found.
modules/access/qtcapture.m
View file @
2c828226
...
...
@@ -246,11 +246,11 @@ static int Open( vlc_object_t *p_this )
goto
error
;
}
int
ivideo
;
for
(
ivideo
=
0
;
ivideo
<
[
myVideoDevices
count
]
;
ivideo
++
){
NSUInteger
deviceCount
=
[
myVideoDevices
count
]
;
for
(
NSUInteger
ivideo
=
0
;
ivideo
<
deviceCount
;
ivideo
++
){
QTCaptureDevice
*
qtk_device
;
qtk_device
=
[
myVideoDevices
objectAtIndex
:
ivideo
];
msg_Dbg
(
p_demux
,
"qtcapture %d/%lu %s %s"
,
ivideo
,
[
myVideoDevices
count
]
,
[[
qtk_device
localizedDisplayName
]
UTF8String
],
[[
qtk_device
uniqueID
]
UTF8String
]);
msg_Dbg
(
p_demux
,
"qtcapture %d/%lu %s %s"
,
ivideo
,
deviceCount
,
[[
qtk_device
localizedDisplayName
]
UTF8String
],
[[
qtk_device
uniqueID
]
UTF8String
]);
if
([[[
qtk_device
uniqueID
]
stringByTrimmingCharactersInSet
:[
NSCharacterSet
whitespaceCharacterSet
]]
isEqualToString
:
qtk_currdevice_uid
]){
break
;
}
...
...
@@ -302,7 +302,8 @@ static int Open( vlc_object_t *p_this )
/* Get the formats */
NSArray
*
format_array
=
[
p_sys
->
device
formatDescriptions
];
QTFormatDescription
*
camera_format
=
NULL
;
for
(
int
k
=
0
;
k
<
[
format_array
count
];
k
++
)
NSUInteger
formatCount
=
[
format_array
count
];
for
(
NSUInteger
k
=
0
;
k
<
formatCount
;
k
++
)
{
camera_format
=
[
format_array
objectAtIndex
:
k
];
...
...
modules/gui/macosx/AppleRemote.m
View file @
2c828226
...
...
@@ -627,8 +627,8 @@ static void QueueCallbackFunction(void* target, IOReturn result, void* refcon,
memset(cookies, 0, sizeof(IOHIDElementCookie) * NUMBER_OF_APPLE_REMOTE_ACTIONS);
*/
allCookies
=
[[
NSMutableArray
alloc
]
init
];
unsigned
int
i
;
for
(
i
=
0
;
i
<
[
elements
count
]
;
i
++
)
{
NSUInteger
elementCount
=
[
elements
count
]
;
for
(
NSUInteger
i
=
0
;
i
<
elementCount
;
i
++
)
{
element
=
[
elements
objectAtIndex
:
i
];
//Get cookie
...
...
@@ -668,8 +668,8 @@ static void QueueCallbackFunction(void* target, IOReturn result, void* refcon,
if
(
queue
)
{
result
=
(
*
queue
)
->
create
(
queue
,
0
,
12
);
//depth: maximum number of elements in queue before oldest elements in queue begin to be lost.
unsigned
int
i
=
0
;
for
(
i
=
0
;
i
<
[
allCookies
count
]
;
i
++
)
{
NSUInteger
cookieCount
=
[
allCookies
count
]
;
for
(
NSUInteger
i
=
0
;
i
<
cookieCount
;
i
++
)
{
IOHIDElementCookie
cookie
=
(
IOHIDElementCookie
)[[
allCookies
objectAtIndex
:
i
]
intValue
];
(
*
queue
)
->
addElement
(
queue
,
cookie
,
0
);
}
...
...
modules/gui/macosx/MainMenu.m
View file @
2c828226
...
...
@@ -375,7 +375,8 @@ static VLCMainMenu *_o_sharedInstance = nil;
if
(
!
p_intf
)
return
;
NSArray
*
menuitems_array
=
[
the_menu
itemArray
];
for
(
int
i
=
0
;
i
<
[
menuitems_array
count
];
i
++
)
NSUInteger
menuItemCount
=
[
menuitems_array
count
];
for
(
NSUInteger
i
=
0
;
i
<
menuItemCount
;
i
++
)
{
NSMenuItem
*
one_item
=
[
menuitems_array
objectAtIndex
:
i
];
if
(
[
one_item
hasSubmenu
]
)
...
...
modules/gui/macosx/about.m
View file @
2c828226
...
...
@@ -106,7 +106,8 @@ static VLAboutBox *_o_sharedInstance = nil;
[
o_name_version_field
setStringValue
:
[
NSString
stringWithFormat
:
@"Version %s (%s)"
,
VERSION_MESSAGE
,
PLATFORM
]];
NSMutableArray
*
tmpArray
=
[
NSMutableArray
arrayWithArray
:
[[
NSString
stringWithUTF8String
:
psz_authors
]
componentsSeparatedByString
:
@"
\n\n
"
]];
for
(
int
i
=
0
;
i
<
[
tmpArray
count
];
i
++
)
NSUInteger
count
=
[
tmpArray
count
];
for
(
NSUInteger
i
=
0
;
i
<
count
;
i
++
)
{
[
tmpArray
replaceObjectAtIndex
:
i
withObject
:[[
tmpArray
objectAtIndex
:
i
]
stringByReplacingOccurrencesOfString
:
@"
\n
"
withString
:
@", "
]];
[
tmpArray
replaceObjectAtIndex
:
i
withObject
:[[
tmpArray
objectAtIndex
:
i
]
stringByReplacingOccurrencesOfString
:
@", -"
withString
:
@"
\n
-"
options
:
0
range
:
NSRangeFromString
(
@"0 30"
)]];
...
...
modules/gui/macosx/misc.m
View file @
2c828226
...
...
@@ -83,9 +83,9 @@ static NSMutableArray *blackoutWindows = NULL;
+
(
NSScreen
*
)
screenWithDisplayID
:
(
CGDirectDisplayID
)
displayID
{
int
i
;
NSUInteger
count
=
[[
NSScreen
screens
]
count
]
;
for
(
i
=
0
;
i
<
[[
NSScreen
screens
]
count
]
;
i
++
)
for
(
NSUInteger
i
=
0
;
i
<
count
;
i
++
)
{
NSScreen
*
screen
=
[[
NSScreen
screens
]
objectAtIndex
:
i
];
if
([
screen
displayID
]
==
displayID
)
...
...
@@ -111,13 +111,12 @@ static NSMutableArray *blackoutWindows = NULL;
-
(
void
)
blackoutOtherScreens
{
unsigned
int
i
;
/* Free our previous blackout window (follow blackoutWindow alloc strategy) */
[
blackoutWindows
makeObjectsPerformSelector
:
@selector
(
close
)];
[
blackoutWindows
removeAllObjects
];
for
(
i
=
0
;
i
<
[[
NSScreen
screens
]
count
];
i
++
)
NSUInteger
screenCount
=
[[
NSScreen
screens
]
count
];
for
(
NSUInteger
i
=
0
;
i
<
screenCount
;
i
++
)
{
NSScreen
*
screen
=
[[
NSScreen
screens
]
objectAtIndex
:
i
];
VLCWindow
*
blackoutWindow
;
...
...
@@ -151,9 +150,9 @@ static NSMutableArray *blackoutWindows = NULL;
+
(
void
)
unblackoutScreens
{
unsigned
int
i
;
NSUInteger
blackoutWindowCount
=
[
blackoutWindows
count
]
;
for
(
i
=
0
;
i
<
[
blackoutWindows
count
]
;
i
++
)
for
(
NSUInteger
i
=
0
;
i
<
blackoutWindowCount
;
i
++
)
{
VLCWindow
*
blackoutWindow
=
[
blackoutWindows
objectAtIndex
:
i
];
[
blackoutWindow
closeAndAnimate
:
YES
];
...
...
@@ -398,12 +397,11 @@ static NSMutableArray *blackoutWindows = NULL;
{
if
([
o_desired_type
isEqualToString
:
NSFilenamesPboardType
])
{
int
i
;
NSArray
*
o_array
=
[
NSArray
array
];
NSArray
*
o_values
=
[[
o_paste
propertyListForType
:
NSFilenamesPboardType
]
sortedArrayUsingSelector:
@selector
(
caseInsensitiveCompare
:)
];
NSArray
*
o_values
=
[[
o_paste
propertyListForType
:
NSFilenamesPboardType
]
sortedArrayUsingSelector
:
@selector
(
caseInsensitiveCompare
:)];
NSUInteger
count
=
[
o_values
count
];
for
(
i
=
0
;
i
<
(
int
)[
o_values
count
]
;
i
++
)
for
(
NSUInteger
i
=
0
;
i
<
count
;
i
++
)
{
NSDictionary
*
o_dic
;
char
*
psz_uri
=
make_URI
([[
o_values
objectAtIndex
:
i
]
UTF8String
],
NULL
);
...
...
@@ -483,12 +481,11 @@ static NSMutableArray *blackoutWindows = NULL;
{
if
([
o_desired_type
isEqualToString
:
NSFilenamesPboardType
])
{
int
i
;
NSArray
*
o_array
=
[
NSArray
array
];
NSArray
*
o_values
=
[[
o_paste
propertyListForType
:
NSFilenamesPboardType
]
sortedArrayUsingSelector:
@selector
(
caseInsensitiveCompare
:)
];
NSArray
*
o_values
=
[[
o_paste
propertyListForType
:
NSFilenamesPboardType
]
sortedArrayUsingSelector
:
@selector
(
caseInsensitiveCompare
:)];
NSUInteger
count
=
[
o_values
count
];
for
(
i
=
0
;
i
<
(
int
)[
o_values
count
]
;
i
++
)
for
(
NSUInteger
i
=
0
;
i
<
count
;
i
++
)
{
NSDictionary
*
o_dic
;
char
*
psz_uri
=
make_URI
([[
o_values
objectAtIndex
:
i
]
UTF8String
],
NULL
);
...
...
modules/gui/macosx/open.m
View file @
2c828226
...
...
@@ -211,7 +211,8 @@ static VLCOpen *_o_sharedMainInstance = nil;
qtk_currdevice_uid
=
[[[
QTCaptureDevice
defaultInputDeviceWithMediaType
:
QTMediaTypeVideo
]
uniqueID
]
stringByTrimmingCharactersInSet:
[
NSCharacterSet
whitespaceCharacterSet
]];
}
for
(
int
ivideo
=
0
;
ivideo
<
[
qtkvideoDevices
count
];
ivideo
++
){
NSUInteger
deviceCount
=
[
qtkvideoDevices
count
];
for
(
int
ivideo
=
0
;
ivideo
<
deviceCount
;
ivideo
++
){
QTCaptureDevice
*
qtk_device
;
qtk_device
=
[
qtkvideoDevices
objectAtIndex
:
ivideo
];
[
o_qtk_device_pop
addItemWithTitle
:
[
qtk_device
localizedDisplayName
]];
...
...
@@ -368,7 +369,6 @@ static VLCOpen *_o_sharedMainInstance = nil;
{
NSMutableDictionary
*
o_dic
;
NSMutableArray
*
o_options
=
[
NSMutableArray
array
];
unsigned
int
i
;
o_dic
=
[
NSMutableDictionary
dictionaryWithObject
:
[
self
MRL
]
forKey
:
@"ITEM_URL"
];
if
(
[
o_file_sub_ckbox
state
]
==
NSOnState
)
...
...
@@ -400,10 +400,10 @@ static VLCOpen *_o_sharedMainInstance = nil;
}
if
(
[
o_output_ckbox
state
]
==
NSOnState
)
{
for
(
i
=
0
;
i
<
[[
o_sout_options
mrl
]
count
]
;
i
++
)
NSUInteger
count
=
[[
o_sout_options
mrl
]
count
];
for
(
NSUInteger
i
=
0
;
i
<
count
;
i
++
)
{
[
o_options
addObject
:
[
NSString
stringWithString
:
[[(
VLCOutput
*
)
o_sout_options
mrl
]
objectAtIndex
:
i
]]];
[
o_options
addObject
:
[
NSString
stringWithString
:
[[(
VLCOutput
*
)
o_sout_options
mrl
]
objectAtIndex
:
i
]]];
}
}
if
(
[
o_file_slave_ckbox
state
]
&&
o_file_slave_path
)
...
...
@@ -752,7 +752,8 @@ static VLCOpen *_o_sharedMainInstance = nil;
{
NSArray
*
topLevelItems
;
topLevelItems
=
[[
NSFileManager
defaultManager
]
subpathsOfDirectoryAtPath
:
mountPath
error
:
NULL
];
for
(
int
i
=
0
;
i
<
[
topLevelItems
count
];
i
++
)
{
NSUInteger
itemCount
=
[
topLevelItems
count
];
for
(
int
i
=
0
;
i
<
itemCount
;
i
++
)
{
if
([[
topLevelItems
objectAtIndex
:
i
]
rangeOfString
:
@"SVCD"
].
location
!=
NSNotFound
)
{
returnValue
=
kVLCMediaSVCD
;
break
;
...
...
@@ -835,7 +836,8 @@ static VLCOpen *_o_sharedMainInstance = nil;
if
([
o_specialMediaFolders
count
]
>
0
)
[
o_opticalDevices
addObjectsFromArray
:
o_specialMediaFolders
];
if
([
o_opticalDevices
count
]
>
0
)
{
for
(
int
i
=
0
;
i
<
[
o_opticalDevices
count
]
;
i
++
)
NSUInteger
deviceCount
=
[
o_opticalDevices
count
];
for
(
NSUInteger
i
=
0
;
i
<
deviceCount
;
i
++
)
[
o_disc_selector_pop
addItemWithTitle
:
[[
NSFileManager
defaultManager
]
displayNameAtPath
:[
o_opticalDevices
objectAtIndex
:
i
]]];
if
([
o_disc_selector_pop
numberOfItems
]
<=
1
)
...
...
modules/gui/macosx/output.m
View file @
2c828226
...
...
@@ -416,27 +416,21 @@
/* split up the hostname and the following path to paste the
* port correctly. Not need, if there isn't any path following the
* hostname. */
NSArray
*
o_urlItems
=
[[
o_stream_address
stringValue
]
\
componentsSeparatedByString
:
@"/"
];
NSArray
*
o_urlItems
=
[[
o_stream_address
stringValue
]
componentsSeparatedByString
:
@"/"
];
NSMutableString
*
o_finalStreamAddress
;
o_finalStreamAddress
=
[[
NSMutableString
alloc
]
init
];
if
([
o_urlItems
count
]
==
1
)
{
[
o_finalStreamAddress
appendFormat
:
@"
\"
%@:%@
\"
"
,
\
[
o_stream_address
stringValue
],[
o_stream_port
stringValue
]];
[
o_finalStreamAddress
appendFormat
:
@"
\"
%@:%@
\"
"
,
[
o_stream_address
stringValue
],[
o_stream_port
stringValue
]];
}
else
{
[
o_finalStreamAddress
appendFormat
:
@"
\"
%@:%@"
,
[
o_urlItems
\
objectAtIndex
:
0
],
[
o_stream_port
stringValue
]];
unsigned
int
x
;
x
=
1
;
while
(
x
!=
[
o_urlItems
count
])
[
o_finalStreamAddress
appendFormat
:
@"
\"
%@:%@"
,
[
o_urlItems
objectAtIndex
:
0
],
[
o_stream_port
stringValue
]];
NSUInteger
itemCount
=
[
o_urlItems
count
];
for
(
NSUInteger
x
=
0
;
x
<
itemCount
;
x
++
)
{
[
o_finalStreamAddress
appendFormat
:
@"/%@"
,
[
o_urlItems
\
objectAtIndex
:
x
]];
x
=
(
x
+
1
);
[
o_finalStreamAddress
appendFormat
:
@"/%@"
,
[
o_urlItems
objectAtIndex
:
x
]];
}
[
o_finalStreamAddress
appendString
:
@"
\"
"
];
}
...
...
modules/gui/macosx/playlist.m
View file @
2c828226
...
...
@@ -502,7 +502,8 @@
-
(
void
)
playlistUpdated
{
/* Clear indications of any existing column sorting */
for
(
unsigned
int
i
=
0
;
i
<
[[
o_outline_view
tableColumns
]
count
]
;
i
++
)
NSUInteger
count
=
[[
o_outline_view
tableColumns
]
count
];
for
(
NSUInteger
i
=
0
;
i
<
count
;
i
++
)
{
[
o_outline_view
setIndicatorImage
:
nil
inTableColumn
:
[[
o_outline_view
tableColumns
]
objectAtIndex
:
i
]];
...
...
@@ -561,9 +562,6 @@
-
(
void
)
updateRowSelection
{
int
i_row
;
unsigned
int
j
;
// FIXME: unsafe
playlist_t
*
p_playlist
=
pl_Get
(
VLCIntf
);
playlist_item_t
*
p_item
,
*
p_temp_item
;
...
...
@@ -585,7 +583,8 @@
}
PL_UNLOCK
;
for
(
j
=
0
;
j
<
[
o_array
count
]
-
1
;
j
++
)
NSUInteger
count
=
[
o_array
count
];
for
(
NSUInteger
j
=
0
;
j
<
count
-
1
;
j
++
)
{
id
o_item
;
if
(
(
o_item
=
[
o_outline_dict
objectForKey
:
...
...
@@ -663,10 +662,11 @@
already selected node */
-
(
void
)
removeItemsFrom
:(
id
)
o_items
ifChildrenOf
:(
id
)
o_nodes
{
unsigned
int
i
,
j
;
for
(
i
=
0
;
i
<
[
o_items
count
]
;
i
++
)
NSUInteger
itemCount
=
[
o_items
count
];
NSUInteger
nodeCount
=
[
o_nodes
count
];
for
(
NSUInteger
i
=
0
;
i
<
itemCount
;
i
++
)
{
for
(
j
=
0
;
j
<
[
o_nodes
count
]
;
j
++
)
for
(
NSUInteger
j
=
0
;
j
<
nodeCount
;
j
++
)
{
if
(
o_items
==
o_nodes
)
{
...
...
@@ -990,7 +990,6 @@
playlist_t
*
p_playlist
=
pl_Get
(
p_intf
);
input_item_t
*
p_input
;
int
i
;
BOOL
b_rem
=
FALSE
,
b_dir
=
FALSE
;
NSString
*
o_uri
,
*
o_name
;
NSArray
*
o_options
;
...
...
@@ -1004,12 +1003,12 @@
/* Find the name for a disc entry (i know, can you believe the trouble?) */
if
(
(
!
o_name
||
[
o_name
isEqualToString
:
@""
]
)
&&
[
o_uri
rangeOfString
:
@"/dev/"
].
location
!=
NSNotFound
)
{
int
i_count
,
i_index
;
int
i_count
;
struct
statfs
*
mounts
=
NULL
;
i_count
=
getmntinfo
(
&
mounts
,
MNT_NOWAIT
);
/* getmntinfo returns a pointer to static data. Do not free. */
for
(
i_index
=
0
;
i_index
<
i_count
;
i_index
++
)
for
(
i
nt
i
_index
=
0
;
i_index
<
i_count
;
i_index
++
)
{
NSMutableString
*
o_temp
,
*
o_temp2
;
o_temp
=
[
NSMutableString
stringWithString
:
o_uri
];
...
...
@@ -1051,7 +1050,8 @@
if
(
o_options
)
{
for
(
i
=
0
;
i
<
(
int
)[
o_options
count
];
i
++
)
NSUInteger
count
=
[
o_options
count
];
for
(
NSUInteger
i
=
0
;
i
<
count
;
i
++
)
{
input_item_AddOption
(
p_input
,
[[
o_options
objectAtIndex
:
i
]
UTF8String
],
VLC_INPUT_OPTION_TRUSTED
);
...
...
@@ -1070,11 +1070,11 @@
-
(
void
)
appendArray
:(
NSArray
*
)
o_array
atPos
:(
int
)
i_position
enqueue
:(
BOOL
)
b_enqueue
{
int
i_item
;
playlist_t
*
p_playlist
=
pl_Get
(
VLCIntf
);
NSUInteger
count
=
[
o_array
count
];
PL_LOCK
;
for
(
i_item
=
0
;
i_item
<
(
int
)[
o_array
count
]
;
i_item
++
)
for
(
NSUInteger
i_item
=
0
;
i_item
<
count
;
i_item
++
)
{
input_item_t
*
p_input
;
NSDictionary
*
o_one_item
;
...
...
@@ -1090,11 +1090,10 @@
/* Add the item */
/* FIXME: playlist_AddInput() can fail */
playlist_AddInput
(
p_playlist
,
p_input
,
PLAYLIST_INSERT
,
i_position
==
-
1
?
PLAYLIST_END
:
i_position
+
i_item
,
true
,
playlist_AddInput
(
p_playlist
,
p_input
,
PLAYLIST_INSERT
,
i_position
==
-
1
?
PLAYLIST_END
:
i_position
+
i_item
,
true
,
pl_Locked
);
if
(
i_item
==
0
&&
!
b_enqueue
)
/*
if( i_item == 0 && !b_enqueue )
{
playlist_item_t *p_item = NULL;
playlist_item_t *p_node = NULL;
...
...
@@ -1113,20 +1112,22 @@
}
playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, pl_Locked, p_node, p_item );
}
}
}
*/
vlc_gc_decref
(
p_input
);
}
PL_UNLOCK
;
[
o_outline_view
selectRowIndexes
:[
NSIndexSet
indexSetWithIndex
:
i_position
]
byExtendingSelection
:
YES
];
[
self
playItem
:
nil
];
[
self
playlistUpdated
];
}
-
(
void
)
appendNodeArray
:(
NSArray
*
)
o_array
inNode
:(
playlist_item_t
*
)
p_node
atPos
:(
int
)
i_position
enqueue
:(
BOOL
)
b_enqueue
{
int
i_item
;
playlist_t
*
p_playlist
=
pl_Get
(
VLCIntf
);
NSUInteger
count
=
[
o_array
count
];
for
(
i_item
=
0
;
i_item
<
(
int
)[
o_array
count
]
;
i_item
++
)
for
(
NSUInteger
i_item
=
0
;
i_item
<
count
;
i_item
++
)
{
input_item_t
*
p_input
;
NSDictionary
*
o_one_item
;
...
...
@@ -1162,16 +1163,15 @@
{
playlist_t
*
p_playlist
=
pl_Get
(
VLCIntf
);
playlist_item_t
*
p_selected_item
;
int
i_
current
,
i_
selected_row
;
int
i_selected_row
;
i_selected_row
=
[
o_outline_view
selectedRow
];
if
(
i_selected_row
<
0
)
i_selected_row
=
0
;
p_selected_item
=
(
playlist_item_t
*
)[[
o_outline_view
itemAtRow
:
i_selected_row
]
pointerValue
];
p_selected_item
=
(
playlist_item_t
*
)[[
o_outline_view
itemAtRow
:
i_selected_row
]
pointerValue
];
for
(
i_current
=
0
;
i_current
<
p_item
->
i_children
;
i_current
++
)
for
(
NSUInteger
i_current
=
0
;
i_current
<
p_item
->
i_children
;
i_current
++
)
{
char
*
psz_temp
;
NSString
*
o_current_name
,
*
o_current_author
;
...
...
@@ -1226,7 +1226,6 @@
playlist_t
*
p_playlist
=
pl_Get
(
VLCIntf
);
id
o_result
;
unsigned
int
i
;
int
i_row
=
-
1
;
b_selected_item_met
=
NO
;
...
...
@@ -1242,13 +1241,13 @@
if
(
o_result
!=
NULL
)
{
int
i_start
;
if
(
[[
o_result
objectAtIndex
:
0
]
pointerValue
]
==
p_playlist
->
p_local_category
)
if
(
[[
o_result
objectAtIndex
:
0
]
pointerValue
]
==
p_playlist
->
p_local_category
)
i_start
=
1
;
else
i_start
=
0
;
NSUInteger
count
=
[
o_result
count
];
for
(
i
=
i_start
;
i
<
[
o_result
count
]
-
1
;
i
++
)
for
(
NSUInteger
i
=
i_start
;
i
<
count
-
1
;
i
++
)
{
[
o_outline_view
expandItem
:
[
o_outline_dict
objectForKey
:
[
NSString
stringWithFormat
:
@"%p"
,
...
...
@@ -1256,7 +1255,7 @@
}
i_row
=
[
o_outline_view
rowForItem
:
[
o_outline_dict
objectForKey
:
[
NSString
stringWithFormat
:
@"%p"
,
[[
o_result
objectAtIndex
:
[
o_result
count
]
-
1
]
[[
o_result
objectAtIndex
:
count
-
1
]
pointerValue
]]]];
}
if
(
i_row
>
-
1
)
...
...
@@ -1426,7 +1425,6 @@
/* Required for drag & drop and reordering */
-
(
BOOL
)
outlineView
:(
NSOutlineView
*
)
outlineView
writeItems
:(
NSArray
*
)
items
toPasteboard
:(
NSPasteboard
*
)
pboard
{
unsigned
int
i
;
playlist_t
*
p_playlist
=
pl_Get
(
VLCIntf
);
/* First remove the items that were moved during the last drag & drop
...
...
@@ -1434,7 +1432,9 @@
[
o_items_array
removeAllObjects
];
[
o_nodes_array
removeAllObjects
];
for
(
i
=
0
;
i
<
[
items
count
]
;
i
++
)
NSUInteger
itemCount
=
[
items
count
];
for
(
NSUInteger
i
=
0
;
i
<
itemCount
;
i
++
)
{
id
o_item
=
[
items
objectAtIndex
:
i
];
...
...
@@ -1504,8 +1504,8 @@
/* Drop from the Playlist */
if
(
[[
o_pasteboard
types
]
containsObject
:
@"VLCPlaylistItemPboardType"
]
)
{
unsigned
int
i
;
for
(
i
=
0
;
i
<
[
o_nodes_array
count
]
;
i
++
)
NSUInteger
count
=
[
o_nodes_array
count
]
;
for
(
NSUInteger
i
=
0
;
i
<
count
;
i
++
)
{
/* We refuse to Drop in a child of an item we are moving */
if
(
[
self
isItem
:
[
item
pointerValue
]
inNode
:
...
...
@@ -1535,7 +1535,6 @@
if
(
[[
o_pasteboard
types
]
containsObject
:
@"VLCPlaylistItemPboardType"
]
)
{
int
i_row
,
i_removed_from_node
=
0
;
unsigned
int
i
;
playlist_item_t
*
p_new_parent
,
*
p_item
=
NULL
;
NSArray
*
o_all_items
=
[
o_nodes_array
arrayByAddingObjectsFromArray
:
o_items_array
];
...
...
@@ -1552,7 +1551,8 @@
return
NO
;
}
for
(
i
=
0
;
i
<
[
o_all_items
count
];
i
++
)
NSUInteger
count
=
[
o_all_items
count
];
for
(
NSUInteger
i
=
0
;
i
<
count
;
i
++
)
{
playlist_item_t
*
p_old_parent
=
NULL
;
int
i_old_index
=
0
;
...
...
@@ -1564,8 +1564,7 @@
/* We may need the old index later */
if
(
p_new_parent
==
p_old_parent
)
{
int
j
;
for
(
j
=
0
;
j
<
p_old_parent
->
i_children
;
j
++
)
for
(
NSInteger
j
=
0
;
j
<
p_old_parent
->
i_children
;
j
++
)
{
if
(
p_old_parent
->
pp_children
[
j
]
==
p_item
)
{
...
...
@@ -1588,8 +1587,7 @@
account that one item will be deleted */
else
{
if
((
p_new_parent
==
p_old_parent
&&
i_old_index
<
index
+
(
int
)
i
)
)
if
((
p_new_parent
==
p_old_parent
&&
i_old_index
<
index
+
(
int
)
i
)
)
{
i_removed_from_node
++
;
}
...
...
@@ -1617,16 +1615,14 @@
else
if
(
[[
o_pasteboard
types
]
containsObject
:
NSFilenamesPboardType
]
)
{
int
i
;
playlist_item_t
*
p_node
=
[
item
pointerValue
];
NSArray
*
o_array
=
[
NSArray
array
];
NSArray
*
o_values
=
[[
o_pasteboard
propertyListForType
:
NSFilenamesPboardType
]
sortedArrayUsingSelector:
@selector
(
caseInsensitiveCompare
:)];
NSArray
*
o_values
=
[[
o_pasteboard
propertyListForType
:
NSFilenamesPboardType
]
sortedArrayUsingSelector:
@selector
(
caseInsensitiveCompare
:)];
NSUInteger
count
=
[
o_values
count
];
NSMutableArray
*
o_array
=
[
NSMutableArray
arrayWithCapacity
:
count
];
for
(
i
=
0
;
i
<
(
int
)[
o_values
count
]
;
i
++
)
for
(
NSUInteger
i
=
0
;
i
<
count
;
i
++
)
{
NSDictionary
*
o_dic
;
char
*
psz_uri
=
make_URI
([[
o_values
objectAtIndex
:
i
]
UTF8String
],
NULL
);
...
...
@@ -1637,7 +1633,7 @@
free
(
psz_uri
);
o_array
=
[
o_array
arrayByAdding
Object
:
o_dic
];
[
o_array
add
Object
:
o_dic
];
}
if
(
item
==
nil
)
...
...
@@ -1647,8 +1643,7 @@
else
{
assert
(
p_node
->
i_children
!=
-
1
);
[
self
appendNodeArray
:
o_array
inNode
:
p_node
atPos:
index
enqueue
:
YES
];
[
self
appendNodeArray
:
o_array
inNode
:
p_node
atPos
:
index
enqueue
:
YES
];
}
return
YES
;
}
...
...
modules/gui/macosx/prefs.m
View file @
2c828226
...
...
@@ -295,7 +295,8 @@ static VLCPrefs *_o_sharedMainInstance = nil;
-
(
VLCTreeCategoryItem
*
)
itemRepresentingCategory
:(
int
)
category
{
for
(
int
i
=
0
;
i
<
[[
self
children
]
count
];
i
++
)
NSUInteger
childrenCount
=
[[
self
children
]
count
];
for
(
int
i
=
0
;
i
<
childrenCount
;
i
++
)
{
VLCTreeCategoryItem
*
categoryItem
=
[[
self
children
]
objectAtIndex
:
i
];
if
(
[
categoryItem
category
]
==
category
)
...
...
@@ -433,7 +434,8 @@ static VLCPrefs *_o_sharedMainInstance = nil;
-
(
VLCTreeSubCategoryItem
*
)
itemRepresentingSubCategory
:(
int
)
subCategory
{
assert
(
[
self
isKindOfClass
:[
VLCTreeCategoryItem
class
]]
);
for
(
int
i
=
0
;
i
<
[[
self
children
]
count
];
i
++
)
NSUInteger
childrenCount
=
[[
self
children
]
count
];
for
(
NSUInteger
i
=
0
;
i
<
childrenCount
;
i
++
)
{
VLCTreeSubCategoryItem
*
subCategoryItem
=
[[
self
children
]
objectAtIndex
:
i
];
if
(
[
subCategoryItem
subCategory
]
==
subCategory
)
...
...
@@ -584,8 +586,8 @@ static VLCPrefs *_o_sharedMainInstance = nil;
{
_subviews
=
[[
NSMutableArray
alloc
]
initWithCapacity
:
10
];
long
i
;
for
(
i
=
0
;
i
<
[[
self
options
]
count
]
;
i
++
)
NSUInteger
count
=
[[
self
options
]
count
]
;
for
(
NSUInteger
i
=
0
;
i
<
count
;
i
++
)
{
VLCTreeLeafItem
*
item
=
[[
self
options
]
objectAtIndex
:
i
];
...
...
@@ -638,24 +640,29 @@ static VLCPrefs *_o_sharedMainInstance = nil;
-
(
void
)
applyChanges
{
unsigned
int
i
;
for
(
i
=
0
;
i
<
[
_subviews
count
]
;
i
++
)
NSUInteger
i
;
NSUInteger
count
=
[
_subviews
count
];
for
(
i
=
0
;
i
<
count
;
i
++
)
[[
_subviews
objectAtIndex
:
i
]
applyChanges
];
for
(
i
=
0
;
i
<
[
_children
count
]
;
i
++
)
count
=
[
_children
count
];
for
(
i
=
0
;
i
<
count
;
i
++
)
[[
_children
objectAtIndex
:
i
]
applyChanges
];
}
-
(
void
)
resetView
{
unsigned
int
i
;
for
(
i
=
0
;
i
<
[
_subviews
count
]
;
i
++
)
NSUInteger
i
;
NSUInteger
count
=
[
_subviews
count
];
for
(
i
=
0
;
i
<
count
;
i
++
)
[[
_subviews
objectAtIndex
:
i
]
resetValues
];
for
(
i
=
0
;
i
<
[
_options
count
]
;
i
++
)
count
=
[
_options
count
];
for
(
i
=
0
;
i
<
count
;
i
++
)
[[
_options
objectAtIndex
:
i
]
resetView
];
for
(
i
=
0
;
i
<
[
_children
count
]
;
i
++
)
count
=
[
_children
count
];
for
(
i
=
0
;
i
<
count
;
i
++
)
[[
_children
objectAtIndex
:
i
]
resetView
];
}
...
...
modules/gui/macosx/prefs_widgets.m
View file @
2c828226
...
...
@@ -2308,8 +2308,8 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
-
(
IBAction
)
tableChanged
:(
id
)
sender
{
NSString
*
o_newstring
=
@""
;
unsigned
int
i
;
for
(
i
=
0
;
i
<
[
o_modulearray
count
]
;
i
++
)
NSUInteger
count
=
[
o_modulearray
count
]
;
for
(
NSUInteger
i
=
0
;
i
<
count
;
i
++
)
if
(
[[[
o_modulearray
objectAtIndex
:
i
]
objectAtIndex
:
2
]
boolValue
]
!=
NO
)
{
...
...
modules/gui/macosx/simple_prefs.m
View file @
2c828226
...
...
@@ -916,7 +916,8 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
********************/
if
(
b_hotkeyChanged
)
{
for
(
NSUInteger
i
=
0
;
i
<
[
o_hotkeySettings
count
];
i
++
)
NSUInteger
hotKeyCount
=
[
o_hotkeySettings
count
];
for
(
NSUInteger
i
=
0
;
i
<
hotKeyCount
;
i
++
)
config_PutPsz
(
p_intf
,
[[
o_hotkeyNames
objectAtIndex
:
i
]
UTF8String
],
[[
o_hotkeySettings
objectAtIndex
:
i
]
UTF8String
]
);
b_hotkeyChanged
=
NO
;
}
...
...
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