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
e0d08374
Commit
e0d08374
authored
Nov 21, 2004
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sort a node (alphabetically, all sub-nodes come first)
parent
0b62ce6d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
1 deletion
+47
-1
include/vlc_playlist.h
include/vlc_playlist.h
+3
-1
modules/gui/wxwindows/playlist.cpp
modules/gui/wxwindows/playlist.cpp
+23
-0
modules/gui/wxwindows/wxwindows.h
modules/gui/wxwindows/wxwindows.h
+1
-0
src/playlist/sort.c
src/playlist/sort.c
+20
-0
No files found.
include/vlc_playlist.h
View file @
e0d08374
...
...
@@ -208,7 +208,8 @@ struct playlist_add_t
#define SORT_ID 0
#define SORT_TITLE 1
#define SORT_AUTHOR 2
#define SORT_TITLE_NODES_FIRST 2
#define SORT_AUTHOR 3
#define SORT_RANDOM 4
#define SORT_DURATION 5
...
...
@@ -331,6 +332,7 @@ VLC_EXPORT( int, playlist_ItemAddOption, (playlist_item_t *, const char *) );
VLC_EXPORT
(
int
,
playlist_Sort
,
(
playlist_t
*
,
int
,
int
)
);
VLC_EXPORT
(
int
,
playlist_Move
,
(
playlist_t
*
,
int
,
int
)
);
VLC_EXPORT
(
int
,
playlist_NodeGroup
,
(
playlist_t
*
,
int
,
playlist_item_t
*
,
playlist_item_t
**
,
int
,
int
,
int
)
);
VLC_EXPORT
(
int
,
playlist_NodeSort
,
(
playlist_t
*
,
playlist_item_t
*
,
int
,
int
)
);
/* Load/Save */
VLC_EXPORT
(
int
,
playlist_Import
,
(
playlist_t
*
,
const
char
*
)
);
...
...
modules/gui/wxwindows/playlist.cpp
View file @
e0d08374
...
...
@@ -93,6 +93,7 @@ enum
PopupPlay_Event
,
PopupPlayThis_Event
,
PopupSort_Event
,
PopupDel_Event
,
PopupEna_Event
,
PopupInfo_Event
,
...
...
@@ -154,6 +155,7 @@ BEGIN_EVENT_TABLE(Playlist, wxFrame)
/* Popup events */
EVT_MENU
(
PopupPlay_Event
,
Playlist
::
OnPopupPlay
)
EVT_MENU
(
PopupPlayThis_Event
,
Playlist
::
OnPopupPlay
)
EVT_MENU
(
PopupSort_Event
,
Playlist
::
OnPopupSort
)
EVT_MENU
(
PopupDel_Event
,
Playlist
::
OnPopupDel
)
EVT_MENU
(
PopupEna_Event
,
Playlist
::
OnPopupEna
)
EVT_MENU
(
PopupInfo_Event
,
Playlist
::
OnPopupInfo
)
...
...
@@ -276,6 +278,7 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
popup_menu
=
new
wxMenu
;
popup_menu
->
Append
(
PopupPlay_Event
,
wxU
(
_
(
"Play"
))
);
popup_menu
->
Append
(
PopupPlayThis_Event
,
wxU
(
_
(
"Play this branch"
))
);
popup_menu
->
Append
(
PopupSort_Event
,
wxU
(
_
(
"Sort this branch"
))
);
popup_menu
->
Append
(
PopupDel_Event
,
wxU
(
_
(
"Delete"
))
);
popup_menu
->
Append
(
PopupEna_Event
,
wxU
(
_
(
"Enable/Disable"
))
);
popup_menu
->
Append
(
PopupInfo_Event
,
wxU
(
_
(
"Info"
))
);
...
...
@@ -1452,6 +1455,26 @@ void Playlist::OnPopupDel( wxMenuEvent& event )
}
}
void
Playlist
::
OnPopupSort
(
wxMenuEvent
&
event
)
{
PlaylistItem
*
p_wxitem
;
p_wxitem
=
(
PlaylistItem
*
)
treectrl
->
GetItemData
(
i_popup_item
);
if
(
p_wxitem
->
p_item
->
i_children
>=
0
)
{
playlist_t
*
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
if
(
p_playlist
)
{
playlist_NodeSort
(
p_playlist
,
p_wxitem
->
p_item
,
SORT_TITLE_NODES_FIRST
,
ORDER_NORMAL
);
vlc_object_release
(
p_playlist
);
}
}
}
void
Playlist
::
OnPopupEna
(
wxMenuEvent
&
event
)
{
playlist_t
*
p_playlist
=
...
...
modules/gui/wxwindows/wxwindows.h
View file @
e0d08374
...
...
@@ -829,6 +829,7 @@ private:
/* Popup functions */
void
OnPopup
(
wxContextMenuEvent
&
event
);
void
OnPopupPlay
(
wxMenuEvent
&
event
);
void
OnPopupSort
(
wxMenuEvent
&
event
);
void
OnPopupDel
(
wxMenuEvent
&
event
);
void
OnPopupEna
(
wxMenuEvent
&
event
);
void
OnPopupInfo
(
wxMenuEvent
&
event
);
...
...
src/playlist/sort.c
View file @
e0d08374
...
...
@@ -153,6 +153,26 @@ int playlist_ItemArraySort( playlist_t *p_playlist, int i_items,
{
msg_Err
(
p_playlist
,
"META SORT not implemented"
);
}
else
if
(
i_mode
==
SORT_TITLE_NODES_FIRST
)
{
/* Alphabetic sort, all nodes first */
if
(
pp_items
[
i
]
->
i_children
==
-
1
&&
pp_items
[
i_small
]
->
i_children
>=
0
)
{
i_test
=
1
;
}
else
if
(
pp_items
[
i
]
->
i_children
>=
0
&&
pp_items
[
i_small
]
->
i_children
==
-
1
)
{
i_test
=
-
1
;
}
else
{
i_test
=
strcasecmp
(
pp_items
[
i
]
->
input
.
psz_name
,
pp_items
[
i_small
]
->
input
.
psz_name
);
}
}
if
(
(
i_type
==
ORDER_NORMAL
&&
i_test
<
0
)
||
(
i_type
==
ORDER_REVERSE
&&
i_test
>
0
)
)
...
...
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