WIP miniaudio working, some sigsev while playing...
This commit is contained in:
parent
78695b7976
commit
7aea8f6cf1
23 changed files with 469 additions and 299 deletions
|
|
@ -1,7 +1,8 @@
|
|||
/*
|
||||
Libre Media Server - A Media Server Sotfware for stage and performing
|
||||
|
||||
Copyright (C) 2012-2024 Santi Noreña lms@criptomart.net
|
||||
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
|
||||
|
|
@ -19,21 +20,16 @@
|
|||
|
||||
#include "libremediaserver-audio.h"
|
||||
|
||||
// QTextEdit * libreMediaServerAudio::textEdit = 0;
|
||||
|
||||
libreMediaServerAudio::libreMediaServerAudio(QStringList args, QWidget *parent)
|
||||
: QMainWindow(parent)
|
||||
{
|
||||
Q_UNUSED(args);
|
||||
ui.setupUi(this);
|
||||
this->setWindowTitle(VERSION);
|
||||
Q_UNUSED(args);
|
||||
ui.setupUi(this);
|
||||
this->setWindowTitle(VERSION);
|
||||
|
||||
// Lee la configuración por defecto
|
||||
Settings::getInstance()->readFile();
|
||||
|
||||
// Inicia el objeto de conexión a ola
|
||||
ola = new olaThread();
|
||||
Q_CHECK_PTR(ola);
|
||||
Settings *set = Settings::getInstance();
|
||||
set->readFile();
|
||||
/*
|
||||
if (args.contains("-log")) {
|
||||
// Inicia el widget Terminal
|
||||
|
|
@ -54,43 +50,35 @@ libreMediaServerAudio::libreMediaServerAudio(QStringList args, QWidget *parent)
|
|||
textEdit, SLOT(append(QString)), Qt::QueuedConnection);
|
||||
*/
|
||||
|
||||
this->setWindowTitle(VERSION);
|
||||
this->setWindowTitle(VERSION);
|
||||
qDebug() << VERSION;
|
||||
qDebug() << COPYRIGHT;
|
||||
qDebug() << LICENSE;
|
||||
|
||||
// qDebug() << QDate::currentDate().toString() << " "<< QTime::currentTime().toString();
|
||||
qDebug() << VERSION;
|
||||
qDebug() << COPYRIGHT;
|
||||
qDebug() << LICENSE;
|
||||
|
||||
setCentralWidget(AudioWidget::getInstance());
|
||||
|
||||
// Inicia el widget Master.
|
||||
amw = new AudioMasterWidget(this);
|
||||
QDockWidget *topWidget = new QDockWidget(tr("Master"), this);
|
||||
topWidget->setAllowedAreas(Qt::TopDockWidgetArea);
|
||||
topWidget->setWidget(amw);
|
||||
addDockWidget(Qt::TopDockWidgetArea, topWidget);
|
||||
|
||||
// Conectamos los menus
|
||||
// start audio engine
|
||||
MediaLibrary::getInstance()->initMediaLibrary();
|
||||
setCentralWidget(AudioWidget::getInstance());
|
||||
amw = new AudioMasterWidget(this);
|
||||
QDockWidget *topWidget = new QDockWidget(tr("Master"), this);
|
||||
topWidget->setAllowedAreas(Qt::TopDockWidgetArea);
|
||||
topWidget->setWidget(amw);
|
||||
addDockWidget(Qt::TopDockWidgetArea, topWidget);
|
||||
// ola setup
|
||||
ola = new olaThread();
|
||||
Q_CHECK_PTR(ola);
|
||||
connect(set, SIGNAL(registerUniverse(int)), ola, SLOT(registerUniverse(int)));
|
||||
ola->registerUniverse(); // register now all the universes
|
||||
ola->blockSignals(true);
|
||||
connect(ola, SIGNAL (layerReceived()), amw, SLOT(updateWatchDMX()));
|
||||
connect(ola, SIGNAL(dmxOutput(int, int, int)), this, SLOT(dmxInput(int, int, int)));
|
||||
connect(ui.actionLaunch_OLA_Setup, SIGNAL(triggered()), this, SLOT(olasetup()));
|
||||
ola->start(QThread::TimeCriticalPriority );
|
||||
ola->blockSignals(false);
|
||||
// menus
|
||||
connect(ui.actionOpen_conf, SIGNAL(triggered()), this, SLOT(openFile()));
|
||||
connect(ui.actionSave_conf, SIGNAL(triggered()), this, SLOT(saveFile()));
|
||||
connect(ui.action_Settings, SIGNAL(triggered()), this, SLOT(settings()));
|
||||
connect(ui.actionLaunch_OLA_Setup, SIGNAL(triggered()), this, SLOT(olasetup()));
|
||||
|
||||
connect(Settings::getInstance(), SIGNAL( registerUniverse(int) ),
|
||||
ola, SLOT( registerUniverse(int) ) );
|
||||
ola->registerUniverse(); // register now all the universes
|
||||
ola->blockSignals(true);
|
||||
connect(ola, SIGNAL (layerReceived()),
|
||||
amw, SLOT(updateWatchDMX()));
|
||||
|
||||
// Inicia la media Library
|
||||
MediaLibrary::getInstance()->initMediaLibrary();
|
||||
|
||||
// Inicia la lectura de datos DMX
|
||||
ola->start(QThread::TimeCriticalPriority );
|
||||
ola->blockSignals(false);
|
||||
connect(ola, SIGNAL( dmxOutput(int, int, int) ),
|
||||
this, SLOT( dmxInput(int, int, int) ) );
|
||||
connect(set, SIGNAL(audioDeviceChanged(int)), this, SLOT(audioDeviceChanged(int)));
|
||||
qDebug("Init Complete");
|
||||
}
|
||||
|
||||
|
|
@ -101,8 +89,7 @@ libreMediaServerAudio::libreMediaServerAudio(QStringList args, QWidget *parent)
|
|||
libreMediaServerAudio::~libreMediaServerAudio()
|
||||
{
|
||||
ola->stop();
|
||||
// qDebug() << QDate::currentDate() << QTime::currentTime();
|
||||
// qDebug() << "********************************************************************************";
|
||||
AudioWidget::getInstance()->stopEngine();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
|
|
@ -174,11 +161,11 @@ void libreMediaServerAudio::dmxInput(int layer, int channel, int value)
|
|||
break;
|
||||
case VOLUME_COARSE:
|
||||
f = ( value * 0x100 ) + ola->getValue(layer, VOLUME_FINE);
|
||||
AudioWidget::getInstance()->volChanged(layer, f / 655.35);
|
||||
AudioWidget::getInstance()->volChanged(layer, (f / 655.35));
|
||||
break;
|
||||
case VOLUME_FINE:
|
||||
f = ( ola->getValue(layer, VOLUME_COARSE) * 0x100 ) + value;
|
||||
AudioWidget::getInstance()->volChanged(layer, f / 655.35);
|
||||
AudioWidget::getInstance()->volChanged(layer, (f / 655.35));
|
||||
break;
|
||||
case PAN:
|
||||
AudioWidget::getInstance()->panChanged(layer, value);
|
||||
|
|
@ -208,3 +195,9 @@ void libreMediaServerAudio::dmxInput(int layer, int channel, int value)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void libreMediaServerAudio::audioDeviceChanged(int id)
|
||||
{
|
||||
AudioWidget::getInstance()->stopEngine();
|
||||
AudioWidget::getInstance()->startEngine(id);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue