cambios desconocidos

This commit is contained in:
snt 2023-09-05 17:47:35 +02:00
parent 5f27d17d8a
commit 0b958b5fd8
18 changed files with 289 additions and 94 deletions

0
LICENSE.txt Executable file → Normal file
View file

12
changelog.txt Executable file → Normal file
View file

@ -23,17 +23,9 @@ Lbre Media Server ChangeLog
*******************************************************************************
v 0.1.2
+ Bugfixes: Reconnecting to ola when the server closes the connection
v 0.1.1
+ Bugfixes
v 0.1.0
v 0.1-1
+ First Version: 4 layers playing .ogg
+ Needs Open Lighting Arquitecture => 0.9.0
+ Qt5 and QtMultimedia sound engine
+ Pure Data as audio engine

40
compiling.txt Executable file → Normal file
View file

@ -21,26 +21,40 @@ You should have received a copy of the GNU General Public License along with thi
If you have troubles, or you are in another distro, you can try compiling from the source code.
0. Prerequisites
Install OLA binaries and headers:
add deb http://apt.openlighting.org/debian wheezy main to your /etc/sources.list
#apt-get update
#apt-get install ola ola-dev
Install Qtcreator from http://qt-project.org/downloads
We are using version 5.3.1
0. Requisites
tcl tk --> To compile Pure Data, not necesary to execute it without GUI (-gui option in command line)
build-essential
make
qmake
gcc
g++
libtool
ola-dev
1. LibreMediaserver Audio
1. Building pd
$./configure
$make
Open the file libremediaserver-audio.pro with QtCreator, configure the project and compile it.
2. LibreMediaserver Audio
Open the file libremediaserver-audio.pro with QtCreator and compile it.
or
$ cd src
$ qmake-qt5 libremediaserver-audio.pro -r -spec linux-g++
$ qmake-qt4 libremediaserver-audio.pro -r -spec linux-g++
$ make -w
2. Copy lms-audio.xml to the working directory or set the project working directory to the folder containing this file
3. Putting all together.
Make a directory. Copy in it:
- libremediaserver binary
- Folder scripts
- Folder puredata
- the tcl folder in the pd sources. This is only necessary to show the Pure Data GUI's. You don't need if you don't want the GUI's. Only it's good for debugging purpouses and developing, for normal use you can skip this step.
In the folder puredata copy:
- the pd executable
- Make a folder named externals and copy all the externals to it. All the externals compiled must be in ~HOME/pd-external.

4
credits.txt Executable file → Normal file
View file

@ -1,2 +1,4 @@
LibreMediaServer Santiago Noreña Sobrado libremediaserver@gmail.com
Pure Data: Copyright © Miller Miller Puckette and others - BSD License.
pdogg~/oggread~: Copyright © 2002-2004 by Olaf Matthes - GPL License.

28
instalacion.txt Executable file → Normal file
View file

@ -23,25 +23,35 @@ You should have received a copy of the GNU General Public License along with thi
LMS Audio está desarrollado y probado en Debian Wheezy y derivados.
1. Instala Open Lighting Arquitecture desde su repositorio:
Para resolver dependencias es necesario tener conexión a internet en el ordenador durante el proceso de instalación.
LMS se comunica con Pure Data mediante puertos TCP, del 9195 al 9198. Open Lighting Arquitecure utiliza el puerto 9090 para su servidor web. Es necesario que estos puertos no estén siendo utilizados por otras aplicaciones.
1. Instala Open Lignting Arquitecture
Añadimos el repositorio de Open Lighting al archivo /etc/apt/sources.list:
Añadimos el repositorio de Open Lighting al archivo /etc/apt/sources.list:
$ echo "deb http://apt.openlighting.org/debian/ wheezy main" >> /etc/apt/sources.list
Actualiza las fuentes: $ apt-get update
Instalamos los paquetes necesarios: $ apt-get install ola
Actualizamos las fuentes:
$ apt-get update
Instalamos los paquetes necesarios:
$ apt-get -y --force-yes install ola libqtcore4 libqtgui4
2. Configuración
Este proceso sólo es necesario la primera vez que se ejecuta LMS Audio.
a. Inicia LMS Audio ejecutando el script runlms.sh
a. Inicia LMS Audio ejecutando el archivo "libremediaserver-audio"
b. Pincha en la opción "OLA setup" en el menu File.
c. Se abrirá la ventana de confiiguración de OLA. Pincha en el botón "add universe"
c. Pincha en el botón "add universe"
d. Marca en la casilla del protocolo de red o dispositivo por el que quieras introducir datos. Asegúrate de que el campo "Direction" sea "input".
d. Marca en la casilla del protocolo de red o dispositivo por el que quieras introducir datos. Asegúrate de que en "Direction" sea "input".
Si el protocolo elegido es ArtNet en "Universe Id" introduce el número del universo ArtNet por el que quieres recibir. La Net y la Subnet de Artnet se pueden cambiar en el archivo ~/.ola/ola-artnet.conf, por defecto es la Net 0 y la SubNet 0.
@ -49,6 +59,8 @@ Puedes confirmar que está llegando información pinchando en el universo en el
Si quieres usar el mismo ordenador como mesa y media server edit el archivo ~/.ola/ola-artnet.conf y define la opción use_loopback a true.
e. La configuración de los universos de ola a los que LMS Audio escucha, el directorio donde se encuentran los archivos a reproducir, y las direcciones DMX de las capas se configuran en el fichero lms-audio.xlm. En el campo Universe tienes que poner el universo de ola que has definido anteriormente. Edita este fichero con un editor de texto plano y reinicia el programa. De momento no se puede configurar mediante GUI.
e. Pincha en el menu File -> Change Media Path y elige el directorio donde estén tus medias.
f. La configuración de los universos de ola a los que LMS Audio escucha y las direcciones DMX de las capas se configuran en el fichero lms.xlm. En el campo Universe tienes que poner el universo de ola que has definido anteriormente. Edita este fichero con un editor de texto plano y reinicia el programa. De momento no se puede configurar mediante GUI.

View file

@ -1,15 +1,11 @@
<?xml version='1.0' encoding='UTF-8'?>
<dmxSettings fileVersion="1" layersNumber="3" path="/home/santi/audio" universeNumber="1">
<dmxSettings fileVersion="1" layersNumber="3" path="/home/santi/lo_que_vio_el_mayordomo/sound" universeNumber="1">
<layer0 dmx="1" universe="1" />
<layer1 dmx="21" universe="1" />
<layer2 dmx="41" universe="1" />
<layer3 dmx="61" universe="1" />
<<<<<<< HEAD
<layer4 dmx="257" universe="1" />
<layer5 dmx="321" universe="1" />
<layer6 dmx="385" universe="1" />
<layer7 dmx="449" universe="1" />
=======
<layer4 dmx="81" universe="1" />
>>>>>>> sfml
</dmxSettings>

View file

@ -0,0 +1,49 @@
#include "layersettingswidget.h"
#include "ui_layersettingswidget.h"
LayerSettingsWidget::LayerSettingsWidget(QWidget *parent, int layer) :
QWidget(parent),
ui(new Ui::LayerSettingsWidget),
m_layer(layer)
{
ui->setupUi(this);
connect(ui->address, SIGNAL(valueChanged(int)),
this, SLOT(addressChanged(int)));
connect(ui->universe, SIGNAL(valueChanged(int)),
this, SLOT(universeChanged(int)));
}
LayerSettingsWidget::~LayerSettingsWidget()
{
delete ui;
}
void LayerSettingsWidget::setAddress(int add)
{
ui->address->setValue(add);
}
int LayerSettingsWidget::getAddress()
{
return ui->address->value();
}
void LayerSettingsWidget::setUniverse(int uni)
{
ui->universe->setValue(uni);
}
int LayerSettingsWidget::getUniverse()
{
return ui->universe->value();
}
void LayerSettingsWidget::universeChanged(int val)
{
Settings::getInstance()->changeLayerSetup(m_layer, val, ui->address->value());
}
void LayerSettingsWidget::addressChanged(int val)
{
Settings::getInstance()->changeLayerSetup(m_layer, ui->universe->value(), val);
}

32
src/layersettingswidget.h Normal file
View file

@ -0,0 +1,32 @@
#ifndef LAYERSETTINGSWIDGET_H
#define LAYERSETTINGSWIDGET_H
#include <QWidget>
#include "settings.h"
namespace Ui {
class LayerSettingsWidget;
}
class LayerSettingsWidget : public QWidget
{
Q_OBJECT
public:
LayerSettingsWidget(QWidget *parent, int layer);
~LayerSettingsWidget();
void setAddress(int add);
int getAddress();
void setUniverse(int uni);
int getUniverse();
private:
Ui::LayerSettingsWidget *ui;
int m_layer;
private slots:
void addressChanged(int val);
void universeChanged(int val);
};
#endif // LAYERSETTINGSWIDGET_H

View file

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>LayerSettingsWidget</class>
<widget class="QWidget" name="LayerSettingsWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>194</width>
<height>59</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<widget class="QSpinBox" name="universe">
<property name="geometry">
<rect>
<x>20</x>
<y>20</y>
<width>52</width>
<height>31</height>
</rect>
</property>
</widget>
<widget class="QSpinBox" name="address">
<property name="geometry">
<rect>
<x>110</x>
<y>20</y>
<width>52</width>
<height>31</height>
</rect>
</property>
<property name="accessibleDescription">
<string>Address</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>

4
src/libremediaserver-audio.cpp Executable file → Normal file
View file

@ -134,8 +134,8 @@ void libreMediaServerAudio::saveFile()
void libreMediaServerAudio::settings()
{
SettingsDialog sd = new SettingsDialog();
sd.show();
SettingsDialog *sd = new SettingsDialog();
sd->show();
}

2
src/libremediaserver-audio.h Executable file → Normal file
View file

@ -25,7 +25,7 @@
#include <QFileInfo>
#include <QFileDialog>
#include <QTextStream>
//#include <QWebView>
#include <QWebView>
#include <QVBoxLayout>
#include <QTextEdit>

9
src/libremediaserver-audio.pro Executable file → Normal file
View file

@ -15,7 +15,8 @@ HEADERS += libremediaserver-audio.h \
audiomasterwidget.h \
defines.h \
settings.h \
settingsdialog.h
settingsdialog.h \
layersettingswidget.h
SOURCES += main.cpp \
libremediaserver-audio.cpp \
@ -25,11 +26,13 @@ SOURCES += main.cpp \
audiowidget.cpp \
audiomasterwidget.cpp \
settings.cpp \
settingsdialog.cpp
settingsdialog.cpp \
layersettingswidget.cpp
FORMS += \
libremediaserver-audio.ui \
settingsdialog.ui
settingsdialog.ui \
layersettingswidget.ui
#INCLUDEPATH += ./

0
src/libremediaserver-audio.ui Executable file → Normal file
View file

0
src/main.cpp Executable file → Normal file
View file

View file

@ -96,6 +96,34 @@ void Settings::readFromFile(QString file) {
void Settings::readFile() {
readFromFile(DEFAULT_FILE);
}
void Settings::changeLayerSetup(int layer, int universe, int address)
{
dmxSetting temp;
temp.address = address;
temp.universe = universe;
temp.layer = layer;
m_settings.replace(layer, temp);
if (!m_universe.contains(temp.universe)) {
m_universe.insert(temp.universe);
// emit registerUniverse(temp.universe);
}
}
void Settings::addLayer()
{
dmxSetting temp;
temp.address = -1;
temp.universe = -1;
temp.layer = -1;
m_settings.append(temp);
}
void Settings::removeLayer(int layer)
{
m_settings.removeAt(layer);
}
/*
void Settings::writeFile(QString filename)
{

View file

@ -7,7 +7,6 @@
#include <QMessageBox>
#include <QSet>
//#include "olathread.h"
#include "medialibrary.h"
#include "defines.h"
@ -66,18 +65,24 @@ public:
*/
void readFile();
private:
static Settings *_instance;
/** Constructor
*
/**
* @brief changeLayerSetup
* @param layer
* @param universe
* @param address
*/
explicit Settings(QObject *parent = 0);
void changeLayerSetup(int layer, int universe, int address);
QSet<int> m_universe; // Registered universes.
/**
* @brief removeLayer
* @param layer
*/
void removeLayer(int layer);
int m_layersNumber; // Number of layers in wich divide the dmx frame. Each layer, one source.
/**
* @brief addLayer
*/
void addLayer();
/**
* @brief olaThread::setLayersNumber
@ -91,12 +96,24 @@ private:
else
m_layersNumber = LAYERS_NUMBER;
}
private:
// The list where we store the settings by layer
QList<dmxSetting> m_settings;
static Settings *_instance;
// The path to media library
QString m_pathmedia;
// The list where we store the settings by layer
QList<dmxSetting> m_settings;
// The path to media library
QString m_pathmedia;
/** Constructor
*
*/
explicit Settings(QObject *parent = 0);
QSet<int> m_universe; // Registered universes.
int m_layersNumber; // Number of layers in wich divide the dmx frame. Each layer, one source.
/**
* @brief readFromFile

View file

@ -6,32 +6,23 @@ SettingsDialog::SettingsDialog(QWidget *parent) :
ui(new Ui::SettingsDialog)
{
ui->setupUi(this);
ui->layersNumber = Settings::getInstance()->getLayersNumber();
QString path;
path << "Path to root folder of the media tree: " << std::endl << Settings::getInstance()->getPathMedia();
this->setWindowTitle("Settings");
ui->layersNumber->setValue(Settings::getInstance()->getLayersNumber());
QString path("Path to root folder of the media tree: /n");
path.append(Settings::getInstance()->getPathMedia());
ui->mediaPath->setText(path);
connect(ui->mediaPatchButton, SIGNAL(clicked()),
this, SLOT(changeMediaPath()));
// ToDo: Conectarlo todoooo
QList<dmxSetting> dmx = Settings::getInstance()->getDmxSettings();
foreach (it, dmx) {
QHBoxLayout *layer = new QHBoxLayout;
QSpinBox *universe = new QSpinBox();
universe->setValue(it.universe);
layer->addWidget(universe);
QSpinBox *address = new QSpinBox();
address->setValue(it.address);
layer->addWidget(address);
ui->layersLayout->addLayout(address);
connect(universe, SIGNAL(valueChanged(int)),
this, SLOT(universeChanged(int)));
connect(address, SIGNAL(valueChanged(int)),
this, SLOT(addressChnged(int)));
connect(ui->layersNumber, SIGNAL(valueChanged(int)),
this, SLOT(layersChanged(int)));
int layer = 0;
foreach (const dmxSetting &it, Settings::getInstance()->getDmxSettings()) {
LayerSettingsWidget *temp = new LayerSettingsWidget(this, layer);
temp->setUniverse(it.universe);
temp->setAddress(it.address);
ui->layersLayout->insertWidget(layer, temp);
layer++;
}
}
@ -40,17 +31,7 @@ SettingsDialog::~SettingsDialog()
delete ui;
}
SettingsDialog::universeChanged(int uni)
{
}
SettingsDialog::addressChanged(int add)
{
}
void SettingsDialog::ChangeMediaPath()
void SettingsDialog::changeMediaPath()
{
QFileDialog dialog(this);
dialog.setFileMode(QFileDialog::Directory);
@ -59,7 +40,30 @@ void SettingsDialog::ChangeMediaPath()
return;
fileNames = dialog.selectedFiles();
QString file = fileNames.at(0);
// MediaLibrary::getInstance()->setPath(file);
Settings::getInstance()->setPathMedia(file);
QString desc = tr("Media Path Changed to: %1").arg(file);
qDebug(desc.toLatin1().constData());
}
void SettingsDialog::layersChanged(int val)
{
int layers = Settings::getInstance()->getLayersNumber();
if (val > layers)
{
while (val != layers)
{
ui->layersLayout->addWidget(new LayerSettingsWidget(this, val));
layers++;
}
} else if (val < layers)
{
while (val != layers)
{
Settings::getInstance()->removeLayer(val);
QLayoutItem * const item = ui->layersLayout->itemAt(layers);
ui->layersLayout->removeItem(item);
layers--;
}
}
Settings::getInstance()->setLayersNumber(layers);
}

View file

@ -2,7 +2,10 @@
#define SETTINGSDIALOG_H
#include <QDialog>
#include <QVBoxLayout>
#include <QFileDialog>
#include "settings.h"
#include "layersettingswidget.h"
namespace Ui {
class SettingsDialog;
@ -17,11 +20,12 @@ public:
~SettingsDialog();
private slots:
universeChanged(int uni);
addressChanged(int add);
void ChangeMediaPath();
void changeMediaPath();
private:
Ui::SettingsDialog *ui;
private slots:
void layersChanged(int val);
};
#endif // SETTINGSDIALOG_H