foobar2000 SDK  2015-08-03
Public Types | Public Member Functions | Protected Member Functions
play_callbackabstract

#include <play_callback.h>

+ Inheritance diagram for play_callback:

Public Types

enum  {
  flag_on_playback_starting = 1 << 0, flag_on_playback_new_track = 1 << 1, flag_on_playback_stop = 1 << 2, flag_on_playback_seek = 1 << 3,
  flag_on_playback_pause = 1 << 4, flag_on_playback_edited = 1 << 5, flag_on_playback_dynamic_info = 1 << 6, flag_on_playback_dynamic_info_track = 1 << 7,
  flag_on_playback_time = 1 << 8, flag_on_volume_change = 1 << 9, flag_on_playback_all
}
 

Public Member Functions

virtual void FB2KAPI on_playback_dynamic_info (const file_info &p_info)=0
 
virtual void FB2KAPI on_playback_dynamic_info_track (const file_info &p_info)=0
 
virtual void FB2KAPI on_playback_edited (metadb_handle_ptr p_track)=0
 
virtual void FB2KAPI on_playback_new_track (metadb_handle_ptr p_track)=0
 
virtual void FB2KAPI on_playback_pause (bool p_state)=0
 
virtual void FB2KAPI on_playback_seek (double p_time)=0
 
virtual void FB2KAPI on_playback_starting (play_control::t_track_command p_command, bool p_paused)=0
 
virtual void FB2KAPI on_playback_stop (play_control::t_stop_reason p_reason)=0
 
virtual void FB2KAPI on_playback_time (double p_time)=0
 
virtual void FB2KAPI on_volume_change (float p_new_val)=0
 

Protected Member Functions

 play_callback ()
 
 ~play_callback ()
 

Detailed Description

Class receiving notifications about playback events. Note that all methods are called only from app's main thread. Use play_callback_manager to register your dynamically created instances. Statically registered version is available too - see play_callback_static.

Definition at line 5 of file play_callback.h.

Member Enumeration Documentation

anonymous enum
Enumerator
flag_on_playback_starting 
flag_on_playback_new_track 
flag_on_playback_stop 
flag_on_playback_seek 
flag_on_playback_pause 
flag_on_playback_edited 
flag_on_playback_dynamic_info 
flag_on_playback_dynamic_info_track 
flag_on_playback_time 
flag_on_volume_change 
flag_on_playback_all 

Definition at line 29 of file play_callback.h.

Constructor & Destructor Documentation

play_callback::play_callback ( )
inlineprotected

Definition at line 47 of file play_callback.h.

47 {}
play_callback::~play_callback ( )
inlineprotected

Definition at line 48 of file play_callback.h.

48 {}

Member Function Documentation

virtual void FB2KAPI play_callback::on_playback_dynamic_info ( const file_info p_info)
pure virtual

Dynamic info (VBR bitrate etc) change.

Implemented in playback_event_notify, play_callback_impl_base, and CPlaybackStateDemo.

virtual void FB2KAPI play_callback::on_playback_dynamic_info_track ( const file_info p_info)
pure virtual

Per-track dynamic info (stream track titles etc) change. Happens less often than on_playback_dynamic_info().

Implemented in playback_event_notify, play_callback_impl_base, and CPlaybackStateDemo.

virtual void FB2KAPI play_callback::on_playback_edited ( metadb_handle_ptr  p_track)
pure virtual

Called when currently played file gets edited.

Implemented in playback_event_notify, play_callback_impl_base, and CPlaybackStateDemo.

virtual void FB2KAPI play_callback::on_playback_new_track ( metadb_handle_ptr  p_track)
pure virtual

Playback advanced to new track.

Implemented in playback_event_notify, play_callback_impl_base, and CPlaybackStateDemo.

virtual void FB2KAPI play_callback::on_playback_pause ( bool  p_state)
pure virtual

Called on pause/unpause.

Implemented in playback_event_notify, play_callback_impl_base, and CPlaybackStateDemo.

virtual void FB2KAPI play_callback::on_playback_seek ( double  p_time)
pure virtual

User has seeked to specific time.

Implemented in playback_event_notify, play_callback_impl_base, and CPlaybackStateDemo.

virtual void FB2KAPI play_callback::on_playback_starting ( play_control::t_track_command  p_command,
bool  p_paused 
)
pure virtual

Playback process is being initialized. on_playback_new_track() should be called soon after this when first file is successfully opened for decoding.

Implemented in playback_event_notify, and play_callback_impl_base.

virtual void FB2KAPI play_callback::on_playback_stop ( play_control::t_stop_reason  p_reason)
pure virtual

Playback stopped.

Implemented in playback_event_notify, play_callback_impl_base, and CPlaybackStateDemo.

virtual void FB2KAPI play_callback::on_playback_time ( double  p_time)
pure virtual

Called every second, for time display.

Implemented in playback_event_notify, play_callback_impl_base, and CPlaybackStateDemo.

virtual void FB2KAPI play_callback::on_volume_change ( float  p_new_val)
pure virtual

User changed volume settings. Possibly called when not playing.

Parameters
p_new_valnew volume level in dB; 0 for full volume.

Implemented in playback_volume_notify, playback_event_notify, play_callback_impl_base, and CPlaybackStateDemo.


The documentation for this class was generated from the following file: