Initial
This commit is contained in:
67
music/Notes.hpp
Normal file
67
music/Notes.hpp
Normal file
@@ -0,0 +1,67 @@
|
||||
#ifndef _MUSIC_NOTES_HPP_
|
||||
#define _MUSIC_NOTES_HPP_
|
||||
#ifndef _COMMON_BLOCK_HPP_
|
||||
#include <common/block.hpp>
|
||||
#endif
|
||||
#ifndef _MUSIC_NOTE_HPP_
|
||||
#include <music/note.hpp>
|
||||
#endif
|
||||
|
||||
class MIDIOutputDevice;
|
||||
|
||||
class Notes : public Block<Note>
|
||||
{
|
||||
public:
|
||||
enum {DefaultDelay=150};
|
||||
Notes();
|
||||
virtual ~Notes();
|
||||
void off(MIDIOutputDevice &device)const;
|
||||
bool play(MIDIOutputDevice &device,int interNoteDelay=DefaultDelay,bool noteOffAfterPlay=true)const;
|
||||
bool playBack(MIDIOutputDevice &device,bool noteOffAfterPlay=true)const;
|
||||
String toString(void)const;
|
||||
void sort(void);
|
||||
void pause(int msecs=DefaultDelay*2);
|
||||
DWORD size(void)const;
|
||||
void size(DWORD size);
|
||||
bool remove(const Note ¬e);
|
||||
void remove(void);
|
||||
protected:
|
||||
virtual int getDelay()const;
|
||||
private:
|
||||
};
|
||||
|
||||
inline
|
||||
Notes::Notes()
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
Notes::~Notes()
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
void Notes::pause(int msecs)
|
||||
{
|
||||
::Sleep(msecs);
|
||||
}
|
||||
|
||||
inline
|
||||
DWORD Notes::size(void)const
|
||||
{
|
||||
return Block<Note>::size();
|
||||
}
|
||||
|
||||
inline
|
||||
void Notes::size(DWORD size)
|
||||
{
|
||||
Block<Note>::remove();
|
||||
for(int index=0;index<size;index++)insert(&Note());
|
||||
}
|
||||
|
||||
inline
|
||||
void Notes::remove(void)
|
||||
{
|
||||
Block<Note>::remove();
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user