Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
4k
Issue boards
Milestones
Code
Merge requests
454
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC
Commits
bb1a55aa
Commit
bb1a55aa
authored
5 years ago
by
Felix Paul Kühne
Browse files
Options
Downloads
Patches
Plain Diff
macosx/playlist controller: expose sorting
parent
c829e34b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/gui/macosx/playlist/VLCPlaylistController.h
+24
-0
24 additions, 0 deletions
modules/gui/macosx/playlist/VLCPlaylistController.h
modules/gui/macosx/playlist/VLCPlaylistController.m
+16
-0
16 additions, 0 deletions
modules/gui/macosx/playlist/VLCPlaylistController.m
with
40 additions
and
0 deletions
modules/gui/macosx/playlist/VLCPlaylistController.h
+
24
−
0
View file @
bb1a55aa
...
...
@@ -142,6 +142,30 @@ extern NSString *VLCPlaylistItemsRemoved;
*/
-
(
void
)
clearPlaylist
;
/**
* Sort the entire playlist listen based on:
* @param sortKey the key used for sorting
* @param sortOrder sort ascending or descending..
* @return Returns VLC_SUCCESS on success.
*/
-
(
int
)
sortByKey
:(
enum
vlc_playlist_sort_key
)
sortKey
andOrder
:(
enum
vlc_playlist_sort_order
)
sortOrder
;
/**
* Initially, the playlist is unsorted until the user decides to do so
* Until then, the unsorted state is retained.
*/
@property
(
readonly
)
BOOL
unsorted
;
/**
* The last key used for sorting
*/
@property
(
readonly
)
enum
vlc_playlist_sort_key
lastSortKey
;
/**
* The last order used for sorting
*/
@property
(
readonly
)
enum
vlc_playlist_sort_order
lastSortOrder
;
/**
* Start the playlist
* @return Returns VLC_SUCCESS on success.
...
...
This diff is collapsed.
Click to expand it.
modules/gui/macosx/playlist/VLCPlaylistController.m
+
16
−
0
View file @
bb1a55aa
...
...
@@ -210,6 +210,7 @@ static const struct vlc_playlist_callbacks playlist_callbacks = {
/* set initial values, further updates through callbacks */
vlc_playlist_Lock
(
_p_playlist
);
_unsorted
=
YES
;
_playbackOrder
=
vlc_playlist_GetPlaybackOrder
(
_p_playlist
);
_playbackRepeat
=
vlc_playlist_GetPlaybackRepeat
(
_p_playlist
);
_playlistListenerID
=
vlc_playlist_AddListener
(
_p_playlist
,
...
...
@@ -424,6 +425,21 @@ static const struct vlc_playlist_callbacks playlist_callbacks = {
vlc_playlist_Unlock
(
_p_playlist
);
}
-
(
int
)
sortByKey
:(
enum
vlc_playlist_sort_key
)
sortKey
andOrder
:(
enum
vlc_playlist_sort_order
)
sortOrder
{
struct
vlc_playlist_sort_criterion
sortCriterion
=
{
sortKey
,
sortOrder
};
int
returnValue
=
VLC_SUCCESS
;
vlc_playlist_Lock
(
_p_playlist
);
returnValue
=
vlc_playlist_Sort
(
_p_playlist
,
&
sortCriterion
,
1
);
vlc_playlist_Unlock
(
_p_playlist
);
if
(
returnValue
==
VLC_SUCCESS
)
{
_lastSortKey
=
sortKey
;
_lastSortOrder
=
sortOrder
;
_unsorted
=
NO
;
}
return
returnValue
;
}
-
(
int
)
startPlaylist
{
NSInteger
selectedIndex
=
[
_playlistDataSource
.
tableView
selectedRow
];
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment