lms-audio/src/libremediaserver-audio.h
2024-05-14 20:49:28 +02:00

75 lines
2.1 KiB
C++

/*
Libre Media Server Audio - An Open source Media Server for arts and performing.
(c) Criptomart - Santiago Noreña 2012-2024 <lms@criptomart.net>
https://git.criptomart.net/libremediaserver
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBREMEDIASERVERAUDIO_H
#define LIBREMEDIASERVERAUDIO_H
#include <bits/stdc++.h>
using namespace std;
#include "medialibrary.h"
#include "miniaudioengine.h"
#include "olathread.h"
#include "settings.h"
#include "defines.h"
#ifndef NOGUI
#include "libremediaserver-audio-gui.h"
#endif
class libreMediaServerAudio : public QObject
{
Q_OBJECT
public:
libreMediaServerAudio();
virtual ~libreMediaServerAudio();
void dmxInput(int layer, int channel, int value);
void loadMedia(int layer, int folder, int file);
#ifndef NOGUI
void setUi(libreMediaServerAudioUi *lmsUi);
bool inline getShowUi() { return m_settings->getShowUi(); }
#endif
private:
olaThread *m_ola;
MediaLibrary *m_mediaLibrary;
MiniAudioEngine m_mae;
Settings *m_settings;
QString m_currentMedia[MAX_LAYERS];
Status m_currentStatus[MAX_LAYERS];
QList<dmxSetting> m_dmxSettings;
bool m_ui;
QList<int> m_played;
uint m_layersQty;
#ifndef NOGUI
QTimer *m_refreshUi;
libreMediaServerAudioUi *m_lmsUi;
float m_updateUi[MAX_LAYERS][4];
private slots:
void refreshUi();
void uiSliderChanged(int layer, Slider s, int value);
void uiPlaybackChanged(int layer, Status s);
void uiLoadMedia(int layer, QString s);
#endif
};
#endif // LIBREMEDIASERVERAUDIO_H