LMMS
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
37class SlicerT : public Instrument
38{
39 Q_OBJECT
40
41public slots:
42 void updateFile(QString file);
43 void updateSlices();
44
45signals:
46 void isPlaying(float current, float start, float end);
47
48public:
50
51 void playNote(NotePlayHandle* handle, SampleFrame* workingBuffer) override;
52 void deleteNotePluginData(NotePlayHandle* handle) override;
53
54 void saveSettings(QDomDocument& document, QDomElement& element) override;
55 void loadSettings(const QDomElement& element) override;
56
57 void loadFile(const QString& file) override;
58 void findSlices();
59 void findBPM();
60
61 QString getSampleName() { return m_originalSample.sampleFile(); }
62
63 QString nodeName() const override;
64 gui::PluginView* instantiateView(QWidget* parent) override;
65
66 std::vector<Note> getMidi();
67
68private:
74
76
77 std::vector<float> m_slicePoints;
78
80
81 friend class gui::SlicerTView;
83};
84} // namespace lmms
85#endif // LMMS_SLICERT_H
Definition AutomatableModel.h:497
Definition ComboBoxModel.h:39
Definition AutomatableModel.h:463
InstrumentTrack * instrumentTrack() const
Definition Instrument.h:156
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:481
Definition NotePlayHandle.h:48
Definition SampleFrame.h:41
Definition Sample.h:37
QString nodeName() const override
Definition SlicerT.cpp:387
BoolModel m_enableSync
Definition SlicerT.h:73
void loadFile(const QString &file) override
Definition SlicerT.cpp:317
void updateFile(QString file)
Definition SlicerT.cpp:307
void saveSettings(QDomDocument &document, QDomElement &element) override
Definition SlicerT.cpp:327
std::vector< float > m_slicePoints
Definition SlicerT.h:77
void isPlaying(float current, float start, float end)
void loadSettings(const QDomElement &element) override
Definition SlicerT.cpp:348
Sample m_originalSample
Definition SlicerT.h:75
QString getSampleName()
Definition SlicerT.h:61
ComboBoxModel m_sliceSnap
Definition SlicerT.h:72
FloatModel m_fadeOutFrames
Definition SlicerT.h:70
std::vector< Note > getMidi()
Definition SlicerT.cpp:279
void playNote(NotePlayHandle *handle, SampleFrame *workingBuffer) override
Definition SlicerT.cpp:78
void updateSlices()
Definition SlicerT.cpp:322
IntModel m_originalBPM
Definition SlicerT.h:71
void findSlices()
Definition SlicerT.cpp:147
SlicerT(InstrumentTrack *instrumentTrack)
Definition SlicerT.cpp:58
void deleteNotePluginData(NotePlayHandle *handle) override
Definition SlicerT.cpp:138
InstrumentTrack * m_parentTrack
Definition SlicerT.h:79
FloatModel m_noteThreshold
Definition SlicerT.h:69
void findBPM()
Definition SlicerT.cpp:255
gui::PluginView * instantiateView(QWidget *parent) override
Create a view for the model.
Definition SlicerT.cpp:392
Definition PluginView.h:36
Definition SlicerTView.h:46
Definition SlicerTWaveform.h:40
static uintptr_t parent
Definition pugl.h:1644
virtual ASIOError start()=0
Definition AudioAlsa.cpp:35
struct zdirent * file
Definition win32.c:1500