Skip to content

Commit 7573d9a

Browse files
committed
wip_vlc
1 parent 95471b6 commit 7573d9a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/audio_vlc.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,12 @@ namespace audio {
4848
int (LIBVLC_API *libvlc_media_player_play)(libvlc_media_player_t*);
4949
bool (LIBVLC_API *libvlc_media_player_is_playing)(libvlc_media_player_t*);
5050
libvlc_time_t (LIBVLC_API *libvlc_media_player_get_time)(libvlc_media_player_t*);
51+
int (LIBVLC_API *libvlc_media_player_set_time)(libvlc_media_player_t*, libvlc_time_t, bool);
5152
int (LIBVLC_API *libvlc_media_player_stop_async)(libvlc_media_player_t*);
5253
void (LIBVLC_API *libvlc_media_player_release)(libvlc_media_player_t*);
54+
libvlc_time_t (LIBVLC_API *libvlc_media_player_get_length)(libvlc_media_player_t*);
55+
void (LIBVLC_API *libvlc_media_player_pause)(libvlc_media_player_t*);
56+
void (LIBVLC_API *libvlc_audio_set_format)(libvlc_media_player_t*, const char*, unsigned,unsigned);
5357
};
5458

5559
class AudioVLC : public AudioBase {
@@ -90,8 +94,12 @@ namespace audio {
9094
VLC_LOAD_FUNC(libvlc_media_player_play);
9195
VLC_LOAD_FUNC(libvlc_media_player_is_playing);
9296
VLC_LOAD_FUNC(libvlc_media_player_get_time);
97+
VLC_LOAD_FUNC(libvlc_media_player_set_time);
9398
VLC_LOAD_FUNC(libvlc_media_player_stop_async);
9499
VLC_LOAD_FUNC(libvlc_media_player_release);
100+
VLC_LOAD_FUNC(libvlc_media_player_get_length);
101+
VLC_LOAD_FUNC(libvlc_media_player_pause);
102+
VLC_LOAD_FUNC(libvlc_audio_set_format);
95103
// TODO: maybe this should be in dev_open?
96104
inst = vlc.libvlc_new(0, nullptr);
97105
if (!inst) {
@@ -126,13 +134,11 @@ namespace audio {
126134
bool mus_open_fp(Music* mus, const char* fp) {
127135
if (mus->h1)
128136
return true;
129-
TF_INFO(<< fp);
130137
libvlc_media_t* med = vlc.libvlc_media_new_path(fp);
131138
if (!med) {
132139
TF_ERROR(<< "Failed create media from file (" << VLC_ERROR() << ")");
133140
return false;
134141
}
135-
TF_INFO(<< (void*)med);
136142
mus->h1 = (void*)vlc.libvlc_media_player_new_from_media(inst, med);
137143
if (!mus->h1)
138144
TF_ERROR(<< "Failed to open music (" << VLC_ERROR() << ")");

0 commit comments

Comments
 (0)