lmms
Cross-platform music production software
Toggle main menu visibility
Loading...
Searching...
No Matches
include
SamplePlayHandle.h
Go to the documentation of this file.
1
2
/*
3
* SamplePlayHandle.h - play-handle for playing a sample
4
*
5
* Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
6
*
7
* This file is part of LMMS - https://lmms.io
8
*
9
* This program is free software; you can redistribute it and/or
10
* modify it under the terms of the GNU General Public
11
* License as published by the Free Software Foundation; either
12
* version 2 of the License, or (at your option) any later version.
13
*
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
* General Public License for more details.
18
*
19
* You should have received a copy of the GNU General Public
20
* License along with this program (see COPYING); if not, write to the
21
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22
* Boston, MA 02110-1301 USA.
23
*
24
*/
25
26
#ifndef LMMS_SAMPLE_PLAY_HANDLE_H
27
#define LMMS_SAMPLE_PLAY_HANDLE_H
28
29
#include "
Sample.h
"
30
#include "
PlayHandle.h
"
31
32
namespace
lmms
33
{
34
35
36
class
PatternTrack
;
37
class
SampleClip
;
38
class
Track
;
39
40
41
class
LMMS_EXPORT
SamplePlayHandle
:
public
PlayHandle
42
{
43
public
:
44
SamplePlayHandle
(
Sample
* sample,
bool
ownAudioBusHandle =
true
);
45
SamplePlayHandle
(
const
QString& sampleFile );
46
SamplePlayHandle
(
SampleClip
* clip );
47
~SamplePlayHandle
()
override
;
48
49
inline
bool
affinityMatters
()
const override
50
{
51
return
true
;
52
}
53
54
55
void
play(
SampleFrame
* buffer )
override
;
56
bool
isFinished()
const override
;
57
58
bool
isFromTrack(
const
Track
* _track )
const override
;
59
60
f_cnt_t
totalFrames()
const
;
61
inline
f_cnt_t
framesDone
()
const
62
{
63
return
(
m_frame
);
64
}
65
void
setDoneMayReturnTrue
(
bool
_enable )
66
{
67
m_doneMayReturnTrue
= _enable;
68
}
69
70
void
setPatternTrack
(
PatternTrack
* pt)
71
{
72
m_patternTrack
= pt;
73
}
74
75
private
:
76
Sample::PlaybackState
m_state
;
77
f_cnt_t
m_frame
= 0;
78
Sample
*
m_sample
=
nullptr
;
79
Track
*
m_track
=
nullptr
;
80
PatternTrack
*
m_patternTrack
=
nullptr
;
81
bool
m_doneMayReturnTrue
=
true
;
82
bool
m_ownAudioBusHandle
=
false
;
83
} ;
84
85
86
}
// namespace lmms
87
88
#endif
// LMMS_SAMPLE_PLAY_HANDLE_H
PlayHandle.h
Sample.h
lmms::PatternTrack
Definition
PatternTrack.h:47
lmms::PlayHandle::PlayHandle
PlayHandle(const Type type, f_cnt_t offset=0)
Definition
PlayHandle.cpp:36
lmms::Sample::PlaybackState
Definition
Sample.h:47
lmms::SampleClip
Definition
SampleClip.h:46
lmms::SampleFrame
Definition
SampleFrame.h:41
lmms::Sample
Definition
Sample.h:37
lmms::SamplePlayHandle::framesDone
f_cnt_t framesDone() const
Definition
SamplePlayHandle.h:61
lmms::SamplePlayHandle::m_ownAudioBusHandle
bool m_ownAudioBusHandle
Definition
SamplePlayHandle.h:82
lmms::SamplePlayHandle::m_state
Sample::PlaybackState m_state
Definition
SamplePlayHandle.h:76
lmms::SamplePlayHandle::setPatternTrack
void setPatternTrack(PatternTrack *pt)
Definition
SamplePlayHandle.h:70
lmms::SamplePlayHandle::SamplePlayHandle
SamplePlayHandle(Sample *sample, bool ownAudioBusHandle=true)
Definition
SamplePlayHandle.cpp:36
lmms::SamplePlayHandle::affinityMatters
bool affinityMatters() const override
Definition
SamplePlayHandle.h:49
lmms::SamplePlayHandle::m_frame
f_cnt_t m_frame
Definition
SamplePlayHandle.h:77
lmms::SamplePlayHandle::m_doneMayReturnTrue
bool m_doneMayReturnTrue
Definition
SamplePlayHandle.h:81
lmms::SamplePlayHandle::m_patternTrack
PatternTrack * m_patternTrack
Definition
SamplePlayHandle.h:80
lmms::SamplePlayHandle::setDoneMayReturnTrue
void setDoneMayReturnTrue(bool _enable)
Definition
SamplePlayHandle.h:65
lmms::SamplePlayHandle::m_track
Track * m_track
Definition
SamplePlayHandle.h:79
lmms::SamplePlayHandle::m_sample
Sample * m_sample
Definition
SamplePlayHandle.h:78
lmms::Track
Base-class for all tracks.
Definition
Track.h:67
lmms
Definition
RemotePluginBase.cpp:34
lmms::f_cnt_t
std::uint64_t f_cnt_t
Definition
LmmsTypes.h:43
Generated on
for lmms by
1.18.0