funcionando sin la parte de las settings.
This commit is contained in:
parent
b59cc92c5f
commit
8b5d9414d1
20 changed files with 239 additions and 343 deletions
|
|
@ -27,55 +27,30 @@ libreMediaServerAudio::libreMediaServerAudio(QStringList args, QWidget *parent)
|
|||
Q_UNUSED(args);
|
||||
ui.setupUi(this);
|
||||
this->setWindowTitle(VERSION);
|
||||
|
||||
Settings *set = Settings::getInstance();
|
||||
set->readFile();
|
||||
connect(set, SIGNAL(audioDeviceChanged(int)), this, SLOT(audioDeviceChanged(int)));
|
||||
/*
|
||||
if (args.contains("-log")) {
|
||||
// Inicia el widget Terminal
|
||||
textEdit = new QTextEdit;
|
||||
textEdit->setReadOnly(true);
|
||||
QDockWidget *bottomWidget = new QDockWidget(tr("Terminal"), this);
|
||||
bottomWidget->setAllowedAreas(Qt::BottomDockWidgetArea);
|
||||
bottomWidget->setWidget(textEdit);
|
||||
addDockWidget(Qt::BottomDockWidgetArea, bottomWidget);
|
||||
connect(ola, SIGNAL(toTerminal(QString)),
|
||||
textEdit, SLOT(append(QString)), Qt::QueuedConnection);
|
||||
}*/
|
||||
|
||||
/* connect(MediaLibrary::getInstance(), SIGNAL(debug(QString)),
|
||||
textEdit, SLOT(append(QString)), Qt::QueuedConnection);
|
||||
|
||||
connect(MediaLibrary::getInstance(), SIGNAL(warning(QString)),
|
||||
textEdit, SLOT(append(QString)), Qt::QueuedConnection);
|
||||
*/
|
||||
|
||||
this->setWindowTitle(VERSION);
|
||||
qDebug() << VERSION;
|
||||
qDebug() << COPYRIGHT;
|
||||
qDebug() << LICENSE;
|
||||
|
||||
// start audio engine
|
||||
MediaLibrary::getInstance()->initMediaLibrary();
|
||||
aw = new AudioWidget;
|
||||
setCentralWidget(aw);
|
||||
amw = new AudioMasterWidget(this);
|
||||
m_dmxWidget = new dmxWidget(this);
|
||||
QDockWidget *topWidget = new QDockWidget(tr("Master"), this);
|
||||
topWidget->setAllowedAreas(Qt::TopDockWidgetArea);
|
||||
topWidget->setWidget(amw);
|
||||
topWidget->setWidget(m_dmxWidget);
|
||||
addDockWidget(Qt::TopDockWidgetArea, topWidget);
|
||||
// ola setup
|
||||
ola = new olaThread(this, set->getLayersNumber());
|
||||
Q_CHECK_PTR(ola);
|
||||
ola->blockSignals(true);
|
||||
connect(set, SIGNAL(registerUniverse(int)), ola, SLOT(registerUniverse(int)));
|
||||
connect(ola, SIGNAL (layerReceived()), amw, SLOT(updateWatchDMX()));
|
||||
connect(ola, SIGNAL (universeReceived(int)), m_dmxWidget, SLOT(updateWatchDMX(int)));
|
||||
connect(ola, SIGNAL(dmxOutput(int, int, int)), this, SLOT(dmxInput(int, int, int)));
|
||||
connect(ui.actionLaunch_OLA_Setup, SIGNAL(triggered()), this, SLOT(olasetup()));
|
||||
ola->registerUniverse();
|
||||
ola->start(QThread::TimeCriticalPriority );
|
||||
// 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()));
|
||||
|
|
@ -85,21 +60,12 @@ libreMediaServerAudio::libreMediaServerAudio(QStringList args, QWidget *parent)
|
|||
ola->resendDmx();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
// Destructor
|
||||
///////////////////////////////////////////////////////////////////
|
||||
|
||||
libreMediaServerAudio::~libreMediaServerAudio()
|
||||
{
|
||||
ola->stop();
|
||||
aw->stopEngine();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
// Menu File
|
||||
///////////////////////////////////////////////////////////////////
|
||||
|
||||
// Open a configuration File
|
||||
void libreMediaServerAudio::openFile()
|
||||
{
|
||||
QFileDialog dialog(this);
|
||||
|
|
@ -110,7 +76,7 @@ void libreMediaServerAudio::openFile()
|
|||
QFile file(fileNames.at(0));
|
||||
// open(&file);
|
||||
}
|
||||
// Save configuration File
|
||||
|
||||
void libreMediaServerAudio::saveFile()
|
||||
{
|
||||
QFileDialog dialog(this);
|
||||
|
|
@ -128,11 +94,6 @@ void libreMediaServerAudio::settings()
|
|||
sd->show();
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
// OLA Stuff
|
||||
///////////////////////////////////////////////////////////////////
|
||||
|
||||
void libreMediaServerAudio::olasetup()
|
||||
{
|
||||
QWebView *view = new QWebView();
|
||||
|
|
@ -142,21 +103,20 @@ void libreMediaServerAudio::olasetup()
|
|||
|
||||
void libreMediaServerAudio::dmxInput(int layer, int channel, int value)
|
||||
{
|
||||
// This qDebug slows all the program. Uncomment only for debugging purpouse and comment again in normal use
|
||||
// qDebug() << tr("olaInterface|") << "newdmx layer" << layer << "channel" << channel << "value" << value;
|
||||
if (layer > LAYER_CHANNELS)
|
||||
return;
|
||||
QString mediaFile = NULL;
|
||||
int aux;
|
||||
qreal f;
|
||||
int r;
|
||||
switch(channel){
|
||||
case DMX_FOLDER:// Folder
|
||||
case DMX_FOLDER:
|
||||
aux = ola->getValue(layer, DMX_FILE);
|
||||
mediaFile = MediaLibrary::getInstance()->requestNewFile(value, aux);
|
||||
if (QFile::exists(mediaFile))
|
||||
aw->mediaLoaded(layer, mediaFile);
|
||||
break;
|
||||
case DMX_FILE:// File
|
||||
case DMX_FILE:
|
||||
aux = ola->getValue(layer, DMX_FOLDER);
|
||||
mediaFile = MediaLibrary::getInstance()->requestNewFile(aux, value);
|
||||
if (QFile::exists(mediaFile))
|
||||
|
|
@ -176,6 +136,14 @@ void libreMediaServerAudio::dmxInput(int layer, int channel, int value)
|
|||
case PITCH:
|
||||
aw->pitchChanged(layer, value);
|
||||
break;
|
||||
case ENTRY_POINT_COARSE:
|
||||
r = ( value * 0x100 ) + ola->getValue(layer, ENTRY_POINT_FINE);
|
||||
aw->entryPointChanged(layer, r);
|
||||
break;
|
||||
case ENTRY_POINT_FINE:
|
||||
r = ( ola->getValue(layer, ENTRY_POINT_COARSE) * 0x100 ) + value;
|
||||
aw->entryPointChanged(layer, r);
|
||||
break;
|
||||
case PLAYBACK:
|
||||
if (value == 0)
|
||||
break;
|
||||
|
|
@ -193,6 +161,8 @@ void libreMediaServerAudio::dmxInput(int layer, int channel, int value)
|
|||
case 3 :
|
||||
aw->playbackChanged(layer, PlayingLoop);
|
||||
break;
|
||||
default :
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue