Fixed sigsev on PD restart.
Fixed pan bug on pd patch
This commit is contained in:
parent
5cfd9f7a10
commit
a45234bc68
2 changed files with 57 additions and 57 deletions
|
@ -1,18 +1,16 @@
|
|||
#N canvas 461 143 904 466 10;
|
||||
#N canvas 762 152 547 527 audio_player 1;
|
||||
#N canvas 459 153 904 466 10;
|
||||
#N canvas 818 90 547 469 audio_player 0;
|
||||
#X msg 203 93 start;
|
||||
#X msg 259 95 stop;
|
||||
#X obj 119 140 oggread~;
|
||||
#X msg 301 92 resume;
|
||||
#X obj 22 9 inlet;
|
||||
#X obj 219 10 r \$0-c5;
|
||||
#X obj 219 31 r \$0-c5;
|
||||
#X obj 77 213 *~ 0;
|
||||
#X obj 136 213 *~ 0;
|
||||
#X obj 158 450 dac~;
|
||||
#X obj 382 129 r \$0-c1;
|
||||
#X obj 211 234 r \$0-c2;
|
||||
#X text 208 155 Volumen;
|
||||
#X text 266 233 Pan;
|
||||
#X obj 219 71 select 0 1 2;
|
||||
#X msg 119 101 seek \$1;
|
||||
#X obj 119 36 r \$0-c8;
|
||||
|
@ -27,48 +25,49 @@
|
|||
#X obj 333 386 outlet;
|
||||
#X obj 333 347 int;
|
||||
#X obj 335 305 * 100;
|
||||
#X obj 117 297 1 - \$1;
|
||||
#X msg 236 308 0.5;
|
||||
#X obj 238 274 loadbang;
|
||||
#X obj 383 157 dbtorms;
|
||||
#X floatatom 423 207 5 0 0 0 - - -;
|
||||
#X floatatom 385 259 5 0 0 0 - - -;
|
||||
#X obj 117 297 - 1;
|
||||
#X text 208 155;
|
||||
#X connect 0 0 2 0;
|
||||
#X connect 1 0 2 0;
|
||||
#X connect 2 0 6 0;
|
||||
#X connect 2 1 7 0;
|
||||
#X connect 2 2 23 0;
|
||||
#X connect 2 2 21 0;
|
||||
#X connect 3 0 2 0;
|
||||
#X connect 4 0 2 0;
|
||||
#X connect 5 0 13 0;
|
||||
#X connect 6 0 22 0;
|
||||
#X connect 7 0 21 0;
|
||||
#X connect 9 0 30 0;
|
||||
#X connect 9 0 31 0;
|
||||
#X connect 10 0 18 0;
|
||||
#X connect 10 0 27 0;
|
||||
#X connect 13 0 0 0;
|
||||
#X connect 13 1 1 0;
|
||||
#X connect 13 2 3 0;
|
||||
#X connect 14 0 2 0;
|
||||
#X connect 15 0 16 0;
|
||||
#X connect 16 0 14 0;
|
||||
#X connect 17 0 21 1;
|
||||
#X connect 5 0 11 0;
|
||||
#X connect 6 0 20 0;
|
||||
#X connect 7 0 19 0;
|
||||
#X connect 9 0 27 0;
|
||||
#X connect 9 0 28 0;
|
||||
#X connect 10 0 16 0;
|
||||
#X connect 10 0 30 0;
|
||||
#X connect 11 0 0 0;
|
||||
#X connect 11 1 1 0;
|
||||
#X connect 11 2 3 0;
|
||||
#X connect 12 0 2 0;
|
||||
#X connect 13 0 14 0;
|
||||
#X connect 14 0 12 0;
|
||||
#X connect 15 0 19 1;
|
||||
#X connect 16 0 15 0;
|
||||
#X connect 17 0 20 1;
|
||||
#X connect 18 0 17 0;
|
||||
#X connect 19 0 22 1;
|
||||
#X connect 20 0 19 0;
|
||||
#X connect 21 0 8 1;
|
||||
#X connect 22 0 8 0;
|
||||
#X connect 25 0 24 0;
|
||||
#X connect 19 0 8 1;
|
||||
#X connect 20 0 8 0;
|
||||
#X connect 23 0 22 0;
|
||||
#X connect 24 0 23 0;
|
||||
#X connect 25 0 16 0;
|
||||
#X connect 25 0 30 0;
|
||||
#X connect 26 0 25 0;
|
||||
#X connect 27 0 20 0;
|
||||
#X connect 28 0 18 0;
|
||||
#X connect 28 0 27 0;
|
||||
#X connect 29 0 28 0;
|
||||
#X connect 30 0 7 1;
|
||||
#X connect 30 0 6 1;
|
||||
#X connect 30 0 26 0;
|
||||
#X connect 30 0 32 0;
|
||||
#X connect 27 0 7 1;
|
||||
#X connect 27 0 6 1;
|
||||
#X connect 27 0 24 0;
|
||||
#X connect 27 0 29 0;
|
||||
#X connect 30 0 18 0;
|
||||
#X restore 219 -234 pd audio_player;
|
||||
#X obj 19 -18 s \$0-c1;
|
||||
#X obj 79 -19 s \$0-c2;
|
||||
|
|
|
@ -26,19 +26,6 @@ AudioMotor::AudioMotor(QObject *parent) :
|
|||
m_gui(true)
|
||||
{
|
||||
qsrand(qrand());
|
||||
qDebug() << "Init MotorAudio";
|
||||
}
|
||||
|
||||
AudioMotor::~AudioMotor()
|
||||
{
|
||||
close();
|
||||
}
|
||||
|
||||
|
||||
/** Init the engine
|
||||
*/
|
||||
bool AudioMotor::init()
|
||||
{
|
||||
/* Sets the socket an connections for the comunication with PD
|
||||
QFile socket(SOCKET);
|
||||
if (socket.exists())
|
||||
|
@ -70,7 +57,19 @@ bool AudioMotor::init()
|
|||
|
||||
connect(m_pd_audio, SIGNAL(readyReadStandardError()), this, SLOT(stdout()));
|
||||
connect(m_pd_audio, SIGNAL(finished(int)), this, SLOT(restartAudio()));
|
||||
qDebug() << "Init MotorAudio";
|
||||
}
|
||||
|
||||
AudioMotor::~AudioMotor()
|
||||
{
|
||||
close();
|
||||
}
|
||||
|
||||
|
||||
/** Init the engine
|
||||
*/
|
||||
bool AudioMotor::init()
|
||||
{
|
||||
QString arguments;
|
||||
// arguments.append("./puredata/pd -alsa -channels 2 -audiodev 1 -stderr -nostdpath -path ./puredata/externals/ -open ./puredata/lms-audio.pd ");
|
||||
arguments.append("./puredata/pd -channels 2 -stderr -nostdpath -path ./puredata/externals/ -open ./puredata/lms-audio.pd ");
|
||||
|
@ -95,27 +94,27 @@ bool AudioMotor::init()
|
|||
*/
|
||||
bool AudioMotor::close()
|
||||
{
|
||||
disconnect(m_pd_audio, SIGNAL(readyReadStandardError()), this, SLOT(stdout()));
|
||||
// disconnect(m_pd_audio, SIGNAL(readyReadStandardError()), this, SLOT(stdout()));
|
||||
disconnect(m_pd_audio, SIGNAL(finished(int)), this, SLOT(restartAudio()));
|
||||
m_pd_audio->terminate();
|
||||
m_pd_audio->waitForFinished(1000);
|
||||
delete m_pd_audio;
|
||||
m_pd_audio = NULL;
|
||||
// m_pd_audio->terminate();
|
||||
m_pd_audio->waitForFinished(3000);
|
||||
// delete m_pd_audio;
|
||||
// m_pd_audio = NULL;
|
||||
if (m_writePD != NULL)
|
||||
{
|
||||
disconnect(m_writePD, SIGNAL(connected()),this, SLOT(newConexion()));
|
||||
m_writePD->close();
|
||||
delete m_writePD;
|
||||
m_writePD = NULL;
|
||||
// delete m_writePD;
|
||||
// m_writePD = NULL;
|
||||
}
|
||||
if (m_readPD != NULL)
|
||||
/* if (m_readPD != NULL)
|
||||
{
|
||||
disconnect(m_readPD, SIGNAL(newConnection()),this, SLOT(newPeer()));
|
||||
m_readPD->close();
|
||||
delete m_readPD;
|
||||
m_readPD = NULL;
|
||||
}
|
||||
/*
|
||||
|
||||
QFile socket(SOCKET);
|
||||
if (socket.exists())
|
||||
{
|
||||
|
@ -313,8 +312,10 @@ void AudioMotor::parse(QString message)
|
|||
emit toTerminal("AudioMotor::newMessage() Loadbang from PD Audio received");
|
||||
// Conectamos a Pure Data para escribir
|
||||
m_writePD->connectToHost(QHostAddress::LocalHost, SOCKET, QIODevice::WriteOnly);
|
||||
if (m_writePD->waitForConnected(30000))
|
||||
if (m_writePD->waitForConnected(30000)) {
|
||||
emit loadbang();
|
||||
connect(m_pd_audio, SIGNAL(finished(int)), this, SLOT(restartAudio()));
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
if (list.at(i).at(2).digitValue() == 0) {
|
||||
|
|
Loading…
Add table
Reference in a new issue