Canorus
0.7
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
interface
playback.h
Go to the documentation of this file.
1
8
#ifndef PLAYBACK_H_
9
#define PLAYBACK_H_
10
11
#include <QThread>
12
#include <QList>
13
14
class
CAMidiDevice
;
15
class
CASheet
;
16
class
CAMusElement
;
17
class
CAPlayable
;
18
class
CANote
;
19
20
class
CAPlayback
:
public
QThread
{
21
#ifndef SWIG
22
Q_OBJECT
23
#endif
24
public
:
25
CAPlayback
(
CASheet
*,
CAMidiDevice
* );
26
CAPlayback
(
CAMidiDevice
*,
int
port );
27
~CAPlayback
();
28
29
void
run
();
30
void
stop
();
31
32
void
playImmediately
( QList<CAMusElement*> elts,
int
port );
33
34
inline
const
int
getInitTimeStart
() {
return
_initTimeStart
; }
35
inline
void
setInitTimeStart
(
int
t) {
_initTimeStart
= t; }
36
inline
CAMidiDevice
*
midiDevice
() {
return
_midiDevice
; }
37
inline
CASheet
*
sheet
() {
return
_sheet
; }
38
inline
void
setSheet
(
CASheet
*s ) {
_sheet
= s; }
39
inline
QList<CAPlayable*>&
curPlaying
() {
return
_curPlaying
; }
40
41
#ifndef SWIG
42
public
slots:
43
#else
44
public
:
45
#endif
46
void
stopNow
();
47
48
#ifndef SWIG
49
signals:
50
void
playbackFinished
();
51
#endif
52
53
private
:
54
void
initStreams
(
CASheet
*
sheet
);
55
void
loopUntilPlayable
(
int
i,
bool
ignoreRepeats=
false
);
56
void
playSelectionImpl
();
57
58
inline
QList<CAMusElement*>
streamAt
(
int
idx) {
return
_stream
[idx]; }
59
inline
int
streamCount
() {
return
_stream
.size(); }
60
inline
int
&
streamIdx
(
int
i ) {
return
_streamIdx
[i]; }
61
inline
int
&
curTime
(
int
i ) {
return
_curTime
[i]; }
62
inline
int
&
lastRepeatOpenIdx
(
int
i ) {
return
_lastRepeatOpenIdx
[i]; }
63
inline
bool
&
repeating
(
int
i ) {
return
_repeating
[i]; }
64
65
inline
bool
stopLock
() {
return
_stopLock
; }
66
inline
void
setStopLock
(
bool
lock) {
_stopLock
= lock; }
67
68
CASheet
*
_sheet
;
69
70
CAMidiDevice
*
_midiDevice
;
71
inline
void
setMidiDevice
(
CAMidiDevice
*d ) {
_midiDevice
= d; }
72
73
inline
void
setStop
(
bool
stop) {
_stop
=
stop
; }
74
bool
_stop
;
75
bool
_stopLock
;
76
77
bool
_playSelectionOnly
;
78
QList<CAMusElement*>
_selection
;
79
80
int
_initTimeStart
;
81
82
QList< QList<CAMusElement*> >
_stream
;
83
QList<CAPlayable*>
_curPlaying
;
// list of currently playing notes and rests
84
int
*
_streamIdx
;
85
bool
*
_repeating
;
86
int
*
_lastRepeatOpenIdx
;
87
int
*
_curTime
;
// multiple curTimes are needed for repeat bars, if staffs aren't synchronized
88
};
89
90
#endif
/* PLAYBACK_H_ */
Generated on Fri Jan 11 2013 14:40:12 for Canorus by
1.8.3