Fixed pan bug (again)
Reduced the debug output The volune range is 0 -100 and dbtorms is used in pure data to make the scale logarithm
This commit is contained in:
parent
6e268323d2
commit
5cfd9f7a10
11 changed files with 43 additions and 29 deletions
|
@ -3,19 +3,24 @@
|
|||
AudioLayerWidget::AudioLayerWidget(QWidget *parent, QString name):
|
||||
QGroupBox(parent)
|
||||
{
|
||||
Q_UNUSED(parent);
|
||||
this->setTitle(name);
|
||||
folder = new QLabel(this);
|
||||
folder->setMaximumWidth(150);
|
||||
file = new QLabel(this);
|
||||
file->setMaximumWidth(150);
|
||||
status = new QLabel(this);
|
||||
vol = new QSlider(this);
|
||||
vol = new QSlider(Qt::Horizontal, this);
|
||||
vol->setMaximum(99);
|
||||
mute = new QCheckBox(this);
|
||||
vol->setMaximumWidth(150);
|
||||
// mute = new QCheckBox(this);
|
||||
|
||||
QVBoxLayout *vbox = new QVBoxLayout;
|
||||
vbox->addWidget(folder);
|
||||
vbox->addWidget(file);
|
||||
vbox->addWidget(status);
|
||||
vbox->addWidget(vol);
|
||||
vbox->addWidget(mute);
|
||||
// vbox->addWidget(mute);
|
||||
this->setLayout(vbox);
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ private:
|
|||
QLabel *file;
|
||||
QLabel *folder;
|
||||
QSlider *vol;
|
||||
QCheckBox *mute;
|
||||
// QCheckBox *mute;
|
||||
QLabel *status;
|
||||
};
|
||||
|
||||
|
|
|
@ -305,7 +305,7 @@ void AudioMotor::parse(QString message)
|
|||
QStringList list = message.split("\n", QString::SkipEmptyParts);
|
||||
for (int i = 0; i < list.size(); i ++) {
|
||||
if (list.at(i).size() > 0) {
|
||||
qDebug() << "AudioMotor::newMessage() message received: " << list.at(i);
|
||||
// qDebug() << "AudioMotor::newMessage() message received: " << list.at(i);
|
||||
QChar val = list.at(i).at(0);
|
||||
switch (val.digitValue()) {
|
||||
case 0:
|
||||
|
@ -348,8 +348,6 @@ void AudioMotor::parse(QString message)
|
|||
|
||||
void AudioMotor::errorWrite(QAbstractSocket::SocketError error)
|
||||
{
|
||||
// QString error = m_writePD->errorString();
|
||||
|
||||
qErrnoWarning(QString("AudioMotor::errorWrite() %1").arg(error).toLatin1());
|
||||
emit toTerminal(QString("AudioMotor::errorWrite() ") + error);
|
||||
}
|
||||
|
|
|
@ -15,17 +15,17 @@ AudioWidget::AudioWidget(QWidget *parent) :
|
|||
void AudioWidget::mediaLoaded(int layer, QString folder, QString file)
|
||||
{
|
||||
QLayoutItem * const item = layout->itemAt(layer - 1);
|
||||
qDebug() << "AudioWidget::mediaLoaded Received layer: " << layer
|
||||
/* qDebug() << "AudioWidget::mediaLoaded Received layer: " << layer
|
||||
<< "Folder: " << folder
|
||||
<<"File : " << file;
|
||||
<<"File : " << file;*/
|
||||
dynamic_cast<AudioLayerWidget *>(item->widget())->setFolder(folder);
|
||||
dynamic_cast<AudioLayerWidget *>(item->widget())->setFile(file);
|
||||
}
|
||||
|
||||
void AudioWidget::volChanged(int layer, int vol) {
|
||||
QLayoutItem * const item = layout->itemAt(layer - 1);
|
||||
qDebug() << "AudioWidget::volChanged Received layer: " << layer
|
||||
<< "Vol : " << vol;
|
||||
/*qDebug() << "AudioWidget::volChanged Received layer: " << layer
|
||||
<< "Vol : " << vol;*/
|
||||
dynamic_cast<AudioLayerWidget *>(item->widget())->setVol(vol);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef DEFINES_H
|
||||
#define DEFINES_H
|
||||
|
||||
#define LAYERS_NUMBER 4
|
||||
#define LAYERS_NUMBER 3
|
||||
|
||||
|
||||
#endif // DEFINES_H
|
||||
|
|
|
@ -211,11 +211,11 @@ void libreMediaServerAudio::dmxInput(int layer, int channel, int value)
|
|||
break;
|
||||
case VOLUME_COARSE:
|
||||
f = ( value * 0x100 ) + ola->getValue(layer, VOLUME_FINE);
|
||||
AudioMotor::getInstance()->setLayerVolume(layer, f/65535);
|
||||
AudioMotor::getInstance()->setLayerVolume(layer, f/655.35);
|
||||
break;
|
||||
case VOLUME_FINE:
|
||||
f = ( ola->getValue(layer, VOLUME_COARSE) * 0x100 ) + value;
|
||||
AudioMotor::getInstance()->setLayerVolume(layer, f/65535);
|
||||
AudioMotor::getInstance()->setLayerVolume(layer, f/655.35);
|
||||
break;
|
||||
case PAN:
|
||||
f = (float)value / 255;
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
|
||||
#include "ui_libremediaserver-audio.h"
|
||||
|
||||
#define VERSION "LibreMediaServer-Audio Version 0.1.0"
|
||||
#define VERSION "Libre Media Server Audio 0.1.0"
|
||||
#define COPYRIGHT "(C) 2014 Santi Norena libremediaserver@gmail.com"
|
||||
#define LICENSE "GPL 3 License. See LICENSE.txt and credits.txt for details"
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>745</width>
|
||||
<height>636</height>
|
||||
<width>148</width>
|
||||
<height>95</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
@ -20,7 +20,7 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>745</width>
|
||||
<width>148</width>
|
||||
<height>29</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
|
|
@ -26,7 +26,7 @@ MediaLibrary::MediaLibrary(QObject *parent) :
|
|||
void MediaLibrary::initMediaLibrary() {
|
||||
QDir dir;
|
||||
if (!dir.cd(m_pathmedia)) {
|
||||
qWarning("olaInterface::initMediaLibrary| Can not cd to the path: ");
|
||||
qWarning("initMediaLibrary| Can not cd to the path: ");
|
||||
qWarning(m_pathmedia.toAscii().constData());
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue