Liblinphone
5.2.0
|
#include <player.hh>
Public Types | |
enum | State { State::Closed = 0, State::Paused = 1, State::Playing = 2 } |
The state of a Player. More... | |
Public Member Functions | |
Player (void *ptr, bool takeRef=true) | |
LINPHONECXX_PUBLIC _LinphonePlayer * | cPtr () |
LINPHONECXX_PUBLIC void | addListener (const std::shared_ptr< PlayerListener > &listener) |
LINPHONECXX_PUBLIC void | removeListener (const std::shared_ptr< PlayerListener > &listener) |
LINPHONECXX_PUBLIC std::shared_ptr< linphone::Core > | getCore () const |
Returns the Core object managing this player's call, if any. More... | |
LINPHONECXX_PUBLIC int | getCurrentPosition () |
Get the current position in the opened file. More... | |
LINPHONECXX_PUBLIC int | getDuration () |
Get the duration of the opened file. More... | |
LINPHONECXX_PUBLIC bool | getIsVideoAvailable () |
Returns whether the file has video and if it can be displayed. More... | |
LINPHONECXX_PUBLIC State | getState () |
Get the current state of a player. More... | |
LINPHONECXX_PUBLIC float | getVolumeGain () |
Get the volume gain of the player. More... | |
LINPHONECXX_PUBLIC void | setVolumeGain (float gain) |
Set the volume gain of the player. More... | |
LINPHONECXX_PUBLIC void | setWindowId (void *windowId) |
Sets a window id to be used to display video if any. More... | |
LINPHONECXX_PUBLIC void | close () |
Close the opened file. | |
LINPHONECXX_PUBLIC linphone::Status | open (const std::string &filename) |
Open a file for playing. More... | |
LINPHONECXX_PUBLIC linphone::Status | pause () |
Pause the playing of a file. More... | |
LINPHONECXX_PUBLIC linphone::Status | seek (int timeMs) |
Seek in an opened file. More... | |
LINPHONECXX_PUBLIC linphone::Status | start () |
Start playing a file that has been opened with open(). More... | |
Player interface.
|
strong |
The state of a Player.
Enumerator | |
---|---|
Closed | No file is opened for playing. |
Paused | The player is paused. |
Playing | The player is playing. |
LINPHONECXX_PUBLIC std::shared_ptr<linphone::Core> linphone::Player::getCore | ( | ) | const |
LINPHONECXX_PUBLIC int linphone::Player::getCurrentPosition | ( | ) |
Get the current position in the opened file.
LINPHONECXX_PUBLIC int linphone::Player::getDuration | ( | ) |
Get the duration of the opened file.
LINPHONECXX_PUBLIC bool linphone::Player::getIsVideoAvailable | ( | ) |
Returns whether the file has video and if it can be displayed.
LINPHONECXX_PUBLIC State linphone::Player::getState | ( | ) |
Get the current state of a player.
LINPHONECXX_PUBLIC float linphone::Player::getVolumeGain | ( | ) |
Get the volume gain of the player.
LINPHONECXX_PUBLIC linphone::Status linphone::Player::open | ( | const std::string & | filename | ) |
Open a file for playing.
Actually, only WAVE and MKV/MKA file formats are supported and a limited set of codecs depending of the selected format. Here are the list of working combinations:
filename | The path to the file to open |
LINPHONECXX_PUBLIC linphone::Status linphone::Player::pause | ( | ) |
Pause the playing of a file.
LINPHONECXX_PUBLIC linphone::Status linphone::Player::seek | ( | int | timeMs | ) |
Seek in an opened file.
timeMs | The time we want to go to in the file (in milliseconds). |
LINPHONECXX_PUBLIC void linphone::Player::setVolumeGain | ( | float | gain | ) |
Set the volume gain of the player.
gain | Percentage of the gain. Valid values are in [ 0.0 : 1.0 ]. |
LINPHONECXX_PUBLIC void linphone::Player::setWindowId | ( | void * | windowId | ) |
Sets a window id to be used to display video if any.
windowId | The window id pointer to use. |
LINPHONECXX_PUBLIC linphone::Status linphone::Player::start | ( | ) |
Start playing a file that has been opened with open().