Commit 0e3d2ece authored by Geoffrey Métais's avatar Geoffrey Métais

Expose chapters navigation methods

parent 94cfc185
......@@ -759,6 +759,14 @@ void Java_org_videolan_libvlc_LibVLC_setTitle(JNIEnv *env, jobject thiz, jint ti
libvlc_media_player_set_title(mp, title);
}
jint Java_org_videolan_libvlc_LibVLC_getChapterCount(JNIEnv *env, jobject thiz)
{
libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
if (mp)
return libvlc_media_player_get_chapter_count(mp);
return -1;
}
jint Java_org_videolan_libvlc_LibVLC_getChapterCountForTitle(JNIEnv *env, jobject thiz, jint title)
{
libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
......@@ -767,6 +775,35 @@ jint Java_org_videolan_libvlc_LibVLC_getChapterCountForTitle(JNIEnv *env, jobjec
return -1;
}
jint Java_org_videolan_libvlc_LibVLC_getChapter(JNIEnv *env, jobject thiz)
{
libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
if (mp)
return libvlc_media_player_get_chapter(mp);
return -1;
}
void Java_org_videolan_libvlc_LibVLC_setChapter(JNIEnv *env, jobject thiz, jint chapter)
{
libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
if (mp)
libvlc_media_player_set_chapter(mp, chapter);
}
void Java_org_videolan_libvlc_LibVLC_previousChapter(JNIEnv *env, jobject thiz)
{
libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
if (mp)
libvlc_media_player_previous_chapter(mp);
}
void Java_org_videolan_libvlc_LibVLC_nextChapter(JNIEnv *env, jobject thiz)
{
libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
if (mp)
libvlc_media_player_next_chapter(mp);
}
jint Java_org_videolan_libvlc_LibVLC_getTitleCount(JNIEnv *env, jobject thiz)
{
libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
......
......@@ -695,6 +695,11 @@ public class LibVLC {
public native int getTitle();
public native void setTitle(int title);
public native int getChapterCountForTitle(int title);
public native int getChapterCount();
public native int getChapter();
public native int previousChapter();
public native int nextChapter();
public native void setChapter(int chapter);
public native int getTitleCount();
public native void playerNavigate(int navigate);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment