Add some functionality to libvlc player

This commit is contained in:
Mikhail Lobotskiy
2024-04-16 15:15:37 +04:00
parent 2ad2ad9dfd
commit 2901f337e7
2 changed files with 18 additions and 0 deletions

View File

@ -97,9 +97,20 @@ void CVlcPlayer::setTime(qint64 nTime)
libvlc_media_player_set_time(m_pVlcPlayer, nTime);
}
qint64 CVlcPlayer::time()
{
return libvlc_media_player_get_time(m_pVlcPlayer);
}
void CVlcPlayer::setPosition(float fPos)
{
libvlc_media_player_set_position(m_pVlcPlayer, fPos);
emit positionChanged(libvlc_media_player_get_position(m_pVlcPlayer));
}
float CVlcPlayer::position()
{
return libvlc_media_player_get_position(m_pVlcPlayer);
}
bool CVlcPlayer::isAudio()

View File

@ -24,12 +24,19 @@ public:
public:
void integrateIntoWidget(QWidget* pWidget);
void open(CVlcMedia* pMedia);
// control playback
void pause();
void play();
void stop();
// volume
void setVolume(int nVolume);
// time (in ms)
void setTime(qint64 nTime);
qint64 time();
// position (in range 0.0...1.0)
void setPosition(float fPos);
float position();
bool isAudio();
bool isPlaying();
libvlc_state_t getState();