Convert std::shared_ptr<Sample> to Sample
This conversion does not apply to Patman as there seems to be issues with it causing heap-use-after-free issues, such as with PatmanInstrument::unloadCurrentPatch
This commit is contained in:
@@ -63,7 +63,7 @@ public:
|
||||
return "sampleclip";
|
||||
}
|
||||
|
||||
std::shared_ptr<Sample> sample()
|
||||
const Sample& sample()
|
||||
{
|
||||
return m_sample;
|
||||
}
|
||||
@@ -87,7 +87,7 @@ public slots:
|
||||
|
||||
|
||||
private:
|
||||
std::shared_ptr<Sample> m_sample = std::make_shared<Sample>();
|
||||
Sample m_sample;
|
||||
BoolModel m_recordModel;
|
||||
bool m_isPlaying;
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ class AudioPort;
|
||||
class LMMS_EXPORT SamplePlayHandle : public PlayHandle
|
||||
{
|
||||
public:
|
||||
SamplePlayHandle(std::shared_ptr<const Sample> sampleBuffer , bool ownAudioPort = true);
|
||||
SamplePlayHandle(const Sample* sample, bool ownAudioPort = true);
|
||||
SamplePlayHandle( const QString& sampleFile );
|
||||
SamplePlayHandle( SampleClip* clip );
|
||||
~SamplePlayHandle() override;
|
||||
@@ -82,7 +82,7 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
std::shared_ptr<const Sample> m_sample;
|
||||
const Sample* m_sample;
|
||||
bool m_doneMayReturnTrue;
|
||||
|
||||
f_cnt_t m_frame;
|
||||
|
||||
Reference in New Issue
Block a user