foobar2000 SDK
2015-08-03
|
#include <playback_control.h>
Public Types | |
enum | t_display_level { display_level_none, display_level_basic, display_level_titles, display_level_all } |
enum | t_stop_reason { stop_reason_user = 0, stop_reason_eof, stop_reason_starting_another, stop_reason_shutting_down } |
enum | t_track_command { track_command_default = 0, track_command_play, track_command_next, track_command_prev, track_command_settrack, track_command_rand, track_command_resume } |
Public Types inherited from service_base | |
typedef service_base | t_interface |
Public Member Functions | |
virtual bool | get_now_playing (metadb_handle_ptr &p_out)=0 |
virtual bool | get_stop_after_current ()=0 |
virtual float | get_volume ()=0 |
bool | is_muted () |
virtual bool | is_paused ()=0 |
virtual bool | is_playing ()=0 |
void | next () |
virtual void | pause (bool p_state)=0 |
void | play_or_pause () |
void | play_or_unpause () |
void | play_start (t_track_command p_command=track_command_play, bool p_paused=false) |
void | play_stop () |
virtual bool | playback_can_seek ()=0 |
virtual bool | playback_format_title (titleformat_hook *p_hook, pfc::string_base &p_out, const service_ptr_t< class titleformat_object > &p_script, titleformat_text_filter *p_filter, t_display_level p_level)=0 |
bool | playback_format_title_ex (metadb_handle_ptr p_item, titleformat_hook *p_hook, pfc::string_base &p_out, const service_ptr_t< class titleformat_object > &p_script, titleformat_text_filter *p_filter, t_display_level p_level) |
double | playback_get_length () |
double | playback_get_length_ex () |
virtual double | playback_get_position ()=0 |
virtual void | playback_seek (double p_time)=0 |
virtual void | playback_seek_delta (double p_delta)=0 |
void | previous () |
virtual void | set_stop_after_current (bool p_state)=0 |
virtual void | set_volume (float p_value)=0 |
virtual void | start (t_track_command p_command=track_command_play, bool p_paused=false)=0 |
virtual void | stop ()=0 |
void | toggle_pause () |
void | toggle_stop_after_current () |
virtual void | volume_down ()=0 |
virtual void | volume_mute_toggle ()=0 |
virtual void | volume_up ()=0 |
Public Member Functions inherited from service_base | |
template<typename outPtr_t > | |
bool | cast (outPtr_t &outPtr) |
virtual int | service_add_ref ()=0 throw () |
virtual bool | service_query (service_ptr_t< service_base > &p_out, const GUID &p_guid) |
template<class T > | |
bool | service_query_t (service_ptr_t< T > &p_out) |
virtual int | service_release ()=0 throw () |
Static Public Attributes | |
static const int | volume_mute = -100 |
Private Member Functions | |
FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT (playback_control) | |
Additional Inherited Members | |
Protected Member Functions inherited from service_base | |
service_base () | |
~service_base () | |
Provides control for various playback-related operations. All methods provided by this interface work from main app thread only. Calling from another thread will do nothing or trigger an exception. If you need to trigger one of playback_control methods from another thread, see main_thread_callback. Do not call playback_control methods from inside any kind of global callback (e.g. playlist callback), otherwise race conditions may occur. Use static_api_ptr_t to instantiate. See static_api_ptr_t documentation for more info.
Definition at line 5 of file playback_control.h.
Type used to indicate level of dynamic playback-related info displayed. Safe to use with <> opereators, e.g. level above N always includes information rendered by level N.
Definition at line 80 of file playback_control.h.
Enumerator | |
---|---|
stop_reason_user | |
stop_reason_eof | |
stop_reason_starting_another | |
stop_reason_shutting_down |
Definition at line 10 of file playback_control.h.
Definition at line 18 of file playback_control.h.
|
private |
|
pure virtual |
Retrieves now playing item handle.
|
pure virtual |
Retrieves stop-after-current-track option state.
|
pure virtual |
Retrieves playback volume level.
|
inline |
Definition at line 137 of file playback_control.h.
|
pure virtual |
Returns whether playback is active and in paused state.
|
pure virtual |
Returns whether playback is active.
|
inline |
Definition at line 130 of file playback_control.h.
|
pure virtual |
Toggles pause state if playback is active.
p_state | set to true when pausing or to false when unpausing. |
|
inline |
Starts playback if playback is inactive, otherwise toggles pause.
Definition at line 126 of file playback_control.h.
|
inline |
Definition at line 127 of file playback_control.h.
|
inline |
Definition at line 133 of file playback_control.h.
|
inline |
Definition at line 135 of file playback_control.h.
|
pure virtual |
Returns whether currently played track is seekable. If it's not, playback_seek/playback_seek_delta calls will be ignored.
|
pure virtual |
Renders information about currently playing item.
p_hook | Optional callback object overriding fields and functions; set to NULL if not used. |
p_out | String receiving the output on success. |
p_script | Titleformat script to use. Use titleformat_compiler service to create one. |
p_filter | Optional callback object allowing input to be filtered according to context (i.e. removal of linebreak characters present in tags when rendering playlist lines). Set to NULL when not used. |
p_level | Indicates level of dynamic playback-related info displayed. See t_display_level enum for more details. |
|
inline |
Helper; renders info about any item, including currently playing item info if the item is currently played.
Definition at line 103 of file playback_control.h.
double playback_control::playback_get_length | ( | ) |
Helper; retrieves length of currently playing item.
Definition at line 33 of file playback_control.cpp.
double playback_control::playback_get_length_ex | ( | ) |
Definition at line 44 of file playback_control.cpp.
|
pure virtual |
Returns current playback position within currently played track, in seconds.
|
pure virtual |
Seeks in currenly played track to specified time.
p_time | target time in seconds. |
|
pure virtual |
Seeks in currently played track by specified time forward or back.
p_delta | time in seconds to seek by; can be positive to seek forward or negative to seek back. |
|
inline |
Definition at line 129 of file playback_control.h.
|
pure virtual |
Alters stop-after-current-track option state.
|
pure virtual |
Alters playback volume level.
p_value | volume in dB; 0 for full volume. |
|
pure virtual |
Starts playback. If playback is already active, existing process is stopped first.
p_command | Specifies what track to start playback from. See t_track_Command enum for more info. |
p_paused | Specifies whether playback should be started as paused. |
|
pure virtual |
Stops playback.
|
inline |
Toggles pause state.
Definition at line 123 of file playback_control.h.
|
inline |
Toggles stop-after-current state.
Definition at line 121 of file playback_control.h.
|
pure virtual |
Alters playback volume level one step down.
|
pure virtual |
Toggles playback mute state.
|
pure virtual |
Alters playback volume level one step up.
|
static |
Definition at line 139 of file playback_control.h.