Updated SWH plugins and added missing hermes_filter plugin
[lmms/mlankhorst.git] / include / sample_record_handle.h
blobf07cfd35073e1e19501f7ba11a6ab10683526177
1 /*
2 * sample_record_handle.h - play-handle for recording a sample
4 * Copyright (c) 2008 Csaba Hruska <csaba.hruska/at/gmail.com>
5 *
6 * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
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.
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.
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.
26 #ifndef _SAMPLE_RECORD_HANDLE_H
27 #define _SAMPLE_RECORD_HANDLE_H
29 #include <QtCore/QList>
30 #include <QtCore/QPair>
31 #include <qobject.h>
33 #include "mixer.h"
34 #include "sample_buffer.h"
36 class bbTrack;
37 class pattern;
38 class sampleTCO;
39 class track;
42 class sampleRecordHandle : public playHandle
44 public:
45 sampleRecordHandle( sampleTCO * _tco );
46 virtual ~sampleRecordHandle();
48 virtual void play( sampleFrame * _working_buffer );
49 virtual bool done() const;
51 virtual bool isFromTrack( const track * _track ) const;
53 f_cnt_t framesRecorded() const;
54 void createSampleBuffer( sampleBuffer * * _sample_buf );
57 private:
58 virtual void writeBuffer( const sampleFrame * _ab,
59 const f_cnt_t _frames );
61 typedef QList<QPair<sampleFrame *, f_cnt_t> > bufferList;
62 bufferList m_buffers;
63 f_cnt_t m_framesRecorded;
64 midiTime m_minLength;
66 track * m_track;
67 bbTrack * m_bbTrack;
68 sampleTCO * m_tco;
70 } ;
73 #endif