More prominent recording option
Make the option to record samples more prominent by providing a pixmap button that is always shown and that can be used to turn recording on or off. The corresponding widget which constitutes of the button and a label is always positioned at the bottom left of the sample clip. Technical details ------------------ The recording widget is built in the private method `buildRecordWidget`. The method `adjustRecordWidget` is used to move the recording widget to the correct position relative to the sample view. It is called after construction and whenever the sample clip is resized (see `resizeEvent`). Add the method `SampleClip::getRecordModel` so that the pixmap button can be configured to act on it.
This commit is contained in:
@@ -81,6 +81,8 @@ public:
|
||||
void setIsPlaying(bool isPlaying);
|
||||
void setSampleBuffer(std::shared_ptr<const SampleBuffer> sb);
|
||||
|
||||
BoolModel& getRecordModel() { return m_recordModel; }
|
||||
|
||||
public slots:
|
||||
void setSampleFile(const QString& sf);
|
||||
void updateLength();
|
||||
|
||||
@@ -27,10 +27,13 @@
|
||||
|
||||
#include "ClipView.h"
|
||||
|
||||
class QWidget;
|
||||
|
||||
namespace lmms
|
||||
{
|
||||
|
||||
class SampleClip;
|
||||
class BoolModel;
|
||||
|
||||
namespace gui
|
||||
{
|
||||
@@ -59,12 +62,18 @@ protected:
|
||||
void dropEvent( QDropEvent * _de ) override;
|
||||
void mouseDoubleClickEvent( QMouseEvent * ) override;
|
||||
void paintEvent( QPaintEvent * ) override;
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
|
||||
private:
|
||||
QWidget* buildRecordWidget(BoolModel& recordModel);
|
||||
void adjustRecordWidget();
|
||||
|
||||
private:
|
||||
SampleClip * m_clip;
|
||||
QPixmap m_paintPixmap;
|
||||
bool splitClip( const TimePos pos ) override;
|
||||
|
||||
QWidget* m_recordWidget;
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user