panic resotre buttons. copy/cut/paste connects. Load systems settings,
if not, default xml file, if not, generate a generic conf (2 layers, no dmx, path ../media, two audiodevices)
This commit is contained in:
parent
46b7624fb5
commit
eed68d1817
14 changed files with 124 additions and 41 deletions
|
@ -1,8 +0,0 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<lmsAudio ui="1" layersNumber="4" path="../media/sound" >
|
||||
<audioDevice devicesNumber="2" id0="3" id1="4"/>
|
||||
<layer id="0" dmx="1" universe="1" audioDevice="0" />
|
||||
<layer id="1" dmx="17" universe="1" audioDevice="0" />
|
||||
<layer id="2" dmx="33" universe="1" audioDevice="1" />
|
||||
<layer id="3" dmx="49" universe="1" audioDevice="1"/>
|
||||
</lmsAudio>
|
8
docs/lms-audio.xml
Normal file
8
docs/lms-audio.xml
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<lmsAudio ui="1" dmxActive="0" showPlayerActive="1" layersNumber="4" path="../media/sound" >
|
||||
<audioDevice devicesNumber="2" id0="4" id1="3"/>
|
||||
<layer id="0" dmx="1" universe="1" audioDevice="0" />
|
||||
<layer id="1" dmx="26" universe="1" audioDevice="0" />
|
||||
<layer id="2" dmx="51" universe="1" audioDevice="1" />
|
||||
<layer id="3" dmx="76" universe="1" audioDevice="1"/>
|
||||
</lmsAudio>
|
|
@ -42,3 +42,8 @@ v 0.3.0
|
|||
- ampliar writer para recibir un número n de entradas y escribirlas cada una en un buffer
|
||||
- aislar miniaudio del callback dmx tal como hemos hecho con la Ui, al menos las operaciones lentas como cargar medios.
|
||||
- en load media usar un fence para actualizar mediaLoaded.
|
||||
- Video
|
||||
|
||||
v 0.2.1 showplayer
|
||||
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
<file>resources/save_button.png</file>
|
||||
<file>resources/icon.png</file>
|
||||
<file>resources/panic_button.jpg</file>
|
||||
<file>resources/go_button.jpeg</file>
|
||||
<file>resources/go_button.jpeg</file>
|
||||
<file>resources/restore_button.jpg</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
BIN
resources/icon.png
Normal file
BIN
resources/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 35 KiB |
BIN
resources/panic_button.jpg
Normal file
BIN
resources/panic_button.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 35 KiB |
BIN
resources/restore_button.jpg
Normal file
BIN
resources/restore_button.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 80 KiB |
|
@ -708,8 +708,23 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QLabel" name="multiLabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>MultiCue</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QCheckBox" name="multi">
|
||||
<widget class="QRadioButton" name="multi">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
|
@ -727,7 +742,7 @@
|
|||
<string><html><head/><body><p>PLay next cue at same time this cue, do not wait to finish the cue.</p></body></html></string>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::RightToLeft</enum>
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
|
@ -744,21 +759,6 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QLabel" name="multiLabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>MultiCue</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#define VERSION "LibreMediaServerAudio v0.2.0 Antigona"
|
||||
#define COPYRIGHT "(C) 2014-2024 Santi Noreña <lms@criptomart.net>"
|
||||
#define LICENSE "GPL3 Licensed. See LICENSE.txt."
|
||||
#define DEFAULT_FILE "lms-audio.xlm"
|
||||
#define DEFAULT_FILE "lms-audio.xml"
|
||||
#define MAX_LAYERS 4
|
||||
#define MAX_AUDIODEVICES 8
|
||||
#define FORMAT ma_format_f32 /* Must always be f32. */
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
libreMediaServerAudio::libreMediaServerAudio()
|
||||
{
|
||||
m_settings = Settings::getInstance(this);
|
||||
m_settings->readFile();
|
||||
//m_settings->readFile();
|
||||
m_ui = m_settings->getShowUi();
|
||||
m_layersQty = m_settings->getLayersNumber();
|
||||
for (uint i = 0; i < m_layersQty; i++) {
|
||||
|
@ -74,7 +74,7 @@ libreMediaServerAudio::~libreMediaServerAudio()
|
|||
Settings::getInstance()->setValue("showPlayerSize", m_lmsUi->m_showPlayer->size());
|
||||
Settings::getInstance()->setValue("showPlayerGeometry", m_lmsUi->m_showPlayer->saveGeometry());
|
||||
Settings::getInstance()->endGroup();
|
||||
m_settings->settingsSaver();
|
||||
//m_settings->settingsSaver();
|
||||
if (m_settings->getShowPlayerActive())
|
||||
m_lmsUi->m_showPlayer->saveCueTrackList("lastshow.xml");
|
||||
delete m_lmsUi;
|
||||
|
@ -356,6 +356,7 @@ void libreMediaServerAudio::uiSliderChanged(int layer, Slider s, int value)
|
|||
m_updateUi[layer][2] = value;
|
||||
break;
|
||||
case Slider::Bypass:
|
||||
// ToDo: sigsev when no dmx, resolve this whitout dmxSettings, is it needed=
|
||||
m_mae.setBypass(m_dmxSettings.at(layer).audioDevice, layer, value);
|
||||
break;
|
||||
case Slider::Bus1:
|
||||
|
|
|
@ -19,7 +19,31 @@ Settings::Settings(QObject *parent) :
|
|||
m_audioDeviceQty = 0;
|
||||
for (uint i = 0; i < MAX_AUDIODEVICES; i++)
|
||||
m_audioDeviceId[i] = -1;
|
||||
settingsLoader();
|
||||
if (QFile::exists(fileName()))
|
||||
settingsLoader();
|
||||
else if (QFile::exists(DEFAULT_FILE))
|
||||
readFromFile(DEFAULT_FILE);
|
||||
else {
|
||||
qDebug() << "Can not read initial settings, making some standard";
|
||||
setValue("lmsAudio/ui", 1);
|
||||
setValue("lmsAudio/dmxActive", 0);
|
||||
setValue("lmsAudio/showPlayerActive", 1);
|
||||
setValue("lmsAudio/layersNumber", 2);
|
||||
setValue("lmsAudio/path", "../media/");
|
||||
setValue("audioDevice/devicesNumber", 2);
|
||||
setValue("audioDevice/id0", 4);
|
||||
setValue("audioDevice/id1", 3);
|
||||
setValue("layers/layer0/dmx", 1);
|
||||
setValue("layers/layer0/universe", 1);
|
||||
setValue("layers/layer0/id", 0);
|
||||
setValue("layers/layer0/audioDevice", 0);
|
||||
setValue("layers/layer1/dmx", 26);
|
||||
setValue("layers/layer1/universe", 1);
|
||||
setValue("layers/layer1/id", 1);
|
||||
setValue("layers/layer1/audioDevice", 0);
|
||||
sync();
|
||||
settingsLoader();
|
||||
}
|
||||
}
|
||||
|
||||
Settings::~Settings() {
|
||||
|
@ -99,9 +123,8 @@ void Settings::readFromFile(QString file) {
|
|||
QMessageBox::critical(NULL,"Load XML File Problem",
|
||||
QString("Couldn't open %1 to load settings").arg(file),
|
||||
QMessageBox::Ok);
|
||||
// Instead exit give the oportunity to load another file or define the settings
|
||||
qCritical("Load XML File Problem");
|
||||
exit(1);
|
||||
qCritical("Load XML File Problem");
|
||||
return;
|
||||
}
|
||||
QXmlStreamReader* xmlReader = new QXmlStreamReader(xmlFile);
|
||||
while(!xmlReader->atEnd() && !xmlReader->hasError()) {
|
||||
|
|
|
@ -13,7 +13,12 @@ ShowPlayer::ShowPlayer(QWidget *parent) :
|
|||
connect(ui->LoadCueList, SIGNAL(clicked()), this, SLOT(loadCueTrackList()));
|
||||
connect(ui->goButton, SIGNAL(clicked()), this, SLOT(go()));
|
||||
connect(ui->cueListWidget, SIGNAL(changeSelectedIndex(int)), this, SLOT(updateIndex(int)));
|
||||
currentStatus = Status::Iddle;
|
||||
connect(ui->panicButton, SIGNAL(clicked()), this, SLOT(panicButtonClicked()));
|
||||
connect(ui->restoreButton, SIGNAL(clicked()), this, SLOT(restoreButtonClicked()));
|
||||
connect(ui->CopyCue, SIGNAL(clicked()), ui->cueListWidget, SLOT(copyCueTrack()));
|
||||
connect(ui->PasteCue, SIGNAL(clicked()), ui->cueListWidget, SLOT(pasteCueTrack()));
|
||||
connect(ui->CutCue, SIGNAL(clicked()), ui->cueListWidget, SLOT(cutCueTrack()));
|
||||
currentStatus = Status::Iddle;
|
||||
for(int i = 0; i < MAX_LAYERS; i++) {
|
||||
layersUsed[i] = -1;
|
||||
cueTrackWidgetPlaying[i] = nullptr;
|
||||
|
@ -120,12 +125,12 @@ void ShowPlayer::cueTrackAtEnd(int layer)
|
|||
|
||||
void ShowPlayer::cueFinished(int c)
|
||||
{
|
||||
if (!current[c])
|
||||
return;
|
||||
if (!current[c]->stopAtEnd)
|
||||
if (!current[c])
|
||||
return;
|
||||
if (!current[c]->stopAtEnd)
|
||||
this->go();
|
||||
if (current[c]->status == Status::Stopped || current[c]->status == Status::Paused)
|
||||
cueTrackAtEnd(c);
|
||||
if (current[c]->status == Status::Stopped || current[c]->status == Status::Paused)
|
||||
cueTrackAtEnd(c);
|
||||
}
|
||||
|
||||
CueTrackWidget *ShowPlayer::addCueTrackWidget(CueTrack* track) {
|
||||
|
@ -178,4 +183,28 @@ void ShowPlayer::loadCueTrackList(QString path) {
|
|||
|
||||
void ShowPlayer::saveCueTrackList(QString path) {
|
||||
ui->cueListWidget->saveCueTrackList(path.toStdString());
|
||||
}
|
||||
}
|
||||
|
||||
void ShowPlayer::panicButtonClicked() {
|
||||
for (int i = 0; i < MAX_LAYERS; i++) {
|
||||
if (layersUsed[i] != -1) {
|
||||
CueTrack* track = current[i];
|
||||
if (track && track->active) {
|
||||
emit uiSliderChanged(track->audioLayer, Slider::Volume, 0);
|
||||
emit uiPlaybackChanged(track->audioLayer, Status::Paused);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ShowPlayer::restoreButtonClicked() {
|
||||
for (int i = 0; i < MAX_LAYERS; i++) {
|
||||
if (layersUsed[i] != -1) {
|
||||
CueTrack* track = current[i];
|
||||
if (track) {
|
||||
emit uiSliderChangedFaded(track->audioLayer, Slider::Volume, track->volume * 655.35, track->fadeIn, track->fadeOut);
|
||||
emit uiPlaybackChanged(track->audioLayer, track->status);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ private:
|
|||
CueTrack *prevCue[MAX_LAYERS];
|
||||
CueTrackWidget *cueTrackWidgetPlaying[MAX_LAYERS];
|
||||
CueTrackWidget *addCueTrackWidget(CueTrack *track);
|
||||
std::map<int, std::pair<Status, double>> prePanicState;
|
||||
|
||||
private slots:
|
||||
void updateTrackStateInEngine(CueTrack *track);
|
||||
|
@ -53,6 +54,8 @@ private slots:
|
|||
void goAction(int channel);
|
||||
void updateIndex(int index);
|
||||
void fade(Slider s, int start, CueTrack *track);
|
||||
void panicButtonClicked();
|
||||
void restoreButtonClicked();
|
||||
|
||||
signals:
|
||||
void uiPlaybackChanged(int layer, Status s);
|
||||
|
|
|
@ -286,6 +286,9 @@
|
|||
<property name="focusPolicy">
|
||||
<enum>Qt::ClickFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Panic!</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
|
@ -295,7 +298,7 @@
|
|||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>96</width>
|
||||
<width>120</width>
|
||||
<height>120</height>
|
||||
</size>
|
||||
</property>
|
||||
|
@ -303,6 +306,24 @@
|
|||
<string>P</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="restoreButton">
|
||||
<property name="toolTip">
|
||||
<string>Restore</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../lms-resources.qrc">
|
||||
<normaloff>:/buttons/resources/restore_button.jpg</normaloff>:/buttons/resources/restore_button.jpg</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>120</width>
|
||||
<height>120</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QSplitter" name="splitter">
|
||||
<property name="orientation">
|
||||
|
|
Loading…
Add table
Reference in a new issue