diff options
author | Florian Jung <flo@windfisch.org> | 2011-12-21 17:39:57 +0000 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2011-12-21 17:39:57 +0000 |
commit | 1057d7190242cdf9248671b316a398db805f5f56 (patch) | |
tree | ab50268a7db2f80cfb45a7ad6578fe735ab84ce5 /muse2/muse/widgets | |
parent | 9977c7114089b8708d310268833b83343caa0fd1 (diff) | |
parent | c36a5508aa42e596b005425208054af9a60734b4 (diff) |
merged with trunk (that is, pulled the fixes from release_2_0)
only quickly tested, seems okay on the first glance
Diffstat (limited to 'muse2/muse/widgets')
37 files changed, 783 insertions, 333 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/comboQuant.cpp b/muse2/muse/widgets/comboQuant.cpp index aee7ad5c..6d8dc30c 100644 --- a/muse2/muse/widgets/comboQuant.cpp +++ b/muse2/muse/widgets/comboQuant.cpp @@ -37,9 +37,9 @@ static int quantTable[] = { }; static const char* quantStrings[] = { - QT_TRANSLATE_NOOP("@default", "Off"), "64T", "32T", "16T", "8T", "4T", "2T", "1T", - QT_TRANSLATE_NOOP("@default", "Off"), "64", "32", "16", "8", "4", "2", "1", - QT_TRANSLATE_NOOP("@default", "Off"), "64.", "32.", "16.", "8.", "4.", "2.", "1." + QT_TRANSLATE_NOOP("MusEGui::ComboQuant", "Off"), "64T", "32T", "16T", "8T", "4T", "2T", "1T", + QT_TRANSLATE_NOOP("MusEGui::ComboQuant", "Off"), "64", "32", "16", "8", "4", "2", "1", + QT_TRANSLATE_NOOP("MusEGui::ComboQuant", "Off"), "64.", "32.", "16.", "8.", "4.", "2.", "1." }; //--------------------------------------------------------- diff --git a/muse2/muse/widgets/configmidifilebase.ui b/muse2/muse/widgets/configmidifilebase.ui index c050450c..3eb7063e 100644 --- a/muse2/muse/widgets/configmidifilebase.ui +++ b/muse2/muse/widgets/configmidifilebase.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>548</width> - <height>346</height> + <width>546</width> + <height>367</height> </rect> </property> <property name="windowTitle"> @@ -28,8 +28,8 @@ <property name="title"> <string>Import:</string> </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> + <layout class="QGridLayout"> + <item row="0" column="0"> <widget class="QCheckBox" name="splitPartsCheckBox"> <property name="toolTip"> <string>Split tracks into parts, or one single part</string> @@ -42,7 +42,7 @@ </property> </widget> </item> - <item> + <item row="1" column="0"> <layout class="QHBoxLayout" name="horizontalLayout"> <item> <widget class="QRadioButton" name="newDrumsCheckbox"> @@ -78,10 +78,10 @@ <string>Export:</string> </property> <layout class="QGridLayout"> - <item row="2" column="1"> + <item row="3" column="1"> <widget class="QLineEdit" name="copyrightEdit"/> </item> - <item row="1" column="1"> + <item row="2" column="1"> <widget class="QComboBox" name="divisionCombo"> <item> <property name="text"> @@ -100,7 +100,7 @@ </item> </widget> </item> - <item row="3" column="0" colspan="2"> + <item row="4" column="0" colspan="2"> <widget class="QCheckBox" name="extendedFormat"> <property name="enabled"> <bool>true</bool> @@ -110,7 +110,7 @@ </property> </widget> </item> - <item row="4" column="0" colspan="2"> + <item row="5" column="0" colspan="2"> <widget class="QCheckBox" name="twoByteTimeSigs"> <property name="text"> <string>Use &2-byte time signatures instead of standard 4</string> @@ -120,7 +120,7 @@ </property> </widget> </item> - <item row="2" column="0"> + <item row="3" column="0"> <widget class="QLabel" name="textLabel2"> <property name="text"> <string>Copyright:</string> @@ -140,7 +140,23 @@ </property> </widget> </item> - <item row="1" column="0"> + <item row="1" column="0" colspan="2"> + <widget class="QLabel" name="textLabel4"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Note: Format 0 uses the FIRST midi track's name/comment in the arranger</string> + </property> + <property name="wordWrap"> + <bool>false</bool> + </property> + </widget> + </item> + <item row="2" column="0"> <widget class="QLabel" name="textLabel1"> <property name="text"> <string>Division:</string> @@ -150,7 +166,7 @@ </property> </widget> </item> - <item row="5" column="0" colspan="2"> + <item row="6" column="0" colspan="2"> <widget class="QCheckBox" name="optNoteOffs"> <property name="text"> <string>Save space by replacing note-offs with &zero velocity note-ons</string> diff --git a/muse2/muse/widgets/filedialog.cpp b/muse2/muse/widgets/filedialog.cpp index df391b45..7f2c1681 100644 --- a/muse2/muse/widgets/filedialog.cpp +++ b/muse2/muse/widgets/filedialog.cpp @@ -33,6 +33,7 @@ #include "filedialog.h" #include "../globals.h" #include "gconfig.h" +#include "helper.h" namespace MusEGui { @@ -122,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); @@ -269,40 +272,14 @@ 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 //--------------------------------------------------------- -QString getOpenFileName(const QString &startWith, - const QStringList& filters, QWidget* parent, const QString& name, bool* all, MFileDialog::ViewType viewType) +QString getOpenFileName(const QString &startWith, const char** filters_chararray, + QWidget* parent, const QString& name, bool* all, MFileDialog::ViewType viewType) { + QStringList filters = localizedStringListFromCharArray(filters_chararray, "file_patterns"); + QString initialSelection; // FIXME Tim. MFileDialog *dlg = new MFileDialog(startWith, QString::null, parent, false); dlg->setNameFilters(filters); @@ -339,9 +316,10 @@ QString getOpenFileName(const QString &startWith, //--------------------------------------------------------- QString getSaveFileName(const QString &startWith, - //const char** filters, QWidget* parent, const QString& name) - const QStringList& filters, QWidget* parent, const QString& name) + const char** filters_chararray, QWidget* parent, const QString& name) { + QStringList filters = localizedStringListFromCharArray(filters_chararray, "file_patterns"); + MFileDialog *dlg = new MFileDialog(startWith, QString::null, parent, true); dlg->setNameFilters(filters); dlg->setWindowTitle(name); @@ -404,9 +382,9 @@ QString getSaveFileName(const QString &startWith, //--------------------------------------------------------- QString getImageFileName(const QString& startWith, - //const char** filters, QWidget* parent, const QString& name) - const QStringList& filters, QWidget* parent, const QString& name) + const char** filters_chararray, QWidget* parent, const QString& name) { + QStringList filters = localizedStringListFromCharArray(filters_chararray, "file_patterns"); QString initialSelection; QString* workingDirectory = new QString(QDir::currentPath()); if (!startWith.isEmpty() ) { @@ -505,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 { @@ -547,15 +527,14 @@ MFile::~MFile() // open //--------------------------------------------------------- -//FILE* MFile::open(const char* mode, const char** pattern, -FILE* MFile::open(const char* mode, const QStringList& pattern, +FILE* MFile::open(const char* mode, const char** patterns_chararray, QWidget* parent, bool noError, bool warnIfOverwrite, const QString& caption) { QString name; if (strcmp(mode, "r") == 0) - name = getOpenFileName(path, pattern, parent, caption, 0); + name = getOpenFileName(path, patterns_chararray, parent, caption, 0); else - name = getSaveFileName(path, pattern, parent, caption); + name = getSaveFileName(path, patterns_chararray, parent, caption); if (name.isEmpty()) return 0; f = fileOpen(parent, name, ext, mode, isPopen, noError, diff --git a/muse2/muse/widgets/filedialog.h b/muse2/muse/widgets/filedialog.h index e5687494..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 @@ -24,8 +25,6 @@ #include "ui_fdialogbuttons.h" -class QStringList; - namespace MusEGui { //--------------------------------------------------------- @@ -91,14 +90,11 @@ class ContentsPreview : public QWidget, public Q3FilePreview { }; */ -//QString getSaveFileName(const QString& startWidth, const char** filter, -QString getSaveFileName(const QString& startWidth, const QStringList& filters, +QString getSaveFileName(const QString& startWidth, const char** filters, QWidget* parent, const QString& name); -//QString getOpenFileName(const QString& startWidth, const char** filter, -QString getOpenFileName(const QString& startWidth, const QStringList& filters, +QString getOpenFileName(const QString& startWidth, const char** filters, QWidget* parent, const QString& name, bool* openAll, MFileDialog::ViewType viewType = MFileDialog::PROJECT_VIEW); -//QString getImageFileName(const QString& startWith, const char** filters, -QString getImageFileName(const QString& startWith, const QStringList& filters, +QString getImageFileName(const QString& startWith, const char** filters, QWidget* parent, const QString& name); FILE* fileOpen(QWidget*, QString, const QString&, @@ -119,8 +115,7 @@ class MFile { public: MFile(const QString& path, const QString& ext); ~MFile(); - //FILE* open(const char* mode, const char** pattern, - FILE* open(const char* mode, const QStringList& pattern, + FILE* open(const char* mode, const char** patterns, QWidget* parent, bool noError, bool warnIfOverwrite, const QString& caption); }; diff --git a/muse2/muse/widgets/function_dialogs/quantbase.ui b/muse2/muse/widgets/function_dialogs/quantbase.ui index 973be7b8..31173e46 100644 --- a/muse2/muse/widgets/function_dialogs/quantbase.ui +++ b/muse2/muse/widgets/function_dialogs/quantbase.ui @@ -157,7 +157,7 @@ <bool>false</bool> </property> <property name="currentIndex"> - <number>3</number> + <number>0</number> </property> <property name="frame"> <bool>true</bool> @@ -174,7 +174,12 @@ </item> <item> <property name="text"> - <string>Quarter</string> + <string>4th</string> + </property> + </item> + <item> + <property name="text"> + <string>4th Triplet</string> </property> </item> <item> @@ -184,14 +189,29 @@ </item> <item> <property name="text"> + <string>8th Triplet</string> + </property> + </item> + <item> + <property name="text"> <string>16th</string> </property> </item> <item> <property name="text"> + <string>16th Triplet</string> + </property> + </item> + <item> + <property name="text"> <string>32th</string> </property> </item> + <item> + <property name="text"> + <string>32th Triplet</string> + </property> + </item> </widget> </item> <item row="3" column="0"> diff --git a/muse2/muse/widgets/function_dialogs/quantize.cpp b/muse2/muse/widgets/function_dialogs/quantize.cpp index df7c0298..7233c2b8 100644 --- a/muse2/muse/widgets/function_dialogs/quantize.cpp +++ b/muse2/muse/widgets/function_dialogs/quantize.cpp @@ -26,6 +26,20 @@ namespace MusEGui { +int rasterVals[] = { + 1, // Whole note divisor + 2, // Half note divisor + 4, // 4th note divisor + 6, // 4thT divisor + 8, // 8th divisor + 12,//8thT divisor + 16,// ... + 24, + 32, + 48, + 64 +}; + Quantize::Quantize(QWidget* parent) : QDialog(parent) { @@ -44,7 +58,7 @@ void Quantize::pull_values() range = range_group->checkedId(); strength = strength_spinbox->value(); threshold = threshold_spinbox->value(); - raster_power2 = raster_combobox->currentIndex(); + raster_index = raster_combobox->currentIndex(); quant_len = len_checkbox->isChecked(); swing = swing_spinbox->value(); } @@ -62,7 +76,7 @@ int Quantize::exec() range_group->button(range)->setChecked(true); strength_spinbox->setValue(strength); threshold_spinbox->setValue(threshold); - raster_combobox->setCurrentIndex(raster_power2); + raster_combobox->setCurrentIndex(raster_index); len_checkbox->setChecked(quant_len); swing_spinbox->setValue(swing); @@ -88,7 +102,7 @@ void Quantize::read_configuration(MusECore::Xml& xml) else if (tag == "threshold") threshold=xml.parseInt(); else if (tag == "raster") - raster_power2=xml.parseInt(); + raster_index=xml.parseInt(); else if (tag == "swing") swing=xml.parseInt(); else if (tag == "quant_len") @@ -113,7 +127,7 @@ void Quantize::write_configuration(int level, MusECore::Xml& xml) xml.intTag(level, "range", range); xml.intTag(level, "strength", strength); xml.intTag(level, "threshold", threshold); - xml.intTag(level, "raster", raster_power2); + xml.intTag(level, "raster", raster_index); xml.intTag(level, "swing", swing); xml.intTag(level, "quant_len", quant_len); xml.tag(level, "/quantize"); diff --git a/muse2/muse/widgets/function_dialogs/quantize.h b/muse2/muse/widgets/function_dialogs/quantize.h index 6ce74215..b5229f9e 100644 --- a/muse2/muse/widgets/function_dialogs/quantize.h +++ b/muse2/muse/widgets/function_dialogs/quantize.h @@ -33,6 +33,7 @@ class Xml; namespace MusEGui { + class Quantize : public QDialog, public Ui::QuantBase { Q_OBJECT @@ -50,18 +51,18 @@ class Quantize : public QDialog, public Ui::QuantBase int range; int strength; int threshold; - int raster_power2; + int raster_index; int swing; bool quant_len; void read_configuration(MusECore::Xml& xml); void write_configuration(int level, MusECore::Xml& xml); - public slots: int exec(); }; +extern int rasterVals[]; } // namespace MusEGui #endif diff --git a/muse2/muse/widgets/genset.cpp b/muse2/muse/widgets/genset.cpp index dd91e9ec..df7dea78 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 { @@ -100,12 +104,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); @@ -126,6 +124,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); @@ -180,9 +181,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())); @@ -267,6 +273,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); @@ -321,6 +329,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(); } @@ -361,7 +372,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(); MusEGlobal::config.newDrumRecordCondition = MusECore::newDrumRecordCondition_t(recDrumGroup->checkedId()); @@ -421,6 +434,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); @@ -455,8 +471,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 @@ -559,21 +573,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++) @@ -611,5 +610,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 92da61e3..53f5c2c1 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 39dcd4c3..1abc3cd1 100644 --- a/muse2/muse/widgets/gensetbase.ui +++ b/muse2/muse/widgets/gensetbase.ui @@ -7,7 +7,7 @@ <x>0</x> <y>0</y> <width>556</width> - <height>527</height> + <height>552</height> </rect> </property> <property name="windowTitle"> @@ -23,14 +23,43 @@ </sizepolicy> </property> <property name="currentIndex"> - <number>2</number> + <number>0</number> </property> <widget class="QWidget" name="TabPage"> <attribute name="title"> <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"> @@ -995,13 +1024,7 @@ Adjusts responsiveness of audio controls and <attribute name="title"> <string>Midi</string> </attribute> - <layout class="QVBoxLayout"> - <property name="spacing"> - <number>6</number> - </property> - <property name="margin"> - <number>11</number> - </property> + <layout class="QVBoxLayout" name="verticalLayout_7"> <item> <widget class="QGroupBox" name="GroupBox2"> <property name="title"> @@ -1179,30 +1202,6 @@ 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> </layout> </widget> </item> @@ -1244,14 +1243,14 @@ Adjusts responsiveness of audio controls and </widget> </item> <item> - <spacer name="verticalSpacer_2"> + <spacer name="verticalSpacer_3"> <property name="orientation"> <enum>Qt::Vertical</enum> </property> <property name="sizeHint" stdset="0"> <size> - <width>20</width> - <height>40</height> + <width>191</width> + <height>166</height> </size> </property> </spacer> @@ -1260,7 +1259,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"> @@ -1443,10 +1442,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> @@ -1497,8 +1544,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>96</width> + <height>26</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/metronome.cpp b/muse2/muse/widgets/metronome.cpp index e6b7bd91..416e9e47 100644 --- a/muse2/muse/widgets/metronome.cpp +++ b/muse2/muse/widgets/metronome.cpp @@ -85,7 +85,7 @@ void MetronomeConfig::audioBeepRoutesClicked() int nn = 0; for(MusECore::iAudioOutput iao = ol->begin(); iao != ol->end(); ++iao) { - QAction* action = pup->addAction(QT_TRANSLATE_NOOP("@default", (*iao)->name())); + QAction* action = pup->addAction((*iao)->name()); action->setCheckable(true); action->setData(nn); if((*iao)->sendMetronome()) 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 d0c0e070..7952308e 100644 --- a/muse2/muse/widgets/mtrackinfo.cpp +++ b/muse2/muse/widgets/mtrackinfo.cpp @@ -579,7 +579,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); @@ -640,14 +641,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); @@ -1086,11 +1090,9 @@ void MidiTrackInfo::instrPopup() //QMenu* pup = new QMenu; PopupMenu* pup = new PopupMenu(true); - //instr->populatePatchPopup(pop, channel, MusEGlobal::song->mtype(), track->isDrumTrack()); - populatePatchPopup(instr, pup, channel, MusEGlobal::song->mtype(), track->isDrumTrack()); + instr->populatePatchPopup(pup, channel, MusEGlobal::song->mtype(), track->isDrumTrack()); + //populatePatchPopup(instr, pup, channel, MusEGlobal::song->mtype(), track->isDrumTrack()); - //if(pop->actions().count() == 0) - // return; if(pup->actions().count() == 0) { delete pup; @@ -1100,7 +1102,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) { @@ -1351,12 +1352,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/mtscale_flo.cpp b/muse2/muse/widgets/mtscale_flo.cpp index df077102..c54ef1ad 100644 --- a/muse2/muse/widgets/mtscale_flo.cpp +++ b/muse2/muse/widgets/mtscale_flo.cpp @@ -45,6 +45,9 @@ MTScaleFlo::MTScaleFlo(ScoreCanvas* parent_editor, QWidget* parent_widget) pos[0] = MusEGlobal::song->cpos(); pos[1] = MusEGlobal::song->lpos(); pos[2] = MusEGlobal::song->rpos(); + xpos=0; + xoffset=0; + button = Qt::NoButton; setMouseTracking(true); connect(MusEGlobal::song, SIGNAL(posChanged(int, unsigned, bool)), SLOT(setPos(int, unsigned, bool))); diff --git a/muse2/muse/widgets/musewidgetsplug.cpp b/muse2/muse/widgets/musewidgetsplug.cpp index 27e6d523..32a886fa 100644 --- a/muse2/muse/widgets/musewidgetsplug.cpp +++ b/muse2/muse/widgets/musewidgetsplug.cpp @@ -159,7 +159,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 73d29c25..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; } @@ -220,9 +227,9 @@ int RoutePopupMenu::addSyntiPorts(MusECore::AudioTrack* t, PopupMenu* lb, int id { char buffer[128]; if(tchans == 2) - snprintf(buffer, 128, "%s %d,%d", chpup->tr("Channel").toLatin1().constData(), ch+1, ch+2); + snprintf(buffer, 128, "%s %d,%d", tr("Channel").toLatin1().constData(), ch+1, ch+2); else - snprintf(buffer, 128, "%s %d", chpup->tr("Channel").toLatin1().constData(), ch+1); + snprintf(buffer, 128, "%s %d", tr("Channel").toLatin1().constData(), ch+1); act = chpup->addAction(QString(buffer)); act->setCheckable(true); @@ -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; } @@ -347,7 +361,7 @@ int RoutePopupMenu::addMultiChannelPorts(MusECore::AudioTrack* t, PopupMenu* pup if(chans > 1) { char buffer[128]; - snprintf(buffer, 128, "%s %d", pup->tr("Channel").toLatin1().constData(), ch+1); + snprintf(buffer, 128, "%s %d", tr("Channel").toLatin1().constData(), ch+1); chpup->setTitle(QString(buffer)); pup->addMenu(chpup); } @@ -425,7 +439,7 @@ int RoutePopupMenu::addMultiChannelPorts(MusECore::AudioTrack* t, PopupMenu* pup if(chans > 2) { char buffer[128]; - snprintf(buffer, 128, "%s %d,%d", pup->tr("Channel").toLatin1().constData(), ch+1, ch+2); + snprintf(buffer, 128, "%s %d,%d", tr("Channel").toLatin1().constData(), ch+1, ch+2); chpup->setTitle(QString(buffer)); pup->addMenu(chpup); } @@ -482,7 +496,7 @@ int RoutePopupMenu::nonSyntiTrackAddSyntis(MusECore::AudioTrack* t, PopupMenu* l for(int ch = 0; ch < chans; ++ch) { char buffer[128]; - snprintf(buffer, 128, "%s %d", chpup->tr("Channel").toLatin1().constData(), ch+1); + snprintf(buffer, 128, "%s %d", tr("Channel").toLatin1().constData(), ch+1); act = chpup->addAction(QString(buffer)); act->setCheckable(true); @@ -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; } @@ -535,7 +556,7 @@ int RoutePopupMenu::nonSyntiTrackAddSyntis(MusECore::AudioTrack* t, PopupMenu* l for(int ch = 0; ch < chans; ++ch) { char buffer[128]; - snprintf(buffer, 128, "%s %d,%d", chpup->tr("Channel").toLatin1().constData(), ch+1, ch+2); + snprintf(buffer, 128, "%s %d,%d", tr("Channel").toLatin1().constData(), ch+1, ch+2); act = chpup->addAction(QString(buffer)); act->setCheckable(true); @@ -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/shortcutcapturedialog.cpp b/muse2/muse/widgets/shortcutcapturedialog.cpp index 46a3e75d..ad78a2ad 100644 --- a/muse2/muse/widgets/shortcutcapturedialog.cpp +++ b/muse2/muse/widgets/shortcutcapturedialog.cpp @@ -30,7 +30,6 @@ // // Description: // Dialog window for capturing keyboard shortcuts -// #include "shortcutcapturedialog.h" #include "shortcuts.h" @@ -39,6 +38,7 @@ #include <QKeySequence> #include <QInputEvent> #include <QChar> +#include <QApplication> namespace MusEGui { @@ -105,7 +105,7 @@ void ShortcutCaptureDialog::keyPressEvent(QKeyEvent* e) (( shortcuts[i].type & (shortcuts[shortcutindex].type | INVIS_SHRT)) || shortcuts[i].type & GLOBAL_SHRT || shortcuts[shortcutindex].type & GLOBAL_SHRT)) { // affect the same scope - msgString = tr("Shortcut conflicts with %1").arg(shortcuts[i].descr); + msgString = tr("Shortcut conflicts with %1").arg(qApp->translate("shortcuts",shortcuts[i].descr)); conflict = true; break; } diff --git a/muse2/muse/widgets/shortcutconfig.cpp b/muse2/muse/widgets/shortcutconfig.cpp index fc08e7ce..609564cc 100644 --- a/muse2/muse/widgets/shortcutconfig.cpp +++ b/muse2/muse/widgets/shortcutconfig.cpp @@ -30,12 +30,12 @@ // // Description: // Dialog for configuring keyboard shortcuts -// #include <QCloseEvent> #include <QKeySequence> #include <QString> #include <QSettings> +#include <QApplication> #include "shortcutconfig.h" #include "shortcutcapturedialog.h" @@ -86,12 +86,12 @@ void ShortcutConfig::updateSCListView(int category) for (int i=0; i < SHRT_NUM_OF_ELEMENTS; i++) { if (shortcuts[i].type & category) { newItem = new SCListViewItem(scListView, i); - newItem->setText(SHRT_DESCR_COL, tr(shortcuts[i].descr)); + newItem->setText(SHRT_DESCR_COL, qApp->translate("shortcuts", shortcuts[i].descr)); //if(category == ALL_SHRT) // catpre = QString(shortcut_category[shortcuts[i].type].name) + QString(": "); //else // catpre.clear(); - //newItem->setText(SHRT_DESCR_COL, catpre + tr(shortcuts[i].descr)); // Tim + //newItem->setText(SHRT_DESCR_COL, catpre + tr(qApp->translate("shortcuts", shortcuts[i].descr)); // Tim QKeySequence key = QKeySequence(shortcuts[i].key); newItem->setText(SHRT_SHRTCUT_COL, key); } diff --git a/muse2/muse/widgets/shortcutconfigbase.ui b/muse2/muse/widgets/shortcutconfigbase.ui index 119a7007..6dd5d5b7 100644 --- a/muse2/muse/widgets/shortcutconfigbase.ui +++ b/muse2/muse/widgets/shortcutconfigbase.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>466</width> - <height>403</height> + <width>512</width> + <height>452</height> </rect> </property> <property name="windowTitle"> @@ -16,67 +16,64 @@ <property name="sizeGripEnabled"> <bool>true</bool> </property> - <layout class="QVBoxLayout"> + <layout class="QVBoxLayout" name="verticalLayout"> <item> - <widget class="QGroupBox" name="groupBox3"> - <property name="title"> - <string/> + <widget class="QSplitter" name="splitter"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <layout class="QHBoxLayout"> - <property name="spacing"> - <number>3</number> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="childrenCollapsible"> + <bool>false</bool> + </property> + <widget class="QTreeWidget" name="cgListView"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Expanding"> + <horstretch>1</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>105</width> + <height>200</height> + </size> + </property> + <column> + <property name="text"> + <string>Shortcut Category</string> + </property> + </column> + </widget> + <widget class="QTreeWidget" name="scListView"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>2</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="margin"> - <number>0</number> + <property name="minimumSize"> + <size> + <width>170</width> + <height>230</height> + </size> </property> - <item> - <widget class="QTreeWidget" name="cgListView"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Expanding"> - <horstretch>1</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>105</width> - <height>200</height> - </size> - </property> - <column> - <property name="text"> - <string>Shortcut Category</string> - </property> - </column> - </widget> - </item> - <item> - <widget class="QTreeWidget" name="scListView"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> - <horstretch>2</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>170</width> - <height>230</height> - </size> - </property> - <column> - <property name="text"> - <string>Shortcut</string> - </property> - </column> - <column> - <property name="text"> - <string>Description</string> - </property> - </column> - </widget> - </item> - </layout> + <column> + <property name="text"> + <string>Shortcut</string> + </property> + </column> + <column> + <property name="text"> + <string>Description</string> + </property> + </column> + </widget> </widget> </item> <item> diff --git a/muse2/muse/widgets/spinbox.cpp b/muse2/muse/widgets/spinbox.cpp index f7afcf2a..a763eea1 100644 --- a/muse2/muse/widgets/spinbox.cpp +++ b/muse2/muse/widgets/spinbox.cpp @@ -99,4 +99,19 @@ void SpinBox::stepDown() _clearFocus = true; } +void SpinBox::keyPressEvent(QKeyEvent* ev) +{ + switch (ev->key()) { + case Qt::Key_Return: + clearFocus(); + //emit returnPressed(); + // return; + break; + default: + break; + } + QSpinBox::keyPressEvent(ev); +} + } // namespace MusEGui + diff --git a/muse2/muse/widgets/spinbox.h b/muse2/muse/widgets/spinbox.h index cee112d4..cd37fb32 100644 --- a/muse2/muse/widgets/spinbox.h +++ b/muse2/muse/widgets/spinbox.h @@ -43,7 +43,8 @@ class SpinBox : public QSpinBox { protected: bool eventFilter(QObject* obj, QEvent* ev); - + virtual void keyPressEvent(QKeyEvent*); + public slots: virtual void stepUp(); virtual void stepDown(); 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/tb1.cpp b/muse2/muse/widgets/tb1.cpp index 3174260f..589726a9 100644 --- a/muse2/muse/widgets/tb1.cpp +++ b/muse2/muse/widgets/tb1.cpp @@ -20,7 +20,6 @@ // //========================================================= -//#include <assert.h> #include <stdio.h> #include <values.h> @@ -45,9 +44,9 @@ static int rasterTable[] = { }; static const char* rasterStrings[] = { - QT_TRANSLATE_NOOP("@default", "Off"), "2pp", "5pp", "64T", "32T", "16T", "8T", "4T", "2T", "1T", - QT_TRANSLATE_NOOP("@default", "Off"), "3pp", "6pp", "64", "32", "16", "8", "4", "2", "1", - QT_TRANSLATE_NOOP("@default", "Off"), "4pp", "7pp", "64.", "32.", "16.", "8.", "4.", "2.", "1." + QT_TRANSLATE_NOOP("MusEGui::Toolbar1", "Off"), "2pp", "5pp", "64T", "32T", "16T", "8T", "4T", "2T", "1T", + QT_TRANSLATE_NOOP("MusEGui::Toolbar1", "Off"), "3pp", "6pp", "64", "32", "16", "8", "4", "2", "1", + QT_TRANSLATE_NOOP("MusEGui::Toolbar1", "Off"), "4pp", "7pp", "64.", "32.", "16.", "8.", "4.", "2.", "1." }; diff --git a/muse2/muse/widgets/tools.cpp b/muse2/muse/widgets/tools.cpp index 162d2b97..d46126a9 100644 --- a/muse2/muse/widgets/tools.cpp +++ b/muse2/muse/widgets/tools.cpp @@ -30,42 +30,42 @@ namespace MusEGui { -const char* infoPointer = QT_TRANSLATE_NOOP("@default", "select Pointer Tool:\n" +const char* infoPointer = QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "select Pointer Tool:\n" "with the pointer tool you can:\n" " select parts\n" " move parts\n" " copy parts"); -const char* infoPencil = QT_TRANSLATE_NOOP("@default", "select Pencil Tool:\n" +const char* infoPencil = QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "select Pencil Tool:\n" "with the pencil tool you can:\n" " create new parts\n" " modify length of parts"); -const char* infoDel = QT_TRANSLATE_NOOP("@default", "select Delete Tool:\n" +const char* infoDel = QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "select Delete Tool:\n" "with the delete tool you can delete parts"); -const char* infoCut = QT_TRANSLATE_NOOP("@default", "select Cut Tool:\n" +const char* infoCut = QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "select Cut Tool:\n" "with the cut tool you can split a part"); -const char* infoGlue = QT_TRANSLATE_NOOP("@default", "select Glue Tool:\n" +const char* infoGlue = QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "select Glue Tool:\n" "with the glue tool you can glue two parts"); -const char* infoScore = QT_TRANSLATE_NOOP("@default", "select Score Tool:\n"); -const char* infoQuant = QT_TRANSLATE_NOOP("@default", "select Quantize Tool:\n" +const char* infoScore = QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "select Score Tool:\n"); +const char* infoQuant = QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "select Quantize Tool:\n" "insert display quantize event"); -const char* infoDraw = QT_TRANSLATE_NOOP("@default", "select Drawing Tool"); -const char* infoMute = QT_TRANSLATE_NOOP("@default", "select Muting Tool:\n" +const char* infoDraw = QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "select Drawing Tool"); +const char* infoMute = QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "select Muting Tool:\n" "click on part to mute/unmute"); -const char* infoAutomation = QT_TRANSLATE_NOOP("@default", "Manipulate automation"); -const char* infoCursor = QT_TRANSLATE_NOOP("@default", "Cursor tool"); +const char* infoAutomation = QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "Manipulate automation"); +const char* infoCursor = QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "Cursor tool"); ToolB toolList[] = { - {&pointerIcon, QT_TRANSLATE_NOOP("@default", "pointer"), infoPointer }, - {&pencilIcon, QT_TRANSLATE_NOOP("@default", "pencil"), infoPencil }, - {&deleteIcon, QT_TRANSLATE_NOOP("@default", "eraser"), infoDel }, - {&cutIcon, QT_TRANSLATE_NOOP("@default", "cutter"), infoCut }, - {¬e1Icon, QT_TRANSLATE_NOOP("@default", "score"), infoScore }, - {&glueIcon, QT_TRANSLATE_NOOP("@default", "glue"), infoGlue }, - {&quantIcon, QT_TRANSLATE_NOOP("@default", "quantize"), infoQuant }, - {&drawIcon, QT_TRANSLATE_NOOP("@default", "draw"), infoDraw }, - {&editmuteIcon, QT_TRANSLATE_NOOP("@default", "mute parts"), infoMute }, - {&drawIcon, QT_TRANSLATE_NOOP("@default", "edit automation"),infoAutomation}, - {&cursorIcon, QT_TRANSLATE_NOOP("@default", "cursor"), infoCursor}, + {&pointerIcon, QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "pointer"), infoPointer }, + {&pencilIcon, QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "pencil"), infoPencil }, + {&deleteIcon, QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "eraser"), infoDel }, + {&cutIcon, QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "cutter"), infoCut }, + {¬e1Icon, QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "score"), infoScore }, + {&glueIcon, QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "glue"), infoGlue }, + {&quantIcon, QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "quantize"), infoQuant }, + {&drawIcon, QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "draw"), infoDraw }, + {&editmuteIcon, QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "mute parts"), infoMute }, + {&drawIcon, QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "edit automation"),infoAutomation}, + {&cursorIcon, QT_TRANSLATE_NOOP("MusEGui::EditToolBar", "cursor"), infoCursor}, }; //--------------------------------------------------------- @@ -94,7 +94,7 @@ EditToolBar::EditToolBar(QWidget* parent, int tools, const char*) continue; ToolB* t = &toolList[i]; - Action* a = new Action(action, 1<<i, t->tip, true); + Action* a = new Action(action, 1<<i, tr(t->tip).toAscii().data(), true); actions[n] = a; //a->setIconSet(QIcon(**(t->icon))); a->setIcon(QIcon(**(t->icon))); 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 84e7dd42..4976ecf9 100644 --- a/muse2/muse/widgets/visibletracks.cpp +++ b/muse2/muse/widgets/visibletracks.cpp @@ -29,25 +29,26 @@ #include "action.h" #include "track.h" #include "synth.h" +#include "app.h" namespace MusEGui { -const char* waveTrack = QT_TRANSLATE_NOOP("@default", "Show wave tracks"); -const char* groupTrack = QT_TRANSLATE_NOOP("@default", "Show group tracks"); -const char* auxTrack = QT_TRANSLATE_NOOP("@default", "Show aux tracks"); -const char* inputTrack = QT_TRANSLATE_NOOP("@default", "Show input tracks"); -const char* outputTrack = QT_TRANSLATE_NOOP("@default", "Show output tracks"); -const char* midiTrack = QT_TRANSLATE_NOOP("@default", "Show midi tracks"); -const char* synthTrack = QT_TRANSLATE_NOOP("@default", "Show synth tracks"); +const char* waveTrack = QT_TRANSLATE_NOOP("MusEGui::VisibleTracks", "Show wave tracks"); +const char* groupTrack = QT_TRANSLATE_NOOP("MusEGui::VisibleTracks", "Show group tracks"); +const char* auxTrack = QT_TRANSLATE_NOOP("MusEGui::VisibleTracks", "Show aux tracks"); +const char* inputTrack = QT_TRANSLATE_NOOP("MusEGui::VisibleTracks", "Show input tracks"); +const char* outputTrack = QT_TRANSLATE_NOOP("MusEGui::VisibleTracks", "Show output tracks"); +const char* midiTrack = QT_TRANSLATE_NOOP("MusEGui::VisibleTracks", "Show midi tracks"); +const char* synthTrack = QT_TRANSLATE_NOOP("MusEGui::VisibleTracks", "Show synth tracks"); VisibleToolB visTrackList[] = { - {&addtrack_wavetrackIcon, QT_TRANSLATE_NOOP("@default", "Show wave tracks"), waveTrack }, - {&addtrack_audiogroupIcon, QT_TRANSLATE_NOOP("@default", "Show group tracks"), groupTrack }, - {&addtrack_auxsendIcon, QT_TRANSLATE_NOOP("@default", "Show aux tracks"), auxTrack }, - {&addtrack_audioinputIcon, QT_TRANSLATE_NOOP("@default", "Show input tracks"), inputTrack }, - {&addtrack_audiooutputIcon, QT_TRANSLATE_NOOP("@default", "Show output tracks"), outputTrack }, - {&addtrack_addmiditrackIcon,QT_TRANSLATE_NOOP("@default", "Show midi tracks"), midiTrack }, - {&synthIcon, QT_TRANSLATE_NOOP("@default", "Show synth tracks"), midiTrack }, + {&addtrack_wavetrackIcon, QT_TRANSLATE_NOOP("MusEGui::VisibleTracks", "Show wave tracks"), waveTrack }, + {&addtrack_audiogroupIcon, QT_TRANSLATE_NOOP("MusEGui::VisibleTracks", "Show group tracks"), groupTrack }, + {&addtrack_auxsendIcon, QT_TRANSLATE_NOOP("MusEGui::VisibleTracks", "Show aux tracks"), auxTrack }, + {&addtrack_audioinputIcon, QT_TRANSLATE_NOOP("MusEGui::VisibleTracks", "Show input tracks"), inputTrack }, + {&addtrack_audiooutputIcon, QT_TRANSLATE_NOOP("MusEGui::VisibleTracks", "Show output tracks"), outputTrack }, + {&addtrack_addmiditrackIcon,QT_TRANSLATE_NOOP("MusEGui::VisibleTracks", "Show midi tracks"), midiTrack }, + {&synthIcon, QT_TRANSLATE_NOOP("MusEGui::VisibleTracks", "Show synth tracks"), midiTrack }, }; //--------------------------------------------------------- @@ -67,7 +68,7 @@ VisibleTracks::VisibleTracks(QWidget* parent, const char*) for (unsigned i = 0; i < sizeof(visTrackList)/sizeof(*visTrackList); ++i) { VisibleToolB* t = &visTrackList[i]; - Action* a = new Action(action, i, t->tip, true); + Action* a = new Action(action, i, tr(t->tip).toAscii().data(), true); actions[n] = a; //a->setIconSet(QIcon(**(t->icon))); a->setIcon(QIcon(**(t->icon))); @@ -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(); }; |