File kalsatools-1.5.0_gcc4.patch of Package kalsatools
Index: kaconnect-1.1.1/connector.h
===================================================================
--- kaconnect-1.1.1/connector.h.orig
+++ kaconnect-1.1.1/connector.h
@@ -13,7 +13,7 @@
class ConnectorWidget : public QWidget {
Q_OBJECT
-
+
private:
snd_seq_t *seq;
PortListBox *r_portlist;
@@ -21,18 +21,18 @@
bool connected[PORTLISTBOX_MAX_PORTS][PORTLISTBOX_MAX_PORTS];
private:
- void arrow(int x1, int y1, int x2, int y2);
-
+ void arrow(int x1, int y1, int x2, int y2);
+
public:
- ConnectorWidget::ConnectorWidget(QWidget *parent, snd_seq_t *pseq);
+ ConnectorWidget(QWidget *parent, snd_seq_t *pseq);
void set_r_listBox(PortListBox *p_r_portlist);
void set_w_listBox(PortListBox *p_w_portlist);
-
+
protected:
void paintEvent(QPaintEvent *);
signals:
- void isEqual(bool equal);
+ void isEqual(bool equal);
public slots:
void move(int x, int y);
Index: kaconnect-1.1.1/alsa_access.h
===================================================================
--- kaconnect-1.1.1/alsa_access.h.orig
+++ kaconnect-1.1.1/alsa_access.h
@@ -8,17 +8,16 @@
{
Q_OBJECT
-public:
+public:
snd_seq_t *seq;
-
+
public:
AlsaHandle(QObject *parent=0, const char *name=0);
~AlsaHandle();
-
+
public slots:
void alsaAnnounce(int);
};
#endif
-
-
\ No newline at end of file
+
Index: kaconnect-1.1.1/connector.cpp
===================================================================
--- kaconnect-1.1.1/connector.cpp.orig
+++ kaconnect-1.1.1/connector.cpp
@@ -96,7 +96,7 @@
void ConnectorWidget::updateConnector(int n) {
- int l1, l2;
+ unsigned int l1, l2;
snd_seq_query_subscribe_t *subs;
snd_seq_addr_t tmp_addr;
Index: kaconnect-1.1.1/portlistbox.cpp
===================================================================
--- kaconnect-1.1.1/portlistbox.cpp.orig
+++ kaconnect-1.1.1/portlistbox.cpp
@@ -11,19 +11,19 @@
updateList(0);
}
-int PortListBox::check_permission(snd_seq_port_info_t *pinfo, int perm) {
+int PortListBox::check_permission(snd_seq_port_info_t *pinfo, unsigned int perm) {
if (((snd_seq_port_info_get_capability(pinfo) & perm) == perm) &&
! (snd_seq_port_info_get_capability(pinfo) & SND_SEQ_PORT_CAP_NO_EXPORT))
return 1;
return 0;
}
-void PortListBox::list_ports(int perm) {
+void PortListBox::list_ports(unsigned int perm) {
snd_seq_client_info_t *cinfo;
snd_seq_port_info_t *pinfo;
char s[1024];
- int index, l1;
+ unsigned int index, l1;
selected_port = ((index = currentItem()) >= 0) ? port(index) : -1;
selected_client = (index >= 0) ? client(index) : -1;
Index: kaconnect-1.1.1/portlistbox.h
===================================================================
--- kaconnect-1.1.1/portlistbox.h.orig
+++ kaconnect-1.1.1/portlistbox.h
@@ -16,8 +16,8 @@
int selected_port, selected_client;
private:
- int check_permission(snd_seq_port_info_t *pinfo, int perm);
- void list_ports(int perm);
+ int check_permission(snd_seq_port_info_t *pinfo, unsigned int perm);
+ void list_ports(unsigned int perm);
public:
PortListBox(QWidget *parent, snd_seq_t *pseq, int preadflag);
Index: kwaveview-1.1.4/audiodata.h
===================================================================
--- kwaveview-1.1.4/audiodata.h.orig
+++ kwaveview-1.1.4/audiodata.h
@@ -5,7 +5,7 @@
#include <stdlib.h>
#include <qobject.h>
#include <qthread.h>
-#include <sys/asoundlib.h>
+#include <alsa/asoundlib.h>
#define DEFAULT_RATE 44100
#define DEFAULT_PERIODSIZE 16384
@@ -28,7 +28,7 @@
int min, max;
snd_pcm_t *pcm_capture_handle;
bool doCapture;
-
+
public:
AudioData(int p_bufsize);
~AudioData();
@@ -37,6 +37,6 @@
int setRate(int p_rate);
int setChannels(int p_channels);
};
-
+
#endif
-
\ No newline at end of file
+
Index: kwaveview-1.1.4/capture.h
===================================================================
--- kwaveview-1.1.4/capture.h.orig
+++ kwaveview-1.1.4/capture.h
@@ -6,19 +6,18 @@
#include <unistd.h>
#include <qobject.h>
#include <qthread.h>
-#include <sys/asoundlib.h>
#include "audiodata.h"
class Capture : public QThread
{
private:
AudioData *adata;
-
+
public:
Capture(AudioData *p_adata);
~Capture();
- virtual void run();
+ virtual void run();
};
-
+
#endif
-
\ No newline at end of file
+
Index: kwaveview-1.1.4/capture.cpp
===================================================================
--- kwaveview-1.1.4/capture.cpp.orig
+++ kwaveview-1.1.4/capture.cpp
@@ -3,7 +3,6 @@
#include <unistd.h>
#include <sys/mman.h>
#include <qsignal.h>
-#include "audiodata.h"
#include "capture.h"
Capture::Capture(AudioData *p_adata){
@@ -11,7 +10,7 @@
adata = p_adata;
}
-Capture::~Capture(){
+Capture::~Capture(){
}
@@ -42,5 +41,5 @@
if (adata->writeofs >= adata->bufsize) {
adata->writeofs = 0;
}
- }
+ }
}
Index: kwaveview-1.1.4/kwaveview.cpp
===================================================================
--- kwaveview-1.1.4/kwaveview.cpp.orig
+++ kwaveview-1.1.4/kwaveview.cpp
@@ -9,8 +9,6 @@
#include <qvbox.h>
#include <qmessagebox.h>
#include <qsocketnotifier.h>
-#include <sys/asoundlib.h>
-#include "audiodata.h"
#include "capture.h"
#include "scope.h"
#include "spectrum.h"
Index: kwaveview-1.1.4/scope.cpp
===================================================================
--- kwaveview-1.1.4/scope.cpp.orig
+++ kwaveview-1.1.4/scope.cpp
@@ -15,7 +15,6 @@
#include <qhbuttongroup.h>
#include <qgroupbox.h>
#include <qpushbutton.h>
-#include <sys/asoundlib.h>
#include "audiodata.h"
#include "scope.h"
Index: kwaveview-1.1.4/scope.h
===================================================================
--- kwaveview-1.1.4/scope.h.orig
+++ kwaveview-1.1.4/scope.h
@@ -6,8 +6,8 @@
#include <unistd.h>
#include <qwidget.h>
#include <qstring.h>
-#include <qslider.h>
-#include <qcheckbox.h>
+#include <qslider.h>
+#include <qcheckbox.h>
#include <qlabel.h>
#include <qvbox.h>
#include <qhbox.h>
@@ -17,8 +17,6 @@
#include <qradiobutton.h>
#include <qpushbutton.h>
#include <qtimer.h>
-#include <sys/asoundlib.h>
-#include "audiodata.h"
#include "scopescreen.h"
#define SCOPE_BORDER 5
@@ -41,19 +39,19 @@
QPushButton *triggerButton;
QSlider *timeScaleSlider, *zoomSlider, *triggerSlider;
QTimer *timer;
-
- public:
+
+ public:
ScopeScreen *scopeScreen;
private:
void initControls();
-
+
public:
Scope(QWidget* parent=0, const char *name=0, AudioData *p_adata=0);
~Scope();
void startScope(bool run);
-
- public slots:
+
+ public slots:
void modeChanged(int id);
void triggerModeChanged(int id);
void edgeChanged(int id);
@@ -67,6 +65,6 @@
void timerProc();
void midiShot();
};
-
+
#endif
-
\ No newline at end of file
+
Index: kwaveview-1.1.4/scopescreen.cpp
===================================================================
--- kwaveview-1.1.4/scopescreen.cpp.orig
+++ kwaveview-1.1.4/scopescreen.cpp
@@ -8,7 +8,6 @@
#include <qsize.h>
#include <qscrollview.h>
#include <qevent.h>
-#include <sys/asoundlib.h>
#include "audiodata.h"
#include "scope.h"
@@ -52,6 +51,9 @@
QPixmap pm(visibleWidth(), visibleHeight());
QPainter p(&pm);
+ /* fix 'may be used uninitialized in this function' */
+ y1ch1 = y1ch2 = 0;
+
pm.fill(QColor(0, 80, 0));
vx = 0; vy = 0; vw = viewport()->width(); vh = viewport()->height();
xscale = (double)vw / ((double)timeScaleBytes / (double)adata->framesize);
Index: kwaveview-1.1.4/scopescreen.h
===================================================================
--- kwaveview-1.1.4/scopescreen.h.orig
+++ kwaveview-1.1.4/scopescreen.h
@@ -11,7 +11,6 @@
#include <qsizepolicy.h>
#include <qsize.h>
#include <qevent.h>
-#include <sys/asoundlib.h>
#include "audiodata.h"
#define MINIMUM_WIDTH 100
Index: kwaveview-1.1.4/spectrum.cpp
===================================================================
--- kwaveview-1.1.4/spectrum.cpp.orig
+++ kwaveview-1.1.4/spectrum.cpp
@@ -15,7 +15,6 @@
#include <qhbuttongroup.h>
#include <qgroupbox.h>
#include <qpushbutton.h>
-#include <sys/asoundlib.h>
#include "audiodata.h"
#include "spectrum.h"
#include "spectrumscreen.h"
Index: kwaveview-1.1.4/spectrum.h
===================================================================
--- kwaveview-1.1.4/spectrum.h.orig
+++ kwaveview-1.1.4/spectrum.h
@@ -6,8 +6,8 @@
#include <unistd.h>
#include <qwidget.h>
#include <qstring.h>
-#include <qslider.h>
-#include <qcheckbox.h>
+#include <qslider.h>
+#include <qcheckbox.h>
#include <qlabel.h>
#include <qvbox.h>
#include <qhbox.h>
@@ -17,8 +17,6 @@
#include <qradiobutton.h>
#include <qpushbutton.h>
#include <qtimer.h>
-#include <sys/asoundlib.h>
-#include "audiodata.h"
#include "spectrumscreen.h"
#define SPECTRUM_BORDER 5
@@ -45,19 +43,19 @@
QLabel *f_minLabel, *f_maxLabel, *fLabel;
QSlider *framesSlider, *zoomSlider;
QTimer *timer;
-
- public:
+
+ public:
SpectrumScreen *spectrumScreen;
private:
void initControls();
-
+
public:
Spectrum(QWidget* parent=0, const char *name=0, AudioData *p_adata=0);
~Spectrum();
void startSpectrum(bool run);
-
- public slots:
+
+ public slots:
void modeChanged(int id);
void triggerModeChanged(int id);
void fftModeChanged(int id);
@@ -74,6 +72,6 @@
void refreshSpectrum();
void timerProc();
};
-
+
#endif
-
\ No newline at end of file
+
Index: kwaveview-1.1.4/spectrumscreen.cpp
===================================================================
--- kwaveview-1.1.4/spectrumscreen.cpp.orig
+++ kwaveview-1.1.4/spectrumscreen.cpp
@@ -7,7 +7,6 @@
#include <qsizepolicy.h>
#include <qsize.h>
#include <qevent.h>
-#include <sys/asoundlib.h>
#include "audiodata.h"
#include "spectrum.h"
#include <rfftw.h>
@@ -60,6 +59,9 @@
QPixmap pm(width(), height());
QPainter p(&pm);
+ /* fix 'may be used uninitialized in this function' */
+ y1ch1 = y1ch2 = y2ch1 = y2ch2 = 0;
+
pm.fill(QColor(50, 50, 100));
p.setPen(QColor(0, 220, 0));
if ((ch1 < 0) || (ch2 < 0)) {
@@ -134,11 +136,11 @@
}
if ((ch1 >= 0) && (fch1Max > 0)) {
p.setPen(QColor(0, 220, 0));
- p.drawText(xch1Max, height() - ych1Max, QString::number(fch1Max));
+ p.drawText(xch1Max, (int)(height() - ych1Max), QString::number(fch1Max));
}
if ((ch2 >= 0) && (fch2Max > 0)) {
p.setPen(QColor(255, 255, 0));
- p.drawText(xch2Max, height() - ych2Max, QString::number(fch2Max));
+ p.drawText(xch2Max, (int)(height() - ych2Max), QString::number(fch2Max));
}
bitBlt(this, 0, 0, &pm);
} else {
Index: kwaveview-1.1.4/spectrumscreen.h
===================================================================
--- kwaveview-1.1.4/spectrumscreen.h.orig
+++ kwaveview-1.1.4/spectrumscreen.h
@@ -11,7 +11,6 @@
#include <qsize.h>
#include <qpixmap.h>
#include <qevent.h>
-#include <sys/asoundlib.h>
#include "audiodata.h"
#include <rfftw.h>
Index: kaconnect-1.1.1/kaconnect.cpp
===================================================================
--- kaconnect-1.1.1/kaconnect.cpp.orig
+++ kaconnect-1.1.1/kaconnect.cpp
@@ -59,7 +59,7 @@
QMainWindow *top = new QMainWindow();
QMessageBox *aboutWidget = new QMessageBox(top);
int list_box_height = 250;
- QPopupMenu *aboutMenu = new QPopupMenu(top);
+ QPopupMenu *aboutMenu = new QPopupMenu(top);
#endif
QPopupMenu *filePopup = new QPopupMenu(top);
#ifdef WITH_KDE
@@ -71,7 +71,7 @@
view->setMargin(10);
view->setSpacing(10);
QHBox *labelBox = new QHBox(view);
- QHBox *listBox = new QHBox(view);
+ QHBox *listBox = new QHBox(view);
QHBox *buttonBox = new QHBox(view);
AlsaHandle *seq_handle = new AlsaHandle(top);
@@ -79,33 +79,31 @@
ConnectorWidget *connector = new ConnectorWidget(listBox, seq_handle->seq);
PortListBox *alsa_plist_w_box = new PortListBox(listBox, seq_handle->seq, 0);
connector->setMinimumWidth(CONNECTOR_WIDTH);
- connector->set_r_listBox(alsa_plist_r_box);
+ connector->set_r_listBox(alsa_plist_r_box);
connector->set_w_listBox(alsa_plist_w_box);
connector->updateConnector(0);
- QLabel *dummyButtonLabel1 = new QLabel(buttonBox);
QPushButton *subscribe = new QPushButton("connect", buttonBox);
QLabel *dummyButtonLabel2 = new QLabel(buttonBox);
dummyButtonLabel2->setMaximumWidth(30);
QPushButton *unsubscribe = new QPushButton("disconnect", buttonBox);
- QLabel *dummyButtonLabel3 = new QLabel(buttonBox);
-
+
QLabel *r_ports_text = new QLabel(labelBox);
- r_ports_text->setFont(QFont("Arial", 16));
+ r_ports_text->setFont(QFont("Arial", 16));
r_ports_text->setText("Readable Ports:");
- QLabel *dummyLabel = new QLabel(labelBox);
+ QLabel *dummyLabel = new QLabel(labelBox);
dummyLabel->setMaximumWidth(CONNECTOR_WIDTH);
QLabel *w_ports_text = new QLabel(labelBox);
- w_ports_text->setFont(QFont("Arial", 16));
- w_ports_text->setText("Writeable Ports:");
-
+ w_ports_text->setFont(QFont("Arial", 16));
+ w_ports_text->setText("Writeable Ports:");
+
snd_seq_port_subscribe_t *subs;
snd_seq_addr_t tmp_addr;
- int portid;
+ int portid;
int alsaAnnounceFd = 0;
- if (!(portid = snd_seq_create_simple_port(seq_handle->seq, "kaconnect",
- SND_SEQ_PORT_CAP_WRITE|SND_SEQ_PORT_CAP_SUBS_WRITE|SND_SEQ_PORT_CAP_NO_EXPORT,
+ if (!(portid = snd_seq_create_simple_port(seq_handle->seq, "kaconnect",
+ SND_SEQ_PORT_CAP_WRITE|SND_SEQ_PORT_CAP_SUBS_WRITE|SND_SEQ_PORT_CAP_NO_EXPORT,
SND_SEQ_PORT_TYPE_APPLICATION) < 0)) {
snd_seq_port_subscribe_alloca(&subs);
tmp_addr.client = SND_SEQ_CLIENT_SYSTEM;
@@ -113,7 +111,7 @@
snd_seq_port_subscribe_set_sender(subs, &tmp_addr);
tmp_addr.client = snd_seq_client_id(seq_handle->seq);
tmp_addr.port = portid;
- snd_seq_port_subscribe_set_dest(subs, &tmp_addr);
+ snd_seq_port_subscribe_set_dest(subs, &tmp_addr);
snd_seq_subscribe_port(seq_handle->seq, subs);
struct pollfd pfd[1];
snd_seq_poll_descriptors(seq_handle->seq, pfd, 1, POLLIN);
@@ -131,28 +129,28 @@
aboutMenu->insertItem("About Kaconnect", aboutWidget, SLOT(exec()));
#endif
QObject::connect(alsaNotifier, SIGNAL(activated(int)),
- seq_handle, SLOT(alsaAnnounce(int)));
+ seq_handle, SLOT(alsaAnnounce(int)));
QObject::connect(alsaNotifier, SIGNAL(activated(int)),
- alsa_plist_r_box, SLOT(updateList(int)));
+ alsa_plist_r_box, SLOT(updateList(int)));
QObject::connect(alsaNotifier, SIGNAL(activated(int)),
- alsa_plist_w_box, SLOT(updateList(int)));
+ alsa_plist_w_box, SLOT(updateList(int)));
QObject::connect(alsaNotifier, SIGNAL(activated(int)),
connector, SLOT(updateConnector(int)));
QObject::connect(subscribe, SIGNAL(clicked()),
- connector, SLOT(subscribe()));
+ connector, SLOT(subscribe()));
QObject::connect(unsubscribe, SIGNAL(clicked()),
- connector, SLOT(unsubscribe()));
+ connector, SLOT(unsubscribe()));
QObject::connect(alsa_plist_r_box, SIGNAL(highlighted(int)),
- connector, SLOT(checkEqual(int)));
+ connector, SLOT(checkEqual(int)));
QObject::connect(alsa_plist_w_box, SIGNAL(highlighted(int)),
- connector, SLOT(checkEqual(int)));
+ connector, SLOT(checkEqual(int)));
QObject::connect(connector, SIGNAL(isEqual(bool)),
- subscribe, SLOT(setDisabled(bool)));
+ subscribe, SLOT(setDisabled(bool)));
QObject::connect(alsa_plist_r_box, SIGNAL(contentsMoving(int, int)),
connector, SLOT(move(int, int)));
QObject::connect(alsa_plist_w_box, SIGNAL(contentsMoving(int, int)),
- connector, SLOT(move(int, int)));
+ connector, SLOT(move(int, int)));
top->setGeometry(0, 0, DEFAULT_WIDTH, list_box_height);
top->show();
@@ -161,10 +159,10 @@
app.setMainWidget(top);
return app.exec();
#else
- qApp->setMainWidget(top);
+ qApp->setMainWidget(top);
aboutWidget->setText(aboutText);
- aboutWidget->setCaption("About Kaconnect");
- aboutWidget->hide();
+ aboutWidget->setCaption("About Kaconnect");
+ aboutWidget->hide();
return qApp->exec();
#endif
}
Index: kwaveview-1.1.4/kwaveview.h
===================================================================
--- kwaveview-1.1.4/kwaveview.h.orig
+++ kwaveview-1.1.4/kwaveview.h
@@ -10,7 +10,7 @@
#include <qcheckbox.h>
#include <qlabel.h>
#include <qmessagebox.h>
-#include <sys/asoundlib.h>
+#include <alsa/asoundlib.h>
#include "audiodata.h"
#include "capture.h"
#include "scope.h"
Index: qmidicontrol-0.0.1b/gui.cpp
===================================================================
--- qmidicontrol-0.0.1b/gui.cpp.orig
+++ qmidicontrol-0.0.1b/gui.cpp
@@ -59,7 +59,7 @@
void Gui::updateValue(int val) {
snd_seq_event_t ev;
- int l1;
+ unsigned int l1;
QSlider *senderSlider;
senderSlider = (QSlider *)sender();
Index: qmidiroute-0.2.1/mapwidget.cpp
===================================================================
--- qmidiroute-0.2.1/mapwidget.cpp.orig
+++ qmidiroute-0.2.1/mapwidget.cpp
@@ -26,12 +26,12 @@
QVGroupBox *outBox = new QVGroupBox("Event Output", ioBox);
midiMap = p_midiMap;
QHBox *typeInBox = new QHBox(inBox);
- QLabel *typeInLabel = new QLabel("Type:", typeInBox);
+ // QLabel *typeInLabel = new QLabel("Type:", typeInBox);
typeInHighlight = 0;
typeIn = new QComboBox(typeInBox);
QObject::connect(typeIn, SIGNAL(highlighted(int)), this, SLOT(updateTypeIn(int)));
QHBox *typeOutBox = new QHBox(outBox);
- QLabel *typeOutLabel = new QLabel("Type:", typeOutBox);
+ // QLabel *typeOutLabel = new QLabel("Type:", typeOutBox);
typeOut = new QComboBox(typeOutBox);
QObject::connect(typeOut, SIGNAL(highlighted(int)), this, SLOT(updateTypeOut(int)));
QStrList *typeNames = new QStrList(true);
@@ -46,7 +46,7 @@
QVBox *spinInLabel = new QVBox(spinInContainer);
QVBox *spinInSpin1 = new QVBox(spinInContainer);
QVBox *spinInSpin2 = new QVBox(spinInContainer);
- QLabel *chInLabel = new QLabel("Channel:", spinInLabel);
+ // QLabel *chInLabel = new QLabel("Channel:", spinInLabel);
chIn[0] = new QSpinBox(0, 15, 1, spinInSpin1);
chIn[1] = new QSpinBox(0, 15, 1, spinInSpin2);
QObject::connect(chIn[0], SIGNAL(valueChanged(int)), this, SLOT(updateChIn(int)));
@@ -55,7 +55,7 @@
QVBox *chIndexLabelBox = new QVBox(chIndexOutBox);
QVBox *chIndexComboBox = new QVBox(chIndexOutBox);
QVBox *chIndexSpinBox = new QVBox(chIndexOutBox);
- QLabel *chOutLabel = new QLabel("Channel: ", chIndexLabelBox);
+ // QLabel *chOutLabel = new QLabel("Channel: ", chIndexLabelBox);
chOutMode = new QComboBox(chIndexComboBox);
QObject::connect(chOutMode, SIGNAL(highlighted(int)), this, SLOT(updateChOutMode(int)));
chOut = new QSpinBox(-15, 15, 1, chIndexSpinBox);
@@ -100,7 +100,7 @@
QHBox *portBox = new QHBox(this);
new QWidget(portBox);
- QLabel *portLabel = new QLabel("Output to ALSA Port: ", portBox);
+ // QLabel *portLabel = new QLabel("Output to ALSA Port: ", portBox);
portOut = new QSpinBox(0, portCount - 1, 1, portBox);
QObject::connect(portOut, SIGNAL(valueChanged(int)), this, SLOT(updatePortOut(int)));
}
Index: qmidiroute-0.2.1/midimap.cpp
===================================================================
--- qmidiroute-0.2.1/midimap.cpp.orig
+++ qmidiroute-0.2.1/midimap.cpp
@@ -7,7 +7,7 @@
MidiMap::MidiMap() {
int l1;
-
+
typeIn = EVENT_NOTE;
typeOut = EVENT_NOTE;
for (l1 = 0; l1 < 2; l1++) {
@@ -15,7 +15,7 @@
rangeIn[l1] = 0;
indexIn[l1] = 0;
rangeOut[l1] = 0;
- }
+ }
chOut = 0;
indexOut = 0;
chOutMode = OUTMODE_OFFSET;
@@ -30,42 +30,42 @@
if ((evIn->data.control.channel < chIn[0]) || (evIn->data.control.channel > chIn[1])) {
return(false);
- }
+ }
switch(typeIn) {
case EVENT_NOTE:
- if (((evIn->type != SND_SEQ_EVENT_NOTEON) && (evIn->type != SND_SEQ_EVENT_NOTEOFF))
- || ((evIn->data.note.note < indexIn[0]) || (evIn->data.note.note > indexIn[1]))
+ if (((evIn->type != SND_SEQ_EVENT_NOTEON) && (evIn->type != SND_SEQ_EVENT_NOTEOFF))
+ || ((evIn->data.note.note < indexIn[0]) || (evIn->data.note.note > indexIn[1]))
|| ((evIn->data.note.velocity < rangeIn[0]) || (evIn->data.note.velocity > rangeIn[1]))) {
return(false);
- }
+ }
break;
case EVENT_CONTROLLER:
- if ((evIn->type != SND_SEQ_EVENT_CONTROLLER)
- || (evIn->data.control.param < indexIn[0]) || (evIn->data.control.param > indexIn[1])
+ if ((evIn->type != SND_SEQ_EVENT_CONTROLLER)
+ || (evIn->data.control.param < (unsigned int)indexIn[0]) || (evIn->data.control.param > (unsigned int)indexIn[1])
|| (evIn->data.control.value < rangeIn[0]) || (evIn->data.control.value > rangeIn[1])) {
return(false);
}
break;
case EVENT_PITCHBEND:
- if ((evIn->type != SND_SEQ_EVENT_PITCHBEND)
+ if ((evIn->type != SND_SEQ_EVENT_PITCHBEND)
|| (evIn->data.control.value < rangeIn[0]) || (evIn->data.control.value > rangeIn[1])) {
return(false);
}
break;
case EVENT_PRGCHANGE:
- if ((evIn->type != SND_SEQ_EVENT_PGMCHANGE)
+ if ((evIn->type != SND_SEQ_EVENT_PGMCHANGE)
|| (evIn->data.control.value < rangeIn[0]) || (evIn->data.control.value > rangeIn[1])) {
return(false);
}
break;
- }
+ }
return(true);
}
void MidiMap::doMap(snd_seq_event_t *evIn, snd_seq_event_t *evOut, bool *outOfRange) {
memcpy(evOut, evIn, sizeof(snd_seq_event_t));
-
+
switch(chOutMode) {
case OUTMODE_OFFSET:
evOut->data.control.channel = clip(evOut->data.control.channel + chOut, 0, 15, outOfRange);
@@ -77,7 +77,7 @@
evOut->data.control.channel = chOut;
break;
}
-
+
switch(typeIn) {
case EVENT_NOTE:
switch(typeOut) {
@@ -85,14 +85,14 @@
switch(indexOutMode) {
case OUTMODE_OFFSET:
evOut->data.note.note = clip(evIn->data.note.note + indexOut, 0, 127, outOfRange);
- break;
+ break;
case OUTMODE_REVERSE:
evOut->data.note.note = clip(indexOut - evIn->data.note.note, 0, 127, outOfRange);
- break;
+ break;
case OUTMODE_FIXED:
evOut->data.note.note = indexOut;
- break;
- }
+ break;
+ }
evOut->data.note.velocity = linMap(evIn->data.note.velocity, rangeIn, rangeOut);
break;
case EVENT_CONTROLLER:
@@ -100,16 +100,16 @@
switch(indexOutMode) {
case OUTMODE_OFFSET:
evOut->data.control.param = clip(evIn->data.note.note + indexOut, 0, 127, outOfRange);
- break;
+ break;
case OUTMODE_REVERSE:
evOut->data.control.param = clip(indexOut - evIn->data.note.note, 0, 127, outOfRange);
- break;
+ break;
case OUTMODE_FIXED:
evOut->data.control.param = indexOut;
- break;
- }
+ break;
+ }
evOut->data.control.value = linMap(evIn->data.note.velocity, rangeIn, rangeOut);
-
+
break;
case EVENT_PITCHBEND:
evOut->type = SND_SEQ_EVENT_PITCHBEND;
@@ -120,16 +120,16 @@
switch(indexOutMode) {
case OUTMODE_OFFSET:
evOut->data.control.value = clip(evIn->data.note.note + indexOut, 0, 127, outOfRange);
- break;
+ break;
case OUTMODE_REVERSE:
evOut->data.control.value = clip(indexOut - evIn->data.note.note, 0, 127, outOfRange);
- break;
+ break;
case OUTMODE_FIXED:
evOut->data.control.value = indexOut;
- break;
- }
+ break;
+ }
break;
- }
+ }
break;
case EVENT_CONTROLLER:
switch(typeOut) {
@@ -138,28 +138,28 @@
switch(indexOutMode) {
case OUTMODE_OFFSET:
evOut->data.note.note = clip(evIn->data.control.param + indexOut, 0, 127, outOfRange);
- break;
+ break;
case OUTMODE_REVERSE:
evOut->data.note.note = clip(indexOut - evIn->data.control.param, 0, 127, outOfRange);
- break;
+ break;
case OUTMODE_FIXED:
evOut->data.note.note = indexOut;
- break;
- }
+ break;
+ }
evOut->data.note.velocity = linMap(evIn->data.control.value, rangeIn, rangeOut);
break;
case EVENT_CONTROLLER:
switch(indexOutMode) {
case OUTMODE_OFFSET:
evOut->data.control.param = clip(evIn->data.control.param + indexOut, 0, 127, outOfRange);
- break;
+ break;
case OUTMODE_REVERSE:
evOut->data.control.param = clip(indexOut - evIn->data.control.param, 0, 127, outOfRange);
- break;
+ break;
case OUTMODE_FIXED:
evOut->data.control.param = indexOut;
- break;
- }
+ break;
+ }
evOut->data.control.value = linMap(evIn->data.control.value, rangeIn, rangeOut);
break;
case EVENT_PITCHBEND:
@@ -170,7 +170,7 @@
evOut->type = SND_SEQ_EVENT_PGMCHANGE;
evOut->data.control.value = linMap(evIn->data.control.value, rangeIn, rangeOut);
break;
- }
+ }
break;
case EVENT_PITCHBEND:
switch(typeOut) {
@@ -191,7 +191,7 @@
evOut->type = SND_SEQ_EVENT_PGMCHANGE;
evOut->data.control.value = linMap(evIn->data.control.value, rangeIn, rangeOut);
break;
- }
+ }
break;
case EVENT_PRGCHANGE:
switch(typeOut) {
@@ -212,9 +212,9 @@
case EVENT_PRGCHANGE:
evOut->data.control.value = linMap(evIn->data.control.value, rangeIn, rangeOut);
break;
- }
+ }
break;
- }
+ }
}
int MidiMap::linMap(int in, int p_rangeIn[], int p_rangeOut[]) {
@@ -236,6 +236,6 @@
} else if (tmp < min) {
tmp = min;
*outOfRange = true;
- }
+ }
return(tmp);
}
Index: qmidiroute-0.2.1/logwidget.cpp
===================================================================
--- qmidiroute-0.2.1/logwidget.cpp.orig
+++ qmidiroute-0.2.1/logwidget.cpp
@@ -26,7 +26,7 @@
logText->setTextFormat(Qt::LogText);
logActive = true;
QHBox *buttonBox = new QHBox(this);
- QLabel *enableLabel = new QLabel("Enable Log", buttonBox);
+ // QLabel *enableLabel = new QLabel("Enable Log", buttonBox);
enableLog = new QCheckBox(buttonBox);
enableLog->setChecked(logActive);
QObject::connect(enableLog, SIGNAL(toggled(bool)), this, SLOT(enableLogToggle(bool)));
@@ -36,7 +36,7 @@
}
LogWidget::~LogWidget() {
-
+
}
void LogWidget::appendEvent(snd_seq_event_t *ev) {
Index: qmidiroute-0.2.1/seqdriver.cpp
===================================================================
--- qmidiroute-0.2.1/seqdriver.cpp.orig
+++ qmidiroute-0.2.1/seqdriver.cpp
@@ -9,7 +9,7 @@
SeqDriver::SeqDriver(QPtrList<MidiMap> *p_midiMapList, QWidget *parent, const char *name) : QWidget(parent, name) {
- midiMapList = p_midiMapList;
+ midiMapList = p_midiMapList;
portCount = 0;
discardUnmatched = true;
portUnmatched = 0;
@@ -24,7 +24,7 @@
SND_SEQ_PORT_TYPE_APPLICATION)) < 0) {
fprintf(stderr, "Error creating sequencer port.\n");
exit(1);
- }
+ }
}
SeqDriver::~SeqDriver(){
@@ -42,7 +42,7 @@
fprintf(stderr, "Error creating sequencer port.\n");
exit(1);
}
- }
+ }
initSeqNotifier();
}
@@ -66,7 +66,7 @@
void SeqDriver::procEvents(int fd) {
- int l1;
+ unsigned int l1;
snd_seq_event_t *evIn, evOut;
bool outOfRange, unmatched;
@@ -79,20 +79,20 @@
unmatched = false;
midiMapList->at(l1)->doMap(evIn, &evOut, &outOfRange);
if (!outOfRange) {
- snd_seq_ev_set_subs(&evOut);
+ snd_seq_ev_set_subs(&evOut);
snd_seq_ev_set_direct(&evOut);
snd_seq_ev_set_source(&evOut, portid_out[midiMapList->at(l1)->portOut]);
snd_seq_event_output_direct(seq_handle, &evOut);
- }
+ }
}
}
if (!discardUnmatched && unmatched) {
- snd_seq_ev_set_subs(evIn);
+ snd_seq_ev_set_subs(evIn);
snd_seq_ev_set_direct(evIn);
snd_seq_ev_set_source(evIn, portid_out[portUnmatched]);
snd_seq_event_output_direct(seq_handle, evIn);
}
- } while (snd_seq_event_input_pending(seq_handle, 0) > 0);
+ } while (snd_seq_event_input_pending(seq_handle, 0) > 0);
}
void SeqDriver::setDiscardUnmatched(bool on) {
Index: qarecord-0.0.9/recdata.cpp
===================================================================
--- qarecord-0.0.9/recdata.cpp.orig
+++ qarecord-0.0.9/recdata.cpp
@@ -10,7 +10,7 @@
RecData::RecData(QString p_pcmName, unsigned long p_ringBufSize, QObject *parent) : QObject(parent) {
pcmName = p_pcmName;
- wavDataSize = 0;
+ wavDataSize = 0;
writeOfs = 0;
readOfs = 0;
validByteCount = 0;
@@ -55,9 +55,9 @@
rate = jack_get_sample_rate(jack_handle);
jack_in[0] = jack_port_register(jack_handle, "In_0", JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0);
jack_in[1] = jack_port_register(jack_handle, "In_1", JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0);
- return(0);
+ return(0);
}
-
+
int RecData::activateJack() {
jackRunning = true;
@@ -80,7 +80,7 @@
}
}
return(0);
-}
+}
int RecData::capture_callback(jack_nframes_t nframes, void *arg) {
@@ -93,19 +93,20 @@
int RecData::jack_capture(jack_nframes_t nframes) {
- int l1, l2, i;
+ unsigned int l1, l2;
+ int i;
jack_default_audio_sample_t *buf[2];
short s;
if (nframes > MAX_JACK_FRAMES) {
fprintf(stderr, "nframes > %d\n", MAX_JACK_FRAMES);
} else {
- for (l1 = 0; l1 < 2; l1++) {
+ for (l1 = 0; l1 < 2; l1++) {
buf[l1] = (jack_default_audio_sample_t *)jack_port_get_buffer(jack_in[l1], nframes);
memcpy(jackdata[l1], buf[l1], sizeof(jack_default_audio_sample_t) * nframes);
- }
+ }
if (samplesize == 2) {
- for (l2 = 0; l2 < nframes; l2++) {
+ for (l2 = 0; l2 < nframes; l2++) {
for (l1 = 0; l1 < 2; l1++) {
s = (short)(32767.0 * jackdata[l1][l2]);
if (abs(s) > jmax[l1]) jmax[l1] = abs(s);
@@ -119,34 +120,34 @@
for (l1 = 0; l1 < 2; l1++) {
i = (int)(2147483647.0 * jackdata[l1][l2]);
if (abs(i) > jmax[l1]) jmax[l1] = abs(i);
- ringBuf[writeOfs++] = (unsigned char)i;
+ ringBuf[writeOfs++] = (unsigned char)i;
ringBuf[writeOfs++] = i >> 8;
ringBuf[writeOfs++] = i >> 16;
ringBuf[writeOfs++] = i >> 24;
if (writeOfs >= ringBufSize) writeOfs -= ringBufSize;
}
}
- }
+ }
if (newMax) {
newMax = false;
max[0] = jmax[0];
max[1] = jmax[1];
- jmax[0] = 0;
- jmax[1] = 0;
+ jmax[0] = 0;
+ jmax[1] = 0;
}
if (doRecord) {
validByteCount += nframes * framesize;
if (validByteCount > maxValidByteCount) {
maxValidByteCount = validByteCount;
}
- }
+ }
if (writeOfs >= ringBufSize) writeOfs -= ringBufSize;
frameCounter += nframes;
if (frameCounter >= 4096) {
waitForData.wakeOne();
frameCounter = 0;
}
- }
+ }
return(0);
}
Index: qmidiroute-0.2.1/passwidget.cpp
===================================================================
--- qmidiroute-0.2.1/passwidget.cpp.orig
+++ qmidiroute-0.2.1/passwidget.cpp
@@ -21,13 +21,13 @@
setMargin(5);
setSpacing(10);
QHBox *buttonBox = new QHBox(this);
- QLabel *discardLabel = new QLabel("Discard unmatched events ", buttonBox);
+ // QLabel *discardLabel = new QLabel("Discard unmatched events ", buttonBox);
discardCheck = new QCheckBox(buttonBox);
discardCheck->setChecked(true);
QObject::connect(discardCheck, SIGNAL(toggled(bool)), this, SLOT(updateDiscard(bool)));
new QWidget(buttonBox);
QHBox *portBox = new QHBox(this);
- QLabel *portLabel = new QLabel("Send unmatched events to port ", portBox);
+ // QLabel *portLabel = new QLabel("Send unmatched events to port ", portBox);
portUnmatchedSpin = new QSpinBox(0, p_portcount - 1, 1, portBox);
portUnmatchedSpin->setDisabled(true);
QObject::connect(portUnmatchedSpin, SIGNAL(valueChanged(int)), this, SLOT(updatePortUnmatched(int)));
@@ -59,4 +59,4 @@
portUnmatchedSpin->setValue(id);
}
-
\ No newline at end of file
+
Index: qarecord-0.0.9/wavmix.c
===================================================================
--- qarecord-0.0.9/wavmix.c.orig
+++ qarecord-0.0.9/wavmix.c
@@ -17,7 +17,7 @@
int main(int argc, char **argv) {
int l1;
-
+
if (argc < 7) {
fprintf(stderr, "\nwavmix <file_1> <gain_1_l> <gain_1_r> <file_2> <gain_2_l> <gain_2_r> ... <file_n> <gain_n_l> <gain_n_r>\n\n");
exit(1);
@@ -40,9 +40,9 @@
FILE *f;
char ChunkID[5], Format[5], SubChunk1ID[5], SubChunk2ID[5];
int ChunkSize, Subchunk1Size, AudioFormat, NumChannels, SampleRate, ByteRate, BlockAlign, BitsPerSample, Subchunk2Size;
- int l1;
+ /* unused? int l1; */
unsigned char c[4];
-
+
f = fopen(fn, "r");
fread(ChunkID, 1, 4, f);
ChunkID[4] = 0;
@@ -90,10 +90,11 @@
FILE *f[256], *fw;
char *fnw;
- int l1, l2, l3, index, i[2], size, ival;
+ /* unused? int index, */
+ int l1, l2, l3,i[2], size, ival;
unsigned char c[4], buf[64];
double global_gain, val[2], max;
-
+
fnw = (char *)malloc(strlen(fn[0]) + 11);
strcpy (fnw, fn[0]);
fnw = strcat (fnw, "_mix.wav");
@@ -114,15 +115,15 @@
for(l1 = 0; l1 < size; l1++) {
for (l2 = 0; l2 < 2; l2++) {
val[l2] = 0;
- for(l3 = 0; l3 < n; l3++) {
+ for(l3 = 0; l3 < n; l3++) {
if (!feof(f[l3])) {
fread(c, 1, 4, f[l3]);
i[l2] = c[0] | (c[1] << 8) | (c[2] << 16) | (c[3] << 24);
} else {
i[l2] = 0;
}
- val[l2] += gain[l2][l3] * (double)i[l2];
- }
+ val[l2] += gain[l2][l3] * (double)i[l2];
+ }
if (fabs(val[l2]) > max) max = fabs(val[l2]);
}
}
@@ -137,17 +138,17 @@
for(l1 = 0; l1 < size; l1++) {
for (l2 = 0; l2 < 2; l2++) {
val[l2] = 0;
- for(l3 = 0; l3 < n; l3++) {
+ for(l3 = 0; l3 < n; l3++) {
if (!feof(f[l3])) {
fread(c, 1, 4, f[l3]);
i[l2] = c[0] | (c[1] << 8) | (c[2] << 16) | (c[3] << 24);
} else {
i[l2] = 0;
}
- val[l2] += global_gain * gain[l2][l3] * (double)i[l2];
- }
+ val[l2] += global_gain * gain[l2][l3] * (double)i[l2];
+ }
if (fabs(val[l2]) > max) max = fabs(val[l2]);
- ival = (int)val[l2];
+ ival = (int)val[l2];
c[3] = ival >> 24;
c[2] = (ival >> 16) - ((ival >> 24) << 8);
c[1] = (ival >> 8) - ((ival >> 16) << 8);
@@ -158,5 +159,5 @@
for(l1 = 0; l1 < n; l1++) {
fclose(f[l1]);
}
- fclose(fw);
+ fclose(fw);
}
Index: qarecord-0.0.9/wavtool.c
===================================================================
--- qarecord-0.0.9/wavtool.c.orig
+++ qarecord-0.0.9/wavtool.c
@@ -22,9 +22,9 @@
FILE *f;
char ChunkID[5], Format[5], SubChunk1ID[5], SubChunk2ID[5];
int ChunkSize, Subchunk1Size, AudioFormat, NumChannels, SampleRate, ByteRate, BlockAlign, BitsPerSample, Subchunk2Size;
- int l1;
+ /* unused? int l1; */
unsigned char c[4];
-
+
f = fopen(fn, "r");
fread(ChunkID, 1, 4, f);
ChunkID[4] = 0;
@@ -75,7 +75,7 @@
int l1, l2, index, index1, index2, i[2], max[2], size1, size2, gate, trans;
unsigned char c[4];
double val, df1, df2, fader1, fader2;
-
+
f = fopen(fn, "r");
fnw = (char *)malloc(strlen(fn) + 11);
strcpy (fnw, fn);
@@ -105,11 +105,11 @@
if (abs(i[l2]) > max[l2]) {
max[l2] = abs(i[l2]);
}
- }
+ }
if (abs(i[0]) + abs(i[1]) > thrs) {
if (!index1) {
index1 = index;
- }
+ }
trans = (gate) ? 0 : 1;
gate = 1;
} else {
@@ -136,21 +136,21 @@
size2 = index2 - index1;
rewind(f);
fread(c, 1, 4, f);
- fwrite(c, 1, 4, fw);
+ fwrite(c, 1, 4, fw);
i[0] = (size2 * 8) + 36;
c[3] = i[0] >> 24; // ChunkSize
c[2] = (i[0] >> 16) - ((i[0] >> 24) << 8);
c[1] = (i[0] >> 8) - ((i[0] >> 16) << 8);
c[0] = (unsigned char)i[0];
- fwrite(c, 1, 4, fw);
+ fwrite(c, 1, 4, fw);
fseek(f, 8, SEEK_SET);
for (l1 = 0; l1 < 32; l1++) {
c[0] = (unsigned char)fgetc(f);
- fputc(c[0], fw);
+ fputc(c[0], fw);
}
c[3] = (size2 * 8) >> 24; // Subchunk2Size
c[2] = ((size2 * 8) >> 16) - (((size2 * 8) >> 24) << 8);
- c[1] = ((size2 * 8) >> 8) - (((size2 * 8) >> 16) << 8);
+ c[1] = ((size2 * 8) >> 8) - (((size2 * 8) >> 16) << 8);
c[0] = (unsigned char)(size2 * 8);
fwrite(c, 1, 4, fw);
fseek(f, 44 + 8 * index1, SEEK_SET);
@@ -161,8 +161,8 @@
df1 = (fade_start > 0) ? 1.0 / (double)fade_start : 0.0;
df2 = (fade_end > 1) ? 1.0 / (double)(fade_end - 1.0) : 0.0;
fader1 = 0;
- fader2 = 1.0;
- for (l1 = 0; l1 < fade_start; l1++) {
+ fader2 = 1.0;
+ for (l1 = 0; l1 < fade_start; l1++) {
for (l2 = 0; l2 < 2; l2++) {
if (!feof(f)) {
fread(c, 1, 4, f);
@@ -172,15 +172,15 @@
}
val = fader1 * fader1 * fader1 * (double)i[l2];
i[l2] = (int)val;
- c[3] = i[l2] >> 24;
+ c[3] = i[l2] >> 24;
c[2] = (i[l2] >> 16) - ((i[l2] >> 24) << 8);
c[1] = (i[l2] >> 8) - ((i[l2] >> 16) << 8);
c[0] = (unsigned char)i[l2];
fwrite(c, 1, 4, fw);
}
fader1 += df1;
- }
- for (l1 = fade_start; l1 < size2 - fade_end; l1++) {
+ }
+ for (l1 = fade_start; l1 < size2 - fade_end; l1++) {
for (l2 = 0; l2 < 2; l2++) {
if (!feof(f)) {
fread(c, 1, 4, f);
@@ -189,8 +189,8 @@
}
fwrite(c, 1, 4, fw);
}
- }
- for (l1 = size2 - fade_end; l1 < size2; l1++) {
+ }
+ for (l1 = size2 - fade_end; l1 < size2; l1++) {
for (l2 = 0; l2 < 2; l2++) {
if (!feof(f)) {
fread(c, 1, 4, f);
@@ -199,16 +199,16 @@
i[l2] = 0;
}
val = fader2 * fader2 * fader2 * (double)i[l2];
-// fprintf(stderr, "l1: %d l2: %d i: %d, fader2: %f val: %f\n", l1, l2, i[l2], fader2, val);
+// fprintf(stderr, "l1: %d l2: %d i: %d, fader2: %f val: %f\n", l1, l2, i[l2], fader2, val);
i[l2] = (int)val;
c[3] = i[l2] >> 24;
c[2] = (i[l2] >> 16) - ((i[l2] >> 24) << 8);
- c[1] = (i[l2] >> 8) - ((i[l2] >> 16) << 8);
+ c[1] = (i[l2] >> 8) - ((i[l2] >> 16) << 8);
c[0] = (unsigned char)i[l2];
fwrite(c, 1, 4, fw);
}
fader2 -= df2;
- }
+ }
fclose(f);
- fclose(fw);
+ fclose(fw);
}