Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
5eb406b4
Commit
5eb406b4
authored
Dec 12, 2004
by
Benjamin Pracht
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* deleteItem: method
parent
2ad668f3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
90 additions
and
86 deletions
+90
-86
modules/gui/macosx/playlist.h
modules/gui/macosx/playlist.h
+1
-0
modules/gui/macosx/playlist.m
modules/gui/macosx/playlist.m
+89
-86
No files found.
modules/gui/macosx/playlist.h
View file @
5eb406b4
...
...
@@ -70,6 +70,7 @@
-
(
void
)
playlistUpdated
;
-
(
IBAction
)
playItem
:(
id
)
sender
;
-
(
IBAction
)
deleteItem
:(
id
)
sender
;
-
(
IBAction
)
selectAll
:(
id
)
sender
;
-
(
void
)
appendArray
:(
NSArray
*
)
o_array
atPos
:(
int
)
i_position
enqueue
:(
BOOL
)
b_enqueue
;
...
...
modules/gui/macosx/playlist.m
View file @
5eb406b4
...
...
@@ -65,113 +65,28 @@
return
(
[[
self
delegate
]
menuForEvent
:
o_event
]
);
}
-
(
bool
)
isItem
:(
playlist_item_t
*
)
p_item
inNode
:(
playlist_item_t
*
)
p_node
{
playlist_t
*
p_playlist
=
vlc_object_find
(
VLCIntf
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
playlist_item_t
*
p_temp_item
=
p_item
;
if
(
p_playlist
==
NULL
)
{
return
NO
;
}
while
(
p_temp_item
->
i_parents
>
0
)
{
int
i
;
for
(
i
=
0
;
i
<
p_temp_item
->
i_parents
;
i
++
)
{
if
(
p_temp_item
->
pp_parents
[
i
]
->
i_view
==
VIEW_SIMPLE
)
{
if
(
p_temp_item
->
pp_parents
[
i
]
->
p_parent
==
p_node
)
{
vlc_object_release
(
p_playlist
);
return
YES
;
}
else
{
p_temp_item
=
p_temp_item
->
pp_parents
[
i
]
->
p_parent
;
break
;
}
}
}
}
vlc_object_release
(
p_playlist
);
return
NO
;
}
-
(
void
)
keyDown
:(
NSEvent
*
)
o_event
{
unichar
key
=
0
;
int
i
,
c
,
i_row
;
NSMutableArray
*
o_to_delete
;
NSNumber
*
o_number
;
playlist_t
*
p_playlist
;
intf_thread_t
*
p_intf
=
VLCIntf
;
msg_Dbg
(
p_intf
,
"KEYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY"
);
if
(
[[
o_event
characters
]
length
]
)
{
key
=
[[
o_event
characters
]
characterAtIndex
:
0
];
}
p_playlist
=
vlc_object_find
(
p_intf
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
if
(
p_playlist
==
NULL
)
{
return
;
}
switch
(
key
)
{
case
NSDeleteCharacter
:
case
NSDeleteFunctionKey
:
case
NSDeleteCharFunctionKey
:
case
NSBackspaceCharacter
:
o_to_delete
=
[
NSMutableArray
arrayWithArray
:[[
self
selectedRowEnumerator
]
allObjects
]];
c
=
[
o_to_delete
count
];
for
(
i
=
0
;
i
<
c
;
i
++
)
{
playlist_item_t
*
p_item
;
o_number
=
[
o_to_delete
lastObject
];
i_row
=
[
o_number
intValue
];
[
o_to_delete
removeObject
:
o_number
];
[
self
deselectRow
:
i_row
];
p_item
=
(
playlist_item_t
*
)[[
self
itemAtRow
:
i_row
]
pointerValue
];
if
(
p_item
->
i_children
>
-
1
)
{
if
([
self
isItem
:
p_playlist
->
status
.
p_item
inNode
:
p_item
]
==
YES
&&
p_playlist
->
status
.
i_status
)
{
playlist_Stop
(
p_playlist
);
}
playlist_NodeDelete
(
p_playlist
,
p_item
,
VLC_TRUE
);
}
else
{
if
(
p_playlist
->
status
.
p_item
==
[[
self
itemAtRow
:
i_row
]
pointerValue
]
&&
p_playlist
->
status
.
i_status
)
{
playlist_Stop
(
p_playlist
);
}
playlist_Delete
(
p_playlist
,
p_item
->
input
.
i_id
);
}
[[
self
delegate
]
playlistUpdated
];
}
[[
self
delegate
]
deleteItem
:
self
];
break
;
default:
[
super
keyDown
:
o_event
];
break
;
}
if
(
p_playlist
!=
NULL
)
{
vlc_object_release
(
p_playlist
);
}
}
@end
...
...
@@ -259,6 +174,43 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
[
o_outline_view
reloadData
];
}
-
(
bool
)
isItem
:(
playlist_item_t
*
)
p_item
inNode
:(
playlist_item_t
*
)
p_node
{
playlist_t
*
p_playlist
=
vlc_object_find
(
VLCIntf
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
playlist_item_t
*
p_temp_item
=
p_item
;
if
(
p_playlist
==
NULL
)
{
return
NO
;
}
while
(
p_temp_item
->
i_parents
>
0
)
{
int
i
;
for
(
i
=
0
;
i
<
p_temp_item
->
i_parents
;
i
++
)
{
if
(
p_temp_item
->
pp_parents
[
i
]
->
i_view
==
VIEW_SIMPLE
)
{
if
(
p_temp_item
->
pp_parents
[
i
]
->
p_parent
==
p_node
)
{
vlc_object_release
(
p_playlist
);
return
YES
;
}
else
{
p_temp_item
=
p_temp_item
->
pp_parents
[
i
]
->
p_parent
;
break
;
}
}
}
}
vlc_object_release
(
p_playlist
);
return
NO
;
}
-
(
IBAction
)
playItem
:(
id
)
sender
{
intf_thread_t
*
p_intf
=
VLCIntf
;
...
...
@@ -314,6 +266,57 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
[
o_outline_view
selectAll
:
nil
];
}
-
(
IBAction
)
deleteItem
:(
id
)
sender
{
int
i
,
c
,
i_row
;
NSMutableArray
*
o_to_delete
;
NSNumber
*
o_number
;
playlist_t
*
p_playlist
;
intf_thread_t
*
p_intf
=
VLCIntf
;
p_playlist
=
vlc_object_find
(
p_intf
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
if
(
p_playlist
==
NULL
)
{
return
;
}
o_to_delete
=
[
NSMutableArray
arrayWithArray
:[[
o_outline_view
selectedRowEnumerator
]
allObjects
]];
c
=
[
o_to_delete
count
];
for
(
i
=
0
;
i
<
c
;
i
++
)
{
playlist_item_t
*
p_item
;
o_number
=
[
o_to_delete
lastObject
];
i_row
=
[
o_number
intValue
];
[
o_to_delete
removeObject
:
o_number
];
[
o_outline_view
deselectRow
:
i_row
];
p_item
=
(
playlist_item_t
*
)[[
o_outline_view
itemAtRow
:
i_row
]
pointerValue
];
if
(
p_item
->
i_children
>
-
1
)
{
if
(
p_playlist
->
status
.
i_status
)
{
if
([
self
isItem
:
p_playlist
->
status
.
p_item
inNode
:
p_item
]
==
YES
&&
p_playlist
->
status
.
i_status
)
{
playlist_Stop
(
p_playlist
);
}
}
playlist_NodeDelete
(
p_playlist
,
p_item
,
VLC_TRUE
);
}
else
{
if
(
p_playlist
->
status
.
p_item
==
[[
o_outline_view
itemAtRow
:
i_row
]
pointerValue
]
&&
p_playlist
->
status
.
i_status
)
{
playlist_Stop
(
p_playlist
);
}
playlist_Delete
(
p_playlist
,
p_item
->
input
.
i_id
);
}
[
self
playlistUpdated
];
}
}
-
(
void
)
appendArray
:(
NSArray
*
)
o_array
atPos
:(
int
)
i_position
enqueue
:(
BOOL
)
b_enqueue
{
...
...
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