1
// RCS-ID: $Id: SoundEvents.h,v 1.3 2006/02/23 19:25:44 cecilios Exp $
2
//--------------------------------------------------------------------------------------
3
// LenMus Phonascus: The teacher of music
4
// Copyright (c) 2002-2006 Cecilio Salmeron
6
// This program is free software; you can redistribute it and/or modify it under the
7
// terms of the GNU General Public License as published by the Free Software Foundation;
8
// either version 2 of the License, or (at your option) any later version.
10
// This program is distributed in the hope that it will be useful, but WITHOUT ANY
11
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12
// PARTICULAR PURPOSE. See the GNU General Public License for more details.
14
// You should have received a copy of the GNU General Public License along with this
15
// program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street,
16
// Fifth Floor, Boston, MA 02110-1301, USA.
18
// For any comment, suggestion or feature request, please contact the manager of
19
// the project at cecilios@users.sourceforge.net
21
//-------------------------------------------------------------------------------------
22
/*! @file SoundEvents.h
23
@brief Header file for classes realetd to sound events
24
@ingroup sound_management
26
#ifndef __SOUNDEVENTS_H__ //to avoid nested includes
27
#define __SOUNDEVENTS_H__
29
// For compilers that support precompilation, includes "wx/wx.h".
30
#include "wx/wxprec.h"
40
#include "../score/score.h"
42
//-----------------------------------------------------------------------------------------
43
/*! @class lmScoreHighlightEvent
44
@ingroup sound_management
45
@brief An event to signal different actions related to
46
highlighting / unhighlighting notes while they are being played.
48
//-----------------------------------------------------------------------------------------
50
DECLARE_EVENT_TYPE( lmEVT_SCORE_HIGHLIGHT, -1 )
52
class lmScoreHighlightEvent : public wxEvent
55
lmScoreHighlightEvent(lmStaffObj* pSO,
56
EHighlightType nHighlightType,
58
: wxEvent(id, lmEVT_SCORE_HIGHLIGHT)
61
m_nHighlightType = nHighlightType;
65
lmScoreHighlightEvent(const lmScoreHighlightEvent& event) : wxEvent(event)
66
{ m_nHighlightType = event.m_nHighlightType;
70
// clone constructor. Required for sending with wxPostEvent()
71
virtual wxEvent *Clone() const { return new lmScoreHighlightEvent(*this); }
74
lmStaffObj* GetStaffObj() { return m_pSO; }
75
EHighlightType GetHighlightType() { return m_nHighlightType; }
79
EHighlightType m_nHighlightType; //event type: eVisualOn, eVisualOff, eRemoveAllHighlight
80
lmStaffObj* m_pSO; //staffobj who must be highlighted / unhighlighted
83
typedef void (wxEvtHandler::*ScoreHighlightEventFunction)(lmScoreHighlightEvent&);
85
#define LM_EVT_SCORE_HIGHLIGHT(fn) \
86
DECLARE_EVENT_TABLE_ENTRY( lmEVT_SCORE_HIGHLIGHT, wxID_ANY, -1, \
87
(wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxNotifyEventFunction) \
88
wxStaticCastEvent( ScoreHighlightEventFunction, & fn ), (wxObject *) NULL ),
91
//-----------------------------------------------------------------------------------------
92
/*! @class lmEndOfPlayEvent
93
@ingroup sound_management
94
@brief An event to signal end of playback
96
//-----------------------------------------------------------------------------------------
98
DECLARE_EVENT_TYPE( lmEVT_END_OF_PLAY, -1 )
100
class lmEndOfPlayEvent : public wxEvent
103
lmEndOfPlayEvent(int id = 0 ) : wxEvent(id, lmEVT_END_OF_PLAY)
104
{ m_propagationLevel = wxEVENT_PROPAGATE_MAX; }
107
lmEndOfPlayEvent(const lmEndOfPlayEvent& event) : wxEvent(event) {}
109
// clone constructor. Required for sending with wxPostEvent()
110
virtual wxEvent *Clone() const { return new lmEndOfPlayEvent(*this); }
114
typedef void (wxEvtHandler::*EndOfPlayEventFunction)(lmEndOfPlayEvent&);
116
#define LM_EVT_END_OF_PLAY(fn) \
117
DECLARE_EVENT_TABLE_ENTRY( lmEVT_END_OF_PLAY, wxID_ANY, -1, \
118
(wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxNotifyEventFunction) \
119
wxStaticCastEvent( EndOfPlayEventFunction, & fn ), (wxObject *) NULL ),
122
#endif // __SOUNDEVENTS_H__