summaryrefslogtreecommitdiff
path: root/muse2
diff options
context:
space:
mode:
Diffstat (limited to 'muse2')
-rw-r--r--muse2/ChangeLog6
-rw-r--r--muse2/muse/arranger/tlist.cpp18
-rw-r--r--muse2/muse/confmport.cpp10
-rw-r--r--muse2/muse/waveedit/waveedit.cpp12
-rw-r--r--muse2/muse/waveedit/waveedit.h1
-rw-r--r--muse2/muse/waveedit/waveview.cpp9
-rw-r--r--muse2/muse/waveedit/waveview.h2
-rw-r--r--muse2/muse/widgets/CMakeLists.txt2
-rw-r--r--muse2/muse/widgets/fontsel.cpp137
-rw-r--r--muse2/muse/widgets/fontsel.h45
-rw-r--r--muse2/muse/widgets/scldiv.cpp55
-rw-r--r--muse2/muse/widgets/scldiv.h7
-rw-r--r--muse2/muse/widgets/synthwizardbase.h58
13 files changed, 85 insertions, 277 deletions
diff --git a/muse2/ChangeLog b/muse2/ChangeLog
index 153e7ee6..f9656cf5 100644
--- a/muse2/ChangeLog
+++ b/muse2/ChangeLog
@@ -1,3 +1,9 @@
+04.12.2010
+ - Fix: Escape button does not exit track renaming editor. (Orcan)
+ - Fix: Midi ports config table items are editable when they are not supposed to. (Orcan)
+ - Ported scldiv. Things seem to work as before. Maybe needs more testing. (Orcan)
+ - Removed fontsel, and synthwizardbase from the project. (Orcan)
+ - Feature: In waveedit, the mousewheel controls the vertical slider. (Orcan)
03.12.2010
- Ported all copy/paste/drag/drop coding. Including pianoroll, drumedit, pcanvas, prcanvas, dcanvas,
and effect rack. Test OK cut, copy, paste, also drag n drop various files to arranger and rack. (Tim)
diff --git a/muse2/muse/arranger/tlist.cpp b/muse2/muse/arranger/tlist.cpp
index e9ed1a88..887a80f9 100644
--- a/muse2/muse/arranger/tlist.cpp
+++ b/muse2/muse/arranger/tlist.cpp
@@ -655,11 +655,23 @@ void TList::tracklistChanged()
void TList::keyPressEvent(QKeyEvent* e)
{
- if (editMode && ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter)) {
+ if (editMode)
+ {
// First time we get a keypress event when lineedit is open is on the return key:
// -- Not true for Qt4. Modifier keys also send key events - Orcan
- returnPressed();
- return;
+ if ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter)
+ {
+ returnPressed();
+ return;
+ }
+ else if ( e->key() == Qt::Key_Escape )
+ {
+ editor->hide();
+ editTrack = 0;
+ editMode = false;
+ setFocus();
+ return;
+ }
}
emit keyPressExt(e); //redirect keypress events to main app
e->ignore();
diff --git a/muse2/muse/confmport.cpp b/muse2/muse/confmport.cpp
index 953115cc..17abc19c 100644
--- a/muse2/muse/confmport.cpp
+++ b/muse2/muse/confmport.cpp
@@ -771,31 +771,39 @@ void MPConfig::songChanged(int flags)
MidiDevice* dev = port->device();
QString s;
s.setNum(i+1);
- QTableWidgetItem* itemno = new QTableWidgetItem(s);
+ QTableWidgetItem* itemno = new QTableWidgetItem(s);
addItem(i, DEVCOL_NO, itemno, mdevView);
itemno->setTextAlignment(Qt::AlignHCenter);
+ itemno->setFlags(Qt::ItemIsEnabled);
QTableWidgetItem* itemstate = new QTableWidgetItem(port->state());
addItem(i, DEVCOL_STATE, itemstate, mdevView);
+ itemstate->setFlags(Qt::ItemIsEnabled);
QTableWidgetItem* iteminstr = new QTableWidgetItem(port->instrument() ?
port->instrument()->iname() :
tr("<unknown>"));
addItem(i, DEVCOL_INSTR, iteminstr, mdevView);
+ iteminstr->setFlags(Qt::ItemIsEnabled);
QTableWidgetItem* itemname = new QTableWidgetItem;
addItem(i, DEVCOL_NAME, itemname, mdevView);
itemname->setFlags(Qt::ItemIsEnabled);
QTableWidgetItem* itemgui = new QTableWidgetItem;
addItem(i, DEVCOL_GUI, itemgui, mdevView);
itemgui->setTextAlignment(Qt::AlignHCenter);
+ itemgui->setFlags(Qt::ItemIsEnabled);
QTableWidgetItem* itemrec = new QTableWidgetItem;
addItem(i, DEVCOL_REC, itemrec, mdevView);
itemrec->setTextAlignment(Qt::AlignHCenter);
+ itemrec->setFlags(Qt::ItemIsEnabled);
QTableWidgetItem* itemplay = new QTableWidgetItem;
addItem(i, DEVCOL_PLAY, itemplay, mdevView);
itemplay->setTextAlignment(Qt::AlignHCenter);
+ itemplay->setFlags(Qt::ItemIsEnabled);
QTableWidgetItem* itemout = new QTableWidgetItem;
addItem(i, DEVCOL_OUTROUTES, itemout, mdevView);
+ itemout->setFlags(Qt::ItemIsEnabled);
QTableWidgetItem* itemin = new QTableWidgetItem;
addItem(i, DEVCOL_INROUTES, itemin, mdevView);
+ itemin->setFlags(Qt::ItemIsEnabled);
mdevView->blockSignals(false);
diff --git a/muse2/muse/waveedit/waveedit.cpp b/muse2/muse/waveedit/waveedit.cpp
index 1542d4ef..338d702c 100644
--- a/muse2/muse/waveedit/waveedit.cpp
+++ b/muse2/muse/waveedit/waveedit.cpp
@@ -64,7 +64,8 @@ WaveEdit::WaveEdit(PartList* pl)
QAction* act;
//---------Pulldown Menu----------------------------
- QMenu* menuFile = menuBar()->addMenu(tr("&File"));
+ // We probably don't need an empty menu - Orcan
+ //QMenu* menuFile = menuBar()->addMenu(tr("&File"));
QMenu* menuEdit = menuBar()->addMenu(tr("&Edit"));
menuFunctions = menuBar()->addMenu(tr("Func&tions"));
@@ -197,6 +198,7 @@ WaveEdit::WaveEdit(PartList* pl)
time = new MTScale(&_raster, mainw, xscale, true);
ymag->setFixedWidth(16);
+ connect(view, SIGNAL(mouseWheelMoved(int)), this, SLOT(moveVerticalSlider(int)));
connect(ymag, SIGNAL(valueChanged(int)), view, SLOT(setYScale(int)));
time->setOrigin(0, 0);
@@ -447,4 +449,12 @@ void WaveEdit::keyPressEvent(QKeyEvent* event)
}
}
+//---------------------------------------------------------
+// moveVerticalSlider
+//---------------------------------------------------------
+
+void WaveEdit::moveVerticalSlider(int val)
+ {
+ ymag->setValue(ymag->value() + val);
+ }
diff --git a/muse2/muse/waveedit/waveedit.h b/muse2/muse/waveedit/waveedit.h
index 83943944..79102410 100644
--- a/muse2/muse/waveedit/waveedit.h
+++ b/muse2/muse/waveedit/waveedit.h
@@ -55,6 +55,7 @@ class WaveEdit : public MidiEditor {
void setTime(unsigned t);
void songChanged1(int);
void soloChanged(bool flag);
+ void moveVerticalSlider(int val);
public slots:
void configChanged();
diff --git a/muse2/muse/waveedit/waveview.cpp b/muse2/muse/waveedit/waveview.cpp
index d70beefe..b357408c 100644
--- a/muse2/muse/waveedit/waveview.cpp
+++ b/muse2/muse/waveedit/waveview.cpp
@@ -378,6 +378,15 @@ void WaveView::viewMousePressEvent(QMouseEvent* event)
viewMouseMoveEvent(event);
}
+
+//---------------------------------------------------------
+// wheelEvent
+//---------------------------------------------------------
+void WaveView::wheelEvent(QWheelEvent* event)
+ {
+ emit mouseWheelMoved(event->delta() / 10);
+ }
+
//---------------------------------------------------------
// viewMouseReleaseEvent
//---------------------------------------------------------
diff --git a/muse2/muse/waveedit/waveview.h b/muse2/muse/waveedit/waveview.h
index 49ac251f..d1f247b3 100644
--- a/muse2/muse/waveedit/waveview.h
+++ b/muse2/muse/waveedit/waveview.h
@@ -55,6 +55,7 @@ class WaveView : public View {
virtual void viewMousePressEvent(QMouseEvent*);
virtual void viewMouseMoveEvent(QMouseEvent*);
virtual void viewMouseReleaseEvent(QMouseEvent*);
+ virtual void wheelEvent(QWheelEvent*);
bool getUniqueTmpfileName(QString& newFilename); //!< Generates unique filename for temporary SndFile
WaveSelectionList getSelection(unsigned startpos, unsigned stoppos);
@@ -84,6 +85,7 @@ class WaveView : public View {
signals:
void followEvent(int);
void timeChanged(unsigned);
+ void mouseWheelMoved(int);
public:
WaveView(MidiEditor*, QWidget* parent, int xscale, int yscale);
diff --git a/muse2/muse/widgets/CMakeLists.txt b/muse2/muse/widgets/CMakeLists.txt
index 83fa0d6d..ca1df66a 100644
--- a/muse2/muse/widgets/CMakeLists.txt
+++ b/muse2/muse/widgets/CMakeLists.txt
@@ -96,7 +96,6 @@ QT4_WRAP_CPP (widget_mocs
tempolabel.h
tools.h
popupmenu.h
- fontsel.h
ctrlcombo.h
sliderbase.h
slider.h
@@ -200,7 +199,6 @@ add_library ( widgets STATIC
swidget.cpp
tempolabel.cpp
tools.cpp
- fontsel.cpp
ctrlcombo.cpp
sliderbase.cpp
slider.cpp
diff --git a/muse2/muse/widgets/fontsel.cpp b/muse2/muse/widgets/fontsel.cpp
deleted file mode 100644
index a6808ff1..00000000
--- a/muse2/muse/widgets/fontsel.cpp
+++ /dev/null
@@ -1,137 +0,0 @@
-//=========================================================
-// MusE
-// Linux Music Editor
-// $Id: fontsel.cpp,v 1.1.1.1 2003/10/27 18:55:02 wschweer Exp $
-// (C) Copyright 1999 Werner Schweer (ws@seh.de)
-//=========================================================
-
-#include <qlabel.h>
-#include <qspinbox.h>
-#include <qpushbutton.h>
-//#include <qhbuttongroup.h>
-#include <q3buttongroup.h>
-#include <qtoolbutton.h>
-#include <qcombobox.h>
-#include <qlayout.h>
-#include <qfontdialog.h>
-#include <qfontdatabase.h>
-//Added by qt3to4:
-#include <Q3HBoxLayout>
-
-#include "icons.h"
-#include "fontsel.h"
-
-//---------------------------------------------------------
-// FontSel
-//---------------------------------------------------------
-
-FontSel::FontSel(QWidget* parent, const QFont& f, const QString& name)
- : QWidget(parent)
- {
- _font = f;
- Q3HBoxLayout* box = new Q3HBoxLayout(this);
-
- cb = new QComboBox(this);
- cb->setFixedWidth(80);
- cb->insertItem(QString("arial"));
- cb->insertItem(QString("avantgarde"));
- cb->insertItem(QString("charter"));
- cb->insertItem(QString("garamond"));
- cb->insertItem(QString("gillsans"));
- cb->insertItem(QString("helvetica"));
- cb->insertItem(QString("times"));
- cb->insertItem(QString("terminal"));
- cb->insertItem(QString("utopia"));
- cb->insertItem(QString("new century schoolbook"));
-
- QLabel* l1 = new QLabel(tr("Size:"), this);
- s1 = new QSpinBox(8, 48, 1, this);
-
- fcb1 = new QToolButton(this);
- fcb1->setToggleButton(true);
- fcb1->setPixmap(*(boldIcon));
-
- fcb2 = new QToolButton(this);
- fcb2->setToggleButton(true);
- fcb2->setPixmap(*(italicIcon));
-
- fcb3 = new QToolButton(this);
- fcb3->setToggleButton(true);
- fcb3->setPixmap(*(underlinedIcon));
-
- QToolButton* pb = new QToolButton(this);
- connect(pb, SIGNAL(pressed()), SLOT(fontSelect()));
- pb->setText(QString("??"));
-
- QLabel* l2 = new QLabel(name, this);
-
- box->addWidget(cb);
- box->addSpacing(8);
- box->addWidget(l1);
- box->addSpacing(5);
- box->addWidget(s1);
- box->addSpacing(5);
- box->addWidget(fcb1);
- box->addWidget(fcb2);
- box->addWidget(fcb3);
- box->addSpacing(2);
- box->addWidget(pb);
- box->addSpacing(5);
- box->addWidget(l2);
- box->addStretch(100);
- setFixedHeight(18);
- setFont();
- }
-
-//---------------------------------------------------------
-// fontSelect
-//---------------------------------------------------------
-
-void FontSel::fontSelect()
- {
- bool ok;
- QFont f = QFontDialog::getFont(&ok, _font, this);
- if (ok) {
- _font = f;
- setFont();
- }
- }
-
-//---------------------------------------------------------
-// setFont
-//---------------------------------------------------------
-
-void FontSel::setFont()
- {
- s1->setValue(_font.pointSize());
- fcb1->setOn(_font.weight() == QFont::Bold);
- fcb2->setOn(_font.italic());
- fcb3->setOn(_font.underline());
- int i;
- for (i = 0; i < cb->count(); ++i) {
- QString s = cb->text(i);
- if (s == _font.family()) {
- cb->setCurrentItem(i);
- break;
- }
- }
- if (i == cb->count()) {
- cb->insertItem(_font.family());
- cb->setCurrentItem(i);
- }
- }
-
-//---------------------------------------------------------
-// font
-//---------------------------------------------------------
-
-const QFont& FontSel::font()
- {
- _font.setPointSize(s1->value());
- _font.setWeight(fcb1->isOn() ? QFont::Bold : QFont::Normal);
- _font.setItalic(fcb2->isOn());
- _font.setUnderline(fcb3->isOn());
- _font.setFamily(cb->currentText());
- return _font;
- }
-
diff --git a/muse2/muse/widgets/fontsel.h b/muse2/muse/widgets/fontsel.h
deleted file mode 100644
index 1b906aab..00000000
--- a/muse2/muse/widgets/fontsel.h
+++ /dev/null
@@ -1,45 +0,0 @@
-//=========================================================
-// MusE
-// Linux Music Editor
-// $Id: fontsel.h,v 1.1.1.1.2.1 2008/01/19 13:33:46 wschweer Exp $
-// (C) Copyright 1999 Werner Schweer (ws@seh.de)
-//=========================================================
-
-#ifndef __FONTSEL_H__
-#define __FONTSEL_H__
-
-#include <qwidget.h>
-#include "song.h"
-
-class QFont;
-class QSpinBox;
-class QToolButton;
-class QComboBox;
-
-//---------------------------------------------------------
-// FontSel
-//---------------------------------------------------------
-
-class FontSel : public QWidget {
- Q_OBJECT
-
- QFont _font;
- QSpinBox* s1;
- QToolButton* fcb1;
- QToolButton* fcb2;
- QToolButton* fcb3;
- QComboBox* cb;
-
- void setFont();
-
- private slots:
- void fontSelect();
-
- public:
- FontSel(QWidget* parent, const QFont&, const QString&);
- const QFont& font();
- };
-
-
-#endif
-
diff --git a/muse2/muse/widgets/scldiv.cpp b/muse2/muse/widgets/scldiv.cpp
index a0b0e628..0a75cbd4 100644
--- a/muse2/muse/widgets/scldiv.cpp
+++ b/muse2/muse/widgets/scldiv.cpp
@@ -14,8 +14,6 @@
#include <cmath>
#include "scldiv.h"
#include "mmath.h"
-//Added by qt3to4:
-#include <Q3MemArray>
// ScaleDiv - A class for building scale divisions
//
@@ -278,7 +276,7 @@ bool ScaleDiv::buildLinDiv(int maxMajSteps, int maxMinSteps, double step)
double val, mval;
double firstTick, lastTick;
double minStep;
- Q3MemArray<double> buffer;
+ QVector<double> buffer;
bool rv = TRUE;
// parameter range check
@@ -286,9 +284,9 @@ bool ScaleDiv::buildLinDiv(int maxMajSteps, int maxMinSteps, double step)
maxMinSteps = qwtMax(0, maxMinSteps);
step = qwtAbs(step);
- // detach arrays
- d_majMarks.duplicate(0,0);
- d_minMarks.duplicate(0,0);
+ // reset vectors
+ d_minMarks.resize(0);
+ d_majMarks.resize(0);
if (d_lBound == d_hBound) return TRUE;
@@ -307,11 +305,9 @@ bool ScaleDiv::buildLinDiv(int maxMajSteps, int maxMinSteps, double step)
lastTick = floor( (d_hBound + step_eps * d_majStep) / d_majStep) * d_majStep;
nMaj = qwtMin(10000, int(rint((lastTick - firstTick) / d_majStep)) + 1);
-
- if ((rv = d_majMarks.resize(nMaj)))
- qwtLinSpace(d_majMarks.data(), d_majMarks.size(), firstTick, lastTick);
- else
- return FALSE;
+
+ d_majMarks.resize(nMaj);
+ qwtLinSpace(d_majMarks.data(), d_majMarks.size(), firstTick, lastTick);
//
// Set up minor divisions
@@ -339,7 +335,7 @@ bool ScaleDiv::buildLinDiv(int maxMajSteps, int maxMinSteps, double step)
i0 = 0;
// resize buffer to the maximum possible number of minor ticks
- rv = buffer.resize(nMin * (nMaj + 1));
+ buffer.resize(nMin * (nMaj + 1));
// calculate minor ticks
if (rv)
@@ -362,7 +358,9 @@ bool ScaleDiv::buildLinDiv(int maxMajSteps, int maxMinSteps, double step)
}
}
}
- d_minMarks.duplicate(buffer.data(), minSize);
+ //d_minMarks.duplicate(buffer.data(), minSize);
+ d_minMarks.resize(minSize);
+ qCopy(buffer.data(), buffer.data() + minSize, d_minMarks.begin());
}
return rv;
@@ -395,7 +393,7 @@ bool ScaleDiv::buildLogDiv(int maxMajSteps, int maxMinSteps, double majStep)
int rv = TRUE;
double width;
- Q3MemArray<double> buffer;
+ QVector<double> buffer;
// Parameter range check
@@ -407,9 +405,9 @@ bool ScaleDiv::buildLogDiv(int maxMajSteps, int maxMinSteps, double majStep)
limRange(d_hBound, LOG_MIN, LOG_MAX);
limRange(d_lBound, LOG_MIN, LOG_MAX);
- // detach arrays
- d_majMarks.duplicate(0,0);
- d_minMarks.duplicate(0,0);
+ // reset vectors
+ d_minMarks.resize(0);
+ d_majMarks.resize(0);
if (d_lBound == d_hBound) return TRUE;
@@ -447,10 +445,8 @@ bool ScaleDiv::buildLogDiv(int maxMajSteps, int maxMinSteps, double majStep)
nMaj = qwtMin(10000, int(rint(qwtAbs(lLast - lFirst) / d_majStep)) + 1);
- if (d_majMarks.resize(nMaj))
- qwtLogSpace(d_majMarks.data(), d_majMarks.size(), firstTick, lastTick);
- else
- return FALSE;
+ d_majMarks.resize(nMaj);
+ qwtLogSpace(d_majMarks.data(), d_majMarks.size(), firstTick, lastTick);
//
@@ -519,7 +515,10 @@ bool ScaleDiv::buildLogDiv(int maxMajSteps, int maxMinSteps, double majStep)
}
// copy values into the minMarks array
- d_minMarks.duplicate(buffer.data(), minSize);
+ //d_minMarks.duplicate(buffer.data(), minSize);
+ d_minMarks.resize(minSize);
+ qCopy(buffer.data(), buffer.data() + minSize, d_minMarks.begin());
+
}
else // major step > one decade
@@ -569,7 +568,10 @@ bool ScaleDiv::buildLogDiv(int maxMajSteps, int maxMinSteps, double majStep)
}
}
}
- d_minMarks.duplicate(buffer.data(), minSize);
+ //d_minMarks.duplicate(buffer.data(), minSize);
+ d_minMarks.resize(minSize);
+ qCopy(buffer.data(), buffer.data() + minSize, d_minMarks.begin());
+
}
return rv;
@@ -633,9 +635,10 @@ int ScaleDiv::operator!=(const ScaleDiv &s) const
void ScaleDiv::reset()
{
- // detach arrays
- d_majMarks.duplicate(0,0);
- d_minMarks.duplicate(0,0);
+ // reset vectors
+ d_minMarks.resize(0);
+ d_majMarks.resize(0);
+
d_lBound = 0.0;
d_hBound = 0.0;
diff --git a/muse2/muse/widgets/scldiv.h b/muse2/muse/widgets/scldiv.h
index fcb4951c..3d1e1d58 100644
--- a/muse2/muse/widgets/scldiv.h
+++ b/muse2/muse/widgets/scldiv.h
@@ -14,8 +14,7 @@
#ifndef __SCLDIV_H__
#define __SCLDIV_H__
-#include <qglobal.h>
-#include <q3memarray.h>
+#include <QVector>
class ScaleDiv
{
@@ -24,8 +23,8 @@ class ScaleDiv
double d_majStep;
bool d_log;
- Q3MemArray<double> d_majMarks;
- Q3MemArray<double> d_minMarks;
+ QVector<double> d_majMarks;
+ QVector<double> d_minMarks;
void copy(const ScaleDiv &s);
diff --git a/muse2/muse/widgets/synthwizardbase.h b/muse2/muse/widgets/synthwizardbase.h
deleted file mode 100644
index 61d3985c..00000000
--- a/muse2/muse/widgets/synthwizardbase.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/****************************************************************************
-** Form interface generated from reading ui file 'synthwizardbase.ui'
-**
-** Created: Wed Nov 12 10:38:24 2003
-** by: The User Interface Compiler ($Id: synthwizardbase.h,v 1.5 2003/11/12 18:55:06 wschweer Exp $)
-**
-** WARNING! All changes made in this file will be lost!
-****************************************************************************/
-
-#ifndef SYNTHCONFIGBASE_H
-#define SYNTHCONFIGBASE_H
-
-#include <qvariant.h>
-#include <q3wizard.h>
-//Added by qt3to4:
-#include <Q3VBoxLayout>
-#include <Q3GridLayout>
-#include <Q3HBoxLayout>
-
-class Q3VBoxLayout;
-class Q3HBoxLayout;
-class Q3GridLayout;
-class QWidget;
-class Q3GroupBox;
-class Q3ListView;
-class Q3ListViewItem;
-class QPushButton;
-
-class SynthConfigBase : public Q3Wizard
-{
- Q_OBJECT
-
-public:
- SynthConfigBase( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 );
- ~SynthConfigBase();
-
- QWidget* WizardPage;
- Q3GroupBox* GroupBox2;
- Q3ListView* synthList;
- QPushButton* addInstance;
- Q3GroupBox* GroupBox3;
- Q3ListView* instanceList;
- QPushButton* removeInstance;
- QWidget* WizardPage_2;
-
-protected:
- Q3VBoxLayout* WizardPageLayout;
- Q3VBoxLayout* GroupBox2Layout;
- Q3HBoxLayout* Layout1;
- Q3VBoxLayout* GroupBox3Layout;
- Q3HBoxLayout* Layout3;
-
-protected slots:
- virtual void languageChange();
-
-};
-
-#endif // SYNTHCONFIGBASE_H