LMMS
Loading...
Searching...
No Matches
DataprocLauncher.h
Go to the documentation of this file.
1/*
2 * DataprocLauncher.h - QThread::create workaround for older Qt version
3 *
4 * Copyright (c) 2019 Martin Pavelek <he29/dot/HS/at/gmail/dot/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 DATAPROCLAUNCHER_H
26#define DATAPROCLAUNCHER_H
27
28#include <QThread>
29
30#include "SaProcessor.h"
31#include "LocklessRingBuffer.h"
32
33namespace lmms
34{
35
36
37class DataprocLauncher : public QThread
38{
39public:
41 : m_processor(&proc),
42 m_inputBuffer(&buffer)
43 {
44 }
45
46private:
47 void run() override
48 {
49 m_processor->analyze(*m_inputBuffer);
50 }
51
54};
55
56
57} // namespace lmms
58
59#endif // DATAPROCLAUNCHER_H
DataprocLauncher(SaProcessor &proc, LocklessRingBuffer< SampleFrame > &buffer)
Definition DataprocLauncher.h:40
LocklessRingBuffer< SampleFrame > * m_inputBuffer
Definition DataprocLauncher.h:53
void run() override
Definition DataprocLauncher.h:47
SaProcessor * m_processor
Definition DataprocLauncher.h:52
A convenience layer for a realtime-safe and thread-safe multi-reader ringbuffer.
Definition LocklessRingBuffer.h:41
Receives audio data, runs FFT analysis and stores the result.
Definition SaProcessor.h:50
Definition AudioAlsa.cpp:35