lmms
Cross-platform music production software
Loading...
Searching...
No Matches
SlicerT.h
Go to the documentation of this file.
1/*
2 * SlicerT.h - declaration of class SlicerT
3 *
4 * Copyright (c) 2023 Daniel Kauss Serna <daniel.kauss.serna@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_SLICERT_H
26#define LMMS_SLICERT_H
27
28#include "AutomatableModel.h"
29#include "ComboBoxModel.h"
30#include "Instrument.h"
31#include "Note.h"
32#include "Sample.h"
33#include "SlicerTView.h"
34
35namespace lmms {
36
38
39class SlicerT : public Instrument
40{
41 Q_OBJECT
42
43public slots:
44 void updateFile(QString file);
45 void updateSlices();
46
47signals:
48 void isPlaying(float current, float start, float end);
49
50public:
52
53 void playNote(NotePlayHandle* handle, SampleFrame* workingBuffer) override;
54 void deleteNotePluginData(NotePlayHandle* handle) override;
55
56 void saveSettings(QDomDocument& document, QDomElement& element) override;
57 void loadSettings(const QDomElement& element) override;
58
59 void loadFile(const QString& file) override;
60 void findSlices();
61 void findBPM();
62
64
65 QString nodeName() const override;
66 gui::PluginView* instantiateView(QWidget* parent) override;
67
68 std::vector<Note> getMidi();
69
70private:
76
78 std::shared_ptr<const SampleThumbnailCache> m_sampleThumbnailCache;
79
80 std::vector<float> m_slicePoints;
81
83
84 friend class gui::SlicerTView;
86};
87} // namespace lmms
88#endif // LMMS_SLICERT_H
Definition AutomatableModel.h:510
Definition ComboBoxModel.h:39
Definition AutomatableModel.h:476
InstrumentTrack * instrumentTrack() const
Definition Instrument.h:171
Instrument(InstrumentTrack *_instrument_track, const Descriptor *_descriptor, const Descriptor::SubPluginFeatures::Key *key=nullptr, Flags flags=Flag::NoFlags)
Definition Instrument.cpp:38
Definition InstrumentTrack.h:62
Definition AutomatableModel.h:494
Definition NotePlayHandle.h:48
Definition SampleFrame.h:41
Definition Sample.h:37
auto sampleFile() const -> const QString &
Definition Sample.h:84
Holds increasingly downsampled versions of an audio waveform for efficient rendering of them.
Definition SampleThumbnailCache.h:43
QString nodeName() const override
Definition SlicerT.cpp:406
BoolModel m_enableSync
Definition SlicerT.h:75
void loadFile(const QString &file) override
Definition SlicerT.cpp:329
void updateFile(QString file)
Definition SlicerT.cpp:308
void saveSettings(QDomDocument &document, QDomElement &element) override
Definition SlicerT.cpp:339
std::vector< float > m_slicePoints
Definition SlicerT.h:80
void isPlaying(float current, float start, float end)
std::shared_ptr< const SampleThumbnailCache > m_sampleThumbnailCache
Definition SlicerT.h:78
void loadSettings(const QDomElement &element) override
Definition SlicerT.cpp:360
Sample m_originalSample
Definition SlicerT.h:77
QString getSampleName()
Definition SlicerT.h:63
ComboBoxModel m_sliceSnap
Definition SlicerT.h:74
FloatModel m_fadeOutFrames
Definition SlicerT.h:72
std::vector< Note > getMidi()
Definition SlicerT.cpp:280
void playNote(NotePlayHandle *handle, SampleFrame *workingBuffer) override
Definition SlicerT.cpp:79
void updateSlices()
Definition SlicerT.cpp:334
IntModel m_originalBPM
Definition SlicerT.h:73
void findSlices()
Definition SlicerT.cpp:148
SlicerT(InstrumentTrack *instrumentTrack)
Definition SlicerT.cpp:59
void deleteNotePluginData(NotePlayHandle *handle) override
Definition SlicerT.cpp:139
InstrumentTrack * m_parentTrack
Definition SlicerT.h:82
FloatModel m_noteThreshold
Definition SlicerT.h:71
void findBPM()
Definition SlicerT.cpp:256
gui::PluginView * instantiateView(QWidget *parent) override
Create a view for the model.
Definition SlicerT.cpp:411
Definition PluginView.h:36
Definition SlicerTView.h:46
Definition SlicerTWaveform.h:38
Definition RemotePluginBase.cpp:34