Lomse library. API documentation  0.30.0
CmdBreakBeam Class Reference

#include <lomse_command.h>

Inheritance diagram for CmdBreakBeam:
DocCmdSimple DocCommand

Detailed Description

A command to break a beam at the note/rest pointed by the cursor.

See constructor for details.

Public Member Functions

 CmdBreakBeam (const std::string &name="Break beam")
 
int get_cursor_update_policy () override
 
int get_undo_policy () override
 
int get_selection_update_policy () override
 
- Public Member Functions inherited from DocCmdSimple
virtual ~DocCmdSimple ()
 
bool is_composite () override
 
- Public Member Functions inherited from DocCommand
virtual ~DocCommand ()
 
std::string get_name ()
 
bool is_reversible ()
 
bool is_recordable ()
 
std::string get_error ()
 

Additional Inherited Members

- Public Types inherited from DocCommand
enum  ECmdCursorPolicy
 
enum  ECmdUndoPolicy
 
enum  ECmdSelectionPolicy
 

Constructor & Destructor Documentation

◆ CmdBreakBeam()

CmdBreakBeam::CmdBreakBeam ( const std::string &  name = "Break beam")

This command breaks a beam at the note/rest pointed by cursor.

Parameters
nameThe displayable name for the command. If not specified will default to "Break beam".

Remarks

  • If the note pointed by the cursor is not beamed to the previous note, the command will not be executed and will return a failure code.
  • After executing the command:
    • the selection will not be changed.
    • the cursor will not change its position.

Example

void CommandHandler::break_beam()
{
//Break a beam at the note/rest pointed by the cursor
if (SpInteractor spInteractor = m_pPresenter->get_interactor(0).lock())
{
ImoNoteRest* pNR = dynamic_cast<ImoNoteRest*>( m_cursor->get_pointee() );
if (pNR)
{
string name = gettext("Break a beam");
SpInteractor->exec_command( new CmdBreakBeam(name) );
}
}
}

Member Function Documentation

◆ get_cursor_update_policy()

int CmdBreakBeam::get_cursor_update_policy ( )
inlineoverridevirtual

Returns a value from ECmdCursorPolicy that indicates the update policy followed by this command.

Implements DocCommand.

◆ get_selection_update_policy()

int CmdBreakBeam::get_selection_update_policy ( )
inlineoverridevirtual

Returns a value from ECmdSelectionPolicy that indicates the undo policy followed by this command.

Implements DocCommand.

◆ get_undo_policy()

int CmdBreakBeam::get_undo_policy ( )
inlineoverridevirtual

Returns a value from ECmdUndoPolicy that indicates the undo policy followed by this command.

Implements DocCommand.