Commit 81e86462 authored by jcaceres's avatar jcaceres
Browse files

remove dependency on window interface

parent 1b72489d
......@@ -14,54 +14,63 @@
#include <qlayout.h>
//#include <qwt_slider.h>
MainDialog::MainDialog (QWidget * parent, const char *name):
MainWindow (parent, name) // generated by designer
MainDialog::MainDialog (QWidget * parent, const char *name)//:
//MainWindow (parent, name) // generated by designer
{
// plot = new StripChart (plotFrame);
// plot->setAxisScale(0,0.0,0.1);
// plot->setAxisScale(1,0.0,0.1);
//plot->resize (300, 300);
//*********************************************
//Coment out to remove dependency of widget
/*
connect ((QObject *) goButton, SIGNAL (toggled (bool)),
SLOT (goThreads (bool)));
goButton->setChecked (false);
*/
//*********************************************
}
void
MainDialog::init(StreamBD *s)
{
//*********************************************
//Coment out to remove dependency of widget
QString tmp;
QTextOStream (&tmp) << "sampleRate " << s->args->sampleRate;
sampleRateTextLabel->setText (tmp); tmp = "";
//sampleRateTextLabel->setText (tmp); tmp = "";
QTextOStream (&tmp) << "netHarpStrings " << s->args->netHarpStrings;
netHarpStringsTextLabel->setText (tmp); tmp = "";
//netHarpStringsTextLabel->setText (tmp); tmp = "";
QTextOStream (&tmp) << "audioChannels " << s->args->audioChannels;
audioChannelsTextLabel->setText (tmp); tmp = "";
//audioChannelsTextLabel->setText (tmp); tmp = "";
QTextOStream (&tmp) << "runFifo " << s->args->runFifo;
runFifoTextLabel->setText (tmp); tmp = "";
//runFifoTextLabel->setText (tmp); tmp = "";
QTextOStream (&tmp) << "audioDeviceID " << s->args->audioDeviceID;
audioDeviceIDTextLabel->setText (tmp); tmp = "";
//audioDeviceIDTextLabel->setText (tmp); tmp = "";
QTextOStream (&tmp) << "netInQInPackets " << s->args->networkInputQueueLengthInPackets;
netInQInPacketsTextLabel->setText (tmp); tmp = "";
//netInQInPacketsTextLabel->setText (tmp); tmp = "";
QTextOStream (&tmp) << "redundancy " << s->args->redundancy;
redundancyTextLabel->setText (tmp); tmp = "";
//redundancyTextLabel->setText (tmp); tmp = "";
QTextOStream (&tmp) << "audioInQInAudioBufs " << s->args->audioInputQueueLengthInAudioBuffers;
audioInQInAudioBufsTextLabel->setText (tmp); tmp = "";
//audioInQInAudioBufsTextLabel->setText (tmp); tmp = "";
QTextOStream (&tmp) << "framesPerAudioBuffer " << s->args->framesPerAudioBuffer;
framesPerAudioBufferTextLabel->setText (tmp); tmp = "";
//framesPerAudioBufferTextLabel->setText (tmp); tmp = "";
QTextOStream (&tmp) << "networkPortOffset " << s->args->networkPortOffset;
networkPortOffsetTextLabel->setText (tmp); tmp = "";
//networkPortOffsetTextLabel->setText (tmp); tmp = "";
QTextOStream (&tmp) << "runMode " << s->args->runMode;
runModeTextLabel->setText (tmp); tmp = "";
//runModeTextLabel->setText (tmp); tmp = "";
QTextOStream (&tmp) << "secondsBetweenPlucks " << s->args->secondsBetweenPlucks;
secondsBetweenPlucksTextLabel->setText (tmp); tmp = "";
//secondsBetweenPlucksTextLabel->setText (tmp); tmp = "";
QTextOStream (&tmp) << "lowPassFilterCoeff " << s->args->lowPassFilterCoeff;
lowPassFilterCoeffTextLabel->setText (tmp); tmp = "";
//lowPassFilterCoeffTextLabel->setText (tmp); tmp = "";
QTextOStream (&tmp) << "delayIncBtwnStrings " << s->args->delayIncrementBetweenStrings;
delayIncBtwnStringsTextLabel->setText (tmp); tmp = "";
//delayIncBtwnStringsTextLabel->setText (tmp); tmp = "";
QTextOStream (&tmp) << "jack " << s->args->jack;
jackTextLabel->setText (tmp);
//jackTextLabel->setText (tmp);
//*********************************************
/* audioChannels
runFifo
......@@ -85,6 +94,8 @@ MainDialog::~MainDialog ()
{
}
//********JPC Coment out*************************************
/*
void
MainDialog::goThreads (bool go)
{
......@@ -99,16 +110,21 @@ MainDialog::goThreads (bool go)
}
}
void
MainDialog::addThread (QObject * t)
/* append thread to mythreads list */
// append thread to mythreads list
{
mythreads.append (t);
connect (this, SIGNAL (startThread ()), t, SLOT (go ()));
connect (this, SIGNAL (stopThread ()), t, SLOT (stop ()));
connect (this, SIGNAL (joinThread ()), t, SLOT (join ()));
//*********************************************
//Coment out to remove dependency of widget
//connect (this, SIGNAL (startThread ()), t, SLOT (go ()));
//connect (this, SIGNAL (stopThread ()), t, SLOT (stop ()));
//connect (this, SIGNAL (joinThread ()), t, SLOT (join ()));
//*********************************************
}
void
MainDialog::closeEvent (QCloseEvent * e)
{
......@@ -122,7 +138,7 @@ MainDialog::closeEvent (QCloseEvent * e)
void
MainDialog::customEvent (QCustomEvent * e)
{
if (e->type () == QEvent::User + 117)
if (e->type () == QEvent::User + 117)
{
ThreadCommEvent *ce = (ThreadCommEvent *) e;
//if (ce->val0 () > 0.0) plot->setV1 (ce->val0 ());
......@@ -130,3 +146,4 @@ MainDialog::customEvent (QCustomEvent * e)
//if (ce->val1 () > 0.0) plot->setV2 (ce->val1 ());
}
}
*/
......@@ -6,7 +6,7 @@
#ifndef _MAINDIALOG_H_
#define _MAINDIALOG_H_
#include "../src/ui/MainWindow.h"
//#include "../src/ui/MainWindow.h"
#include "qptrlist.h"
#include "qthread.h"
#include "qstring.h"
......@@ -14,21 +14,26 @@
#include "StreamBD.h"
//#include "StripChart.h"
class MainDialog:public MainWindow
class MainDialog//:public MainWindow
{
Q_OBJECT public:
//Q_OBJECT public://********JPC Coment out*************************************
public:
MainDialog (QWidget * parent = 0, const char *name = 0);
virtual ~ MainDialog ();
void init(StreamBD *s);
//StripChart *plot;
virtual void closeEvent (QCloseEvent * e);
void customEvent (QCustomEvent * e);
//virtual void closeEvent (QCloseEvent * e);//********JPC Coment out*************************************
//void customEvent (QCustomEvent * e);//********JPC Coment out*************************************
//********JPC Coment out*************************************
/*
void addThread (QObject * t);
QPtrList < QObject > mythreads;
public slots:void goThreads (bool);
signals:void startThread ();
void stopThread ();
void joinThread ();
*/
};
......
......@@ -51,8 +51,8 @@ main (int argc, char **argv)
if (s.ParseCommandLine (argc, argv) == 0)
return 0;
MainDialog m;
a.setMainWidget (&m);
if (s.args->gui) m.show ();
//a.setMainWidget (&m);
//if (s.args->gui) m.show ();
m.init (&s);
a.processEvents ();
return a.exec ();
......
<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
<class>MainWindow</class>
<widget class="QMainWindow">
<property name="name">
<cstring>MainWindow</cstring>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>619</width>
<height>531</height>
</rect>
</property>
<property name="caption">
<string>Clapper Experiment</string>
</property>
<property name="focusPolicy">
<enum>StrongFocus</enum>
</property>
<widget class="QFrame">
<property name="name">
<cstring>frame4</cstring>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>10</y>
<width>410</width>
<height>120</height>
</rect>
</property>
<property name="frameShape">
<enum>StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>Raised</enum>
</property>
<widget class="QGroupBox">
<property name="name">
<cstring>groupBox2_2</cstring>
</property>
<property name="geometry">
<rect>
<x>10</x>
<y>20</y>
<width>190</width>
<height>60</height>
</rect>
</property>
<property name="title">
<string>Directory for files</string>
</property>
<widget class="QLineEdit">
<property name="name">
<cstring>dirLineEdit</cstring>
</property>
<property name="geometry">
<rect>
<x>10</x>
<y>30</y>
<width>170</width>
<height>23</height>
</rect>
</property>
<property name="focusPolicy">
<enum>ClickFocus</enum>
</property>
<property name="text">
<string>/zap/trials</string>
</property>
</widget>
</widget>
<widget class="QLabel">
<property name="name">
<cstring>fullpathTextLabel</cstring>
</property>
<property name="geometry">
<rect>
<x>140</x>
<y>90</y>
<width>250</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>.wav</string>
</property>
</widget>
<widget class="QLabel">
<property name="name">
<cstring>textLabel1</cstring>
</property>
<property name="geometry">
<rect>
<x>220</x>
<y>10</y>
<width>160</width>
<height>94</height>
</rect>
</property>
<property name="text">
<string>Start jack first with
qjackctl &amp;
and make the buffersize
and sample rate match
</string>
</property>
</widget>
</widget>
<widget class="QGroupBox">
<property name="name">
<cstring>groupBox2</cstring>
</property>
<property name="geometry">
<rect>
<x>30</x>
<y>140</y>
<width>210</width>
<height>330</height>
</rect>
</property>
<property name="title">
<string>settings</string>
</property>
<widget class="QLabel">
<property name="name">
<cstring>sampleRateTextLabel</cstring>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>21</y>
<width>160</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>sampleRate</string>
</property>
</widget>
<widget class="QLabel">
<property name="name">
<cstring>netHarpStringsTextLabel</cstring>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>40</y>
<width>160</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>netHarpStrings</string>
</property>
</widget>
<widget class="QLabel">
<property name="name">
<cstring>audioInQInAudioBufsTextLabel</cstring>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>140</y>
<width>160</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>audioInQInAudioBufs</string>
</property>
</widget>
<widget class="QLabel">
<property name="name">
<cstring>framesPerAudioBufferTextLabel</cstring>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>160</y>
<width>160</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>framesPerAudioBuffer</string>
</property>
</widget>
<widget class="QLabel">
<property name="name">
<cstring>networkPortOffsetTextLabel</cstring>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>180</y>
<width>160</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>networkPortOffset</string>
</property>
</widget>
<widget class="QLabel">
<property name="name">
<cstring>runModeTextLabel</cstring>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>200</y>
<width>160</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>runMode</string>
</property>
</widget>
<widget class="QLabel">
<property name="name">
<cstring>secondsBetweenPlucksTextLabel</cstring>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>220</y>
<width>160</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>secondsBetweenPlucks</string>
</property>
</widget>
<widget class="QLabel">
<property name="name">
<cstring>lowPassFilterCoeffTextLabel</cstring>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>240</y>
<width>160</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>lowpassFilterCoeff</string>
</property>
</widget>
<widget class="QLabel">
<property name="name">
<cstring>delayIncBtwnStringsTextLabel</cstring>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>260</y>
<width>160</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>delayIncBtwnStrings</string>
</property>
</widget>
<widget class="QLabel">
<property name="name">
<cstring>audioChannelsTextLabel</cstring>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>60</y>
<width>160</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>audioChannels</string>
</property>
</widget>
<widget class="QLabel">
<property name="name">
<cstring>runFifoTextLabel</cstring>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>80</y>
<width>160</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>runFifo</string>
</property>
</widget>
<widget class="QLabel">
<property name="name">
<cstring>audioDeviceIDTextLabel</cstring>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>100</y>
<width>160</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>audioDeviceID</string>
</property>
</widget>
<widget class="QLabel">
<property name="name">
<cstring>jackTextLabel</cstring>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>280</y>
<width>160</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>jack</string>
</property>
</widget>
<widget class="QLabel">
<property name="name">
<cstring>netInQInPacketsTextLabel</cstring>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>120</y>
<width>160</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>netInQInPackets</string>
</property>
</widget>
<widget class="QLabel">
<property name="name">
<cstring>redundancyTextLabel</cstring>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>300</y>
<width>160</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>redundancy</string>
</property>
</widget>
</widget>
<widget class="QFrame">
<property name="name">
<cstring>plotFrame</cstring>
</property>
<property name="geometry">
<rect>
<x>250</x>
<y>149</y>
<width>361</width>
<height>321</height>
</rect>
</property>
<property name="frameShape">
<enum>StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>Raised</enum>
</property>
</widget>
<widget class="QRadioButton">
<property name="name">
<cstring>goButton</cstring>
</property>
<property name="geometry">
<rect>
<x>450</x>
<y>39</y>
<width>104</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>running</string>
</property>
</widget>
</widget>
<menubar>
<property name="name">
<cstring>menubar</cstring>
</property>
<item text="&amp;Session" name="fileMenu">
<separator/>
<separator/>
<action name="fileExitAction"/>
</item>
</menubar>
<toolbars>
</toolbars>
<actions>
<action>
<property name="name">
<cstring>fileNewAction</cstring>
</property>
<property name="iconSet">
<iconset>image0</iconset>
</property>
<property name="text">
<string>New</string>
</property>
<property name="menuText">
<string>&amp;New</string>
</property>
<property name="accel">
<string>Ctrl+N</string>
</property>
</action>
<action>
<property name="name">
<cstring>fileOpenAction</cstring>
</property>
<property name="iconSet">
<iconset>image1</iconset>
</property>
<property name="text">
<string>Open</string>
</property>
<property name="menuText">
<string>&amp;Open...</string>
</property>
<property name="accel">
<string>Ctrl+O</string>