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
69731466
Commit
69731466
authored
Mar 07, 2015
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: select currently played item
And expand outline view tree if necessary.
parent
e11d1337
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
36 deletions
+46
-36
modules/gui/macosx/PLModel.h
modules/gui/macosx/PLModel.h
+2
-0
modules/gui/macosx/PLModel.m
modules/gui/macosx/PLModel.m
+12
-0
modules/gui/macosx/intf.m
modules/gui/macosx/intf.m
+2
-1
modules/gui/macosx/playlist.h
modules/gui/macosx/playlist.h
+2
-1
modules/gui/macosx/playlist.m
modules/gui/macosx/playlist.m
+28
-34
No files found.
modules/gui/macosx/PLModel.h
View file @
69731466
...
...
@@ -80,6 +80,8 @@ typedef enum {
-
(
void
)
addItem
:(
int
)
i_item
withParentNode
:(
int
)
i_node
;
-
(
void
)
removeItem
:(
int
)
i_item
;
-
(
PLItem
*
)
currentlyPlayingItem
;
-
(
void
)
sortForColumn
:(
NSString
*
)
o_column
withMode
:(
int
)
i_mode
;
-
(
void
)
searchUpdate
:(
NSString
*
)
o_search
;
...
...
modules/gui/macosx/PLModel.m
View file @
69731466
...
...
@@ -199,6 +199,18 @@
[
_outlineView
reloadItem
:
o_parent
reloadChildren
:
YES
];
}
-
(
PLItem
*
)
currentlyPlayingItem
{
PLItem
*
item
=
nil
;
PL_LOCK
;
playlist_item_t
*
p_current
=
playlist_CurrentPlayingItem
(
p_playlist
);
if
(
p_current
)
item
=
[
self
findItemByPlaylistId
:
p_current
->
i_id
];
PL_UNLOCK
;
return
item
;
}
-
(
void
)
sortForColumn
:(
NSString
*
)
o_column
withMode
:(
int
)
i_mode
{
int
i_column
=
0
;
...
...
modules/gui/macosx/intf.m
View file @
69731466
...
...
@@ -1356,6 +1356,8 @@ static bool f_appExit = false;
p_input_changed
=
vlc_object_hold
(
p_current_input
);
[[
self
playlist
]
currentlyPlayingItemChanged
];
[[
self
playlist
]
continuePlaybackWhereYouLeftOff
:
p_current_input
];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
VLCInputChangedNotification
...
...
@@ -1363,7 +1365,6 @@ static bool f_appExit = false;
}
}
[
o_playlist
updateRowSelection
];
[
o_mainwindow
updateWindow
];
[
self
updateDelays
];
[
self
updateMainMenu
];
...
...
modules/gui/macosx/playlist.h
View file @
69731466
...
...
@@ -91,7 +91,8 @@
-
(
void
)
playlistUpdated
;
-
(
void
)
outlineViewSelectionDidChange
:(
NSNotification
*
)
notification
;
-
(
void
)
sortNode
:(
int
)
i_mode
;
-
(
void
)
updateRowSelection
;
-
(
void
)
currentlyPlayingItemChanged
;
-
(
BOOL
)
isSelectionEmpty
;
...
...
modules/gui/macosx/playlist.m
View file @
69731466
...
...
@@ -354,42 +354,36 @@
return
[
o_outline_view
selectedRow
]
==
-
1
;
}
-
(
void
)
updateRowSelection
-
(
void
)
currentlyPlayingItemChanged
{
// FIXME: unsafe
playlist_t
*
p_playlist
=
pl_Get
(
VLCIntf
);
playlist_item_t
*
p_item
,
*
p_temp_item
;
NSMutableArray
*
o_array
=
[
NSMutableArray
array
];
PLItem
*
item
=
[[
self
model
]
currentlyPlayingItem
];
if
(
!
item
)
return
;
// TODO Rework
// PL_LOCK;
// p_item = playlist_CurrentPlayingItem(p_playlist);
// if (p_item == NULL) {
// PL_UNLOCK;
// return;
// }
//
// p_temp_item = p_item;
// while(p_temp_item->p_parent) {
// [o_array insertObject: [NSValue valueWithPointer: p_temp_item] atIndex: 0];
// p_temp_item = p_temp_item->p_parent;
// }
// PL_UNLOCK;
//
// NSUInteger count = [o_array count];
// for (NSUInteger j = 0; j < count - 1; j++) {
// id o_item;
// if ((o_item = [o_outline_dict objectForKey:
// [NSString stringWithFormat: @"%p",
// [[o_array objectAtIndex:j] pointerValue]]]) != nil) {
// [o_outline_view expandItem: o_item];
// }
// }
//
// id o_item = [o_outline_dict objectForKey:[NSString stringWithFormat: @"%p", p_item]];
// NSInteger i_index = [o_outline_view rowForItem:o_item];
// [o_outline_view selectRowIndexes:[NSIndexSet indexSetWithIndex:i_index] byExtendingSelection:NO];
// [o_outline_view setNeedsDisplay:YES];
[[[
VLCMain
sharedInstance
]
info
]
updatePanelWithItem
:
[
item
input
]];
// select item
NSInteger
itemIndex
=
[
o_outline_view
rowForItem
:
item
];
if
(
itemIndex
<
0
)
{
// expand if needed
while
(
item
!=
nil
)
{
PLItem
*
parent
=
[
item
parent
];
if
(
!
[
o_outline_view
isExpandable
:
parent
])
break
;
if
(
!
[
o_outline_view
isItemExpanded
:
parent
])
[
o_outline_view
expandItem
:
parent
];
item
=
parent
;
}
// search for row again
itemIndex
=
[
o_outline_view
rowForItem
:
item
];
if
(
itemIndex
<
0
)
{
return
;
}
}
[
o_outline_view
selectRowIndexes
:
[
NSIndexSet
indexSetWithIndex
:
itemIndex
]
byExtendingSelection
:
NO
];
}
-
(
IBAction
)
savePlaylist
:(
id
)
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