From 35a46ba162aab33268436e7ecbdd9bf47e23c4ef Mon Sep 17 00:00:00 2001 From: Werner Schweer Date: Tue, 9 May 2006 13:44:20 +0000 Subject: replace "appearance settings" and "global settings" by "preferences" --- muse/muse/CMakeLists.txt | 4 +- muse/muse/appearance.cpp | 647 ----------- muse/muse/appearance.h | 73 -- muse/muse/appearance.ui | 1182 ------------------- muse/muse/conf.cpp | 26 +- muse/muse/genset.cpp | 475 -------- muse/muse/genset.h | 56 - muse/muse/genset.ui | 1320 --------------------- muse/muse/muse.cpp | 42 +- muse/muse/muse.h | 20 +- muse/muse/preferences.cpp | 1062 +++++++++++++++++ muse/muse/preferences.h | 87 ++ muse/muse/preferences.ui | 2362 ++++++++++++++++++++++++++++++++++++++ muse/muse/shortcuts.cpp | 4 +- muse/muse/shortcuts.h | 4 +- muse/muse/widgets/CMakeLists.txt | 12 +- 16 files changed, 3576 insertions(+), 3800 deletions(-) delete mode 100644 muse/muse/appearance.cpp delete mode 100644 muse/muse/appearance.h delete mode 100644 muse/muse/appearance.ui delete mode 100644 muse/muse/genset.cpp delete mode 100644 muse/muse/genset.h delete mode 100644 muse/muse/genset.ui create mode 100644 muse/muse/preferences.cpp create mode 100644 muse/muse/preferences.h create mode 100644 muse/muse/preferences.ui diff --git a/muse/muse/CMakeLists.txt b/muse/muse/CMakeLists.txt index 64ff6da7..a997f084 100644 --- a/muse/muse/CMakeLists.txt +++ b/muse/muse/CMakeLists.txt @@ -44,7 +44,7 @@ subdirs( ctrl widgets master driver instruments marker liste ) set (muse_uics - muse genset appearance exportmididialog configmidifile + muse preferences exportmididialog configmidifile transport aboutbox transpose midiedit/quantconfig mixer/routedialog @@ -52,7 +52,7 @@ set (muse_uics ) set(muse_mocs - appearance plugingui midiplugin muse genset song transport conf editor + preferences plugingui midiplugin muse song transport conf editor cobject transpose track midisynti midiport miditrack wavetrack audiotrack audioaux audiooutput audioinput audiogroup exportmidi diff --git a/muse/muse/appearance.cpp b/muse/muse/appearance.cpp deleted file mode 100644 index 02b9819a..00000000 --- a/muse/muse/appearance.cpp +++ /dev/null @@ -1,647 +0,0 @@ -//============================================================================= -// MusE -// Linux Music Editor -// $Id:$ -// -// Copyright (C) 2002-2006 by Werner Schweer and others -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License version 2. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -//============================================================================= - -#include "icons.h" -#include "appearance.h" -#include "track.h" -#include "muse.h" -#include "song.h" -#include "event.h" -#include "arranger/arranger.h" -#include "widgets/filedialog.h" -#include "waveedit/waveedit.h" -#include "globals.h" -#include "conf.h" -#include "gconfig.h" - -//--------------------------------------------------------- -// twi -//--------------------------------------------------------- - -static QTreeWidgetItem* twi(QTreeWidget* tw, const char* txt, int data) - { - QTreeWidgetItem* i = new QTreeWidgetItem(tw); - i->setText(0, txt); - i->setData(0, 1, data); - return i; - } - -static QTreeWidgetItem* twi(QTreeWidgetItem* tw, const char* txt, int data) - { - QTreeWidgetItem* i = new QTreeWidgetItem(tw); - i->setText(0, txt); - i->setData(0, 1, data); - return i; - } - -//--------------------------------------------------------- -// Appearance -//--------------------------------------------------------- - -Appearance::Appearance(Arranger* a, QWidget* parent) - : QDialog(parent) - { - setupUi(this); - colorframe->setAutoFillBackground(true); - palette0->setAutoFillBackground(true); - palette1->setAutoFillBackground(true); - palette2->setAutoFillBackground(true); - palette3->setAutoFillBackground(true); - arr = a; - color = 0; - config = new GlobalConfigValues; - resetValues(); - - // ARRANGER - - usePixmap->setChecked(config->canvasUseBgPixmap); - useColor->setChecked(!config->canvasUseBgPixmap); - connect(usePixmap, SIGNAL(toggled(bool)), SLOT(usePixmapToggled(bool))); - connect(useColor, SIGNAL(toggled(bool)), SLOT(useColorToggled(bool))); - - currentBg = config->canvasBgPixmap; - if (currentBg.isEmpty()) - currentBg = ""; - else { - QBrush b; - b.setTexture(QPixmap(currentBg)); - QPalette p; - p.setBrush(QPalette::Window, b); - currentBgLabel->setPalette(p); - } - QPalette p; - canvasBackgroundColor->setAutoFillBackground(true); - p.setColor(QPalette::Window, config->canvasBgColor); - canvasBackgroundColor->setPalette(p); - - currentBgLabel->setAutoFillBackground(true); - currentBgLabel->setText(currentBg); - - partShownames->setChecked(config->canvasShowPartType & 1); - partShowevents->setChecked(config->canvasShowPartType & 2); - partShowCakes->setChecked(!(config->canvasShowPartType & 2)); - - eventNoteon->setChecked(config->canvasShowPartEvent & (1 << 0)); - eventPolypressure->setChecked(config->canvasShowPartEvent & (1 << 1)); - eventController->setChecked(config->canvasShowPartEvent & (1 << 2)); - eventProgramchange->setChecked(config->canvasShowPartEvent & (1 << 3)); - eventAftertouch->setChecked(config->canvasShowPartEvent & (1 << 4)); - eventPitchbend->setChecked(config->canvasShowPartEvent & (1 << 5)); - eventSpecial->setChecked(config->canvasShowPartEvent & (1 << 6)); - eventButtonGroup->setEnabled(config->canvasShowPartType == 2); - arrGrid->setChecked(config->canvasShowGrid); - - // COLORS - QTreeWidgetItem* id; - QTreeWidgetItem* aid; - itemList->setSortingEnabled(false); - itemList->clear(); - - aid = twi(itemList, "Arranger", 0); - id = twi(aid, "PartColors", 0); - twi(id, "Selected", 0x41d); - - twi(id, "Default", 0x400); - twi(id, "Refrain", 0x401); - twi(id, "Bridge", 0x402); - twi(id, "Intro", 0x403); - twi(id, "Coda", 0x404); - twi(id, "Chorus", 0x405); - twi(id, "Solo", 0x406); - twi(id, "Brass", 0x407); - twi(id, "Percussion", 0x408); - twi(id, "Drums", 0x409); - twi(id, "Guitar", 0x40a); - twi(id, "Bass", 0x40b); - twi(id, "Flute", 0x40c); - twi(id, "Strings", 0x40d); - twi(id, "Keyboard", 0x40e); - twi(id, "Piano", 0x40f); - twi(id, "Saxophon", 0x410); - - twi(id, "part canvas background", 0x41c); - - id = twi(aid, "Track List", 0); - twi(id, "Audio Output", 0x500 + Track::AUDIO_OUTPUT); - twi(id, "Audio Group", 0x500 + Track::AUDIO_GROUP); - twi(id, "Audio Aux", 0x500 + Track::AUDIO_AUX); - twi(id, "Wave Track", 0x500 + Track::WAVE); - twi(id, "Audio Input", 0x500 + Track::AUDIO_INPUT); - twi(id, "Synthesizer", 0x500 + Track::AUDIO_SOFTSYNTH); - twi(id, "Midi Track", 0x500 + Track::MIDI); - twi(id, "Midi Output", 0x500 + Track::MIDI_OUT); - twi(id, "Midi Input", 0x500 + Track::MIDI_IN); - twi(id, "Midi Channel", 0x500 + Track::MIDI_CHANNEL); - twi(id, "Midi Synti", 0x500 + Track::MIDI_SYNTI); - - id = twi(itemList, "BigTime", 0); - twi(id, "background", 0x100); - twi(id, "foreground", 0x101); - - id = twi(itemList, "Transport", 0); - twi(id, "handle", 0x200); - - id = twi(itemList, "Editor", 0); - twi(id, "background", 0x300); - - colorGroup = new QButtonGroup(this); - colorGroup->setExclusive(true); - colorGroup->addButton(palette0, 0); - colorGroup->addButton(palette1, 1); - colorGroup->addButton(palette2, 2); - colorGroup->addButton(palette3, 3); - colorGroup->addButton(palette4, 4); - colorGroup->addButton(palette5, 5); - colorGroup->addButton(palette6, 6); - colorGroup->addButton(palette7, 7); - colorGroup->addButton(palette8, 8); - colorGroup->addButton(palette9, 9); - colorGroup->addButton(palette10, 10); - colorGroup->addButton(palette11, 11); - colorGroup->addButton(palette12, 12); - colorGroup->addButton(palette13, 13); - colorGroup->addButton(palette14, 14); - colorGroup->addButton(palette15, 15); - connect(itemList, SIGNAL(itemSelectionChanged()), SLOT(colorItemSelectionChanged())); - connect(colorGroup, SIGNAL(buttonClicked(QAbstractButton*)), SLOT(paletteClicked(QAbstractButton*))); - connect(hslider, SIGNAL(valueChanged(int)), SLOT(hsliderChanged(int))); - connect(sslider, SIGNAL(valueChanged(int)), SLOT(ssliderChanged(int))); - connect(vslider, SIGNAL(valueChanged(int)), SLOT(vsliderChanged(int))); - - connect(addToPalette, SIGNAL(clicked()), SLOT(addToPaletteClicked())); - - //--------------------------------------------------- - // STYLE - //--------------------------------------------------- - - themeComboBox->clear(); - - QString cs = muse->style()->objectName(); - cs = cs.toLower(); - - themeComboBox->addItems(QStyleFactory::keys()); - for (int i = 0; i < themeComboBox->count(); ++i) { - if (themeComboBox->itemText(i).toLower() == cs) { - themeComboBox->setCurrentIndex(i); - } - } - - //--------------------------------------------------- - // Fonts - //--------------------------------------------------- - - fontBrowse0->setIcon(*openIcon); - fontBrowse1->setIcon(*openIcon); - fontBrowse2->setIcon(*openIcon); - fontBrowse3->setIcon(*openIcon); - fontBrowse4->setIcon(*openIcon); - fontBrowse5->setIcon(*openIcon); - connect(fontBrowse0, SIGNAL(clicked()), SLOT(browseFont0())); - connect(fontBrowse1, SIGNAL(clicked()), SLOT(browseFont1())); - connect(fontBrowse2, SIGNAL(clicked()), SLOT(browseFont2())); - connect(fontBrowse3, SIGNAL(clicked()), SLOT(browseFont3())); - connect(fontBrowse4, SIGNAL(clicked()), SLOT(browseFont4())); - connect(fontBrowse5, SIGNAL(clicked()), SLOT(browseFont5())); - - connect(applyButton, SIGNAL(clicked()), SLOT(apply())); - connect(okButton, SIGNAL(clicked()), SLOT(ok())); - connect(cancelButton, SIGNAL(clicked()), SLOT(cancel())); - connect(selectCanvasBgPixmap, SIGNAL(clicked()), SLOT(configCanvasBgPixmap())); - connect(selectCanvasBgColor, SIGNAL(clicked()), SLOT(configCanvasBgColor())); - connect(partShowevents, SIGNAL(toggled(bool)), eventButtonGroup, SLOT(setEnabled(bool))); - updateColor(); - } - -//--------------------------------------------------------- -// resetValues -//--------------------------------------------------------- - -void Appearance::resetValues() - { - *config = ::config; // init with global config values - updateFonts(); - QPalette p(palette0->palette()); - p.setColor(QPalette::Button, config->palette[0]); - palette0->setPalette(p); - p.setColor(QPalette::Button, config->palette[1]); - palette1->setPalette(p); - p.setColor(QPalette::Button, config->palette[2]); - palette2->setPalette(p); - p.setColor(QPalette::Button, config->palette[3]); - palette3->setPalette(p); - p.setColor(QPalette::Button, config->palette[4]); - palette4->setPalette(p); - p.setColor(QPalette::Button, config->palette[5]); - palette5->setPalette(p); - p.setColor(QPalette::Button, config->palette[6]); - palette6->setPalette(p); - p.setColor(QPalette::Button, config->palette[7]); - palette7->setPalette(p); - p.setColor(QPalette::Button, config->palette[8]); - palette8->setPalette(p); - p.setColor(QPalette::Button, config->palette[9]); - palette9->setPalette(p); - p.setColor(QPalette::Button, config->palette[10]); - palette10->setPalette(p); - p.setColor(QPalette::Button, config->palette[11]); - palette11->setPalette(p); - p.setColor(QPalette::Button, config->palette[12]); - palette12->setPalette(p); - p.setColor(QPalette::Button, config->palette[13]); - palette13->setPalette(p); - p.setColor(QPalette::Button, config->palette[14]); - palette14->setPalette(p); - p.setColor(QPalette::Button, config->palette[15]); - palette15->setPalette(p); - } - -//--------------------------------------------------------- -// Appearance -//--------------------------------------------------------- - -Appearance::~Appearance() - { - delete config; - } - -//--------------------------------------------------------- -// updateFonts -//--------------------------------------------------------- - -void Appearance::updateFonts() - { - fontSize0->setValue(config->fonts[0]->pointSize()); - fontName0->setText(config->fonts[0]->family()); - italic0->setChecked(config->fonts[0]->italic()); - bold0->setChecked(config->fonts[0]->bold()); - - fontSize1->setValue(config->fonts[1]->pointSize()); - fontName1->setText(config->fonts[1]->family()); - italic1->setChecked(config->fonts[1]->italic()); - bold1->setChecked(config->fonts[1]->bold()); - - fontSize2->setValue(config->fonts[2]->pointSize()); - fontName2->setText(config->fonts[2]->family()); - italic2->setChecked(config->fonts[2]->italic()); - bold2->setChecked(config->fonts[2]->bold()); - - fontSize3->setValue(config->fonts[3]->pointSize()); - fontName3->setText(config->fonts[3]->family()); - italic3->setChecked(config->fonts[3]->italic()); - bold3->setChecked(config->fonts[3]->bold()); - - fontSize4->setValue(config->fonts[4]->pointSize()); - fontName4->setText(config->fonts[4]->family()); - italic4->setChecked(config->fonts[4]->italic()); - bold4->setChecked(config->fonts[4]->bold()); - - fontSize5->setValue(config->fonts[5]->pointSize()); - fontName5->setText(config->fonts[5]->family()); - italic5->setChecked(config->fonts[5]->italic()); - bold5->setChecked(config->fonts[5]->bold()); - } - -//--------------------------------------------------------- -// apply -//--------------------------------------------------------- - -void Appearance::apply() - { - int showPartEvent = 0; - int showPartType = 0; - - if (partShownames->isChecked()) - showPartType |= 1; - if (partShowevents->isChecked()) - showPartType |= 2; - if (partShowCakes->isChecked()) - showPartType |= 4; - - if (eventNoteon->isChecked()) - showPartEvent |= (1 << 0); - if (eventPolypressure->isChecked()) - showPartEvent |= (1 << 1); - if (eventController->isChecked()) - showPartEvent |= (1 << 2); - if (eventProgramchange->isChecked()) - showPartEvent |= (1 << 3); - if (eventAftertouch->isChecked()) - showPartEvent |= (1 << 4); - if (eventPitchbend->isChecked()) - showPartEvent |= (1 << 5); - if (eventSpecial->isChecked()) - showPartEvent |= (1 << 6); - - config->canvasUseBgPixmap = usePixmap->isChecked(); - if (currentBg != "") - config->canvasBgPixmap = currentBg; - config->fonts[0]->setPointSize(fontSize0->value()); - config->fonts[0]->setItalic(italic0->isChecked()); - config->fonts[0]->setBold(bold0->isChecked()); - - QApplication::setFont(*config->fonts[0]); - - config->fonts[1]->setPointSize(fontSize1->value()); - config->fonts[1]->setItalic(italic1->isChecked()); - config->fonts[1]->setBold(bold1->isChecked()); - - config->fonts[2]->setPointSize(fontSize2->value()); - config->fonts[2]->setItalic(italic2->isChecked()); - config->fonts[2]->setBold(bold2->isChecked()); - - config->fonts[3]->setPointSize(fontSize3->value()); - config->fonts[3]->setItalic(italic3->isChecked()); - config->fonts[3]->setBold(bold3->isChecked()); - - config->fonts[4]->setPointSize(fontSize4->value()); - config->fonts[4]->setItalic(italic4->isChecked()); - config->fonts[4]->setBold(bold4->isChecked()); - - config->fonts[5]->setPointSize(fontSize5->value()); - config->fonts[5]->setItalic(italic5->isChecked()); - config->fonts[5]->setBold(bold5->isChecked()); - - config->style = themeComboBox->currentText(); - // setting up a new theme might change the fontsize, so re-read - fontSize0->setValue(QApplication::font().pointSize()); - - config->canvasShowGrid = arrGrid->isChecked(); - // set colors... - ::config = *config; - muse->changeConfig(true); - } - -//--------------------------------------------------------- -// ok -//--------------------------------------------------------- - -void Appearance::ok() - { - apply(); - close(); - } - -//--------------------------------------------------------- -// cancel -//--------------------------------------------------------- - -void Appearance::cancel() - { - close(); - } - -//--------------------------------------------------------- -// configCanvasBgPixmap -//--------------------------------------------------------- - -void Appearance::configCanvasBgPixmap() - { - QString cur(currentBg); - if (cur == "") - cur = museGlobalShare + "/wallpapers"; - - QStringList pattern; - const char** p = image_file_pattern; - while(*p) - pattern << *p++; - QString s = getImageFileName(cur, pattern, this, tr("MusE: load image")); - if (!s.isEmpty()) { - QBrush b; - currentBg = s; - b.setTexture(QPixmap(s)); - QPalette p; - p.setBrush(QPalette::Window, b); - currentBgLabel->setPalette(p); - currentBgLabel->setText(currentBg); - } - } - -//--------------------------------------------------------- -// configCanvasBgColor -//--------------------------------------------------------- - -void Appearance::configCanvasBgColor() - { - QColor color = QColorDialog::getColor(config->canvasBgColor, this); - if (color.isValid()) { - config->canvasBgColor = color; - QPalette p; - p.setColor(QPalette::Window, color); - canvasBackgroundColor->setPalette(p); - } - } - -//--------------------------------------------------------- -// selectionChanged -//--------------------------------------------------------- - -void Appearance::colorItemSelectionChanged() - { - QTreeWidgetItem* item = (QTreeWidgetItem*)itemList->selectedItems().at(0); - QString txt = item->text(0); - int id = item->data(0, 1).toInt(); - if (id == 0) { - color = 0; - return; - } - switch(id) { - case 0x400 ... 0x410: // "Default" - color = &config->partColors[id & 0xff]; - break; - case 0x100: - color = &config->bigTimeBackgroundColor; - break; - case 0x101: - color = &config->bigTimeForegroundColor; - break; - case 0x200: - color = &config->transportHandleColor; - break; - case 0x300: - color = &config->waveEditBackgroundColor; - break; - case 0x500 ... 0x5ff: - color = &config->trackBg[id & 0xff]; - break; - case 0x41c: - color = &config->selectPartBg; - break; - default: - color = 0; - break; - } - updateColor(); - } - -//--------------------------------------------------------- -// updateColor -//--------------------------------------------------------- - -void Appearance::updateColor() - { - hslider->setEnabled(color); - sslider->setEnabled(color); - vslider->setEnabled(color); - if (color == 0) - return; - QPalette p(colorframe->palette()); - p.setColor(QPalette::Window, *color); - colorframe->setPalette(p); - int r, g, b, h, s, v; - color->getRgb(&r, &g, &b); - color->getHsv(&h, &s, &v); - - hslider->blockSignals(true); - sslider->blockSignals(true); - vslider->blockSignals(true); - - hslider->setValue(h); - sslider->setValue(s); - vslider->setValue(v); - - hslider->blockSignals(false); - sslider->blockSignals(false); - vslider->blockSignals(false); - } - -void Appearance::hsliderChanged(int val) - { - int h, s, v; - if (color) { - color->getHsv(&h, &s, &v); - color->setHsv(val, s, v); - } - updateColor(); - } - -void Appearance::ssliderChanged(int val) - { - int h, s, v; - if (color) { - color->getHsv(&h, &s, &v); - color->setHsv(h, val, v); - } - updateColor(); - } - -void Appearance::vsliderChanged(int val) - { - int h, s, v; - if (color) { - color->getHsv(&h, &s, &v); - color->setHsv(h, s, val); - } - updateColor(); - } - -//--------------------------------------------------------- -// addToPaletteClicked -//--------------------------------------------------------- - -void Appearance::addToPaletteClicked() - { - if (!color) - return; - QAbstractButton* button = colorGroup->checkedButton(); - int r, g, b; - QColor c; - if (button) { - c = button->palette().color(QPalette::Button); - c.getRgb(&r, &g, &b); - } - if (button == 0 || r != 0xff || g != 0xff || b != 0xff) { - for (int i = 0; i < 16; ++i) { - button = colorGroup->button(i); - c = button->palette().color(QPalette::Button); - c.getRgb(&r, &g, &b); - if (r == 0xff && g == 0xff && b == 0xff) { - // found empty slot - button->setChecked(true); - break; - } - } - } - if (button) { - int id = colorGroup->checkedId(); - config->palette[id] = *color; - QPalette p(button->palette()); - // p.setColor(QPalette::Active, QPalette::Button, *color); - p.setColor(QPalette::Button, *color); - p.setColor(button->backgroundRole(), *color); - - p.setColor(QPalette::Inactive, QPalette::Button, *color); - button->setPalette(p); - } - } - -//--------------------------------------------------------- -// paletteClicked -//--------------------------------------------------------- - -void Appearance::paletteClicked(QAbstractButton* button) - { - QColor c = button->palette().color(QPalette::Button); - int r, g, b; - c.getRgb(&r, &g, &b); - if (r == 0xff && g == 0xff && b == 0xff) - return; // interpret palette slot as empty - *color = c; - updateColor(); - } - -//--------------------------------------------------------- -// browseFont -//--------------------------------------------------------- - -void Appearance::browseFont0() { browseFont(0); } -void Appearance::browseFont1() { browseFont(1); } -void Appearance::browseFont2() { browseFont(2); } -void Appearance::browseFont3() { browseFont(3); } -void Appearance::browseFont4() { browseFont(4); } -void Appearance::browseFont5() { browseFont(5); } - -void Appearance::browseFont(int n) - { - bool ok; - QFont font = QFontDialog::getFont(&ok, *config->fonts[n], this); - if (ok) { - config->fonts[n] = new QFont(font); - updateFonts(); - } - } - -//--------------------------------------------------------- -// usePixmapToggled -//--------------------------------------------------------- - -void Appearance::usePixmapToggled(bool val) - { - useColor->setChecked(!val); - } - -//--------------------------------------------------------- -// useColorToggled -//--------------------------------------------------------- - -void Appearance::useColorToggled(bool val) - { - usePixmap->setChecked(!val); - } - diff --git a/muse/muse/appearance.h b/muse/muse/appearance.h deleted file mode 100644 index e993f437..00000000 --- a/muse/muse/appearance.h +++ /dev/null @@ -1,73 +0,0 @@ -//============================================================================= -// MusE -// Linux Music Editor -// $Id:$ -// -// Copyright (C) 2002-2006 by Werner Schweer and others -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License version 2. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -//============================================================================= - -#ifndef __APPEARANCE_H__ -#define __APPEARANCE_H__ - -#include "ui_appearance.h" - -class MusE; -class Arranger; -class GlobalConfigValues; - -//--------------------------------------------------------- -// Appearance Dialog -//--------------------------------------------------------- - -class Appearance : public QDialog, public Ui::AppearanceDialogBase { - Arranger* arr; - QColor* color; - QString currentBg; - GlobalConfigValues* config; - QButtonGroup* colorGroup; - - Q_OBJECT - void updateFonts(); - void updateColor(); - - private slots: - void apply(); - void ok(); - void cancel(); - void configCanvasBgColor(); - void configCanvasBgPixmap(); - void colorItemSelectionChanged(); - void browseFont(int); - void browseFont0(); - void browseFont1(); - void browseFont2(); - void browseFont3(); - void browseFont4(); - void browseFont5(); - void hsliderChanged(int); - void ssliderChanged(int); - void vsliderChanged(int); - void addToPaletteClicked(); - void paletteClicked(QAbstractButton*); - void useColorToggled(bool); - void usePixmapToggled(bool); - - public: - Appearance(Arranger*, QWidget* parent=0); - ~Appearance(); - void resetValues(); - }; - -#endif diff --git a/muse/muse/appearance.ui b/muse/muse/appearance.ui deleted file mode 100644 index 920d68de..00000000 --- a/muse/muse/appearance.ui +++ /dev/null @@ -1,1182 +0,0 @@ - - - - - AppearanceDialogBase - - - - 0 - 0 - 583 - 395 - - - - MusE: Appearance settings - - - - 9 - - - 6 - - - - - - 3 - 7 - 0 - 0 - - - - - Arranger - - - - 9 - - - 6 - - - - - Background - - - false - - - - 9 - - - 6 - - - - - select... - - - - - - - select... - - - - - - - Color - - - - - - - Pixmap - - - - - - - - 7 - 1 - 0 - 0 - - - - bg - - - Qt::AlignCenter - - - -1 - - - - - - - Color - - - Qt::AlignCenter - - - - - - - - - - show snap grid - - - - - - - Events - - - - 11 - - - 6 - - - - - note on - - - - - - - poly pressure - - - - - - - controller - - - - - - - aftertouch - - - - - - - pitch bend - - - - - - - program change - - - - - - - special - - - - - - - - - - Parts - - - - 11 - - - 6 - - - - - show names - - - - - - - show events - - - - - - - show Cakewalk Style - - - - - - - - - - - Colors - - - - 9 - - - 6 - - - - - 0 - - - 6 - - - - - V - - - Qt::AlignCenter - - - - - - - 255 - - - Qt::Horizontal - - - - - - - - - 0 - - - 6 - - - - - S - - - Qt::AlignCenter - - - - - - - 255 - - - Qt::Horizontal - - - - - - - - - 0 - - - 6 - - - - - H - - - Qt::AlignCenter - - - - - - - 255 - - - Qt::Horizontal - - - - - - - - - add to palette - - - - - - - - 1 - 7 - 0 - 0 - - - - true - - - - Items - - - - - - - - - 7 - 7 - 0 - 0 - - - - QFrame::StyledPanel - - - QFrame::Sunken - - - - - - - Qt::NoFocus - - - Palette - - - - 9 - - - 6 - - - - - - - - true - - - - - - - - - - true - - - - - - - - - - true - - - - - - - - - - true - - - - - - - - - - true - - - - - - - - - - true - - - - - - - - - - true - - - - - - - - - - true - - - - - - - - - - true - - - - - - - - - - true - - - - - - - - - - true - - - - - - - - - - true - - - - - - - - - - true - - - - - - - - - - true - - - - - - - - - - true - - - - - - - - - - true - - - - - - - - - - - Style/Fonts - - - - 0 - - - 6 - - - - - - 7 - 5 - 0 - 0 - - - - QT Theme - - - - 11 - - - 6 - - - - - 0 - - - 6 - - - - - - 1 - 0 - 0 - 0 - - - - - Windows - - - - - MusE - - - - - Metal - - - - - Norwegian Wood - - - - - Platinum - - - - - CDE - - - - - Motif - - - - - Motif Plus - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 190 - 20 - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 40 - - - - - - - - - - - Fonts - - - - 11 - - - 6 - - - - - Family - - - - - - - Size - - - - - - - Font 1 - - - - - - - Font 2 - - - - - - - Font 3 - - - - - - - - 7 - 0 - 0 - 0 - - - - - - - - - 7 - 0 - 0 - 0 - - - - - - - - - 7 - 0 - 0 - 0 - - - - - - - - - 7 - 0 - 0 - 0 - - - - - - - - Font 0 - - - - - - - - 4 - 0 - 0 - 0 - - - - - - - - - 4 - 0 - 0 - 0 - - - - - - - - - 4 - 0 - 0 - 0 - - - - - - - - - 4 - 0 - 0 - 0 - - - - - - - - Bold - - - - - - - Bold - - - - - - - Bold - - - - - - - Bold - - - - - - - Italic - - - - - - - Italic - - - - - - - Italic - - - - - - - Italic - - - - - - - - 4 - 1 - 0 - 0 - - - - ... - - - - - - - - 4 - 1 - 0 - 0 - - - - ... - - - - - - - - 4 - 1 - 0 - 0 - - - - ... - - - - - - - - 4 - 1 - 0 - 0 - - - - ... - - - - - - - Font 4 - - - - - - - - 7 - 0 - 0 - 0 - - - - - - - - Font 5 - - - - - - - - 7 - 0 - 0 - 0 - - - - - - - - - 4 - 0 - 0 - 0 - - - - - - - - - 4 - 0 - 0 - 0 - - - - - - - - Bold - - - - - - - Bold - - - - - - - Italic - - - - - - - Italic - - - - - - - - 4 - 1 - 0 - 0 - - - - ... - - - - - - - - 4 - 1 - 0 - 0 - - - - ... - - - - - - - - - - - - - - 0 - - - 6 - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 20 - 20 - - - - - - - - Apply - - - - - - - Ok - - - true - - - - - - - Cancel - - - - - - - - - qPixmapFromMimeSource - - TabWidget2 - itemList - addToPalette - hslider - sslider - vslider - applyButton - okButton - cancelButton - partShownames - partShowevents - partShowCakes - eventNoteon - eventPolypressure - eventController - eventAftertouch - eventPitchbend - eventProgramchange - eventSpecial - arrGrid - themeComboBox - fontName0 - fontName1 - fontName2 - fontName3 - fontSize0 - fontSize1 - fontSize2 - fontSize3 - bold1 - bold2 - bold3 - bold0 - italic2 - italic3 - italic1 - italic0 - fontName4 - fontName5 - fontSize4 - fontSize5 - bold4 - bold5 - italic4 - italic5 - - - - diff --git a/muse/muse/conf.cpp b/muse/muse/conf.cpp index 980e0c68..40f91dec 100644 --- a/muse/muse/conf.cpp +++ b/muse/muse/conf.cpp @@ -27,7 +27,7 @@ #include "gconfig.h" #include "al/xml.h" #include "widgets/midisync.h" -#include "genset.h" +// #include "genset.h" #include "sync.h" #include "mixer/mixer.h" #include "globals.h" @@ -638,18 +638,18 @@ void MidiFileConfig::cancelClicked() // configGlobalSettings //--------------------------------------------------------- -void MusE::configGlobalSettings() - { - if (!globalSettingsConfig) - globalSettingsConfig = new GlobalSettingsConfig(); - - if (globalSettingsConfig->isVisible()) { - globalSettingsConfig->raise(); -//TD globalSettingsConfig->setActiveWindow(); - } - else - globalSettingsConfig->show(); - } +//void MusE::configGlobalSettings() +// { +// if (!globalSettingsConfig) +// globalSettingsConfig = new GlobalSettingsConfig(); +// +// if (globalSettingsConfig->isVisible()) { +// globalSettingsConfig->raise(); +////TD globalSettingsConfig->setActiveWindow(); +// } +// else +// globalSettingsConfig->show(); +// } //--------------------------------------------------------- // write diff --git a/muse/muse/genset.cpp b/muse/muse/genset.cpp deleted file mode 100644 index 49950694..00000000 --- a/muse/muse/genset.cpp +++ /dev/null @@ -1,475 +0,0 @@ -//============================================================================= -// MusE -// Linux Music Editor -// $Id:$ -// -// Copyright (C) 2002-2006 by Werner Schweer and others -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License version 2. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -//============================================================================= - -#include "genset.h" -#include "muse.h" -#include "gconfig.h" -#include "audio.h" -#include "globals.h" -#include "mixer/mixer.h" -#include "icons.h" -#include "song.h" -#include "midirc.h" -#include "driver/alsamidi.h" -#include "instruments/minstrument.h" -#include "midiedit/pianoroll.h" -#include "midiedit/drumedit.h" - -static int rtcResolutions[] = { - 1024, 2048, 4096, 8192 - }; -static int divisions[] = { - 48, 96, 192, 384, 768, 1536, 3072, 6144, 12288 - }; - -//--------------------------------------------------------- -// GlobalSettingsConfig -//--------------------------------------------------------- - -GlobalSettingsConfig::GlobalSettingsConfig(QWidget* parent) - : QDialog(parent) - { - setupUi(this); - for (unsigned i = 0; i < sizeof(rtcResolutions)/sizeof(*rtcResolutions); ++i) { - if (rtcResolutions[i] == config.rtcTicks) { - rtcResolutionSelect->setCurrentIndex(i); - break; - } - } - for (unsigned i = 0; i < sizeof(divisions)/sizeof(*divisions); ++i) { - if (divisions[i] == config.division) { - midiDivisionSelect->setCurrentIndex(i); - break; - } - } - std::list* ol = midiDriver->inputPorts(); - int i = 0; - for (std::list::iterator ip = ol->begin(); ip != ol->end(); ++ip, ++i) { - preferredInput->addItem(ip->name); - if (ip->name == config.defaultMidiInputDevice) - preferredInput->setCurrentIndex(i); - } - ol = midiDriver->outputPorts(); - i = 0; - for (std::list::iterator ip = ol->begin(); ip != ol->end(); ++ip, ++i) { - preferredOutput->addItem(ip->name); - if (ip->name == config.defaultMidiOutputDevice) - preferredOutput->setCurrentIndex(i); - } - - i = 0; - for (iMidiInstrument mi = midiInstruments.begin(); mi != midiInstruments.end(); ++mi, ++i) { - preferredInstrument->addItem((*mi)->iname()); - if ((*mi)->iname() == config.defaultMidiInstrument) - preferredInstrument->setCurrentIndex(i); - } - - connectToAllDevices->setChecked(config.connectToAllMidiDevices); - connectToAllTracks->setChecked(config.connectToAllMidiTracks); - createDefaultInput->setChecked(config.createDefaultMidiInput); - - guiRefreshSelect->setValue(config.guiRefresh); - minSliderSelect->setValue(int(config.minSlider)); - minMeterSelect->setValue(config.minMeter); - peakHoldTime->setValue(config.peakHoldTime); - helpBrowser->setText(config.helpBrowser); - startSongEntry->setText(config.startSong); - - startSongGroup = new QButtonGroup(this); - startSongGroup->addButton(startLast); - startSongGroup->addButton(startTemplate); - startSongGroup->addButton(startSong); - - switch(config.startMode) { - case 0: startLast->setChecked(true); break; - case 1: startTemplate->setChecked(true); break; - case 2: startSong->setChecked(true); break; - } - - showTransport->setChecked(config.transportVisible); - showBigtime->setChecked(config.bigTimeVisible); - showMixer1->setChecked(config.mixer1Visible); - showMixer2->setChecked(config.mixer2Visible); - - arrangerX->setValue(config.geometryMain.x()); - arrangerY->setValue(config.geometryMain.y()); - arrangerW->setValue(config.geometryMain.width()); - arrangerH->setValue(config.geometryMain.height()); - - transportX->setValue(config.geometryTransport.x()); - transportY->setValue(config.geometryTransport.y()); - - bigtimeX->setValue(config.geometryBigTime.x()); - bigtimeY->setValue(config.geometryBigTime.y()); - bigtimeW->setValue(config.geometryBigTime.width()); - bigtimeH->setValue(config.geometryBigTime.height()); - - mixerX1->setValue(config.mixer1.geometry.x()); - mixerY1->setValue(config.mixer1.geometry.y()); - mixerW1->setValue(config.mixer1.geometry.width()); - mixerH1->setValue(config.mixer1.geometry.height()); - - mixerX2->setValue(config.mixer2.geometry.x()); - mixerY2->setValue(config.mixer2.geometry.y()); - mixerW2->setValue(config.mixer2.geometry.width()); - mixerH2->setValue(config.mixer2.geometry.height()); - - setMixerCurrent1->setEnabled(muse->mixer1Window()); - setMixerCurrent1->setEnabled(muse->mixer2Window()); - - setBigtimeCurrent->setEnabled(muse->bigtimeWindow()); - setTransportCurrent->setEnabled(muse->transportWindow()); - freewheelMode->setChecked(config.useJackFreewheelMode); - showSplash->setChecked(config.showSplashScreen); - - stopActive->setChecked(midiRCList.isActive(RC_STOP)); - playActive->setChecked(midiRCList.isActive(RC_PLAY)); - gotoLeftMarkActive->setChecked(midiRCList.isActive(RC_GOTO_LEFT_MARK)); - recordActive->setChecked(midiRCList.isActive(RC_RECORD)); - - connect(applyButton, SIGNAL(clicked()), SLOT(apply())); - connect(okButton, SIGNAL(clicked()), SLOT(ok())); - connect(cancelButton, SIGNAL(clicked()), SLOT(cancel())); - connect(setMixerCurrent1, SIGNAL(clicked()), SLOT(mixerCurrent1())); - connect(setMixerCurrent2, SIGNAL(clicked()), SLOT(mixerCurrent2())); - connect(setBigtimeCurrent, SIGNAL(clicked()), SLOT(bigtimeCurrent())); - connect(setArrangerCurrent, SIGNAL(clicked()), SLOT(arrangerCurrent())); - connect(setTransportCurrent, SIGNAL(clicked()), SLOT(transportCurrent())); - - recordStop->setChecked(false); - recordRecord->setChecked(false); - recordGotoLeftMark->setChecked(false); - recordPlay->setChecked(false); - rcGroup->setChecked(rcEnable); - - pianorollWidth->setValue(PianoRoll::initWidth); - pianorollHeight->setValue(PianoRoll::initHeight); - pianorollRaster->setRaster(PianoRoll::initRaster); - pianorollQuant->setQuant(PianoRoll::initQuant); - - drumEditorWidth->setValue(DrumEdit::initWidth); - drumEditorHeight->setValue(DrumEdit::initHeight); - - connect(recordStop, SIGNAL(clicked(bool)), SLOT(recordStopToggled(bool))); - connect(recordRecord, SIGNAL(clicked(bool)), SLOT(recordRecordToggled(bool))); - connect(recordGotoLeftMark, SIGNAL(clicked(bool)), SLOT(recordGotoLeftMarkToggled(bool))); - connect(recordPlay, SIGNAL(clicked(bool)), SLOT(recordPlayToggled(bool))); - } - -//--------------------------------------------------------- -// apply -//--------------------------------------------------------- - -void GlobalSettingsConfig::apply() - { - rcEnable = rcGroup->isChecked(); - int rtcticks = rtcResolutionSelect->currentIndex(); - int div = midiDivisionSelect->currentIndex(); - - config.connectToAllMidiDevices = connectToAllDevices->isChecked(); - config.connectToAllMidiTracks = connectToAllTracks->isChecked(); - config.createDefaultMidiInput = createDefaultInput->isChecked(); - config.defaultMidiInputDevice = preferredInput->currentText(); - config.defaultMidiOutputDevice = preferredOutput->currentText(); - config.defaultMidiInstrument = preferredInstrument->currentText(); - - config.guiRefresh = guiRefreshSelect->value(); - config.minSlider = minSliderSelect->value(); - config.minMeter = minMeterSelect->value(); - config.peakHoldTime = peakHoldTime->value(); - config.rtcTicks = rtcResolutions[rtcticks]; - config.guiDivision = divisions[div]; - config.helpBrowser = helpBrowser->text(); - config.startSong = startSongEntry->text(); - - if (startLast->isChecked()) - config.startMode = 0; - else if (startTemplate->isChecked()) - config.startMode = 1; - else if (startSong->isChecked()) - config.startMode = 2; - - config.transportVisible = showTransport->isChecked(); - config.bigTimeVisible = showBigtime->isChecked(); - config.mixer1Visible = showMixer1->isChecked(); - config.mixer2Visible = showMixer2->isChecked(); - - config.geometryMain.setX(arrangerX->value()); - config.geometryMain.setY(arrangerY->value()); - config.geometryMain.setWidth(arrangerW->value()); - config.geometryMain.setHeight(arrangerH->value()); - - config.geometryTransport.setX(transportX->value()); - config.geometryTransport.setY(transportY->value()); - config.geometryTransport.setWidth(0); - config.geometryTransport.setHeight(0); - - config.geometryBigTime.setX(bigtimeX->value()); - config.geometryBigTime.setY(bigtimeY->value()); - config.geometryBigTime.setWidth(bigtimeW->value()); - config.geometryBigTime.setHeight(bigtimeH->value()); - - config.mixer1.geometry.setX(mixerX1->value()); - config.mixer1.geometry.setY(mixerY1->value()); - config.mixer1.geometry.setWidth(mixerW1->value()); - config.mixer1.geometry.setHeight(mixerH1->value()); - - config.mixer2.geometry.setX(mixerX2->value()); - config.mixer2.geometry.setY(mixerY2->value()); - config.mixer2.geometry.setWidth(mixerW2->value()); - config.mixer2.geometry.setHeight(mixerH2->value()); - - config.useJackFreewheelMode = freewheelMode->isChecked(); - config.showSplashScreen = showSplash->isChecked(); - - PianoRoll::initWidth = pianorollWidth->value(); - PianoRoll::initHeight = pianorollHeight->value(); - PianoRoll::initRaster = pianorollRaster->raster(); - PianoRoll::initQuant = pianorollQuant->quant(); - - DrumEdit::initWidth = drumEditorWidth->value(); - DrumEdit::initHeight = drumEditorHeight->value(); - - muse->showMixer1(config.mixer1Visible); - muse->showMixer2(config.mixer2Visible); - muse->showBigtime(config.bigTimeVisible); - muse->showTransport(config.transportVisible); - QWidget* w = muse->transportWindow(); - if (w) { - w->resize(config.geometryTransport.size()); - w->move(config.geometryTransport.topLeft()); - } - w = muse->mixer1Window(); - if (w) { - w->resize(config.mixer1.geometry.size()); - w->move(config.mixer1.geometry.topLeft()); - } - w = muse->mixer2Window(); - if (w) { - w->resize(config.mixer2.geometry.size()); - w->move(config.mixer2.geometry.topLeft()); - } - w = muse->bigtimeWindow(); - if (w) { - w->resize(config.geometryBigTime.size()); - w->move(config.geometryBigTime.topLeft()); - } - - muse->resize(config.geometryMain.size()); - muse->move(config.geometryMain.topLeft()); - - muse->setHeartBeat(); // set guiRefresh - audio->msgSetRtc(); // set midi tick rate - muse->changeConfig(true); // save settings - } - -//--------------------------------------------------------- -// ok -//--------------------------------------------------------- - -void GlobalSettingsConfig::ok() - { - apply(); - close(); - } - -//--------------------------------------------------------- -// cancel -//--------------------------------------------------------- - -void GlobalSettingsConfig::cancel() - { - close(); - } - -//--------------------------------------------------------- -// mixerCurrent1 -//--------------------------------------------------------- - -void GlobalSettingsConfig::mixerCurrent1() - { - QWidget* w = muse->mixer1Window(); - if (!w) - return; - QRect r(w->frameGeometry()); - mixerX1->setValue(r.x()); - mixerY1->setValue(r.y()); - mixerW1->setValue(r.width()); - mixerH1->setValue(r.height()); - } - -//--------------------------------------------------------- -// mixerCurrent2 -//--------------------------------------------------------- - -void GlobalSettingsConfig::mixerCurrent2() - { - QWidget* w = muse->mixer2Window(); - if (!w) - return; - QRect r(w->frameGeometry()); - mixerX2->setValue(r.x()); - mixerY2->setValue(r.y()); - mixerW2->setValue(r.width()); - mixerH2->setValue(r.height()); - } - -//--------------------------------------------------------- -// bigtimeCurrent -//--------------------------------------------------------- - -void GlobalSettingsConfig::bigtimeCurrent() - { - QWidget* w = muse->bigtimeWindow(); - if (!w) - return; - QRect r(w->frameGeometry()); - bigtimeX->setValue(r.x()); - bigtimeY->setValue(r.y()); - bigtimeW->setValue(r.width()); - bigtimeH->setValue(r.height()); - } - -//--------------------------------------------------------- -// arrangerCurrent -//--------------------------------------------------------- - -void GlobalSettingsConfig::arrangerCurrent() - { - QRect r(muse->frameGeometry()); - arrangerX->setValue(r.x()); - arrangerY->setValue(r.y()); - arrangerW->setValue(r.width()); - arrangerH->setValue(r.height()); - } - -//--------------------------------------------------------- -// transportCurrent -//--------------------------------------------------------- - -void GlobalSettingsConfig::transportCurrent() - { - QWidget* w = muse->transportWindow(); - if (!w) - return; - QRect r(w->frameGeometry()); - transportX->setValue(r.x()); - transportY->setValue(r.y()); - } - -//--------------------------------------------------------- -// recordStopToggled -//--------------------------------------------------------- - -void GlobalSettingsConfig::recordStopToggled(bool f) - { - recordStop->setChecked(!f); - if (!f) { - recordRecord->setChecked(false); - recordGotoLeftMark->setChecked(false); - recordPlay->setChecked(false); - connect(song, SIGNAL(midiEvent(MidiEvent)), SLOT(midiEventReceived(MidiEvent))); - } - else - disconnect(song, SIGNAL(midiEvent(MidiEvent)), this, SLOT(midiEventReceived(MidiEvent))); - } - -//--------------------------------------------------------- -// recordRecordToggled -//--------------------------------------------------------- - -void GlobalSettingsConfig::recordRecordToggled(bool f) - { - recordRecord->setChecked(!f); - if (!f) { - recordStop->setChecked(false); - recordGotoLeftMark->setChecked(false); - recordPlay->setChecked(false); - connect(song, SIGNAL(midiEvent(MidiEvent)), SLOT(midiEventReceived(MidiEvent))); - } - else - disconnect(song, SIGNAL(midiEvent(MidiEvent)), this, SLOT(midiEventReceived(MidiEvent))); - } - -//--------------------------------------------------------- -// recordGotoLeftMarkToggled -//--------------------------------------------------------- - -void GlobalSettingsConfig::recordGotoLeftMarkToggled(bool f) - { - recordGotoLeftMark->setChecked(!f); - if (!f) { - recordStop->setChecked(false); - recordRecord->setChecked(false); - recordPlay->setChecked(false); - connect(song, SIGNAL(midiEvent(MidiEvent)), SLOT(midiEventReceived(MidiEvent))); - } - else - disconnect(song, SIGNAL(midiEvent(MidiEvent)), this, SLOT(midiEventReceived(MidiEvent))); - } - -//--------------------------------------------------------- -// recordPlayToggled -//--------------------------------------------------------- - -void GlobalSettingsConfig::recordPlayToggled(bool f) - { - recordPlay->setChecked(!f); - if (!f) { - recordStop->setChecked(false); - recordRecord->setChecked(false); - recordGotoLeftMark->setChecked(false); - connect(song, SIGNAL(midiEvent(MidiEvent)), SLOT(midiEventReceived(MidiEvent))); - } - else - disconnect(song, SIGNAL(midiEvent(MidiEvent)), this, SLOT(midiEventReceived(MidiEvent))); - } - -//--------------------------------------------------------- -// midiEventReceived -//--------------------------------------------------------- - -void GlobalSettingsConfig::midiEventReceived(MidiEvent event) - { - printf("event received\n"); - if (recordPlay->isChecked()) { - recordPlay->setChecked(false); - playActive->setChecked(true); - midiRCList.setAction(event, RC_PLAY); - } - else if (recordStop->isChecked()) { - recordStop->setChecked(false); - stopActive->setChecked(true); - midiRCList.setAction(event, RC_STOP); - } - else if (recordRecord->isChecked()) { - recordRecord->setChecked(false); - recordActive->setChecked(true); - midiRCList.setAction(event, RC_RECORD); - } - else if (recordGotoLeftMark->isChecked()) { - recordGotoLeftMark->setChecked(false); - gotoLeftMarkActive->setChecked(true); - midiRCList.setAction(event, RC_GOTO_LEFT_MARK); - } - // only one shot - disconnect(song, SIGNAL(midiEvent(MidiEvent)), this, SLOT(midiEventReceived(MidiEvent))); - } - diff --git a/muse/muse/genset.h b/muse/muse/genset.h deleted file mode 100644 index 6eb602f0..00000000 --- a/muse/muse/genset.h +++ /dev/null @@ -1,56 +0,0 @@ -//============================================================================= -// MusE -// Linux Music Editor -// $Id:$ -// -// Copyright (C) 2002-2006 by Werner Schweer and others -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License version 2. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -//============================================================================= - -#ifndef __GENSET_H__ -#define __GENSET_H__ - -#include "ui_genset.h" -#include "event.h" -#include "mpevent.h" - -//--------------------------------------------------------- -// GlobalSettingsConfig -//--------------------------------------------------------- - -class GlobalSettingsConfig : public QDialog, Ui::GlobalSettingsDialogBase { - Q_OBJECT - - QButtonGroup* startSongGroup; - - private slots: - void apply(); - void ok(); - void cancel(); - void mixerCurrent1(); - void mixerCurrent2(); - void bigtimeCurrent(); - void arrangerCurrent(); - void transportCurrent(); - void recordStopToggled(bool); - void recordRecordToggled(bool); - void recordGotoLeftMarkToggled(bool); - void recordPlayToggled(bool); - void midiEventReceived(MidiEvent); - - public: - GlobalSettingsConfig(QWidget* parent=0); - }; - -#endif diff --git a/muse/muse/genset.ui b/muse/muse/genset.ui deleted file mode 100644 index c391fb05..00000000 --- a/muse/muse/genset.ui +++ /dev/null @@ -1,1320 +0,0 @@ - - - - - GlobalSettingsDialogBase - - - - 0 - 0 - 596 - 562 - - - - Dialog - - - - 9 - - - 6 - - - - - - Application - - - - 9 - - - 6 - - - - - Start MusE - - - - 9 - - - 6 - - - - - 0 - - - 6 - - - - - start song - - - - - - - - - - - - - - - - 9 - - - 6 - - - - - start with last song - - - - - - - start with template: default.med - - - - - - - start with song - - - - - - - - - - 0 - - - 6 - - - - - show splash screen - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - Views - - - - 9 - - - 6 - - - - - Cur - - - - - - - show - - - - - - - Mixer 1 - - - - - - - Big Time - - - - - - - Cur - - - - - - - Cur - - - - - - - Cur - - - - - - - 9999 - - - - - - - 9999 - - - 0 - - - - - - - 9999 - - - - - - - 9999 - - - - - - - 9999 - - - - - - - 9999 - - - - - - - 9999 - - - - - - - 9999 - - - - - - - 9999 - - - - - - - 9999 - - - - - - - 9999 - - - - - - - 9999 - - - - - - - 9999 - - - - - - - 9999 - - - - - - - 9999 - - - - - - - 9999 - - - - - - - 9999 - - - - - - - 9999 - - - - - - - show - - - - - - - show - - - - - - - Mixer 2 - - - - - - - Transport - - - - - - - Arranger - - - - - - - show - - - - - - - Cur - - - - - - - - - - - Editors - - - - - 9 - 9 - 556 - 457 - - - - - Pianoroll - - - - 9 - - - 6 - - - - - Qt::Vertical - - - - 20 - 211 - - - - - - - - <html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Arial; font-size:10pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600;">Quant</p></body></html> - - - - - - - <html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Arial; font-size:10pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600;">Raster</p></body></html> - - - - - - - <html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Arial; font-size:10pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600;">Geometry</p></body></html> - - - - - - - height: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - width: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - 9999 - - - 50 - - - - - - - 9999 - - - 50 - - - - - - - - - - - - - - DrumEditor - - - - 9 - - - 6 - - - - - Qt::Vertical - - - - 20 - 351 - - - - - - - - <html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Arial; font-size:10pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600;">Geometry</p></body></html> - - - - - - - 9999 - - - 50 - - - - - - - width: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - 9999 - - - 50 - - - - - - - height: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - MasterEditor - - - - 9 - - - 6 - - - - - Qt::Vertical - - - - 20 - 331 - - - - - - - - 9999 - - - 50 - - - - - - - height: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - 9999 - - - 50 - - - - - - - width: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - <html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Arial; font-size:10pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600;">Geometry</p></body></html> - - - - - - - - WaveEditor - - - - 9 - - - 6 - - - - - 9999 - - - 50 - - - - - - - height: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - width: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - <html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Arial; font-size:10pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600;">Geometry</p></body></html> - - - - - - - 9999 - - - 50 - - - - - - - Qt::Vertical - - - - 20 - 351 - - - - - - - - - - - Audio - - - - 9 - - - 6 - - - - - Mixer - - - - 9 - - - 6 - - - - - ms - - - 5000 - - - 20 - - - - - - - Peak Hold Time: - - - - - - - dB - - - 0 - - - -100 - - - 10 - - - -60 - - - - - - - dB - - - 0 - - - -100 - - - -60 - - - - - - - min. Meter Val - - - - - - - min. Slider Val - - - - - - - - - - use JACK freewheel mode if possible - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - Midi - - - - 8 - - - 6 - - - - - Ticks - - - - 9 - - - 6 - - - - - Displayed Resolution -(Ticks/Quarternote) - - - - - - - RTC Resolution -(Ticks/Sec) - - - - - - - - 1024 - - - - - 2048 - - - - - 4096 - - - - - 8172 - - - - - - - - 0 - - - - 48 - - - - - 96 - - - - - 192 - - - - - 384 - - - - - 768 - - - - - 1536 - - - - - 3072 - - - - - 6144 - - - - - 12288 - - - - - - - - - - - Input Routing - - - - 8 - - - 6 - - - - - Connect to all Tracks - - - - - - - Connect to all Input Devices - - - - - - - <html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Arial; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Preferred Input Device:</p></body></html> - - - - - - - - - - Create Default Input Strip - - - - - - - - - - Output Routing - - - - 8 - - - 8 - - - - - <html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Arial; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Preferred Output Device:</p></body></html> - - - - - - - - - - <html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Arial; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Preferred Instrument:</p></body></html> - - - - - - - - - - - - - Qt::Vertical - - - - 20 - 20 - - - - - - - - - GUI - - - - 9 - - - 6 - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - Help Browser - - - - - - - /sec - - - 100 - - - 2 - - - - - - - GUI Refresh Rate: - - - - - - - - RemoteControl - - - - 9 - - - 6 - - - - - Midi Remote Control - - - true - - - - 9 - - - 6 - - - - - Record - - - - - - - Goto Left Mark - - - - - - - Stop - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Play - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - 0 - - - 6 - - - - - Qt::Horizontal - - - - 131 - 31 - - - - - - - - Apply - - - - - - - OK - - - - - - - Cancel - - - - - - - - - - - RecordButton - QToolButton -
recordbutton.h
- 0 - -
- - GreendotButton - QToolButton -
greendotbutton.h
- 0 - -
- - RasterCombo - QComboBox -
rastercombo.h
- 0 - -
- - QuantCombo - QComboBox -
quantcombo.h
- 0 - -
-
- - - - okButton - clicked() - GlobalSettingsDialogBase - accept() - - - 278 - 253 - - - 96 - 254 - - - - - cancelButton - clicked() - GlobalSettingsDialogBase - reject() - - - 369 - 253 - - - 179 - 282 - - - - -
diff --git a/muse/muse/muse.cpp b/muse/muse/muse.cpp index dba0a186..052c1278 100644 --- a/muse/muse/muse.cpp +++ b/muse/muse/muse.cpp @@ -40,7 +40,7 @@ #include "plugin.h" #include "marker/markerview.h" #include "transpose.h" -#include "appearance.h" +#include "preferences.h" #include "widgets/gatetime.h" #include "audio.h" #include "midiseq.h" @@ -444,11 +444,12 @@ MusE::MusE() midiFilterConfig = 0; midiInputTransform = 0; midiRhythmGenerator = 0; - globalSettingsConfig = 0; +// globalSettingsConfig = 0; + preferencesDialog = 0; softSynthesizerConfig = 0; midiTransformerDialog = 0; shortcutConfig = 0; - appearance = 0; +// appearance = 0; editInstrument = 0; appName = QString("MusE"); _raster = 0; @@ -794,8 +795,8 @@ MusE::MusE() menuSettings = mb->addMenu(tr("Setti&ngs")); - menu_ids[CMD_GLOBAL_CONFIG] = menuSettings->addAction(QIcon(*settings_globalsettingsIcon), tr("Global Settings")); - connect(menu_ids[CMD_GLOBAL_CONFIG], SIGNAL(triggered()), this, SLOT(configGlobalSettings())); +// menu_ids[CMD_GLOBAL_CONFIG] = menuSettings->addAction(QIcon(*settings_globalsettingsIcon), tr("Global Settings")); +// connect(menu_ids[CMD_GLOBAL_CONFIG], SIGNAL(triggered()), this, SLOT(configGlobalSettings())); menu_ids[CMD_CONFIG_SHORTCUTS] = menuSettings->addAction(QIcon(*settings_configureshortcutsIcon), tr("Configure shortcuts")); connect(menu_ids[CMD_CONFIG_SHORTCUTS], SIGNAL(triggered()), this, SLOT(configShortCuts())); @@ -821,8 +822,9 @@ MusE::MusE() menu_ids[CMD_MIDI_FILE_CONFIG] = menuSettings->addAction(QIcon(*settings_midifileexportIcon), tr("Midi File Export")); connect(menu_ids[CMD_MIDI_FILE_CONFIG], SIGNAL(triggered()), this, SLOT(configMidiFile())); menuSettings->addSeparator(); - menu_ids[CMD_APPEARANCE_SETTINGS] = menuSettings->addAction(QIcon(*settings_appearance_settingsIcon), tr("Appearance settings")); - connect(menu_ids[CMD_APPEARANCE_SETTINGS], SIGNAL(triggered()), this, SLOT(configAppearance())); +// menu_ids[CMD_GLOBAL_CONFIG] = menuSettings->addAction(QIcon(*settings_globalsettingsIcon), tr("Global Settings")); + QAction* action = menuSettings->addAction(QIcon(*settings_globalsettingsIcon), tr("Preferences")); + connect(action, SIGNAL(triggered()), this, SLOT(preferences())); //--------------------------------------------------- // Help @@ -2252,13 +2254,25 @@ void MusE::mixTrack() //--------------------------------------------------------- // configAppearance //--------------------------------------------------------- +// +//void MusE::configAppearance() +// { +// if (!appearance) +// appearance = new Appearance(arranger); +// appearance->resetValues(); +// appearance->show(); +// } + +//--------------------------------------------------------- +// preferences +//--------------------------------------------------------- -void MusE::configAppearance() +void MusE::preferences() { - if (!appearance) - appearance = new Appearance(arranger); - appearance->resetValues(); - appearance->show(); + if (!preferencesDialog) + preferencesDialog = new PreferencesDialog(arranger); + preferencesDialog->resetValues(); + preferencesDialog->show(); } //--------------------------------------------------------- @@ -2691,7 +2705,7 @@ void MusE::updateConfiguration() menu_ids[CMD_AUDIO_BOUNCE_TO_TRACK]->setShortcut(shortcuts[CMD_AUDIO_BOUNCE_TO_TRACK].key); menu_ids[CMD_AUDIO_BOUNCE_TO_FILE]->setShortcut(shortcuts[CMD_AUDIO_BOUNCE_TO_FILE].key); - menu_ids[CMD_GLOBAL_CONFIG]->setShortcut(shortcuts[SHRT_GLOBAL_CONFIG].key); +// menu_ids[CMD_GLOBAL_CONFIG]->setShortcut(shortcuts[SHRT_GLOBAL_CONFIG].key); menu_ids[CMD_CONFIG_SHORTCUTS]->setShortcut(shortcuts[SHRT_CONFIG_SHORTCUTS].key); // Follow options @@ -2701,7 +2715,7 @@ void MusE::updateConfiguration() menu_ids[CMD_CONFIG_MIDISYNC]->setShortcut(shortcuts[SHRT_CONFIG_MIDISYNC].key); menu_ids[CMD_MIDI_FILE_CONFIG]->setShortcut(shortcuts[SHRT_MIDI_FILE_CONFIG].key); - menu_ids[CMD_APPEARANCE_SETTINGS]->setShortcut(shortcuts[SHRT_APPEARANCE_SETTINGS].key); +// menu_ids[CMD_APPEARANCE_SETTINGS]->setShortcut(shortcuts[SHRT_APPEARANCE_SETTINGS].key); menu_ids[CMD_OPEN_HELP]->setShortcut(shortcuts[SHRT_OPEN_HELP].key); // menu_ids[CMD_OPEN_HOMEPAGE]->setShortcut(shortcuts[SHRT_OPEN_HOMEPAGE].key); diff --git a/muse/muse/muse.h b/muse/muse/muse.h index 6720bf4f..7b9e0bd6 100644 --- a/muse/muse/muse.h +++ b/muse/muse/muse.h @@ -43,13 +43,14 @@ class AudioConf; class MidiFileConfig; class MidiFilterConfig; class MarkerView; -class GlobalSettingsConfig; +// class GlobalSettingsConfig; class MidiInputTransformDialog; class MidiTransformerDialog; class RhythmGen; class MidiTrack; class ShortcutConfig; -class Appearance; +// class Appearance; +class PreferencesDialog; class EditInstrument; class Mixer; class ExportMidiDialog; @@ -75,11 +76,11 @@ class MusE : public QMainWindow, public Ui::MuseBase //File menu items: enum { CMD_OPEN_RECENT=0, CMD_IMPORT_MIDI, CMD_EXPORT_MIDI, CMD_IMPORT_AUDIO, CMD_QUIT, CMD_OPEN_DRUMS, - CMD_OPEN_LIST, CMD_OPEN_LIST_MASTER, CMD_GLOBAL_CONFIG, + CMD_OPEN_LIST, CMD_OPEN_LIST_MASTER, CMD_OPEN_GRAPHIC_MASTER, CMD_OPEN_MIDI_TRANSFORM, CMD_TRANSPOSE, CMD_GLOBAL_CUT, CMD_GLOBAL_INSERT, CMD_GLOBAL_SPLIT, CMD_COPY_RANGE, CMD_CUT_EVENTS, CMD_CONFIG_SHORTCUTS, CMD_CONFIG_METRONOME, CMD_CONFIG_MIDISYNC, - CMD_MIDI_FILE_CONFIG, CMD_APPEARANCE_SETTINGS, CMD_CONFIG_AUDIO_PORTS, + CMD_MIDI_FILE_CONFIG, CMD_CONFIG_AUDIO_PORTS, CMD_MIDI_EDIT_INSTRUMENTS, CMD_MIDI_RESET, CMD_MIDI_INIT, CMD_MIDI_LOCAL_OFF, CMD_MIXER_SNAPSHOT, CMD_MIXER_AUTOMATION_CLEAR, CMD_OPEN_HELP, CMD_OPEN_HOMEPAGE, CMD_OPEN_BUG, CMD_START_WHATSTHIS, @@ -138,11 +139,12 @@ class MusE : public QMainWindow, public Ui::MuseBase MetronomeConfig* metronomeConfig; AudioConf* audioConfig; MidiFileConfig* midiFileConfig; - GlobalSettingsConfig* globalSettingsConfig; +// GlobalSettingsConfig* globalSettingsConfig; MidiFilterConfig* midiFilterConfig; MidiInputTransformDialog* midiInputTransform; ShortcutConfig* shortcutConfig; - Appearance* appearance; +// Appearance* appearance; + PreferencesDialog* preferencesDialog; ExportMidiDialog* exportMidiDialog; MidiTransformerDialog* midiTransformerDialog; @@ -183,7 +185,7 @@ class MusE : public QMainWindow, public Ui::MuseBase private slots: void loadProject(); bool save(); - void configGlobalSettings(); +// void configGlobalSettings(); void quitDoc(); void about(); void aboutQt(); @@ -199,7 +201,8 @@ class MusE : public QMainWindow, public Ui::MuseBase void configMidiSync(); void configMidiFile(); void configShortCuts(); - void configAppearance(); +// void configAppearance(); + void startMasterEditor(); void startListEditor(); void startListEditor(PartList*); @@ -248,6 +251,7 @@ class MusE : public QMainWindow, public Ui::MuseBase void mixer2Closed(); void setRaster(int); void syncChanged(); + void preferences(); public slots: void bounceToFile(); diff --git a/muse/muse/preferences.cpp b/muse/muse/preferences.cpp new file mode 100644 index 00000000..2c85b228 --- /dev/null +++ b/muse/muse/preferences.cpp @@ -0,0 +1,1062 @@ +//============================================================================= +// MusE +// Linux Music Editor +// $Id:$ +// +// Copyright (C) 2002-2006 by Werner Schweer and others +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//============================================================================= + +#include "icons.h" +#include "preferences.h" +#include "track.h" +#include "muse.h" +#include "song.h" +#include "event.h" +#include "arranger/arranger.h" +#include "widgets/filedialog.h" +#include "waveedit/waveedit.h" +#include "globals.h" +#include "conf.h" +#include "gconfig.h" + +#include "audio.h" +#include "mixer/mixer.h" +#include "midirc.h" +#include "driver/alsamidi.h" +#include "instruments/minstrument.h" +#include "midiedit/pianoroll.h" +#include "midiedit/drumedit.h" + +static int rtcResolutions[] = { + 1024, 2048, 4096, 8192 + }; +static int divisions[] = { + 48, 96, 192, 384, 768, 1536, 3072, 6144, 12288 + }; + +//--------------------------------------------------------- +// twi +//--------------------------------------------------------- + +static QTreeWidgetItem* twi(QTreeWidget* tw, const char* txt, int data) + { + QTreeWidgetItem* i = new QTreeWidgetItem(tw); + i->setText(0, txt); + i->setData(0, 1, data); + return i; + } + +static QTreeWidgetItem* twi(QTreeWidgetItem* tw, const char* txt, int data) + { + QTreeWidgetItem* i = new QTreeWidgetItem(tw); + i->setText(0, txt); + i->setData(0, 1, data); + return i; + } + +//--------------------------------------------------------- +// PreferencesDialog +//--------------------------------------------------------- + +PreferencesDialog::PreferencesDialog(Arranger* a, QWidget* parent) + : QDialog(parent) + { + setupUi(this); + colorframe->setAutoFillBackground(true); + palette0->setAutoFillBackground(true); + palette1->setAutoFillBackground(true); + palette2->setAutoFillBackground(true); + palette3->setAutoFillBackground(true); + arr = a; + color = 0; + config = new GlobalConfigValues; + resetValues(); + + // ARRANGER + + usePixmap->setChecked(config->canvasUseBgPixmap); + useColor->setChecked(!config->canvasUseBgPixmap); + connect(usePixmap, SIGNAL(toggled(bool)), SLOT(usePixmapToggled(bool))); + connect(useColor, SIGNAL(toggled(bool)), SLOT(useColorToggled(bool))); + + currentBg = config->canvasBgPixmap; + if (currentBg.isEmpty()) + currentBg = ""; + else { + QBrush b; + b.setTexture(QPixmap(currentBg)); + QPalette p; + p.setBrush(QPalette::Window, b); + currentBgLabel->setPalette(p); + } + QPalette p; + canvasBackgroundColor->setAutoFillBackground(true); + p.setColor(QPalette::Window, config->canvasBgColor); + canvasBackgroundColor->setPalette(p); + + currentBgLabel->setAutoFillBackground(true); + currentBgLabel->setText(currentBg); + + partShownames->setChecked(config->canvasShowPartType & 1); + partShowevents->setChecked(config->canvasShowPartType & 2); + partShowCakes->setChecked(!(config->canvasShowPartType & 2)); + + eventNoteon->setChecked(config->canvasShowPartEvent & (1 << 0)); + eventPolypressure->setChecked(config->canvasShowPartEvent & (1 << 1)); + eventController->setChecked(config->canvasShowPartEvent & (1 << 2)); + eventProgramchange->setChecked(config->canvasShowPartEvent & (1 << 3)); + eventAftertouch->setChecked(config->canvasShowPartEvent & (1 << 4)); + eventPitchbend->setChecked(config->canvasShowPartEvent & (1 << 5)); + eventSpecial->setChecked(config->canvasShowPartEvent & (1 << 6)); + eventButtonGroup->setEnabled(config->canvasShowPartType == 2); + arrGrid->setChecked(config->canvasShowGrid); + + // COLORS + QTreeWidgetItem* id; + QTreeWidgetItem* aid; + itemList->setSortingEnabled(false); + itemList->clear(); + + aid = twi(itemList, "Arranger", 0); + id = twi(aid, "PartColors", 0); + twi(id, "Selected", 0x41d); + + twi(id, "Default", 0x400); + twi(id, "Refrain", 0x401); + twi(id, "Bridge", 0x402); + twi(id, "Intro", 0x403); + twi(id, "Coda", 0x404); + twi(id, "Chorus", 0x405); + twi(id, "Solo", 0x406); + twi(id, "Brass", 0x407); + twi(id, "Percussion", 0x408); + twi(id, "Drums", 0x409); + twi(id, "Guitar", 0x40a); + twi(id, "Bass", 0x40b); + twi(id, "Flute", 0x40c); + twi(id, "Strings", 0x40d); + twi(id, "Keyboard", 0x40e); + twi(id, "Piano", 0x40f); + twi(id, "Saxophon", 0x410); + + twi(id, "part canvas background", 0x41c); + + id = twi(aid, "Track List", 0); + twi(id, "Audio Output", 0x500 + Track::AUDIO_OUTPUT); + twi(id, "Audio Group", 0x500 + Track::AUDIO_GROUP); + twi(id, "Audio Aux", 0x500 + Track::AUDIO_AUX); + twi(id, "Wave Track", 0x500 + Track::WAVE); + twi(id, "Audio Input", 0x500 + Track::AUDIO_INPUT); + twi(id, "Synthesizer", 0x500 + Track::AUDIO_SOFTSYNTH); + twi(id, "Midi Track", 0x500 + Track::MIDI); + twi(id, "Midi Output", 0x500 + Track::MIDI_OUT); + twi(id, "Midi Input", 0x500 + Track::MIDI_IN); + twi(id, "Midi Channel", 0x500 + Track::MIDI_CHANNEL); + twi(id, "Midi Synti", 0x500 + Track::MIDI_SYNTI); + + id = twi(itemList, "BigTime", 0); + twi(id, "background", 0x100); + twi(id, "foreground", 0x101); + + id = twi(itemList, "Transport", 0); + twi(id, "handle", 0x200); + + id = twi(itemList, "Editor", 0); + twi(id, "background", 0x300); + + colorGroup = new QButtonGroup(this); + colorGroup->setExclusive(true); + colorGroup->addButton(palette0, 0); + colorGroup->addButton(palette1, 1); + colorGroup->addButton(palette2, 2); + colorGroup->addButton(palette3, 3); + colorGroup->addButton(palette4, 4); + colorGroup->addButton(palette5, 5); + colorGroup->addButton(palette6, 6); + colorGroup->addButton(palette7, 7); + colorGroup->addButton(palette8, 8); + colorGroup->addButton(palette9, 9); + colorGroup->addButton(palette10, 10); + colorGroup->addButton(palette11, 11); + colorGroup->addButton(palette12, 12); + colorGroup->addButton(palette13, 13); + colorGroup->addButton(palette14, 14); + colorGroup->addButton(palette15, 15); + connect(itemList, SIGNAL(itemSelectionChanged()), SLOT(colorItemSelectionChanged())); + connect(colorGroup, SIGNAL(buttonClicked(QAbstractButton*)), SLOT(paletteClicked(QAbstractButton*))); + connect(hslider, SIGNAL(valueChanged(int)), SLOT(hsliderChanged(int))); + connect(sslider, SIGNAL(valueChanged(int)), SLOT(ssliderChanged(int))); + connect(vslider, SIGNAL(valueChanged(int)), SLOT(vsliderChanged(int))); + + connect(addToPalette, SIGNAL(clicked()), SLOT(addToPaletteClicked())); + + //--------------------------------------------------- + // STYLE + //--------------------------------------------------- + + themeComboBox->clear(); + + QString cs = muse->style()->objectName(); + cs = cs.toLower(); + + themeComboBox->addItems(QStyleFactory::keys()); + for (int i = 0; i < themeComboBox->count(); ++i) { + if (themeComboBox->itemText(i).toLower() == cs) { + themeComboBox->setCurrentIndex(i); + } + } + + //--------------------------------------------------- + // Fonts + //--------------------------------------------------- + + fontBrowse0->setIcon(*openIcon); + fontBrowse1->setIcon(*openIcon); + fontBrowse2->setIcon(*openIcon); + fontBrowse3->setIcon(*openIcon); + fontBrowse4->setIcon(*openIcon); + fontBrowse5->setIcon(*openIcon); + connect(fontBrowse0, SIGNAL(clicked()), SLOT(browseFont0())); + connect(fontBrowse1, SIGNAL(clicked()), SLOT(browseFont1())); + connect(fontBrowse2, SIGNAL(clicked()), SLOT(browseFont2())); + connect(fontBrowse3, SIGNAL(clicked()), SLOT(browseFont3())); + connect(fontBrowse4, SIGNAL(clicked()), SLOT(browseFont4())); + connect(fontBrowse5, SIGNAL(clicked()), SLOT(browseFont5())); + + connect(applyButton, SIGNAL(clicked()), SLOT(apply())); + connect(okButton, SIGNAL(clicked()), SLOT(ok())); + connect(cancelButton, SIGNAL(clicked()), SLOT(cancel())); + connect(selectCanvasBgPixmap, SIGNAL(clicked()), SLOT(configCanvasBgPixmap())); + connect(selectCanvasBgColor, SIGNAL(clicked()), SLOT(configCanvasBgColor())); + connect(partShowevents, SIGNAL(toggled(bool)), eventButtonGroup, SLOT(setEnabled(bool))); + updateColor(); + + for (unsigned i = 0; i < sizeof(rtcResolutions)/sizeof(*rtcResolutions); ++i) { + if (rtcResolutions[i] == config->rtcTicks) { + rtcResolutionSelect->setCurrentIndex(i); + break; + } + } + for (unsigned i = 0; i < sizeof(divisions)/sizeof(*divisions); ++i) { + if (divisions[i] == config->division) { + midiDivisionSelect->setCurrentIndex(i); + break; + } + } + std::list* ol = midiDriver->inputPorts(); + int i = 0; + for (std::list::iterator ip = ol->begin(); ip != ol->end(); ++ip, ++i) { + preferredInput->addItem(ip->name); + if (ip->name == config->defaultMidiInputDevice) + preferredInput->setCurrentIndex(i); + } + ol = midiDriver->outputPorts(); + i = 0; + for (std::list::iterator ip = ol->begin(); ip != ol->end(); ++ip, ++i) { + preferredOutput->addItem(ip->name); + if (ip->name == config->defaultMidiOutputDevice) + preferredOutput->setCurrentIndex(i); + } + + i = 0; + for (iMidiInstrument mi = midiInstruments.begin(); mi != midiInstruments.end(); ++mi, ++i) { + preferredInstrument->addItem((*mi)->iname()); + if ((*mi)->iname() == config->defaultMidiInstrument) + preferredInstrument->setCurrentIndex(i); + } + + connectToAllDevices->setChecked(config->connectToAllMidiDevices); + connectToAllTracks->setChecked(config->connectToAllMidiTracks); + createDefaultInput->setChecked(config->createDefaultMidiInput); + + guiRefreshSelect->setValue(config->guiRefresh); + minSliderSelect->setValue(int(config->minSlider)); + minMeterSelect->setValue(config->minMeter); + peakHoldTime->setValue(config->peakHoldTime); + helpBrowser->setText(config->helpBrowser); + startSongEntry->setText(config->startSong); + + startSongGroup = new QButtonGroup(this); + startSongGroup->addButton(startLast); + startSongGroup->addButton(startTemplate); + startSongGroup->addButton(startSong); + + switch(config->startMode) { + case 0: startLast->setChecked(true); break; + case 1: startTemplate->setChecked(true); break; + case 2: startSong->setChecked(true); break; + } + + showTransport->setChecked(config->transportVisible); + showBigtime->setChecked(config->bigTimeVisible); + showMixer1->setChecked(config->mixer1Visible); + showMixer2->setChecked(config->mixer2Visible); + + arrangerX->setValue(config->geometryMain.x()); + arrangerY->setValue(config->geometryMain.y()); + arrangerW->setValue(config->geometryMain.width()); + arrangerH->setValue(config->geometryMain.height()); + + transportX->setValue(config->geometryTransport.x()); + transportY->setValue(config->geometryTransport.y()); + + bigtimeX->setValue(config->geometryBigTime.x()); + bigtimeY->setValue(config->geometryBigTime.y()); + bigtimeW->setValue(config->geometryBigTime.width()); + bigtimeH->setValue(config->geometryBigTime.height()); + + mixerX1->setValue(config->mixer1.geometry.x()); + mixerY1->setValue(config->mixer1.geometry.y()); + mixerW1->setValue(config->mixer1.geometry.width()); + mixerH1->setValue(config->mixer1.geometry.height()); + + mixerX2->setValue(config->mixer2.geometry.x()); + mixerY2->setValue(config->mixer2.geometry.y()); + mixerW2->setValue(config->mixer2.geometry.width()); + mixerH2->setValue(config->mixer2.geometry.height()); + + setMixerCurrent1->setEnabled(muse->mixer1Window()); + setMixerCurrent1->setEnabled(muse->mixer2Window()); + + setBigtimeCurrent->setEnabled(muse->bigtimeWindow()); + setTransportCurrent->setEnabled(muse->transportWindow()); + freewheelMode->setChecked(config->useJackFreewheelMode); + showSplash->setChecked(config->showSplashScreen); + + stopActive->setChecked(midiRCList.isActive(RC_STOP)); + playActive->setChecked(midiRCList.isActive(RC_PLAY)); + gotoLeftMarkActive->setChecked(midiRCList.isActive(RC_GOTO_LEFT_MARK)); + recordActive->setChecked(midiRCList.isActive(RC_RECORD)); + + connect(applyButton, SIGNAL(clicked()), SLOT(apply())); + connect(okButton, SIGNAL(clicked()), SLOT(ok())); + connect(cancelButton, SIGNAL(clicked()), SLOT(cancel())); + connect(setMixerCurrent1, SIGNAL(clicked()), SLOT(mixerCurrent1())); + connect(setMixerCurrent2, SIGNAL(clicked()), SLOT(mixerCurrent2())); + connect(setBigtimeCurrent, SIGNAL(clicked()), SLOT(bigtimeCurrent())); + connect(setArrangerCurrent, SIGNAL(clicked()), SLOT(arrangerCurrent())); + connect(setTransportCurrent, SIGNAL(clicked()), SLOT(transportCurrent())); + + recordStop->setChecked(false); + recordRecord->setChecked(false); + recordGotoLeftMark->setChecked(false); + recordPlay->setChecked(false); + rcGroup->setChecked(rcEnable); + + pianorollWidth->setValue(PianoRoll::initWidth); + pianorollHeight->setValue(PianoRoll::initHeight); + pianorollRaster->setRaster(PianoRoll::initRaster); + pianorollQuant->setQuant(PianoRoll::initQuant); + + drumEditorWidth->setValue(DrumEdit::initWidth); + drumEditorHeight->setValue(DrumEdit::initHeight); + + connect(recordStop, SIGNAL(clicked(bool)), SLOT(recordStopToggled(bool))); + connect(recordRecord, SIGNAL(clicked(bool)), SLOT(recordRecordToggled(bool))); + connect(recordGotoLeftMark, SIGNAL(clicked(bool)), SLOT(recordGotoLeftMarkToggled(bool))); + connect(recordPlay, SIGNAL(clicked(bool)), SLOT(recordPlayToggled(bool))); + + } + +//--------------------------------------------------------- +// resetValues +//--------------------------------------------------------- + +void PreferencesDialog::resetValues() + { + *config = ::config; // init with global config values + updateFonts(); + QPalette p(palette0->palette()); + p.setColor(QPalette::Button, config->palette[0]); + palette0->setPalette(p); + p.setColor(QPalette::Button, config->palette[1]); + palette1->setPalette(p); + p.setColor(QPalette::Button, config->palette[2]); + palette2->setPalette(p); + p.setColor(QPalette::Button, config->palette[3]); + palette3->setPalette(p); + p.setColor(QPalette::Button, config->palette[4]); + palette4->setPalette(p); + p.setColor(QPalette::Button, config->palette[5]); + palette5->setPalette(p); + p.setColor(QPalette::Button, config->palette[6]); + palette6->setPalette(p); + p.setColor(QPalette::Button, config->palette[7]); + palette7->setPalette(p); + p.setColor(QPalette::Button, config->palette[8]); + palette8->setPalette(p); + p.setColor(QPalette::Button, config->palette[9]); + palette9->setPalette(p); + p.setColor(QPalette::Button, config->palette[10]); + palette10->setPalette(p); + p.setColor(QPalette::Button, config->palette[11]); + palette11->setPalette(p); + p.setColor(QPalette::Button, config->palette[12]); + palette12->setPalette(p); + p.setColor(QPalette::Button, config->palette[13]); + palette13->setPalette(p); + p.setColor(QPalette::Button, config->palette[14]); + palette14->setPalette(p); + p.setColor(QPalette::Button, config->palette[15]); + palette15->setPalette(p); + } + +//--------------------------------------------------------- +// PreferencesDialog +//--------------------------------------------------------- + +PreferencesDialog::~PreferencesDialog() + { + delete config; + } + +//--------------------------------------------------------- +// updateFonts +//--------------------------------------------------------- + +void PreferencesDialog::updateFonts() + { + fontSize0->setValue(config->fonts[0]->pointSize()); + fontName0->setText(config->fonts[0]->family()); + italic0->setChecked(config->fonts[0]->italic()); + bold0->setChecked(config->fonts[0]->bold()); + + fontSize1->setValue(config->fonts[1]->pointSize()); + fontName1->setText(config->fonts[1]->family()); + italic1->setChecked(config->fonts[1]->italic()); + bold1->setChecked(config->fonts[1]->bold()); + + fontSize2->setValue(config->fonts[2]->pointSize()); + fontName2->setText(config->fonts[2]->family()); + italic2->setChecked(config->fonts[2]->italic()); + bold2->setChecked(config->fonts[2]->bold()); + + fontSize3->setValue(config->fonts[3]->pointSize()); + fontName3->setText(config->fonts[3]->family()); + italic3->setChecked(config->fonts[3]->italic()); + bold3->setChecked(config->fonts[3]->bold()); + + fontSize4->setValue(config->fonts[4]->pointSize()); + fontName4->setText(config->fonts[4]->family()); + italic4->setChecked(config->fonts[4]->italic()); + bold4->setChecked(config->fonts[4]->bold()); + + fontSize5->setValue(config->fonts[5]->pointSize()); + fontName5->setText(config->fonts[5]->family()); + italic5->setChecked(config->fonts[5]->italic()); + bold5->setChecked(config->fonts[5]->bold()); + } + +//--------------------------------------------------------- +// apply +//--------------------------------------------------------- + +void PreferencesDialog::apply() + { + int showPartEvent = 0; + int showPartType = 0; + + if (partShownames->isChecked()) + showPartType |= 1; + if (partShowevents->isChecked()) + showPartType |= 2; + if (partShowCakes->isChecked()) + showPartType |= 4; + + if (eventNoteon->isChecked()) + showPartEvent |= (1 << 0); + if (eventPolypressure->isChecked()) + showPartEvent |= (1 << 1); + if (eventController->isChecked()) + showPartEvent |= (1 << 2); + if (eventProgramchange->isChecked()) + showPartEvent |= (1 << 3); + if (eventAftertouch->isChecked()) + showPartEvent |= (1 << 4); + if (eventPitchbend->isChecked()) + showPartEvent |= (1 << 5); + if (eventSpecial->isChecked()) + showPartEvent |= (1 << 6); + + config->canvasUseBgPixmap = usePixmap->isChecked(); + if (currentBg != "") + config->canvasBgPixmap = currentBg; + config->fonts[0]->setPointSize(fontSize0->value()); + config->fonts[0]->setItalic(italic0->isChecked()); + config->fonts[0]->setBold(bold0->isChecked()); + + QApplication::setFont(*config->fonts[0]); + + config->fonts[1]->setPointSize(fontSize1->value()); + config->fonts[1]->setItalic(italic1->isChecked()); + config->fonts[1]->setBold(bold1->isChecked()); + + config->fonts[2]->setPointSize(fontSize2->value()); + config->fonts[2]->setItalic(italic2->isChecked()); + config->fonts[2]->setBold(bold2->isChecked()); + + config->fonts[3]->setPointSize(fontSize3->value()); + config->fonts[3]->setItalic(italic3->isChecked()); + config->fonts[3]->setBold(bold3->isChecked()); + + config->fonts[4]->setPointSize(fontSize4->value()); + config->fonts[4]->setItalic(italic4->isChecked()); + config->fonts[4]->setBold(bold4->isChecked()); + + config->fonts[5]->setPointSize(fontSize5->value()); + config->fonts[5]->setItalic(italic5->isChecked()); + config->fonts[5]->setBold(bold5->isChecked()); + + config->style = themeComboBox->currentText(); + // setting up a new theme might change the fontsize, so re-read + fontSize0->setValue(QApplication::font().pointSize()); + + config->canvasShowGrid = arrGrid->isChecked(); + // set colors... + ::config = *config; + + rcEnable = rcGroup->isChecked(); + int rtcticks = rtcResolutionSelect->currentIndex(); + int div = midiDivisionSelect->currentIndex(); + + ::config.connectToAllMidiDevices = connectToAllDevices->isChecked(); + ::config.connectToAllMidiTracks = connectToAllTracks->isChecked(); + ::config.createDefaultMidiInput = createDefaultInput->isChecked(); + ::config.defaultMidiInputDevice = preferredInput->currentText(); + ::config.defaultMidiOutputDevice = preferredOutput->currentText(); + ::config.defaultMidiInstrument = preferredInstrument->currentText(); + + ::config.guiRefresh = guiRefreshSelect->value(); + ::config.minSlider = minSliderSelect->value(); + ::config.minMeter = minMeterSelect->value(); + ::config.peakHoldTime = peakHoldTime->value(); + ::config.rtcTicks = rtcResolutions[rtcticks]; + ::config.guiDivision = divisions[div]; + ::config.helpBrowser = helpBrowser->text(); + ::config.startSong = startSongEntry->text(); + + if (startLast->isChecked()) + ::config.startMode = 0; + else if (startTemplate->isChecked()) + ::config.startMode = 1; + else if (startSong->isChecked()) + ::config.startMode = 2; + + ::config.transportVisible = showTransport->isChecked(); + ::config.bigTimeVisible = showBigtime->isChecked(); + ::config.mixer1Visible = showMixer1->isChecked(); + ::config.mixer2Visible = showMixer2->isChecked(); + + ::config.geometryMain.setX(arrangerX->value()); + ::config.geometryMain.setY(arrangerY->value()); + ::config.geometryMain.setWidth(arrangerW->value()); + ::config.geometryMain.setHeight(arrangerH->value()); + + ::config.geometryTransport.setX(transportX->value()); + ::config.geometryTransport.setY(transportY->value()); + ::config.geometryTransport.setWidth(0); + ::config.geometryTransport.setHeight(0); + + ::config.geometryBigTime.setX(bigtimeX->value()); + ::config.geometryBigTime.setY(bigtimeY->value()); + ::config.geometryBigTime.setWidth(bigtimeW->value()); + ::config.geometryBigTime.setHeight(bigtimeH->value()); + + ::config.mixer1.geometry.setX(mixerX1->value()); + ::config.mixer1.geometry.setY(mixerY1->value()); + ::config.mixer1.geometry.setWidth(mixerW1->value()); + ::config.mixer1.geometry.setHeight(mixerH1->value()); + + ::config.mixer2.geometry.setX(mixerX2->value()); + ::config.mixer2.geometry.setY(mixerY2->value()); + ::config.mixer2.geometry.setWidth(mixerW2->value()); + ::config.mixer2.geometry.setHeight(mixerH2->value()); + + ::config.useJackFreewheelMode = freewheelMode->isChecked(); + ::config.showSplashScreen = showSplash->isChecked(); + + PianoRoll::initWidth = pianorollWidth->value(); + PianoRoll::initHeight = pianorollHeight->value(); + PianoRoll::initRaster = pianorollRaster->raster(); + PianoRoll::initQuant = pianorollQuant->quant(); + + DrumEdit::initWidth = drumEditorWidth->value(); + DrumEdit::initHeight = drumEditorHeight->value(); + + muse->showMixer1(::config.mixer1Visible); + muse->showMixer2(::config.mixer2Visible); + muse->showBigtime(::config.bigTimeVisible); + muse->showTransport(::config.transportVisible); + QWidget* w = muse->transportWindow(); + if (w) { + w->resize(::config.geometryTransport.size()); + w->move(::config.geometryTransport.topLeft()); + } + w = muse->mixer1Window(); + if (w) { + w->resize(::config.mixer1.geometry.size()); + w->move(::config.mixer1.geometry.topLeft()); + } + w = muse->mixer2Window(); + if (w) { + w->resize(::config.mixer2.geometry.size()); + w->move(::config.mixer2.geometry.topLeft()); + } + w = muse->bigtimeWindow(); + if (w) { + w->resize(::config.geometryBigTime.size()); + w->move(::config.geometryBigTime.topLeft()); + } + + muse->resize(::config.geometryMain.size()); + muse->move(::config.geometryMain.topLeft()); + + muse->setHeartBeat(); // set guiRefresh + audio->msgSetRtc(); // set midi tick rate + muse->changeConfig(true); // save settings + } + +//--------------------------------------------------------- +// ok +//--------------------------------------------------------- + +void PreferencesDialog::ok() + { + apply(); + close(); + } + +//--------------------------------------------------------- +// cancel +//--------------------------------------------------------- + +void PreferencesDialog::cancel() + { + close(); + } + +//--------------------------------------------------------- +// configCanvasBgPixmap +//--------------------------------------------------------- + +void PreferencesDialog::configCanvasBgPixmap() + { + QString cur(currentBg); + if (cur == "") + cur = museGlobalShare + "/wallpapers"; + + QStringList pattern; + const char** p = image_file_pattern; + while(*p) + pattern << *p++; + QString s = getImageFileName(cur, pattern, this, tr("MusE: load image")); + if (!s.isEmpty()) { + QBrush b; + currentBg = s; + b.setTexture(QPixmap(s)); + QPalette p; + p.setBrush(QPalette::Window, b); + currentBgLabel->setPalette(p); + currentBgLabel->setText(currentBg); + } + } + +//--------------------------------------------------------- +// configCanvasBgColor +//--------------------------------------------------------- + +void PreferencesDialog::configCanvasBgColor() + { + QColor color = QColorDialog::getColor(config->canvasBgColor, this); + if (color.isValid()) { + config->canvasBgColor = color; + QPalette p; + p.setColor(QPalette::Window, color); + canvasBackgroundColor->setPalette(p); + } + } + +//--------------------------------------------------------- +// selectionChanged +//--------------------------------------------------------- + +void PreferencesDialog::colorItemSelectionChanged() + { + QTreeWidgetItem* item = (QTreeWidgetItem*)itemList->selectedItems().at(0); + QString txt = item->text(0); + int id = item->data(0, 1).toInt(); + if (id == 0) { + color = 0; + return; + } + switch(id) { + case 0x400 ... 0x410: // "Default" + color = &config->partColors[id & 0xff]; + break; + case 0x100: + color = &config->bigTimeBackgroundColor; + break; + case 0x101: + color = &config->bigTimeForegroundColor; + break; + case 0x200: + color = &config->transportHandleColor; + break; + case 0x300: + color = &config->waveEditBackgroundColor; + break; + case 0x500 ... 0x5ff: + color = &config->trackBg[id & 0xff]; + break; + case 0x41c: + color = &config->selectPartBg; + break; + default: + color = 0; + break; + } + updateColor(); + } + +//--------------------------------------------------------- +// updateColor +//--------------------------------------------------------- + +void PreferencesDialog::updateColor() + { + hslider->setEnabled(color); + sslider->setEnabled(color); + vslider->setEnabled(color); + if (color == 0) + return; + QPalette p(colorframe->palette()); + p.setColor(QPalette::Window, *color); + colorframe->setPalette(p); + int r, g, b, h, s, v; + color->getRgb(&r, &g, &b); + color->getHsv(&h, &s, &v); + + hslider->blockSignals(true); + sslider->blockSignals(true); + vslider->blockSignals(true); + + hslider->setValue(h); + sslider->setValue(s); + vslider->setValue(v); + + hslider->blockSignals(false); + sslider->blockSignals(false); + vslider->blockSignals(false); + } + +void PreferencesDialog::hsliderChanged(int val) + { + int h, s, v; + if (color) { + color->getHsv(&h, &s, &v); + color->setHsv(val, s, v); + } + updateColor(); + } + +void PreferencesDialog::ssliderChanged(int val) + { + int h, s, v; + if (color) { + color->getHsv(&h, &s, &v); + color->setHsv(h, val, v); + } + updateColor(); + } + +void PreferencesDialog::vsliderChanged(int val) + { + int h, s, v; + if (color) { + color->getHsv(&h, &s, &v); + color->setHsv(h, s, val); + } + updateColor(); + } + +//--------------------------------------------------------- +// addToPaletteClicked +//--------------------------------------------------------- + +void PreferencesDialog::addToPaletteClicked() + { + if (!color) + return; + QAbstractButton* button = colorGroup->checkedButton(); + int r, g, b; + QColor c; + if (button) { + c = button->palette().color(QPalette::Button); + c.getRgb(&r, &g, &b); + } + if (button == 0 || r != 0xff || g != 0xff || b != 0xff) { + for (int i = 0; i < 16; ++i) { + button = colorGroup->button(i); + c = button->palette().color(QPalette::Button); + c.getRgb(&r, &g, &b); + if (r == 0xff && g == 0xff && b == 0xff) { + // found empty slot + button->setChecked(true); + break; + } + } + } + if (button) { + int id = colorGroup->checkedId(); + config->palette[id] = *color; + QPalette p(button->palette()); + // p.setColor(QPalette::Active, QPalette::Button, *color); + p.setColor(QPalette::Button, *color); + p.setColor(button->backgroundRole(), *color); + + p.setColor(QPalette::Inactive, QPalette::Button, *color); + button->setPalette(p); + } + } + +//--------------------------------------------------------- +// paletteClicked +//--------------------------------------------------------- + +void PreferencesDialog::paletteClicked(QAbstractButton* button) + { + QColor c = button->palette().color(QPalette::Button); + int r, g, b; + c.getRgb(&r, &g, &b); + if (r == 0xff && g == 0xff && b == 0xff) + return; // interpret palette slot as empty + *color = c; + updateColor(); + } + +//--------------------------------------------------------- +// browseFont +//--------------------------------------------------------- + +void PreferencesDialog::browseFont0() { browseFont(0); } +void PreferencesDialog::browseFont1() { browseFont(1); } +void PreferencesDialog::browseFont2() { browseFont(2); } +void PreferencesDialog::browseFont3() { browseFont(3); } +void PreferencesDialog::browseFont4() { browseFont(4); } +void PreferencesDialog::browseFont5() { browseFont(5); } + +void PreferencesDialog::browseFont(int n) + { + bool ok; + QFont font = QFontDialog::getFont(&ok, *config->fonts[n], this); + if (ok) { + config->fonts[n] = new QFont(font); + updateFonts(); + } + } + +//--------------------------------------------------------- +// usePixmapToggled +//--------------------------------------------------------- + +void PreferencesDialog::usePixmapToggled(bool val) + { + useColor->setChecked(!val); + } + +//--------------------------------------------------------- +// useColorToggled +//--------------------------------------------------------- + +void PreferencesDialog::useColorToggled(bool val) + { + usePixmap->setChecked(!val); + } + +//--------------------------------------------------------- +// mixerCurrent1 +//--------------------------------------------------------- + +void PreferencesDialog::mixerCurrent1() + { + QWidget* w = muse->mixer1Window(); + if (!w) + return; + QRect r(w->frameGeometry()); + mixerX1->setValue(r.x()); + mixerY1->setValue(r.y()); + mixerW1->setValue(r.width()); + mixerH1->setValue(r.height()); + } + +//--------------------------------------------------------- +// mixerCurrent2 +//--------------------------------------------------------- + +void PreferencesDialog::mixerCurrent2() + { + QWidget* w = muse->mixer2Window(); + if (!w) + return; + QRect r(w->frameGeometry()); + mixerX2->setValue(r.x()); + mixerY2->setValue(r.y()); + mixerW2->setValue(r.width()); + mixerH2->setValue(r.height()); + } + +//--------------------------------------------------------- +// bigtimeCurrent +//--------------------------------------------------------- + +void PreferencesDialog::bigtimeCurrent() + { + QWidget* w = muse->bigtimeWindow(); + if (!w) + return; + QRect r(w->frameGeometry()); + bigtimeX->setValue(r.x()); + bigtimeY->setValue(r.y()); + bigtimeW->setValue(r.width()); + bigtimeH->setValue(r.height()); + } + +//--------------------------------------------------------- +// arrangerCurrent +//--------------------------------------------------------- + +void PreferencesDialog::arrangerCurrent() + { + QRect r(muse->frameGeometry()); + arrangerX->setValue(r.x()); + arrangerY->setValue(r.y()); + arrangerW->setValue(r.width()); + arrangerH->setValue(r.height()); + } + +//--------------------------------------------------------- +// transportCurrent +//--------------------------------------------------------- + +void PreferencesDialog::transportCurrent() + { + QWidget* w = muse->transportWindow(); + if (!w) + return; + QRect r(w->frameGeometry()); + transportX->setValue(r.x()); + transportY->setValue(r.y()); + } + +//--------------------------------------------------------- +// recordStopToggled +//--------------------------------------------------------- + +void PreferencesDialog::recordStopToggled(bool f) + { + recordStop->setChecked(!f); + if (!f) { + recordRecord->setChecked(false); + recordGotoLeftMark->setChecked(false); + recordPlay->setChecked(false); + connect(song, SIGNAL(midiEvent(MidiEvent)), SLOT(midiEventReceived(MidiEvent))); + } + else + disconnect(song, SIGNAL(midiEvent(MidiEvent)), this, SLOT(midiEventReceived(MidiEvent))); + } + +//--------------------------------------------------------- +// recordRecordToggled +//--------------------------------------------------------- + +void PreferencesDialog::recordRecordToggled(bool f) + { + recordRecord->setChecked(!f); + if (!f) { + recordStop->setChecked(false); + recordGotoLeftMark->setChecked(false); + recordPlay->setChecked(false); + connect(song, SIGNAL(midiEvent(MidiEvent)), SLOT(midiEventReceived(MidiEvent))); + } + else + disconnect(song, SIGNAL(midiEvent(MidiEvent)), this, SLOT(midiEventReceived(MidiEvent))); + } + +//--------------------------------------------------------- +// recordGotoLeftMarkToggled +//--------------------------------------------------------- + +void PreferencesDialog::recordGotoLeftMarkToggled(bool f) + { + recordGotoLeftMark->setChecked(!f); + if (!f) { + recordStop->setChecked(false); + recordRecord->setChecked(false); + recordPlay->setChecked(false); + connect(song, SIGNAL(midiEvent(MidiEvent)), SLOT(midiEventReceived(MidiEvent))); + } + else + disconnect(song, SIGNAL(midiEvent(MidiEvent)), this, SLOT(midiEventReceived(MidiEvent))); + } + +//--------------------------------------------------------- +// recordPlayToggled +//--------------------------------------------------------- + +void PreferencesDialog::recordPlayToggled(bool f) + { + recordPlay->setChecked(!f); + if (!f) { + recordStop->setChecked(false); + recordRecord->setChecked(false); + recordGotoLeftMark->setChecked(false); + connect(song, SIGNAL(midiEvent(MidiEvent)), SLOT(midiEventReceived(MidiEvent))); + } + else + disconnect(song, SIGNAL(midiEvent(MidiEvent)), this, SLOT(midiEventReceived(MidiEvent))); + } + +//--------------------------------------------------------- +// midiEventReceived +//--------------------------------------------------------- + +void PreferencesDialog::midiEventReceived(MidiEvent event) + { + printf("event received\n"); + if (recordPlay->isChecked()) { + recordPlay->setChecked(false); + playActive->setChecked(true); + midiRCList.setAction(event, RC_PLAY); + } + else if (recordStop->isChecked()) { + recordStop->setChecked(false); + stopActive->setChecked(true); + midiRCList.setAction(event, RC_STOP); + } + else if (recordRecord->isChecked()) { + recordRecord->setChecked(false); + recordActive->setChecked(true); + midiRCList.setAction(event, RC_RECORD); + } + else if (recordGotoLeftMark->isChecked()) { + recordGotoLeftMark->setChecked(false); + gotoLeftMarkActive->setChecked(true); + midiRCList.setAction(event, RC_GOTO_LEFT_MARK); + } + // only one shot + disconnect(song, SIGNAL(midiEvent(MidiEvent)), this, SLOT(midiEventReceived(MidiEvent))); + } + + diff --git a/muse/muse/preferences.h b/muse/muse/preferences.h new file mode 100644 index 00000000..d4f1496c --- /dev/null +++ b/muse/muse/preferences.h @@ -0,0 +1,87 @@ +//============================================================================= +// MusE +// Linux Music Editor +// $Id:$ +// +// Copyright (C) 2002-2006 by Werner Schweer and others +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//============================================================================= + +#ifndef __PREFERENCES_H__ +#define __PREFERENCES_H__ + +#include "ui_preferences.h" +#include "mpevent.h" + +class MusE; +class Arranger; +class GlobalConfigValues; + +//--------------------------------------------------------- +// PreferencesDialog +//--------------------------------------------------------- + +class PreferencesDialog : public QDialog, public Ui::PreferencesDialogBase { + Q_OBJECT + + Arranger* arr; + QColor* color; + QString currentBg; + GlobalConfigValues* config; + QButtonGroup* colorGroup; + QButtonGroup* startSongGroup; + + void updateFonts(); + void updateColor(); + + private slots: + void apply(); + void ok(); + void cancel(); + void configCanvasBgColor(); + void configCanvasBgPixmap(); + void colorItemSelectionChanged(); + void browseFont(int); + void browseFont0(); + void browseFont1(); + void browseFont2(); + void browseFont3(); + void browseFont4(); + void browseFont5(); + void hsliderChanged(int); + void ssliderChanged(int); + void vsliderChanged(int); + void addToPaletteClicked(); + void paletteClicked(QAbstractButton*); + void useColorToggled(bool); + void usePixmapToggled(bool); + + void mixerCurrent1(); + void mixerCurrent2(); + void bigtimeCurrent(); + void arrangerCurrent(); + void transportCurrent(); + void recordStopToggled(bool); + void recordRecordToggled(bool); + void recordGotoLeftMarkToggled(bool); + void recordPlayToggled(bool); + void midiEventReceived(MidiEvent); + + public: + PreferencesDialog(Arranger*, QWidget* parent=0); + ~PreferencesDialog(); + void resetValues(); + }; + +#endif diff --git a/muse/muse/preferences.ui b/muse/muse/preferences.ui new file mode 100644 index 00000000..c910c175 --- /dev/null +++ b/muse/muse/preferences.ui @@ -0,0 +1,2362 @@ + + + + + PreferencesDialogBase + + + + 0 + 0 + 721 + 569 + + + + Dialog + + + + 9 + + + 6 + + + + + + Application + + + + 9 + + + 6 + + + + + Start MusE + + + + 9 + + + 6 + + + + + 0 + + + 6 + + + + + start song + + + + + + + + + + + + + + + + 9 + + + 6 + + + + + start with last song + + + + + + + start with template: default.med + + + + + + + start with song + + + + + + + + + + 0 + + + 6 + + + + + show splash screen + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + Views + + + + 9 + + + 6 + + + + + Cur + + + + + + + show + + + + + + + Mixer 1 + + + + + + + Big Time + + + + + + + Cur + + + + + + + Cur + + + + + + + Cur + + + + + + + 9999 + + + + + + + 9999 + + + 0 + + + + + + + 9999 + + + + + + + 9999 + + + + + + + 9999 + + + + + + + 9999 + + + + + + + 9999 + + + + + + + 9999 + + + + + + + 9999 + + + + + + + 9999 + + + + + + + 9999 + + + + + + + 9999 + + + + + + + 9999 + + + + + + + 9999 + + + + + + + 9999 + + + + + + + 9999 + + + + + + + 9999 + + + + + + + 9999 + + + + + + + show + + + + + + + show + + + + + + + Mixer 2 + + + + + + + Transport + + + + + + + Arranger + + + + + + + show + + + + + + + Cur + + + + + + + + + + + Editors + + + + + 9 + 9 + 641 + 457 + + + + + Arranger + + + + 9 + + + 6 + + + + + show snap grid + + + + + + + Events + + + + 11 + + + 6 + + + + + note on + + + + + + + poly pressure + + + + + + + controller + + + + + + + aftertouch + + + + + + + pitch bend + + + + + + + program change + + + + + + + special + + + + + + + + + + Background + + + false + + + + 9 + + + 6 + + + + + select... + + + + + + + select... + + + + + + + Color + + + + + + + Pixmap + + + + + + + + 7 + 1 + 0 + 0 + + + + bg + + + Qt::AlignCenter + + + -1 + + + + + + + Color + + + Qt::AlignCenter + + + + + + + + + + Parts + + + + 11 + + + 6 + + + + + show names + + + + + + + show events + + + + + + + show Cakewalk Style + + + + + + + + + + + Pianoroll + + + + 9 + + + 6 + + + + + Qt::Vertical + + + + 20 + 211 + + + + + + + + <html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Arial; font-size:10pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600;">Quant</p></body></html> + + + + + + + <html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Arial; font-size:10pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600;">Raster</p></body></html> + + + + + + + <html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Arial; font-size:10pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600;">Geometry</p></body></html> + + + + + + + height: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + width: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 9999 + + + 50 + + + + + + + 9999 + + + 50 + + + + + + + + + + + + + + DrumEditor + + + + 9 + + + 6 + + + + + Qt::Vertical + + + + 20 + 351 + + + + + + + + <html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Arial; font-size:10pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600;">Geometry</p></body></html> + + + + + + + 9999 + + + 50 + + + + + + + width: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 9999 + + + 50 + + + + + + + height: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + MasterEditor + + + + 9 + + + 6 + + + + + Qt::Vertical + + + + 20 + 331 + + + + + + + + 9999 + + + 50 + + + + + + + height: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 9999 + + + 50 + + + + + + + width: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + <html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Arial; font-size:10pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600;">Geometry</p></body></html> + + + + + + + + WaveEditor + + + + 9 + + + 6 + + + + + 9999 + + + 50 + + + + + + + height: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + width: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + <html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Arial; font-size:10pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600;">Geometry</p></body></html> + + + + + + + 9999 + + + 50 + + + + + + + Qt::Vertical + + + + 20 + 351 + + + + + + + + + + + Audio + + + + 9 + + + 6 + + + + + Mixer + + + + 9 + + + 6 + + + + + ms + + + 5000 + + + 20 + + + + + + + Peak Hold Time: + + + + + + + dB + + + 0 + + + -100 + + + 10 + + + -60 + + + + + + + dB + + + 0 + + + -100 + + + -60 + + + + + + + min. Meter Val + + + + + + + min. Slider Val + + + + + + + + + + use JACK freewheel mode if possible + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Midi + + + + 8 + + + 6 + + + + + Ticks + + + + 9 + + + 6 + + + + + Displayed Resolution +(Ticks/Quarternote) + + + + + + + RTC Resolution +(Ticks/Sec) + + + + + + + + 1024 + + + + + 2048 + + + + + 4096 + + + + + 8172 + + + + + + + + 0 + + + + 48 + + + + + 96 + + + + + 192 + + + + + 384 + + + + + 768 + + + + + 1536 + + + + + 3072 + + + + + 6144 + + + + + 12288 + + + + + + + + + + + Input Routing + + + + 8 + + + 6 + + + + + Connect to all Tracks + + + + + + + Connect to all Input Devices + + + + + + + <html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Arial; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Preferred Input Device:</p></body></html> + + + + + + + + + + Create Default Input Strip + + + + + + + + + + Output Routing + + + + 8 + + + 8 + + + + + <html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Arial; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Preferred Output Device:</p></body></html> + + + + + + + + + + <html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Arial; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Preferred Instrument:</p></body></html> + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 20 + + + + + + + + + GUI + + + + 9 + + + 6 + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + Help Browser + + + + + + + /sec + + + 100 + + + 2 + + + + + + + GUI Refresh Rate: + + + + + + + + RemoteControl + + + + 9 + + + 6 + + + + + Midi Remote Control + + + true + + + + 9 + + + 6 + + + + + Record + + + + + + + Goto Left Mark + + + + + + + Stop + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Play + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Colors + + + + 9 + + + 6 + + + + + 0 + + + 6 + + + + + S + + + Qt::AlignCenter + + + + + + + 255 + + + Qt::Horizontal + + + + + + + + + 0 + + + 6 + + + + + H + + + Qt::AlignCenter + + + + + + + 255 + + + Qt::Horizontal + + + + + + + + + + 7 + 7 + 0 + 0 + + + + QFrame::StyledPanel + + + QFrame::Sunken + + + + + + + add to palette + + + + + + + Qt::NoFocus + + + Palette + + + + 9 + + + 6 + + + + + + + + true + + + + + + + + + + true + + + + + + + + + + true + + + + + + + + + + true + + + + + + + + + + true + + + + + + + + + + true + + + + + + + + + + true + + + + + + + + + + true + + + + + + + + + + true + + + + + + + + + + true + + + + + + + + + + true + + + + + + + + + + true + + + + + + + + + + true + + + + + + + + + + true + + + + + + + + + + true + + + + + + + + + + true + + + + + + + + + + + 1 + 7 + 0 + 0 + + + + true + + + + Items + + + + + + + + 0 + + + 6 + + + + + V + + + Qt::AlignCenter + + + + + + + 255 + + + Qt::Horizontal + + + + + + + + + + Style/Fonts + + + + 9 + + + 6 + + + + + + 7 + 5 + 0 + 0 + + + + QT Theme + + + + 11 + + + 6 + + + + + 0 + + + 6 + + + + + + 1 + 0 + 0 + 0 + + + + + Windows + + + + + MusE + + + + + Metal + + + + + Norwegian Wood + + + + + Platinum + + + + + CDE + + + + + Motif + + + + + Motif Plus + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 190 + 20 + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 20 + 40 + + + + + + + + + + + Fonts + + + + 11 + + + 6 + + + + + Family + + + + + + + Size + + + + + + + Font 1 + + + + + + + Font 2 + + + + + + + Font 3 + + + + + + + + 7 + 0 + 0 + 0 + + + + + + + + + 7 + 0 + 0 + 0 + + + + + + + + + 7 + 0 + 0 + 0 + + + + + + + + + 7 + 0 + 0 + 0 + + + + + + + + Font 0 + + + + + + + + 4 + 0 + 0 + 0 + + + + + + + + + 4 + 0 + 0 + 0 + + + + + + + + + 4 + 0 + 0 + 0 + + + + + + + + + 4 + 0 + 0 + 0 + + + + + + + + Bold + + + + + + + Bold + + + + + + + Bold + + + + + + + Bold + + + + + + + Italic + + + + + + + Italic + + + + + + + Italic + + + + + + + Italic + + + + + + + + 4 + 1 + 0 + 0 + + + + ... + + + + + + + + 4 + 1 + 0 + 0 + + + + ... + + + + + + + + 4 + 1 + 0 + 0 + + + + ... + + + + + + + + 4 + 1 + 0 + 0 + + + + ... + + + + + + + Font 4 + + + + + + + + 7 + 0 + 0 + 0 + + + + + + + + Font 5 + + + + + + + + 7 + 0 + 0 + 0 + + + + + + + + + 4 + 0 + 0 + 0 + + + + + + + + + 4 + 0 + 0 + 0 + + + + + + + + Bold + + + + + + + Bold + + + + + + + Italic + + + + + + + Italic + + + + + + + + 4 + 1 + 0 + 0 + + + + ... + + + + + + + + 4 + 1 + 0 + 0 + + + + ... + + + + + + + + + + + + + + 0 + + + 6 + + + + + Qt::Horizontal + + + + 131 + 31 + + + + + + + + Apply + + + + + + + OK + + + + + + + Cancel + + + + + + + + + + + GreendotButton + QToolButton +
greendotbutton.h
+ 0 + +
+ + RasterCombo + QComboBox +
rastercombo.h
+ 0 + +
+ + QuantCombo + QComboBox +
quantcombo.h
+ 0 + +
+ + RecordButton + QToolButton +
recordbutton.h
+ 0 + +
+
+ + + + okButton + clicked() + PreferencesDialogBase + accept() + + + 278 + 253 + + + 96 + 254 + + + + + cancelButton + clicked() + PreferencesDialogBase + reject() + + + 369 + 253 + + + 179 + 282 + + + + +
diff --git a/muse/muse/shortcuts.cpp b/muse/muse/shortcuts.cpp index a5127e53..6a182b6c 100644 --- a/muse/muse/shortcuts.cpp +++ b/muse/muse/shortcuts.cpp @@ -275,12 +275,12 @@ void initShortCuts() defShrt(SHRT_FOLLOW_NO, 0, 48, ARRANG_SHRT, "follow_no"); defShrt(SHRT_FOLLOW_CONTINUOUS, 0, 49, ARRANG_SHRT, "follow_continuous"); - defShrt(SHRT_GLOBAL_CONFIG, 0, 50, ARRANG_SHRT, "configure_global"); +// defShrt(SHRT_GLOBAL_CONFIG, 0, 50, ARRANG_SHRT, "configure_global"); defShrt(SHRT_CONFIG_SHORTCUTS, 0, 51, ARRANG_SHRT, "configure_shortcuts"); defShrt(SHRT_CONFIG_METRONOME, 0, 52, ARRANG_SHRT, "configure_metronome"); defShrt(SHRT_CONFIG_MIDISYNC, 0, 53, ARRANG_SHRT, "configure_midi_sync"); defShrt(SHRT_MIDI_FILE_CONFIG, 0, 54, ARRANG_SHRT, "configure_midi_file"); - defShrt(SHRT_APPEARANCE_SETTINGS, 0, 55, ARRANG_SHRT, "configure_appearance_settings"); +// defShrt(SHRT_APPEARANCE_SETTINGS, 0, 55, ARRANG_SHRT, "configure_appearance_settings"); defShrt(SHRT_CONFIG_MIDI_PORTS, 0, 56, ARRANG_SHRT, "configure_midi_ports"); defShrt(SHRT_CONFIG_AUDIO_PORTS, 0, 57, ARRANG_SHRT, "configure_audio_ports"); defShrt(SHRT_MIDI_EDIT_INSTRUMENTS, 0, 58, ARRANG_SHRT, "midi_edit_instruments"); diff --git a/muse/muse/shortcuts.h b/muse/muse/shortcuts.h index f7b885f9..9d29409c 100644 --- a/muse/muse/shortcuts.h +++ b/muse/muse/shortcuts.h @@ -158,12 +158,12 @@ enum { SHRT_FOLLOW_NO, //Default: undefined SHRT_FOLLOW_CONTINUOUS, //Default: undefined - SHRT_GLOBAL_CONFIG, //Default: undefined +// SHRT_GLOBAL_CONFIG, //Default: undefined SHRT_CONFIG_SHORTCUTS, //Default: undefined SHRT_CONFIG_METRONOME, //Default: undefined SHRT_CONFIG_MIDISYNC, //Default: undefined SHRT_MIDI_FILE_CONFIG, //Default: undefined - SHRT_APPEARANCE_SETTINGS, //Default: undefined +// SHRT_APPEARANCE_SETTINGS, //Default: undefined SHRT_CONFIG_MIDI_PORTS, //Default: undefined SHRT_CONFIG_AUDIO_PORTS, //Default: undefined //SHRT_SAVE_GLOBAL_CONFIG, //Default: undefined diff --git a/muse/muse/widgets/CMakeLists.txt b/muse/muse/widgets/CMakeLists.txt index 4cf9d05b..27ee7e73 100644 --- a/muse/muse/widgets/CMakeLists.txt +++ b/muse/muse/widgets/CMakeLists.txt @@ -51,13 +51,13 @@ QT4_WRAP_UI (widget_ui_headers velocity.ui ) -# ADD_CUSTOM_COMMAND(OUTPUT ui_midisync.h -# COMMAND ${QT_UIC_EXECUTABLE} -# ARGS -o ${CMAKE_CURRENT_BINARY_DIR}/ui_midisync.h ${CMAKE_CURRENT_SOURCE_DIR}/midisync.ui -# DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/midisync.ui -# ) +add_custom_command(OUTPUT ui_midisync.h + COMMAND ${QT_UIC_EXECUTABLE} + ARGS -o ${CMAKE_CURRENT_BINARY_DIR}/ui_midisync.h ${CMAKE_CURRENT_SOURCE_DIR}/midisync.ui + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/midisync.ui + ) -# ADD_FILE_DEPENDENCIES(moc_midisync.cxx ${CMAKE_CURRENT_BINARY_DIR}/ui_midisync.h) +ADD_FILE_DEPENDENCIES(moc_midisync.cxx ${CMAKE_CURRENT_BINARY_DIR}/ui_midisync.h) add_library ( widgets STATIC ${widget_ui_headers} -- cgit v1.2.3