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
76781954
Commit
76781954
authored
Jan 10, 2004
by
Derk-Jan Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Fixed some doxygen comments.
* Added SORT_ID * remember last sorting and ordering in playlist struct
parent
24a26dde
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
33 deletions
+46
-33
include/vlc_playlist.h
include/vlc_playlist.h
+9
-6
src/playlist/item-ext.c
src/playlist/item-ext.c
+23
-23
src/playlist/playlist.c
src/playlist/playlist.c
+3
-1
src/playlist/sort.c
src/playlist/sort.c
+11
-3
No files found.
include/vlc_playlist.h
View file @
76781954
...
...
@@ -2,7 +2,7 @@
* vlc_playlist.h : Playlist functions
*****************************************************************************
* Copyright (C) 1999-2004 VideoLAN
* $Id: vlc_playlist.h,v 1.2
2 2004/01/10 03:36:0
3 hartman Exp $
* $Id: vlc_playlist.h,v 1.2
3 2004/01/10 14:24:3
3 hartman Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
...
...
@@ -120,14 +120,16 @@ struct playlist_t
input_thread_t
*
p_input
;
/**< the input thread ascosiated
* with the current item */
int
i_last_id
;
/**< Last id to an item */
int
i_sort
;
/**< Last sorting applied to the playlist */
int
i_order
;
/**< Last ordering applied to the playlist */
/*@}*/
};
#define SORT_
TITLE
0
#define SORT_
AUTHOR
1
#define SORT_
GROUP
2
#define SORT_
RANDOM
3
#define SORT_
ID
4
#define SORT_
ID
0
#define SORT_
TITLE
1
#define SORT_
AUTHOR
2
#define SORT_
GROUP
3
#define SORT_
RANDOM
4
#define ORDER_NORMAL 0
#define ORDER_REVERSE 1
...
...
@@ -199,6 +201,7 @@ VLC_EXPORT( int, playlist_AddOption, (playlist_t *, int, const char *, ...) );
VLC_EXPORT
(
int
,
playlist_AddItemOption
,
(
playlist_item_t
*
,
const
char
*
,
...)
);
/* Playlist sorting */
#define playlist_SortID(p, i) playlist_Sort( p, SORT_ID, i)
#define playlist_SortTitle(p, i) playlist_Sort( p, SORT_TITLE, i)
#define playlist_SortAuthor(p, i) playlist_Sort( p, SORT_AUTHOR, i)
#define playlist_SortGroup(p, i) playlist_Sort( p, SORT_GROUP, i)
...
...
src/playlist/item-ext.c
View file @
76781954
...
...
@@ -2,7 +2,7 @@
* item-ext.c : Exported playlist item functions
*****************************************************************************
* Copyright (C) 1999-2004 VideoLAN
* $Id: item-ext.c,v 1.
6 2004/01/10 03:36:0
3 hartman Exp $
* $Id: item-ext.c,v 1.
7 2004/01/10 14:24:3
3 hartman Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Clément Stenac <zorglub@videolan.org>
...
...
@@ -151,11 +151,11 @@ playlist_item_t * playlist_GetItemById( playlist_t * p_playlist , int i_id )
* Set the group of a playlist item
*
* \param p_playlist the playlist
* \param i_
item the item of which we change the group (position)
* \param i_
pos the postition of the item of which we change the group
* \param i_group the new group
* \return 0 on success, -1 on failure
*/
int
playlist_SetGroup
(
playlist_t
*
p_playlist
,
int
i_
item
,
int
i_group
)
int
playlist_SetGroup
(
playlist_t
*
p_playlist
,
int
i_
pos
,
int
i_group
)
{
char
*
psz_group
;
/* Check the existence of the playlist */
...
...
@@ -164,12 +164,12 @@ int playlist_SetGroup( playlist_t *p_playlist, int i_item, int i_group )
return
-
1
;
}
/* Get a correct item */
if
(
i_
item
>=
0
&&
i_item
<
p_playlist
->
i_size
)
if
(
i_
pos
>=
0
&&
i_pos
<
p_playlist
->
i_size
)
{
}
else
if
(
p_playlist
->
i_size
>
0
)
{
i_
item
=
p_playlist
->
i_index
;
i_
pos
=
p_playlist
->
i_index
;
}
else
{
...
...
@@ -179,7 +179,7 @@ int playlist_SetGroup( playlist_t *p_playlist, int i_item, int i_group )
psz_group
=
playlist_FindGroup
(
p_playlist
,
i_group
);
if
(
psz_group
!=
NULL
)
{
p_playlist
->
pp_items
[
i_
item
]
->
i_group
=
i_group
;
p_playlist
->
pp_items
[
i_
pos
]
->
i_group
=
i_group
;
}
return
0
;
}
...
...
@@ -188,11 +188,11 @@ int playlist_SetGroup( playlist_t *p_playlist, int i_item, int i_group )
* Set the name of a playlist item
*
* \param p_playlist the playlist
* \param i_
item
the item of which we change the name
* \param i_
pos the position of
the item of which we change the name
* \param psz_name the new name
* \return VLC_SUCCESS on success, VLC_EGENERIC on failure
*/
int
playlist_SetName
(
playlist_t
*
p_playlist
,
int
i_
item
,
char
*
psz_name
)
int
playlist_SetName
(
playlist_t
*
p_playlist
,
int
i_
pos
,
char
*
psz_name
)
{
vlc_value_t
val
;
...
...
@@ -202,25 +202,25 @@ int playlist_SetName( playlist_t *p_playlist, int i_item, char *psz_name )
return
-
1
;
}
/* Get a correct item */
if
(
i_
item
>=
0
&&
i_item
<
p_playlist
->
i_size
)
if
(
i_
pos
>=
0
&&
i_pos
<
p_playlist
->
i_size
)
{
}
else
if
(
p_playlist
->
i_size
>
0
)
{
i_
item
=
p_playlist
->
i_index
;
i_
pos
=
p_playlist
->
i_index
;
}
else
{
return
-
1
;
}
if
(
p_playlist
->
pp_items
[
i_
item
]
->
psz_name
)
free
(
p_playlist
->
pp_items
[
i_
item
]
->
psz_name
);
if
(
p_playlist
->
pp_items
[
i_
pos
]
->
psz_name
)
free
(
p_playlist
->
pp_items
[
i_
pos
]
->
psz_name
);
if
(
psz_name
)
p_playlist
->
pp_items
[
i_
item
]
->
psz_name
=
strdup
(
psz_name
);
p_playlist
->
pp_items
[
i_
pos
]
->
psz_name
=
strdup
(
psz_name
);
val
.
b_bool
=
i_
item
;
val
.
b_bool
=
i_
pos
;
var_Set
(
p_playlist
,
"item-change"
,
val
);
return
VLC_SUCCESS
;
}
...
...
@@ -229,11 +229,11 @@ int playlist_SetName( playlist_t *p_playlist, int i_item, char *psz_name )
* Set the duration of a playlist item
*
* \param p_playlist the playlist
* \param i_
item the item of which we change the name
* \param i_
pos the position of the item of which we change the duration
* \param i_duration the duration to set
* \return VLC_SUCCESS on success, VLC_EGENERIC on failure
*/
int
playlist_SetDuration
(
playlist_t
*
p_playlist
,
int
i_
item
,
mtime_t
i_duration
)
int
playlist_SetDuration
(
playlist_t
*
p_playlist
,
int
i_
pos
,
mtime_t
i_duration
)
{
char
psz_buffer
[
MSTRTIME_MAX_SIZE
];
vlc_value_t
val
;
...
...
@@ -244,19 +244,19 @@ int playlist_SetDuration( playlist_t *p_playlist, int i_item, mtime_t i_duration
return
-
1
;
}
/* Get a correct item */
if
(
i_
item
>=
0
&&
i_item
<
p_playlist
->
i_size
)
if
(
i_
pos
>=
0
&&
i_pos
<
p_playlist
->
i_size
)
{
}
else
if
(
p_playlist
->
i_size
>
0
)
{
i_
item
=
p_playlist
->
i_index
;
i_
pos
=
p_playlist
->
i_index
;
}
else
{
return
VLC_EGENERIC
;
}
p_playlist
->
pp_items
[
i_
item
]
->
i_duration
=
i_duration
;
p_playlist
->
pp_items
[
i_
pos
]
->
i_duration
=
i_duration
;
if
(
i_duration
!=
-
1
)
{
secstotimestr
(
psz_buffer
,
i_duration
/
1000000
);
...
...
@@ -265,10 +265,10 @@ int playlist_SetDuration( playlist_t *p_playlist, int i_item, mtime_t i_duration
{
memcpy
(
psz_buffer
,
"--:--:--"
,
sizeof
(
"--:--:--"
)
);
}
playlist_AddInfo
(
p_playlist
,
i_
item
,
_
(
"General"
)
,
_
(
"Duration"
),
playlist_AddInfo
(
p_playlist
,
i_
pos
,
_
(
"General"
)
,
_
(
"Duration"
),
"%s"
,
psz_buffer
);
val
.
b_bool
=
i_
item
;
val
.
b_bool
=
i_
pos
;
var_Set
(
p_playlist
,
"item-change"
,
val
);
return
VLC_SUCCESS
;
}
...
...
@@ -457,7 +457,7 @@ int playlist_Enable( playlist_t * p_playlist, int i_pos )
* Disables a playlist group
*
* \param p_playlist the playlist to disable from.
* \param i_
pos
the id of the group to disable
* \param i_
group
the id of the group to disable
* \return returns 0
*/
int
playlist_DisableGroup
(
playlist_t
*
p_playlist
,
int
i_group
)
...
...
@@ -491,7 +491,7 @@ int playlist_DisableGroup( playlist_t * p_playlist, int i_group)
* Enables a playlist group
*
* \param p_playlist the playlist to enable from.
* \param i_
pos
the id of the group to enable
* \param i_
group
the id of the group to enable
* \return returns 0
*/
int
playlist_EnableGroup
(
playlist_t
*
p_playlist
,
int
i_group
)
...
...
src/playlist/playlist.c
View file @
76781954
...
...
@@ -2,7 +2,7 @@
* playlist.c : Playlist management functions
*****************************************************************************
* Copyright (C) 1999-2004 VideoLAN
* $Id: playlist.c,v 1.7
2 2004/01/06 08:50:20 zorglub
Exp $
* $Id: playlist.c,v 1.7
3 2004/01/10 14:24:33 hartman
Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
...
...
@@ -101,6 +101,8 @@ playlist_t * __playlist_Create ( vlc_object_t *p_parent )
p_playlist
->
pp_groups
=
NULL
;
p_playlist
->
i_last_group
=
0
;
p_playlist
->
i_last_id
=
0
;
p_playlist
->
i_sort
=
SORT_ID
;
p_playlist
->
i_order
=
ORDER_NORMAL
;
playlist_CreateGroup
(
p_playlist
,
"Normal"
);
...
...
src/playlist/sort.c
View file @
76781954
...
...
@@ -2,7 +2,7 @@
* sort.c : Playlist sorting functions
*****************************************************************************
* Copyright (C) 1999-2004 VideoLAN
* $Id: sort.c,v 1.
6 2004/01/10 03:36:0
3 hartman Exp $
* $Id: sort.c,v 1.
7 2004/01/10 14:24:3
3 hartman Exp $
*
* Authors: Clment Stenac <zorglub@videolan.org>
*
...
...
@@ -33,7 +33,7 @@
/**
* Sort the playlist
* \param p_playlist the playlist
* \param i_mode: SORT_
TITLE, SORT_GROUP, SORT_AUTHOR, SORT_RANDOM SORT_ID
* \param i_mode: SORT_
ID, SORT_TITLE, SORT_GROUP, SORT_AUTHOR, SORT_RANDOM
* \param i_type: ORDER_NORMAL or ORDER_REVERSE (reversed order)
* \return 0 on success
*/
...
...
@@ -46,6 +46,9 @@ int playlist_Sort( playlist_t * p_playlist , int i_mode, int i_type )
vlc_mutex_lock
(
&
p_playlist
->
object_lock
);
p_playlist
->
i_sort
=
i_mode
;
p_playlist
->
i_order
=
i_type
;
if
(
i_mode
==
SORT_RANDOM
)
{
for
(
i_position
=
0
;
i_position
<
p_playlist
->
i_size
;
i_position
++
)
...
...
@@ -77,7 +80,12 @@ int playlist_Sort( playlist_t * p_playlist , int i_mode, int i_type )
{
int
i_test
=
0
;
if
(
i_mode
==
SORT_TITLE
)
if
(
i_mode
==
SORT_ID
)
{
i_test
=
p_playlist
->
pp_items
[
i
]
->
i_id
,
p_playlist
->
pp_items
[
i_small
]
->
i_id
;
}
else
if
(
i_mode
==
SORT_TITLE
)
{
i_test
=
strcasecmp
(
p_playlist
->
pp_items
[
i
]
->
psz_name
,
p_playlist
->
pp_items
[
i_small
]
->
psz_name
);
...
...
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