LMMS
Loading...
Searching...
No Matches
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 "AutomatableModel.h"
31#include "PlayHandle.h"
32
33namespace lmms
34{
35
36
37class PatternTrack;
38class SampleClip;
39class Track;
40
41
42class LMMS_EXPORT SamplePlayHandle : public PlayHandle
43{
44public:
45 SamplePlayHandle(Sample* sample, bool ownAudioBusHandle = true);
46 SamplePlayHandle( const QString& sampleFile );
48 ~SamplePlayHandle() override;
49
50 inline bool affinityMatters() const override
51 {
52 return true;
53 }
54
55
56 void play( SampleFrame* buffer ) override;
57 bool isFinished() const override;
58
59 bool isFromTrack( const Track * _track ) const override;
60
61 f_cnt_t totalFrames() const;
62 inline f_cnt_t framesDone() const
63 {
64 return( m_frame );
65 }
66 void setDoneMayReturnTrue( bool _enable )
67 {
68 m_doneMayReturnTrue = _enable;
69 }
70
72 {
73 m_patternTrack = pt;
74 }
75
76 void setVolumeModel( FloatModel * _model )
77 {
78 m_volumeModel = _model;
79 }
80
81
82private:
85
88
90
94
96
97} ;
98
99
100} // namespace lmms
101
102#endif // LMMS_SAMPLE_PLAY_HANDLE_H
Definition AutomatableModel.h:463
Definition PatternTrack.h:47
PlayHandle(const Type type, f_cnt_t offset=0)
Definition PlayHandle.cpp:36
Definition Sample.h:47
Definition SampleClip.h:46
Definition SampleFrame.h:41
Definition Sample.h:37
f_cnt_t framesDone() const
Definition SamplePlayHandle.h:62
Sample::PlaybackState m_state
Definition SamplePlayHandle.h:87
FloatModel * m_volumeModel
Definition SamplePlayHandle.h:92
void setVolumeModel(FloatModel *_model)
Definition SamplePlayHandle.h:76
void setPatternTrack(PatternTrack *pt)
Definition SamplePlayHandle.h:71
SamplePlayHandle(Sample *sample, bool ownAudioBusHandle=true)
Definition SamplePlayHandle.cpp:38
bool affinityMatters() const override
Definition SamplePlayHandle.h:50
f_cnt_t m_frame
Definition SamplePlayHandle.h:86
FloatModel m_defaultVolumeModel
Definition SamplePlayHandle.h:91
bool m_doneMayReturnTrue
Definition SamplePlayHandle.h:84
const bool m_ownAudioBusHandle
Definition SamplePlayHandle.h:89
PatternTrack * m_patternTrack
Definition SamplePlayHandle.h:95
void setDoneMayReturnTrue(bool _enable)
Definition SamplePlayHandle.h:66
Track * m_track
Definition SamplePlayHandle.h:93
Sample * m_sample
Definition SamplePlayHandle.h:83
Base-class for all tracks.
Definition Track.h:68
Definition AudioAlsa.cpp:35
std::uint64_t f_cnt_t
Definition LmmsTypes.h:43
signed int sample
Definition tap_dynamics_m.c:41