Files
lmms/include/SampleClip.h
Michael Gregorius d8c271650c Remove recording button
Remove the recording button that was added to the sample clip view with
commit 48c4dce96f.

This commit simply reverts the aforementioned one.
2024-06-14 20:16:57 +02:00

109 lines
2.5 KiB
C++

/*
* SampleClip.h
*
* Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of LMMS - https://lmms.io
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program (see COPYING); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
*/
#ifndef LMMS_SAMPLE_CLIP_H
#define LMMS_SAMPLE_CLIP_H
#include <memory>
#include "Clip.h"
#include "Sample.h"
namespace lmms
{
class SampleBuffer;
namespace gui
{
class SampleClipView;
} // namespace gui
class SampleClip : public Clip
{
Q_OBJECT
mapPropertyFromModel(bool,isRecord,setRecord,m_recordModel);
public:
SampleClip(Track* track, Sample sample, bool isPlaying);
SampleClip(Track* track);
SampleClip( const SampleClip& orig );
~SampleClip() override;
SampleClip& operator=( const SampleClip& that ) = delete;
void changeLength( const TimePos & _length ) override;
void changeLengthToSampleLength();
const QString& sampleFile() const;
bool hasSampleFileLoaded(const QString & filename) const;
void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override;
void loadSettings( const QDomElement & _this ) override;
inline QString nodeName() const override
{
return "sampleclip";
}
Sample& sample()
{
return m_sample;
}
TimePos sampleLength() const;
void setSampleStartFrame( f_cnt_t startFrame );
void setSamplePlayLength( f_cnt_t length );
gui::ClipView * createView( gui::TrackView * _tv ) override;
bool isPlaying() const;
void setIsPlaying(bool isPlaying);
void setSampleBuffer(std::shared_ptr<const SampleBuffer> sb);
public slots:
void setSampleFile(const QString& sf);
void updateLength();
void toggleRecord();
void playbackPositionChanged();
void updateTrackClips();
private:
Sample m_sample;
BoolModel m_recordModel;
bool m_isPlaying;
friend class gui::SampleClipView;
signals:
void sampleChanged();
void wasReversed();
} ;
} // namespace lmms
#endif // LMMS_SAMPLE_CLIP_H