LMMS
Loading...
Searching...
No Matches
SampleRecordHandle.h
Go to the documentation of this file.
1/*
2 * SampleRecordHandle.h - play-handle for recording a sample
3 *
4 * Copyright (c) 2008 Csaba Hruska <csaba.hruska/at/gmail.com>
5 *
6 * This file is part of LMMS - https://lmms.io
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program (see COPYING); if not, write to the
20 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301 USA.
22 *
23 */
24
25#ifndef LMMS_SAMPLE_RECORD_HANDLE_H
26#define LMMS_SAMPLE_RECORD_HANDLE_H
27
28#include <QList>
29#include <QPair>
30#include <memory>
31
32#include "PlayHandle.h"
33#include "TimePos.h"
34
35namespace lmms
36{
37
38
39class PatternTrack;
40class SampleBuffer;
41class SampleClip;
42class Track;
43
44
46{
47public:
49 ~SampleRecordHandle() override;
50
51 void play( SampleFrame* _working_buffer ) override;
52 bool isFinished() const override;
53
54 bool isFromTrack( const Track * _track ) const override;
55
56 f_cnt_t framesRecorded() const;
57 std::shared_ptr<const SampleBuffer> createSampleBuffer();
58
59
60private:
61 virtual void writeBuffer( const SampleFrame* _ab,
62 const f_cnt_t _frames );
63
64 using bufferList = QList<QPair<SampleFrame*, f_cnt_t>>;
68
72
73} ;
74
75
76} // namespace lmms
77
78#endif // LMMS_SAMPLE_RECORD_HANDLE_H
Definition PatternTrack.h:47
PlayHandle(const Type type, f_cnt_t offset=0)
Definition PlayHandle.cpp:36
Definition SampleBuffer.h:39
Definition SampleClip.h:46
Definition SampleFrame.h:41
SampleClip * m_clip
Definition SampleRecordHandle.h:71
void play(SampleFrame *_working_buffer) override
Definition SampleRecordHandle.cpp:66
TimePos m_minLength
Definition SampleRecordHandle.h:67
f_cnt_t framesRecorded() const
Definition SampleRecordHandle.cpp:100
virtual void writeBuffer(const SampleFrame *_ab, const f_cnt_t _frames)
Definition SampleRecordHandle.cpp:129
~SampleRecordHandle() override
Definition SampleRecordHandle.cpp:51
f_cnt_t m_framesRecorded
Definition SampleRecordHandle.h:66
bufferList m_buffers
Definition SampleRecordHandle.h:65
PatternTrack * m_patternTrack
Definition SampleRecordHandle.h:70
SampleRecordHandle(SampleClip *clip)
Definition SampleRecordHandle.cpp:38
std::shared_ptr< const SampleBuffer > createSampleBuffer()
Definition SampleRecordHandle.cpp:108
bool isFinished() const override
Definition SampleRecordHandle.cpp:84
Track * m_track
Definition SampleRecordHandle.h:69
QList< QPair< SampleFrame *, f_cnt_t > > bufferList
Definition SampleRecordHandle.h:64
bool isFromTrack(const Track *_track) const override
Definition SampleRecordHandle.cpp:92
Definition TimePos.h:68
Base-class for all tracks.
Definition Track.h:68
Definition AudioAlsa.cpp:35
std::uint64_t f_cnt_t
Definition LmmsTypes.h:43