drumstick
0.5.0
Main Page
Related Pages
Modules
Classes
Files
Examples
File List
File Members
playthread.h
Go to the documentation of this file.
1
/*
2
MIDI Sequencer C++ library
3
Copyright (C) 2006-2010, Pedro Lopez-Cabanillas <plcl@users.sf.net>
4
5
This library is free software; you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation; either version 2 of the License, or
8
(at your option) any later version.
9
10
This library is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
14
15
You should have received a copy of the GNU General Public License along
16
with this program; if not, write to the Free Software Foundation, Inc.,
17
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18
*/
19
20
#ifndef DRUMSTICK_PLAYTHREAD_H
21
#define DRUMSTICK_PLAYTHREAD_H
22
23
#include "
alsaevent.h
"
24
#include <QThread>
25
#include <QReadWriteLock>
26
34
namespace
drumstick {
35
36
class
MidiClient;
37
class
MidiQueue;
38
47
class
DRUMSTICK_EXPORT
SequencerOutputThread
:
public
QThread
48
{
49
Q_OBJECT
50
51
public
:
52
SequencerOutputThread
(
MidiClient
*seq,
int
portId);
53
virtual
void
run();
58
virtual
unsigned
int
getInitialPosition
() {
return
0; }
65
virtual
unsigned
int
getEchoResolution
() {
return
0; }
72
virtual
bool
hasNext() = 0;
79
virtual
SequencerEvent
* nextEvent() = 0;
80
84
virtual
void
stop();
85
86
signals:
90
void
finished();
91
96
void
stopped();
97
98
public
slots:
99
void
start( Priority priority = InheritPriority );
100
101
protected
:
102
virtual
void
sendEchoEvent(
int
tick);
103
virtual
void
sendSongEvent(
SequencerEvent
* ev);
104
virtual
void
drainOutput();
105
virtual
void
syncOutput();
106
virtual
bool
stopRequested();
107
108
MidiClient
*
m_MidiClient
;
109
MidiQueue
*
m_Queue
;
110
int
m_PortId
;
111
bool
m_Stopped
;
112
int
m_QueueId
;
113
int
m_npfds
;
114
pollfd*
m_pfds
;
115
QReadWriteLock
m_mutex
;
116
};
117
118
}
/* namespace drumstick */
119
122
#endif
/*DRUMSTICK_PLAYTHREAD_H*/
library
include
playthread.h
Generated by
1.8.1.2