summaryrefslogtreecommitdiff
path: root/muse2/muse/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'muse2/muse/widgets')
-rw-r--r--muse2/muse/widgets/citem.h2
-rw-r--r--muse2/muse/widgets/filedialog.cpp42
-rw-r--r--muse2/muse/widgets/filedialog.h1
-rw-r--r--muse2/muse/widgets/genset.cpp56
-rw-r--r--muse2/muse/widgets/genset.h4
-rw-r--r--muse2/muse/widgets/gensetbase.ui121
-rw-r--r--muse2/muse/widgets/header.cpp6
-rw-r--r--muse2/muse/widgets/knob.cpp24
-rw-r--r--muse2/muse/widgets/knob.h1
-rw-r--r--muse2/muse/widgets/meter.cpp7
-rw-r--r--muse2/muse/widgets/midisync.ui13
-rw-r--r--muse2/muse/widgets/mtrackinfo.cpp33
-rw-r--r--muse2/muse/widgets/musewidgetsplug.cpp3
-rw-r--r--muse2/muse/widgets/popupmenu.cpp23
-rw-r--r--muse2/muse/widgets/poslabel.cpp6
-rw-r--r--muse2/muse/widgets/projectcreate.ui99
-rw-r--r--muse2/muse/widgets/projectcreateimpl.cpp191
-rw-r--r--muse2/muse/widgets/projectcreateimpl.h19
-rw-r--r--muse2/muse/widgets/routepopup.cpp48
-rw-r--r--muse2/muse/widgets/synthconfigbase.ui14
-rw-r--r--muse2/muse/widgets/utils.cpp3
-rw-r--r--muse2/muse/widgets/visibletracks.cpp2
-rw-r--r--muse2/muse/widgets/visibletracks.h3
23 files changed, 557 insertions, 164 deletions
diff --git a/muse2/muse/widgets/citem.h b/muse2/muse/widgets/citem.h
index 1777eb23..199d18b0 100644
--- a/muse2/muse/widgets/citem.h
+++ b/muse2/muse/widgets/citem.h
@@ -90,7 +90,7 @@ class CItem {
};
typedef std::multimap<int, CItem*, std::less<int> >::iterator iCItem;
-//typedef std::multimap<int, CItem*, std::less<int> >::const_iterator ciCItem;
+typedef std::multimap<int, CItem*, std::less<int> >::const_iterator ciCItem;
typedef std::multimap<int, CItem*, std::less<int> >::const_reverse_iterator rciCItem;
//---------------------------------------------------------
diff --git a/muse2/muse/widgets/filedialog.cpp b/muse2/muse/widgets/filedialog.cpp
index 68f2718f..7f2c1681 100644
--- a/muse2/muse/widgets/filedialog.cpp
+++ b/muse2/muse/widgets/filedialog.cpp
@@ -123,11 +123,13 @@ void MFileDialog::userToggled(bool flag)
if (lastUserDir.isEmpty()) {
- lastUserDir = MusEGlobal::museUser + QString("/") + baseDir; // Initialize if first time
+ //lastUserDir = MusEGlobal::museUser + QString("/") + baseDir; // Initialize if first time
+ lastUserDir = MusEGlobal::configPath + QString("/") + baseDir; // Initialize if first time // p4.0.39
}
if (testDirCreate(this, lastUserDir))
- setDirectory(MusEGlobal::museUser);
+ //setDirectory(MusEGlobal::museUser);
+ setDirectory(MusEGlobal::configPath); // p4.0.39
else
setDirectory(lastUserDir);
@@ -270,34 +272,6 @@ void MFileDialog::directoryChanged(const QString&)
}
}
-
-//---------------------------------------------------------
-// getFilterExtension
-//---------------------------------------------------------
-
-QString getFilterExtension(const QString &filter)
-{
- //
- // Return the first extension found. Must contain at least one * character.
- //
-
- int pos = filter.indexOf('*');
- if(pos == -1)
- return QString();
-
- QString filt;
- int len = filter.length();
- ++pos;
- for( ; pos < len; ++pos)
- {
- QChar c = filter[pos];
- if((c == ')') || (c == ';') || (c == ',') || (c == ' '))
- break;
- filt += filter[pos];
- }
- return filt;
-}
-
//---------------------------------------------------------
// getOpenFileName
//---------------------------------------------------------
@@ -509,10 +483,12 @@ FILE* fileOpen(QWidget* parent, QString name, const QString& ext,
FILE* fp = 0;
if (popenFlag) {
if (strcmp(mode, "r") == 0)
- zip += QString(" -d < ");
+ //zip += QString(" -d < ");
+ zip += QString(" -d < \""); // p4.0.40
else
- zip += QString(" > ");
- zip += name;
+ zip += QString(" > \"");
+ //zip += name;
+ zip = zip + name + QString("\""); // p4.0.40
fp = popen(zip.toAscii().data(), mode);
}
else {
diff --git a/muse2/muse/widgets/filedialog.h b/muse2/muse/widgets/filedialog.h
index b731b65a..b4e21e2c 100644
--- a/muse2/muse/widgets/filedialog.h
+++ b/muse2/muse/widgets/filedialog.h
@@ -3,6 +3,7 @@
// Linux Music Editor
// $Id: filedialog.h,v 1.2.2.2 2008/01/19 13:33:46 wschweer Exp $
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+// (C) Copyright 2011 Tim E. Real (terminator356 on sourceforge)
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
diff --git a/muse2/muse/widgets/genset.cpp b/muse2/muse/widgets/genset.cpp
index d7642b3b..ec2c8637 100644
--- a/muse2/muse/widgets/genset.cpp
+++ b/muse2/muse/widgets/genset.cpp
@@ -4,6 +4,7 @@
// $Id: genset.cpp,v 1.7.2.8 2009/12/01 03:52:40 terminator356 Exp $
//
// (C) Copyright 2001-2004 Werner Schweer (ws@seh.de)
+// (C) Copyright 2011 Tim E. Real (terminator356 on sourceforge)
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
@@ -24,8 +25,10 @@
#include <stdio.h>
#include <QFileDialog>
+#include <QFileInfo>
#include <QRect>
#include <QShowEvent>
+#include <QString>
#include "genset.h"
#include "app.h"
@@ -33,6 +36,7 @@
#include "midiseq.h"
#include "globals.h"
#include "icons.h"
+#include "helper.h"
namespace MusEGui {
@@ -93,12 +97,6 @@ GlobalSettingsConfig::GlobalSettingsConfig(QWidget* parent)
}
}
- userInstrumentsPath->setText(MusEGlobal::config.userInstrumentsDir);
- selectInstrumentsDirButton->setIcon(*openIcon);
- defaultInstrumentsDirButton->setIcon(*undoIcon);
- connect(selectInstrumentsDirButton, SIGNAL(clicked()), SLOT(selectInstrumentsPath()));
- connect(defaultInstrumentsDirButton, SIGNAL(clicked()), SLOT(defaultInstrumentsPath()));
-
guiRefreshSelect->setValue(MusEGlobal::config.guiRefresh);
minSliderSelect->setValue(int(MusEGlobal::config.minSlider));
minMeterSelect->setValue(MusEGlobal::config.minMeter);
@@ -119,6 +117,9 @@ GlobalSettingsConfig::GlobalSettingsConfig(QWidget* parent)
Period affects midi playback resolution.
Shorter periods are desirable.</string>
</property> */
+
+ projDirEntry->setText(MusEGlobal::config.projectBaseFolder);
+ projDirOpenToolButton->setIcon(*openIcon);
startSongEntry->setText(MusEGlobal::config.startSong);
startSongGroup->button(MusEGlobal::config.startMode)->setChecked(true);
@@ -171,9 +172,14 @@ Shorter periods are desirable.</string>
popsDefStayOpenCheckBox->setChecked(MusEGlobal::config.popupsDefaultStayOpen);
lmbDecreasesCheckBox->setChecked(MusEGlobal::config.leftMouseButtonCanDecrease);
rangeMarkerWithoutMMBCheckBox->setChecked(MusEGlobal::config.rangeMarkerWithoutMMB);
-
+
+ addHiddenCheckBox->setChecked(MusEGlobal::config.addHiddenTracks);
+ unhideTracksCheckBox->setChecked(MusEGlobal::config.unhideTracks);
+
//updateSettings(); // TESTING
+ connect(projDirOpenToolButton, SIGNAL(clicked()), SLOT(browseProjDir()));
+
connect(applyButton, SIGNAL(clicked()), SLOT(apply()));
connect(okButton, SIGNAL(clicked()), SLOT(ok()));
connect(cancelButton, SIGNAL(clicked()), SLOT(cancel()));
@@ -258,6 +264,8 @@ void GlobalSettingsConfig::updateSettings()
//dummyAudioRealRate->setText(dad ? QString().setNum(sampleRate) : "---");
//dummyAudioRealRate->setText(QString().setNum(sampleRate)); // Not used any more. p4.0.20
+ projDirEntry->setText(MusEGlobal::config.projectBaseFolder);
+
startSongEntry->setText(MusEGlobal::config.startSong);
startSongGroup->button(MusEGlobal::config.startMode)->setChecked(true);
@@ -310,6 +318,9 @@ void GlobalSettingsConfig::updateSettings()
lmbDecreasesCheckBox->setChecked(MusEGlobal::config.leftMouseButtonCanDecrease);
rangeMarkerWithoutMMBCheckBox->setChecked(MusEGlobal::config.rangeMarkerWithoutMMB);
+ addHiddenCheckBox->setChecked(MusEGlobal::config.addHiddenTracks);
+ unhideTracksCheckBox->setChecked(MusEGlobal::config.unhideTracks);
+
updateMdiSettings();
}
@@ -350,7 +361,9 @@ void GlobalSettingsConfig::apply()
MusEGlobal::config.useOutputLimiter = outputLimiterCheckBox->isChecked();
MusEGlobal::config.vstInPlace = vstInPlaceCheckBox->isChecked();
MusEGlobal::config.rtcTicks = rtcResolutions[rtcticks];
- MusEGlobal::config.userInstrumentsDir = userInstrumentsPath->text();
+
+ MusEGlobal::config.projectBaseFolder = projDirEntry->text();
+
MusEGlobal::config.startSong = startSongEntry->text();
MusEGlobal::config.startMode = startSongGroup->checkedId();
int das = dummyAudioSize->currentIndex();
@@ -408,6 +421,9 @@ void GlobalSettingsConfig::apply()
MusEGlobal::config.leftMouseButtonCanDecrease = lmbDecreasesCheckBox->isChecked();
MusEGlobal::config.rangeMarkerWithoutMMB = rangeMarkerWithoutMMBCheckBox->isChecked();
+ MusEGlobal::config.addHiddenTracks = addHiddenCheckBox->isChecked();
+ MusEGlobal::config.unhideTracks = unhideTracksCheckBox->isChecked();
+
//MusEGlobal::muse->showMixer(MusEGlobal::config.mixerVisible);
MusEGlobal::muse->showMixer1(MusEGlobal::config.mixer1Visible);
MusEGlobal::muse->showMixer2(MusEGlobal::config.mixer2Visible);
@@ -442,8 +458,6 @@ void GlobalSettingsConfig::apply()
MusEGlobal::muse->resize(MusEGlobal::config.geometryMain.size());
MusEGlobal::muse->move(MusEGlobal::config.geometryMain.topLeft());
- MusEGlobal::museUserInstruments = MusEGlobal::config.userInstrumentsDir;
-
MusEGlobal::muse->setHeartBeat(); // set guiRefresh
MusEGlobal::midiSeq->msgSetRtc(); // set midi tick rate
@@ -546,21 +560,6 @@ void GlobalSettingsConfig::transportCurrent()
transportY->setValue(r.y());
}
-void GlobalSettingsConfig::selectInstrumentsPath()
- {
- QString dir = QFileDialog::getExistingDirectory(this,
- tr("Selects instruments directory"),
- MusEGlobal::config.userInstrumentsDir);
- userInstrumentsPath->setText(dir);
- }
-
-void GlobalSettingsConfig::defaultInstrumentsPath()
- {
- QString dir = MusEGlobal::configPath + "/instruments";
- userInstrumentsPath->setText(dir);
- }
-
-
void GlobalSettingsConfig::traditionalPreset()
{
for (std::list<MdiSettings*>::iterator it = mdisettings.begin(); it!=mdisettings.end(); it++)
@@ -598,5 +597,12 @@ void GlobalSettingsConfig::borlandPreset()
updateMdiSettings();
}
+void GlobalSettingsConfig::browseProjDir()
+{
+ QString dir = MusEGui::browseProjectFolder(this);
+ if(!dir.isEmpty())
+ projDirEntry->setText(dir);
+}
+
} // namespace MusEGui
diff --git a/muse2/muse/widgets/genset.h b/muse2/muse/widgets/genset.h
index 0e1697ee..b076a27f 100644
--- a/muse2/muse/widgets/genset.h
+++ b/muse2/muse/widgets/genset.h
@@ -4,6 +4,7 @@
// $Id: genset.h,v 1.3 2004/01/25 09:55:17 wschweer Exp $
//
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+// (C) Copyright 2011 Tim E. Real (terminator356 on sourceforge)
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
@@ -53,8 +54,7 @@ class GlobalSettingsConfig : public QDialog, public Ui::GlobalSettingsDialogBase
void bigtimeCurrent();
void mainCurrent();
void transportCurrent();
- void selectInstrumentsPath();
- void defaultInstrumentsPath();
+ void browseProjDir();
void traditionalPreset();
void mdiPreset();
void borlandPreset();
diff --git a/muse2/muse/widgets/gensetbase.ui b/muse2/muse/widgets/gensetbase.ui
index ba26cf38..124ee72a 100644
--- a/muse2/muse/widgets/gensetbase.ui
+++ b/muse2/muse/widgets/gensetbase.ui
@@ -30,7 +30,36 @@
<string>Application</string>
</attribute>
<layout class="QGridLayout">
- <item row="1" column="0">
+ <item row="0" column="0">
+ <widget class="QGroupBox" name="projDirGroupBox">
+ <property name="title">
+ <string>Project directory</string>
+ </property>
+ <layout class="QHBoxLayout" name="qhboxProjDir">
+ <item>
+ <widget class="QLabel" name="textLabel_ProjDir">
+ <property name="text">
+ <string>Projects:</string>
+ </property>
+ <property name="wordWrap">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="projDirEntry"/>
+ </item>
+ <item>
+ <widget class="QToolButton" name="projDirOpenToolButton">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="2" column="0">
<widget class="QGroupBox" name="groupBox4">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
@@ -413,14 +442,14 @@
</layout>
</widget>
</item>
- <item row="0" column="0">
+ <item row="1" column="0">
<widget class="QGroupBox" name="groupBox3">
<property name="title">
<string>Start Muse</string>
</property>
<layout class="QGridLayout">
<item row="0" column="0">
- <layout class="QGridLayout">
+ <layout class="QGridLayout" name="gridLayout11">
<item row="1" column="0">
<spacer name="spacer7_2">
<property name="orientation">
@@ -438,7 +467,7 @@
</spacer>
</item>
<item row="2" column="0" colspan="2">
- <layout class="QHBoxLayout">
+ <layout class="QHBoxLayout" name="qhboxStartSong">
<item>
<widget class="QLabel" name="textLabel1_2">
<property name="text">
@@ -811,9 +840,9 @@ Adjusts responsiveness of audio controls and
<number>2</number>
</property>
<item row="0" column="0">
- <layout class="QGridLayout">
+ <layout class="QGridLayout" name="gridLayoutwaveEditor">
<item row="0" column="0">
- <layout class="QHBoxLayout">
+ <layout class="QHBoxLayout" name="qhboxLayoutWaveEditor">
<item>
<widget class="QLabel" name="textLabel2_2">
<property name="sizePolicy">
@@ -1179,31 +1208,7 @@ Adjusts responsiveness of audio controls and
</item>
</widget>
</item>
- <item row="3" column="0">
- <widget class="QLabel" name="TextLabel3_4">
- <property name="text">
- <string>Instruments Directory</string>
- </property>
- </widget>
- </item>
<item row="3" column="1">
- <widget class="QLineEdit" name="userInstrumentsPath"/>
- </item>
- <item row="3" column="2">
- <widget class="QPushButton" name="selectInstrumentsDirButton">
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item row="3" column="3">
- <widget class="QPushButton" name="defaultInstrumentsDirButton">
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item row="4" column="1">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -1223,7 +1228,7 @@ Adjusts responsiveness of audio controls and
</widget>
<widget class="QWidget" name="tab3">
<attribute name="title">
- <string>GUI</string>
+ <string>GUI Behaviour</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="spacing">
@@ -1406,10 +1411,58 @@ left button behave like the middle button in such areas.</string>
</property>
</widget>
</item>
+ <item row="9" column="0">
+ <spacer name="verticalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="7" column="1">
+ <widget class="QCheckBox" name="addHiddenCheckBox">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="0">
+ <widget class="QLabel" name="label_4">
+ <property name="text">
+ <string>Allow adding hidden tracks in track list menu</string>
+ </property>
+ </widget>
+ </item>
+ <item row="8" column="0">
+ <widget class="QLabel" name="label_5">
+ <property name="text">
+ <string>Unhide tracks when adding hidden tracks</string>
+ </property>
+ </widget>
+ </item>
+ <item row="8" column="1">
+ <widget class="QCheckBox" name="unhideTracksCheckBox">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
- <item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_2">
+ <attribute name="title">
+ <string>GUI Style</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayoutTab2">
+ <item row="0" column="0">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>MDI-subwindowness and sharing menus</string>
@@ -1460,8 +1513,8 @@ left button behave like the middle button in such areas.</string>
<rect>
<x>0</x>
<y>0</y>
- <width>482</width>
- <height>143</height>
+ <width>512</width>
+ <height>378</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
diff --git a/muse2/muse/widgets/header.cpp b/muse2/muse/widgets/header.cpp
index 2c1057c3..968e7f73 100644
--- a/muse2/muse/widgets/header.cpp
+++ b/muse2/muse/widgets/header.cpp
@@ -51,7 +51,7 @@ void Header::readStatus(MusECore::Xml& xml)
for (QStringList::Iterator it = l.begin(); it != l.end(); ++it) {
int logialIdx=abs((*it).toInt());
bool isHidden = (*it).toInt() < 0 ? true:false;
- int section = visualIndex(logialIdx);
+ int section = visualIndex(logialIdx - (isHidden? 1:0));
moveSection(section, index);
if (isHidden)
hideSection(logialIdx-1);
@@ -65,7 +65,7 @@ void Header::readStatus(MusECore::Xml& xml)
bool foundIt=false;
for (QStringList::Iterator it = l.begin(); it != l.end(); ++it) {
int id=((*it).toInt());
- if ( id == i || i ==1-id )
+ if ( id == i || i == -1 - id )
foundIt=true;
}
if (foundIt == false) {
@@ -97,7 +97,7 @@ void Header::writeStatus(int level, MusECore::Xml& xml) const
//xml.nput(level, "<%s> ", name());
xml.nput(level, "<%s> ", MusECore::Xml::xmlString(objectName()).toLatin1().constData());
int n = count();
- for (int i = n; i >= 0; --i) {
+ for (int i = n-1; i >= 0; --i) {
if (isSectionHidden(logicalIndex(i)))
xml.nput("%d ", -logicalIndex(i)-1); // hidden is stored as negative value starting from -1
else
diff --git a/muse2/muse/widgets/knob.cpp b/muse2/muse/widgets/knob.cpp
index 920d2028..269f65cf 100644
--- a/muse2/muse/widgets/knob.cpp
+++ b/muse2/muse/widgets/knob.cpp
@@ -323,6 +323,30 @@ void Knob::rangeChange()
repaint();
}
+void Knob::mousePressEvent(QMouseEvent *e)
+{
+ if (e->button() == Qt::MidButton || e->modifiers() & Qt::ControlModifier) {
+ int xpos = e->x() - width() /2;
+ double v = float(e->y()) / height() * 1.2;
+
+ double halfRange = (maxValue() - minValue())/2;
+ double midValue = minValue() + halfRange;
+ // apply to range
+ if (xpos < 0) { // left values
+ v = -v;
+ }
+ setValue(v * halfRange + midValue);
+ SliderBase::valueChange();
+
+ // fake a left-click to make the knob still "stick" to
+ // the mouse.
+ QMouseEvent temp(e->type(), e->pos(), Qt::LeftButton, e->buttons(), e->modifiers());
+ SliderBase::mousePressEvent(&temp);
+ return;
+ }
+ SliderBase::mousePressEvent(e);
+}
+
//---------------------------------------------------------
// resizeEvent
//---------------------------------------------------------
diff --git a/muse2/muse/widgets/knob.h b/muse2/muse/widgets/knob.h
index 483fafa6..bd8621a1 100644
--- a/muse2/muse/widgets/knob.h
+++ b/muse2/muse/widgets/knob.h
@@ -80,6 +80,7 @@ class Knob : public SliderBase, public ScaleIf
virtual void paintEvent(QPaintEvent *);
virtual void resizeEvent(QResizeEvent *e);
+ virtual void mousePressEvent(QMouseEvent *e);
double getValue(const QPoint &p);
void getScrollMode( QPoint &p, const Qt::MouseButton &button, int &scrollMode, int &direction );
void scaleChange() { repaint(); }
diff --git a/muse2/muse/widgets/meter.cpp b/muse2/muse/widgets/meter.cpp
index 5c79ffb2..d9ca8e20 100644
--- a/muse2/muse/widgets/meter.cpp
+++ b/muse2/muse/widgets/meter.cpp
@@ -229,6 +229,8 @@ void Meter::setRange(double min, double max)
void Meter::paintEvent(QPaintEvent* ev)
{
+ // For some reason upon resizing we get double calls here and in resizeEvent.
+
QPainter p(this);
p.setRenderHint(QPainter::Antialiasing);
@@ -534,8 +536,11 @@ void Meter::drawVU(QPainter& p, const QRect& rect, const QPainterPath& drawPath,
void Meter::resizeEvent(QResizeEvent* ev)
{
- QFrame::resizeEvent(ev);
+ // For some reason upon resizing we get double calls here and in paintEvent.
+ //printf("Meter::resizeEvent w:%d h:%d\n", ev->size().width(), ev->size().height());
cur_yv = -1; // Force re-initialization.
+ QFrame::resizeEvent(ev);
+ update();
}
//---------------------------------------------------------
diff --git a/muse2/muse/widgets/midisync.ui b/muse2/muse/widgets/midisync.ui
index 8fc6248a..81d7451e 100644
--- a/muse2/muse/widgets/midisync.ui
+++ b/muse2/muse/widgets/midisync.ui
@@ -388,6 +388,19 @@ Enabled inputs in the list will
</column>
</widget>
</item>
+ <item row="5" column="0">
+ <widget class="QLabel" name="toBeDoneLabel">
+ <property name="text">
+ <string>Note: Sync delay and MTC sync currently not fully implemeted</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+ </property>
+ <property name="wordWrap">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
diff --git a/muse2/muse/widgets/mtrackinfo.cpp b/muse2/muse/widgets/mtrackinfo.cpp
index b5460447..19e9729a 100644
--- a/muse2/muse/widgets/mtrackinfo.cpp
+++ b/muse2/muse/widgets/mtrackinfo.cpp
@@ -574,7 +574,8 @@ void MidiTrackInfo::setLabelText()
//gradient.setColorAt(0, c.darker());
//gradient.setColorAt(0, c);
//gradient.setColorAt(1, c.darker());
- gradient.setColorAt(0, c.lighter());
+ gradient.setColorAt(0, c);
+ gradient.setColorAt(0.5, c.lighter());
gradient.setColorAt(1, c);
//palette.setBrush(QPalette::Button, gradient);
//palette.setBrush(QPalette::Window, gradient);
@@ -635,14 +636,17 @@ void MidiTrackInfo::iOutputPortChanged(int index)
{
if(!selected)
return;
+ int port_num = iOutput->itemData(index).toInt();
+ if(port_num < 0 || port_num >= MIDI_PORTS)
+ return;
MusECore::MidiTrack* track = (MusECore::MidiTrack*)selected;
- if (index == track->outPort())
+ if (port_num == track->outPort())
return;
// Changed by T356.
- //track->setOutPort(index);
+ //track->setOutPort(port_num);
MusEGlobal::audio->msgIdle(true);
- //audio->msgSetTrackOutPort(track, index);
- track->setOutPortAndUpdate(index);
+ //audio->msgSetTrackOutPort(track, port_num);
+ track->setOutPortAndUpdate(port_num);
MusEGlobal::audio->msgIdle(false);
//MusEGlobal::song->update(SC_MIDI_TRACK_PROP);
@@ -1081,11 +1085,9 @@ void MidiTrackInfo::instrPopup()
//QMenu* pup = new QMenu;
PopupMenu* pup = new PopupMenu(true);
- //instr->populatePatchPopup(pop, channel, MusEGlobal::song->mtype(), track->type() == MusECore::Track::DRUM);
- populatePatchPopup(instr, pup, channel, MusEGlobal::song->mtype(), track->type() == MusECore::Track::DRUM);
+ instr->populatePatchPopup(pup, channel, MusEGlobal::song->mtype(), track->type() == MusECore::Track::DRUM);
+ //populatePatchPopup(instr, pup, channel, MusEGlobal::song->mtype(), track->type() == MusECore::Track::DRUM);
- //if(pop->actions().count() == 0)
- // return;
if(pup->actions().count() == 0)
{
delete pup;
@@ -1095,7 +1097,6 @@ void MidiTrackInfo::instrPopup()
connect(pup, SIGNAL(triggered(QAction*)), SLOT(instrPopupActivated(QAction*)));
//connect(pup, SIGNAL(hovered(QAction*)), SLOT(instrPopupActivated(QAction*)));
- //QAction *act = pop->exec(iPatch->mapToGlobal(QPoint(10,5)));
QAction *act = pup->exec(iPatch->mapToGlobal(QPoint(10,5)));
if(act)
{
@@ -1346,12 +1347,20 @@ void MidiTrackInfo::updateTrackInfo(int flags)
//iInput->clear();
iOutput->clear();
+ int item_idx = 0;
for (int i = 0; i < MIDI_PORTS; ++i) {
+ MusECore::MidiDevice* md = MusEGlobal::midiPorts[i].device();
+ if(!md) // In the case of this combo box, don't bother listing empty ports. p4.0.41
+ continue;
+ //if(!(md->rwFlags() & 1 || md->isSynti()) && (i != outPort))
+ if(!(md->rwFlags() & 1) && (i != outPort)) // Only writeable ports, or current one. p4.0.41
+ continue;
QString name;
name.sprintf("%d:%s", i+1, MusEGlobal::midiPorts[i].portname().toLatin1().constData());
- iOutput->insertItem(i, name);
+ iOutput->insertItem(item_idx, name, i);
if (i == outPort)
- iOutput->setCurrentIndex(i);
+ iOutput->setCurrentIndex(item_idx);
+ item_idx++;
}
iOutput->blockSignals(false);
diff --git a/muse2/muse/widgets/musewidgetsplug.cpp b/muse2/muse/widgets/musewidgetsplug.cpp
index 4068da57..f707fb7c 100644
--- a/muse2/muse/widgets/musewidgetsplug.cpp
+++ b/muse2/muse/widgets/musewidgetsplug.cpp
@@ -157,7 +157,8 @@ MusEGlobal::GlobalConfigValues config = {
-60.0, // double minSlider;
false, // use Jack freewheel
20, // int guiRefresh;
- QString(""), // helpBrowser
+ QString(""), // userInstrumentsDir // Obsolete. Must keep for compatibility.
+ //QString(""), // helpBrowser // Obsolete
true, // extendedMidi
384, // division for smf export
QString(""), // copyright string for smf export
diff --git a/muse2/muse/widgets/popupmenu.cpp b/muse2/muse/widgets/popupmenu.cpp
index af546ec3..af870975 100644
--- a/muse2/muse/widgets/popupmenu.cpp
+++ b/muse2/muse/widgets/popupmenu.cpp
@@ -341,21 +341,38 @@ void PopupMenu::popHovered(QAction* action)
void PopupMenu::mouseReleaseEvent(QMouseEvent *e)
{
- #ifdef POPUP_MENU_DISABLE_STAY_OPEN
+ QAction* action = actionAt(e->pos());
+ if (!(action && action == activeAction() && !action->isSeparator() && action->isEnabled()))
+ action=NULL;
+
+ #ifdef POPUP_MENU_DISABLE_STAY_OPEN
+ if (action && action->menu() != NULL && action->isCheckable())
+ action->activate(QAction::Trigger);
+
QMenu::mouseReleaseEvent(e);
+
+ if (action && action->menu() != NULL && action->isCheckable())
+ close();
+
return;
#else
// Check for Ctrl to stay open.
if(!_stayOpen || (!MusEGlobal::config.popupsDefaultStayOpen && (e->modifiers() & Qt::ControlModifier) == 0))
{
+ if (action && action->menu() != NULL && action->isCheckable())
+ action->activate(QAction::Trigger);
+
QMenu::mouseReleaseEvent(e);
+
+ if (action && action->menu() != NULL && action->isCheckable())
+ close();
+
return;
}
//printf("PopupMenu::mouseReleaseEvent\n");
- QAction *action = actionAt(e->pos());
- if (action && action == activeAction() && !action->isSeparator() && action->isEnabled())
+ if (action)
action->activate(QAction::Trigger);
else
QMenu::mouseReleaseEvent(e);
diff --git a/muse2/muse/widgets/poslabel.cpp b/muse2/muse/widgets/poslabel.cpp
index 6cdcb27e..b893c58d 100644
--- a/muse2/muse/widgets/poslabel.cpp
+++ b/muse2/muse/widgets/poslabel.cpp
@@ -138,7 +138,11 @@ void PosLabel::setTickValue(unsigned val)
if (val == _tickValue)
return;
if (val >= MAX_TICK)
- abort();
+ {
+ printf("THIS SHOULD NEVER HAPPEN: val=%u > MAX_TICK=%u in PosLabel::setTickValue()!\n",val, MAX_TICK);
+ val=MAX_TICK-1;
+ }
+
_tickValue = val;
updateValue();
}
diff --git a/muse2/muse/widgets/projectcreate.ui b/muse2/muse/widgets/projectcreate.ui
index 406c83d6..d03f093c 100644
--- a/muse2/muse/widgets/projectcreate.ui
+++ b/muse2/muse/widgets/projectcreate.ui
@@ -17,28 +17,94 @@
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
- <widget class="QLabel" name="label_2">
- <property name="text">
- <string>Project Name:</string>
+ <layout class="QHBoxLayout" name="horizontalLayout_8">
+ <item>
+ <widget class="QLabel" name="label_5">
+ <property name="text">
+ <string>Projects folder:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="projDirLineEdit">
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="projDirToolButton">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="Line" name="line">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Project Name:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<widget class="QLineEdit" name="projectNameEdit"/>
</item>
<item>
+ <widget class="QCheckBox" name="templateCheckBox">
+ <property name="text">
+ <string>Project is a Template</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
+ <enum>QSizePolicy::Minimum</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>60</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_5">
+ <item>
+ <widget class="QLabel" name="label_4">
+ <property name="text">
+ <string>Project song file type:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="projectFileTypeCB"/>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
- <width>75</width>
+ <width>40</width>
<height>20</height>
</size>
</property>
@@ -87,9 +153,16 @@
</widget>
</item>
<item>
- <widget class="QPushButton" name="browseDirButton">
+ <widget class="QToolButton" name="browseDirButton">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="restorePathButton">
<property name="text">
- <string>Browse</string>
+ <string>...</string>
</property>
</widget>
</item>
@@ -123,6 +196,18 @@
</item>
</layout>
</widget>
+ <tabstops>
+ <tabstop>projectNameEdit</tabstop>
+ <tabstop>templateCheckBox</tabstop>
+ <tabstop>projectFileTypeCB</tabstop>
+ <tabstop>createFolderCheckbox</tabstop>
+ <tabstop>storageDirEdit</tabstop>
+ <tabstop>browseDirButton</tabstop>
+ <tabstop>commentEdit</tabstop>
+ <tabstop>buttonBox</tabstop>
+ <tabstop>projDirLineEdit</tabstop>
+ <tabstop>projDirToolButton</tabstop>
+ </tabstops>
<resources/>
<connections>
<connection>
diff --git a/muse2/muse/widgets/projectcreateimpl.cpp b/muse2/muse/widgets/projectcreateimpl.cpp
index 31973101..665d725e 100644
--- a/muse2/muse/widgets/projectcreateimpl.cpp
+++ b/muse2/muse/widgets/projectcreateimpl.cpp
@@ -4,6 +4,7 @@
// $Id: ./muse/widgets/projectcreateimpl.cpp $
//
// Copyright (C) 1999-2011 by Werner Schweer and others
+// (C) Copyright 2011 Tim E. Real (terminator356 on sourceforge)
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
@@ -21,12 +22,16 @@
//
//=========================================================
#include <stdio.h>
-#include <qfiledialog.h>
-#include <qdir.h>
+#include <QFileDialog>
+#include <QDir>
+#include <QStringList>
+
#include "projectcreateimpl.h"
#include "gconfig.h"
#include "globals.h"
#include "app.h"
+#include "helper.h"
+#include "icons.h"
namespace MusEGui {
@@ -35,10 +40,51 @@ ProjectCreateImpl::ProjectCreateImpl(QWidget *parent) :
{
setupUi(this);
- createFolderCheckbox->setChecked(MusEGlobal::config.projectStoreInFolder);
+ //bool is_new = (MusEGlobal::museProject == MusEGlobal::museProjectInitPath);
+ directoryPath = MusEGlobal::config.projectBaseFolder;
+
+ QStringList filters = localizedStringListFromCharArray(MusEGlobal::project_create_file_save_pattern, "file_patterns");
+ projectFileTypeCB->addItems(filters);
+
+ QString proj_title = MusEGlobal::muse->projectTitle();
+ QString proj_path = MusEGlobal::muse->projectPath();
+ QString proj_ext = MusEGlobal::muse->projectExtension();
+
+ projectNameEdit->setText(proj_title);
+
+ bool is_template = proj_path.startsWith(MusEGlobal::configPath + "/templates");
+
+ templateCheckBox->setChecked(is_template);
+
+ projDirPath = proj_path;
+
+ int type_idx = 0;
+ if(!proj_ext.isEmpty())
+ {
+ // FIXME Imperfect. Trying to avoid adding yet another series of character strings. p4.0.40
+ type_idx = projectFileTypeCB->findText(proj_ext, Qt::MatchContains | Qt::MatchCaseSensitive);
+ if(type_idx == -1)
+ type_idx = 0;
+ }
+ projectFileTypeCB->setCurrentIndex(type_idx);
+
+ projDirToolButton->setIcon(*openIcon);
+ browseDirButton->setIcon(*openIcon);
+ restorePathButton->setIcon(*undoIcon);
+
+ restorePathButton->setEnabled(false); // Disabled at first.
+
+ //createFolderCheckbox->setChecked(MusEGlobal::config.projectStoreInFolder && is_new); // Suggest no folder if not new.
+
+ connect(templateCheckBox,SIGNAL(clicked()), this, SLOT(templateButtonChanged()));
+ //connect(templateCheckBox,SIGNAL(clicked()), this, SLOT(updateDirectoryPath()));
+ connect(projDirToolButton,SIGNAL(clicked()), this, SLOT(browseProjDir()));
+ connect(restorePathButton,SIGNAL(clicked()), this, SLOT(restorePath()));
connect(browseDirButton,SIGNAL(clicked()), this, SLOT(selectDirectory()));
- connect(projectNameEdit,SIGNAL(textChanged(QString)), this, SLOT(updateDirectoryPath()));
- connect(createFolderCheckbox,SIGNAL(clicked()), this, SLOT(updateDirectoryPath()));
+ //connect(projectNameEdit,SIGNAL(textChanged(QString)), this, SLOT(updateDirectoryPath()));
+ connect(projectNameEdit,SIGNAL(textChanged(QString)), this, SLOT(updateProjectName()));
+ connect(createFolderCheckbox,SIGNAL(clicked()), this, SLOT(createProjFolderChanged()));
+ connect(projectFileTypeCB,SIGNAL(currentIndexChanged(int)), this, SLOT(updateDirectoryPath()));
connect(buttonBox, SIGNAL(accepted()), this, SLOT(ok()));
#if QT_VERSION >= 0x040700
projectNameEdit->setPlaceholderText("<Project Name>");
@@ -46,52 +92,155 @@ ProjectCreateImpl::ProjectCreateImpl(QWidget *parent) :
// as of Qt-4.7.1
//commentEdit->setPlaceholderText("<Add information about project here>");
#endif
- directoryPath = MusEGlobal::config.projectBaseFolder;
updateDirectoryPath();
show();
}
void ProjectCreateImpl::selectDirectory()
{
- QFileDialog qfd;
- qfd.selectFile(directoryPath);
- qfd.setFileMode(QFileDialog::DirectoryOnly);
- if (qfd.exec() == QDialog::Rejected) {
- return;
- }
- directoryPath=qfd.selectedFiles().first();
+ QString dpath = templateCheckBox->isChecked() ?
+ (overrideTemplDirPath.isEmpty() ? (MusEGlobal::configPath + QString("/templates")) : overrideTemplDirPath) :
+ (overrideDirPath.isEmpty() ? directoryPath : overrideDirPath);
+
+ QString dir = QFileDialog::getExistingDirectory(this, tr("Select directory"), dpath);
+ if(dir.isEmpty())
+ return;
+
+ (templateCheckBox->isChecked() ? overrideTemplDirPath : overrideDirPath) = dir;
+ restorePathButton->setEnabled(true);
updateDirectoryPath();
}
-void ProjectCreateImpl::updateDirectoryPath()
+void ProjectCreateImpl::updateProjectName()
{
+ QString curExt = projectFileTypeCB->currentText();
+ if(curExt.isEmpty())
+ curExt = ".med";
+ else
+ {
+ curExt = MusEGui::getFilterExtension(curExt);
+ // Do we have a valid extension?
+ if(curExt.isEmpty())
+ curExt = ".med";
+ }
+
QString name = "";
if (createFolderCheckbox->isChecked()) {
if (!projectNameEdit->text().isEmpty())
- name = projectNameEdit->text() + "/" + projectNameEdit->text() + ".med";
+ //name = projectNameEdit->text() + "/" + projectNameEdit->text() + ".med";
+ name = projectNameEdit->text() + "/" + projectNameEdit->text() + curExt;
//storageDirEdit->setText(directoryPath + name );
} else {
if (!projectNameEdit->text().isEmpty())
- name = projectNameEdit->text() + ".med";
+ //name = projectNameEdit->text() + ".med";
+ name = projectNameEdit->text() + curExt;
//storageDirEdit->setText(directoryPath +"/" + name);
}
- storageDirEdit->setText(directoryPath +"/" + name ); // Tim
+
+ bool is_new = (MusEGlobal::museProject == MusEGlobal::museProjectInitPath);
+
+ QString dpath = templateCheckBox->isChecked() ?
+ (overrideTemplDirPath.isEmpty() ? (MusEGlobal::configPath + QString("/templates")) : overrideTemplDirPath) :
+ (overrideDirPath.isEmpty() ? (is_new ? directoryPath : projDirPath) : overrideDirPath);
+
+ QDir proj_dir(dpath);
+ //if(is_project && MusEGlobal::config.projectStoreInFolder)
+ bool is_project = dpath.startsWith(MusEGlobal::config.projectBaseFolder);
+ //bool is_template = dpath.startsWith(MusEGlobal::configPath + "/templates") && templateCheckBox->isChecked();
+ //bool is_new = (MusEGlobal::museProject == MusEGlobal::museProjectInitPath) && MusEGlobal::config.projectStoreInFolder;
+ //bool is_new = (MusEGlobal::museProject == MusEGlobal::museProjectInitPath) &&
+ MusEGlobal::config.projectStoreInFolder &&
+ (templateCheckBox->isChecked() ? overrideTemplDirPath.isEmpty() : overrideDirPath.isEmpty());
+ //bool is_template = is_new && dpath.startsWith(MusEGlobal::configPath + "/templates") && templateCheckBox->isChecked();
+ if(!is_new && createFolderCheckbox->isChecked() && !templateCheckBox->isChecked() &&
+ (templateCheckBox->isChecked() ? overrideTemplDirPath.isEmpty() : overrideDirPath.isEmpty()))
+ proj_dir.cdUp();
+ dpath = proj_dir.absolutePath();
+
+ //if(!initProjPath.isEmpty())
+ //{
+ // initProjPath.clear();
+ //}
+
+ storageDirEdit->blockSignals(true);
+ storageDirEdit->setText(dpath + "/" + name );
+ storageDirEdit->blockSignals(false);
+
+ projDirLineEdit->setEnabled(!templateCheckBox->isChecked() && is_project);
+}
+
+void ProjectCreateImpl::updateDirectoryPath()
+{
+ updateProjectName();
+
+ projDirLineEdit->blockSignals(true);
+ projDirLineEdit->setText(MusEGlobal::config.projectBaseFolder);
+ projDirLineEdit->blockSignals(false);
}
-QString ProjectCreateImpl::getProjectPath()
+QString ProjectCreateImpl::getProjectPath() const
{
return storageDirEdit->text();
}
-QString ProjectCreateImpl::getSongInfo()
+
+QString ProjectCreateImpl::getSongInfo() const
{
return commentEdit->toPlainText();
}
+
void ProjectCreateImpl::ok()
{
MusEGlobal::config.projectStoreInFolder = createFolderCheckbox->isChecked();
- MusEGlobal::config.projectBaseFolder = directoryPath;
- MusEGlobal::muse->changeConfig(true);
+ //MusEGlobal::config.projectBaseFolder = directoryPath;
+ //MusEGlobal::muse->changeConfig(true);
emit accept();
}
+void ProjectCreateImpl::createProjFolderChanged()
+{
+ //MusEGlobal::config.projectStoreInFolder = createFolderCheckbox->isChecked();
+ //MusEGlobal::muse->changeConfig(true); // Save to config file.
+ updateDirectoryPath();
+}
+
+void ProjectCreateImpl::browseProjDir()
+{
+ QString dir = MusEGui::browseProjectFolder(this);
+ if(!dir.isEmpty())
+ {
+ directoryPath = dir;
+ MusEGlobal::config.projectBaseFolder = dir;
+ MusEGlobal::muse->changeConfig(true); // Save to config file.
+ updateDirectoryPath();
+ }
+}
+
+void ProjectCreateImpl::templateButtonChanged()
+{
+ restorePathButton->setEnabled(templateCheckBox->isChecked() ? !overrideTemplDirPath.isEmpty() : !overrideDirPath.isEmpty());
+ updateDirectoryPath();
+}
+
+void ProjectCreateImpl::restorePath()
+{
+ if(templateCheckBox->isChecked())
+ overrideTemplDirPath.clear();
+ else
+ overrideDirPath.clear();
+ restorePathButton->setEnabled(templateCheckBox->isChecked() ? !overrideTemplDirPath.isEmpty() : !overrideDirPath.isEmpty());
+ updateDirectoryPath();
+}
+
+/*
+bool ProjectCreateImpl::getProjectIsTemplate() const
+{
+ return templateCheckBox->isChecked();
+}
+
+QString ProjectCreateImpl::getTemplatePath() const
+{
+ return templDirPath;
+}
+*/
+
} //namespace MusEGui
diff --git a/muse2/muse/widgets/projectcreateimpl.h b/muse2/muse/widgets/projectcreateimpl.h
index 258b0921..f08cb1bc 100644
--- a/muse2/muse/widgets/projectcreateimpl.h
+++ b/muse2/muse/widgets/projectcreateimpl.h
@@ -4,6 +4,7 @@
// $Id: ./muse/widgets/projectcreateimpl.h $
//
// Copyright (C) 1999-2011 by Werner Schweer and others
+// (C) Copyright 2011 Tim E. Real (terminator356 on sourceforge)
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
@@ -33,18 +34,28 @@ class ProjectCreateImpl : public QDialog, Ui::ProjectCreate
Q_OBJECT
QString directoryPath;
+ QString overrideDirPath;
+ QString overrideTemplDirPath;
+ QString projDirPath;
+
public:
explicit ProjectCreateImpl(QWidget *parent = 0);
- QString getProjectPath();
- QString getSongInfo();
+ QString getProjectPath() const;
+ QString getSongInfo() const;
+ //bool getProjectIsTemplate() const;
+ //QString getTemplatePath() const;
signals:
-public slots:
+protected slots:
+ void updateProjectName();
void updateDirectoryPath();
void selectDirectory();
void ok();
-
+ void createProjFolderChanged();
+ void browseProjDir();
+ void templateButtonChanged();
+ void restorePath();
};
} // namespace MusEGui
diff --git a/muse2/muse/widgets/routepopup.cpp b/muse2/muse/widgets/routepopup.cpp
index 80ae98bd..0f1f8264 100644
--- a/muse2/muse/widgets/routepopup.cpp
+++ b/muse2/muse/widgets/routepopup.cpp
@@ -43,10 +43,10 @@ namespace MusEGui {
int RoutePopupMenu::addMenuItem(MusECore::AudioTrack* track, MusECore::Track* route_track, PopupMenu* lb, int id, int channel, int channels, bool isOutput)
{
// totalInChannels is only used by syntis.
- int toch = ((MusECore::AudioTrack*)track)->totalOutChannels();
+ //int toch = ((MusECore::AudioTrack*)track)->totalOutChannels();
// If track channels = 1, it must be a mono synth. And synti channels cannot be changed by user.
- if(track->channels() == 1)
- toch = 1;
+ //if(track->channels() == 1)
+ // toch = 1;
// Don't add the last stray mono route if the track is stereo.
//if(route_track->channels() > 1 && (channel+1 == chans))
@@ -95,6 +95,13 @@ int RoutePopupMenu::addMenuItem(MusECore::AudioTrack* track, MusECore::Track* ro
}
}
}
+
+ if(!act->isChecked()) // If circular route exists, allow user to break it, otherwise forbidden.
+ {
+ if( (isOutput ? track : route_track)->isCircularRoute(isOutput ? route_track : track) )
+ act->setEnabled(false);
+ }
+
return ++id;
}
@@ -259,6 +266,13 @@ int RoutePopupMenu::addSyntiPorts(MusECore::AudioTrack* t, PopupMenu* lb, int id
}
}
}
+
+ if(!act->isChecked()) // If circular route exists, allow user to break it, otherwise forbidden.
+ {
+ if( (isOutput ? t : track)->isCircularRoute(isOutput ? track : t) )
+ act->setEnabled(false);
+ }
+
++id;
}
@@ -520,6 +534,13 @@ int RoutePopupMenu::nonSyntiTrackAddSyntis(MusECore::AudioTrack* t, PopupMenu* l
}
}
}
+
+ if(!act->isChecked()) // If circular route exists, allow user to break it, otherwise forbidden.
+ {
+ if( (isOutput ? t : track)->isCircularRoute(isOutput ? track : t) )
+ act->setEnabled(false);
+ }
+
++id;
}
@@ -573,6 +594,13 @@ int RoutePopupMenu::nonSyntiTrackAddSyntis(MusECore::AudioTrack* t, PopupMenu* l
}
}
}
+
+ if(!act->isChecked()) // If circular route exists, allow user to break it, otherwise forbidden.
+ {
+ if( (isOutput ? t : track)->isCircularRoute(isOutput ? track : t) )
+ act->setEnabled(false);
+ }
+
++id;
}
}
@@ -1062,9 +1090,8 @@ void RoutePopupMenu::prepare()
for( ; pi < MIDI_PORTS; ++pi)
{
MusECore::MidiDevice* md = MusEGlobal::midiPorts[pi].device();
- //if(md && !md->isSynti() && (md->rwFlags() & 2))
- //if(md && (md->rwFlags() & 2)) // p4.0.27
- if(md && (md->rwFlags() & 2 || md->isSynti()) ) // p4.0.27
+ if(md && !md->isSynti() && (md->rwFlags() & 2))
+ //if(md && (md->rwFlags() & 2 || md->isSynti()) ) // p4.0.27 Reverted p4.0.35
break;
}
if(pi == MIDI_PORTS)
@@ -1091,12 +1118,9 @@ void RoutePopupMenu::prepare()
// continue;
// Do not list synth devices!
- ///if(md && md->isSynti())
- /// continue;
- ///if(md && !(md->rwFlags() & 2))
- /// continue;
- // p4.0.27 Go ahead. Synths esp MESS send out stuff.
- if( md && !(md->rwFlags() & 2) && !md->isSynti() )
+ if( md && (!(md->rwFlags() & 2) || md->isSynti()) )
+ // p4.0.27 Go ahead. Synths esp MESS send out stuff. Reverted p4.0.35
+ //if( md && !(md->rwFlags() & 2) && !md->isSynti() )
continue;
//printf("MusE::prepareRoutingPopupMenu adding submenu portnum:%d\n", i);
diff --git a/muse2/muse/widgets/synthconfigbase.ui b/muse2/muse/widgets/synthconfigbase.ui
index 97f0beaa..500241a8 100644
--- a/muse2/muse/widgets/synthconfigbase.ui
+++ b/muse2/muse/widgets/synthconfigbase.ui
@@ -6,12 +6,12 @@
<rect>
<x>0</x>
<y>0</y>
- <width>630</width>
+ <width>810</width>
<height>492</height>
</rect>
</property>
<property name="windowTitle">
- <string>MusE: Synth Configuration</string>
+ <string>Midi Port and Soft Synth Configuration</string>
</property>
<layout class="QGridLayout">
<item row="1" column="1">
@@ -32,6 +32,11 @@
</column>
<column>
<property name="text">
+ <string>Type</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
<string>Midi Port</string>
</property>
</column>
@@ -137,6 +142,11 @@
</column>
<column>
<property name="text">
+ <string>Type</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
<string>Inst</string>
</property>
</column>
diff --git a/muse2/muse/widgets/utils.cpp b/muse2/muse/widgets/utils.cpp
index 708bef07..1641b267 100644
--- a/muse2/muse/widgets/utils.cpp
+++ b/muse2/muse/widgets/utils.cpp
@@ -528,7 +528,8 @@ int get_paste_len()
if (p->endTick() > end_tick)
end_tick=p->endTick();
-
+
+ unchainClone(p);
delete p;
}
}
diff --git a/muse2/muse/widgets/visibletracks.cpp b/muse2/muse/widgets/visibletracks.cpp
index f8ce06bf..4976ecf9 100644
--- a/muse2/muse/widgets/visibletracks.cpp
+++ b/muse2/muse/widgets/visibletracks.cpp
@@ -29,6 +29,7 @@
#include "action.h"
#include "track.h"
#include "synth.h"
+#include "app.h"
namespace MusEGui {
@@ -130,6 +131,7 @@ void VisibleTracks::visibilityChanged(QAction* action)
default:
break;
}
+ MusEGlobal::muse->changeConfig(true); // save settings
emit visibilityChanged();
}
diff --git a/muse2/muse/widgets/visibletracks.h b/muse2/muse/widgets/visibletracks.h
index d56c9ce7..bf49c068 100644
--- a/muse2/muse/widgets/visibletracks.h
+++ b/muse2/muse/widgets/visibletracks.h
@@ -52,13 +52,14 @@ class VisibleTracks : public QToolBar {
private slots:
void visibilityChanged(QAction* action);
+ public slots:
+ void updateVisibleTracksButtons();
signals:
void visibilityChanged();
public:
VisibleTracks(QWidget* /*parent*/, const char* name = 0); // Needs a parent !
- void updateVisibleTracksButtons();
~VisibleTracks();
};