Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
ef7ff281
Commit
ef7ff281
authored
Jun 13, 2008
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add playlist_CurrentId() to get the playlist item id from the currently playing item.
parent
5da255df
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
6 deletions
+30
-6
include/vlc/deprecated.h
include/vlc/deprecated.h
+2
-0
include/vlc_playlist.h
include/vlc_playlist.h
+3
-0
projects/activex/vlccontrol.cpp
projects/activex/vlccontrol.cpp
+12
-5
src/control/playlist.c
src/control/playlist.c
+12
-1
src/libvlc.sym
src/libvlc.sym
+1
-0
No files found.
include/vlc/deprecated.h
View file @
ef7ff281
...
@@ -127,6 +127,8 @@ VLC_DEPRECATED_API int libvlc_playlist_isplaying( libvlc_instance_t *,
...
@@ -127,6 +127,8 @@ VLC_DEPRECATED_API int libvlc_playlist_isplaying( libvlc_instance_t *,
VLC_DEPRECATED_API
int
libvlc_playlist_items_count
(
libvlc_instance_t
*
,
VLC_DEPRECATED_API
int
libvlc_playlist_items_count
(
libvlc_instance_t
*
,
libvlc_exception_t
*
);
libvlc_exception_t
*
);
VLC_DEPRECATED_API
int
libvlc_playlist_get_current_index
(
libvlc_instance_t
*
,
libvlc_exception_t
*
);
/**
/**
* Lock the playlist.
* Lock the playlist.
*
*
...
...
include/vlc_playlist.h
View file @
ef7ff281
...
@@ -420,6 +420,9 @@ static inline int playlist_Import( playlist_t *p_playlist, const char *psz_file)
...
@@ -420,6 +420,9 @@ static inline int playlist_Import( playlist_t *p_playlist, const char *psz_file)
/** Tell the number of items in the current playing context */
/** Tell the number of items in the current playing context */
#define playlist_CurrentSize( pl ) pl->current.i_size
#define playlist_CurrentSize( pl ) pl->current.i_size
/** Tell the current item id in current playing context */
#define playlist_CurrentId( pl ) pl->status.p_item->i_id
/** Ask the playlist to do some work */
/** Ask the playlist to do some work */
#define playlist_Signal( p_playlist ) vlc_object_signal( p_playlist )
#define playlist_Signal( p_playlist ) vlc_object_signal( p_playlist )
...
...
projects/activex/vlccontrol.cpp
View file @
ef7ff281
...
@@ -890,21 +890,28 @@ STDMETHODIMP VLCControl::addTarget(BSTR uri, VARIANT options, enum VLCPlaylistMo
...
@@ -890,21 +890,28 @@ STDMETHODIMP VLCControl::addTarget(BSTR uri, VARIANT options, enum VLCPlaylistMo
STDMETHODIMP
VLCControl
::
get_PlaylistIndex
(
int
*
index
)
STDMETHODIMP
VLCControl
::
get_PlaylistIndex
(
int
*
index
)
{
{
return
E_INVALIDARG
;
#if 0
if
(
NULL
==
index
)
if
(
NULL
==
index
)
return
E_POINTER
;
return
E_POINTER
;
*
index
=
0
;
libvlc_instance_t
*
p_libvlc
;
libvlc_instance_t
*
p_libvlc
;
HRESULT
result
=
_p_instance
->
getVLC
(
&
p_libvlc
);
HRESULT
result
=
_p_instance
->
getVLC
(
&
p_libvlc
);
if
(
SUCCEEDED
(
result
)
)
if
(
SUCCEEDED
(
result
)
)
{
{
*index = VLC_PlaylistIndex(i_vlc);
libvlc_exception_t
ex
;
libvlc_exception_init
(
&
ex
);
*
index
=
libvlc_playlist_get_current_index
(
p_libvlc
,
&
ex
);
if
(
libvlc_exception_raised
(
&
ex
)
)
{
_p_instance
->
setErrorInfo
(
IID_IVLCControl
,
libvlc_exception_get_message
(
&
ex
));
libvlc_exception_clear
(
&
ex
);
return
E_FAIL
;
}
return
NOERROR
;
return
NOERROR
;
}
}
*index = 0;
return
result
;
return
result
;
#endif
};
};
STDMETHODIMP
VLCControl
::
get_PlaylistCount
(
int
*
count
)
STDMETHODIMP
VLCControl
::
get_PlaylistCount
(
int
*
count
)
...
...
src/control/playlist.c
View file @
ef7ff281
...
@@ -62,7 +62,7 @@ void libvlc_playlist_play( libvlc_instance_t *p_instance, int i_id,
...
@@ -62,7 +62,7 @@ void libvlc_playlist_play( libvlc_instance_t *p_instance, int i_id,
int
i_options
,
char
**
ppsz_options
,
int
i_options
,
char
**
ppsz_options
,
libvlc_exception_t
*
p_e
)
libvlc_exception_t
*
p_e
)
{
{
VLC_UNUSED
(
p_e
);
VLC_UNUSED
(
p_e
);
VLC_UNUSED
(
i_options
);
VLC_UNUSED
(
ppsz_options
);
int
did_lock
=
0
;
int
did_lock
=
0
;
assert
(
PL
);
assert
(
PL
);
...
@@ -208,6 +208,17 @@ int libvlc_playlist_items_count( libvlc_instance_t *p_instance,
...
@@ -208,6 +208,17 @@ int libvlc_playlist_items_count( libvlc_instance_t *p_instance,
return
playlist_CurrentSize
(
PL
);
return
playlist_CurrentSize
(
PL
);
}
}
int
libvlc_playlist_get_current_index
(
libvlc_instance_t
*
p_instance
,
libvlc_exception_t
*
p_e
)
{
VLC_UNUSED
(
p_e
);
assert
(
PL
);
if
(
!
PL
->
status
.
p_item
)
return
-
1
;
return
playlist_CurrentId
(
PL
);
}
void
libvlc_playlist_lock
(
libvlc_instance_t
*
p_instance
)
void
libvlc_playlist_lock
(
libvlc_instance_t
*
p_instance
)
{
{
assert
(
PL
);
assert
(
PL
);
...
...
src/libvlc.sym
View file @
ef7ff281
...
@@ -148,6 +148,7 @@ libvlc_playlist_delete_item
...
@@ -148,6 +148,7 @@ libvlc_playlist_delete_item
libvlc_playlist_get_media_player
libvlc_playlist_get_media_player
libvlc_playlist_isplaying
libvlc_playlist_isplaying
libvlc_playlist_items_count
libvlc_playlist_items_count
libvlc_playlist_get_current_index
libvlc_playlist_lock
libvlc_playlist_lock
libvlc_playlist_loop
libvlc_playlist_loop
libvlc_playlist_next
libvlc_playlist_next
...
...
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