Lomse library. API documentation  0.30.0
EventEndOfPlayback Class Reference

#include <lomse_events.h>

Inheritance diagram for EventEndOfPlayback:
EventPlayback EventInfo

Detailed Description

An event generated by the ScorePlayer object to inform about the end of playback, just in case your application would like to do any action, such as enabling or disabling GUI buttons related to playback or to enable document edition.

Events of type k_end_of_playback_event must be handled by by converting them into application events, placing them in the application events loop and returning control to Lomse:

void MainFrame::on_lomse_event(SpEventInfo pEvent)
{
DocumentWindow* pCanvas = get_active_document_window();
switch (pEvent->get_event_type())
{
...
{
if (pCanvas)
{
//generate end of playback event
SpEventEndOfPlayback pEv( static_pointer_cast<EventEndOfPlayback>(pEvent) );
MyEndOfPlaybackEvent event(pEv);
::wxPostEvent(pCanvas, event);
}
break;
}
...

Later, your application will process the application event. When doing it, it must inform the Interactor, and then your application should do whatever it needs to do, i.e.: enabling document edition:

void DocumentWindow::on_end_of_playback(MyEndOfPlaybackEvent& event)
{
SpEventEndOfPlayback pEv = event.get_lomse_event();
WpInteractor wpInteractor = pEv->get_interactor();
if (SpInteractor spInteractor = wpInteractor.lock())
{
spInteractor->on_end_of_play_event(pEv->get_score(), pEv->get_player());
spInteractor->set_operating_mode(is_edition_enabled() ? Interactor::k_mode_edition
}
}

Public Member Functions

 EventEndOfPlayback (EEventType evType, WpInteractor wpInteractor, ImoScore *pScore, PlayerGui *pPlayer)
 
ImoScore * get_score () const
 
PlayerGui * get_player () const
 
- Public Member Functions inherited from EventPlayback
virtual ~EventPlayback ()
 
WpInteractor get_interactor ()
 
- Public Member Functions inherited from EventInfo
virtual ~EventInfo ()
 
virtual Observableget_source ()
 
EEventType get_event_type ()
 
bool is_doc_modified_event ()
 
bool is_update_window_event ()
 
bool is_mouse_in_event ()
 
bool is_mouse_out_event ()
 
bool is_on_click_event ()
 
bool is_link_clicked_event ()
 
bool is_show_contextual_menu_event ()
 
bool is_control_point_moved_event ()
 
bool is_selection_set_change ()
 
bool is_pointed_object_change ()
 
bool is_do_play_score_event ()
 
bool is_pause_score_event ()
 
bool is_stop_playback_event ()
 
bool is_tracking_event ()
 
bool is_update_viewport_event ()
 
bool is_end_of_playback_event ()
 

Constructor & Destructor Documentation

◆ EventEndOfPlayback()

EventEndOfPlayback::EventEndOfPlayback ( EEventType  evType,
WpInteractor  wpInteractor,
ImoScore *  pScore,
PlayerGui *  pPlayer 
)
inline

Constructor.

Member Function Documentation

◆ get_player()

PlayerGui* EventEndOfPlayback::get_player ( ) const
inline

Returns a ptr. to the PlayerGui object associated with this score playback.

◆ get_score()

ImoScore* EventEndOfPlayback::get_score ( ) const
inline

Returns a ptr. to the score affected by the event.