📄 notationconfigurationpage.cpp
字号:
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: *//* Rosegarden A MIDI and audio sequencer and musical notation editor. This program is Copyright 2000-2007 Guillaume Laurent <glaurent@telegraph-road.org>, Chris Cannam <cannam@all-day-breakfast.com>, Richard Bown <richard.bown@ferventsoftware.com> The moral rights of Guillaume Laurent, Chris Cannam, and Richard Bown to claim authorship of this work have been asserted. Other copyrights also apply to some parts of this work. Please see the AUTHORS file and individual file headers for details. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. See the file COPYING included with this distribution for more information.*/#include "NotationConfigurationPage.h"#include <qlayout.h>#include "misc/Strings.h"#include "document/ConfigGroups.h"#include "base/Exception.h"#include "base/NotationTypes.h"#include "commands/edit/PasteEventsCommand.h"#include "ConfigurationPage.h"#include "document/RosegardenGUIDoc.h"#include "gui/editors/notation/NotationHLayout.h"#include "gui/editors/notation/NoteFontFactory.h"#include "gui/editors/notation/NoteFont.h"#include "gui/editors/notation/NoteFontMap.h"#include "gui/editors/notation/NoteFontViewer.h"#include "gui/editors/notation/NotePixmapFactory.h"#include "gui/editors/notation/NoteStyleFactory.h"#include "gui/widgets/QuantizeParameters.h"#include "TabbedConfigurationPage.h"#include <kcombobox.h>#include <kconfig.h>#include <kfontrequester.h>#include <kmessagebox.h>#include <qcheckbox.h>#include <qcombobox.h>#include <qfont.h>#include <qframe.h>#include <qgroupbox.h>#include <qhbox.h>#include <qlabel.h>#include <qobject.h>#include <qpushbutton.h>#include <qstring.h>#include <qstringlist.h>#include <qtabwidget.h>#include <qwidget.h>namespace Rosegarden{NotationConfigurationPage::NotationConfigurationPage(KConfig *cfg, QWidget *parent, const char *name) : TabbedConfigurationPage(cfg, parent, name){ m_cfg->setGroup(NotationViewConfigGroup); QFrame *frame; QGridLayout *layout; frame = new QFrame(m_tabWidget); layout = new QGridLayout(frame, 9, 3, 10, 5); int row = 0; layout->setRowSpacing(row, 15); ++row; layout->addWidget(new QLabel(i18n("Default layout mode"), frame), row, 0); m_layoutMode = new KComboBox(frame); m_layoutMode->setEditable(false); m_layoutMode->insertItem(i18n("Linear layout")); m_layoutMode->insertItem(i18n("Continuous page layout")); m_layoutMode->insertItem(i18n("Multiple page layout")); int defaultLayoutMode = m_cfg->readNumEntry("layoutmode", 0); if (defaultLayoutMode >= 0 && defaultLayoutMode <= 2) { m_layoutMode->setCurrentItem(defaultLayoutMode); } layout->addMultiCellWidget(m_layoutMode, row, row, 1, 2); ++row; layout->addWidget(new QLabel(i18n("Default spacing"), frame), row, 0); m_spacing = new KComboBox(frame); m_spacing->setEditable(false); std::vector<int> s = NotationHLayout::getAvailableSpacings(); int defaultSpacing = m_cfg->readNumEntry("spacing", 100); for (std::vector<int>::iterator i = s.begin(); i != s.end(); ++i) { QString text("%1 %"); if (*i == 100) text = "%1 % (normal)"; m_spacing->insertItem(text.arg(*i)); if (*i == defaultSpacing) { m_spacing->setCurrentItem(m_spacing->count() - 1); } } layout->addMultiCellWidget(m_spacing, row, row, 1, 2); ++row; layout->addWidget(new QLabel(i18n("Default duration factor"), frame), row, 0); m_proportion = new KComboBox(frame); m_proportion->setEditable(false); s = NotationHLayout::getAvailableProportions(); int defaultProportion = m_cfg->readNumEntry("proportion", 60); for (std::vector<int>::iterator i = s.begin(); i != s.end(); ++i) { QString text = QString("%1 %").arg(*i); if (*i == 40) text = "40 % (normal)"; else if (*i == 0) text = i18n("None"); else if (*i == 100) text = i18n("Full"); m_proportion->insertItem(text); if (*i == defaultProportion) { m_proportion->setCurrentItem(m_proportion->count() - 1); } } layout->addMultiCellWidget(m_proportion, row, row, 1, 2); ++row; layout->setRowSpacing(row, 20); ++row; layout->addMultiCellWidget (new QLabel (i18n("Show non-notation events as question marks"), frame), row, row, 0, 1); m_showUnknowns = new QCheckBox(frame); bool defaultShowUnknowns = m_cfg->readBoolEntry("showunknowns", false); m_showUnknowns->setChecked(defaultShowUnknowns); layout->addWidget(m_showUnknowns, row, 2); ++row; layout->addMultiCellWidget (new QLabel (i18n("Show notation-quantized notes in a different color"), frame), row, row, 0, 1); m_colourQuantize = new QCheckBox(frame); bool defaultColourQuantize = m_cfg->readBoolEntry("colourquantize", false); m_colourQuantize->setChecked(defaultColourQuantize); layout->addWidget(m_colourQuantize, row, 2); ++row; layout->addMultiCellWidget (new QLabel (i18n("Show \"invisible\" events in grey"), frame), row, row, 0, 1); m_showInvisibles = new QCheckBox(frame); bool defaultShowInvisibles = m_cfg->readBoolEntry("showinvisibles", true); m_showInvisibles->setChecked(defaultShowInvisibles); layout->addWidget(m_showInvisibles, row, 2); ++row; layout->addMultiCellWidget (new QLabel (i18n("Show notes outside suggested playable range in red"), frame), row, row, 0, 1); m_showRanges = new QCheckBox(frame); bool defaultShowRanges = m_cfg->readBoolEntry("showranges", true); m_showRanges->setChecked(defaultShowRanges); layout->addWidget(m_showRanges, row, 2); ++row; layout->addMultiCellWidget (new QLabel (i18n("Highlight superimposed notes with a halo effect"), frame), row, row, 0, 1); m_showCollisions = new QCheckBox(frame); bool defaultShowCollisions = m_cfg->readBoolEntry("showcollisions", true); m_showCollisions->setChecked(defaultShowCollisions); layout->addWidget(m_showCollisions, row, 2); ++row; layout->setRowSpacing(row, 20); ++row; layout->addMultiCellWidget (new QLabel (i18n("When recording MIDI, split-and-tie long notes at barlines"), frame), row, row, 0, 1); m_splitAndTie = new QCheckBox(frame); bool defaultSplitAndTie = m_cfg->readBoolEntry("quantizemakeviable", false); m_splitAndTie->setChecked(defaultSplitAndTie); layout->addWidget(m_splitAndTie, row, 2); ++row; layout->setRowStretch(row, 10); addTab(frame, i18n("Layout")); frame = new QFrame(m_tabWidget); layout = new QGridLayout(frame, 6, 3, 10, 5); row = 0; layout->setRowSpacing(row, 15); ++row; layout->addMultiCellWidget (new QLabel(i18n("Default note style for new notes"), frame), row, row, 0, 1); layout->setColStretch(2, 10); m_noteStyle = new KComboBox(frame); m_noteStyle->setEditable(false); m_untranslatedNoteStyle.clear(); QString defaultStyle = m_cfg->readEntry("style", strtoqstr(NoteStyleFactory::DefaultStyle)); std::vector<NoteStyleName> styles (NoteStyleFactory::getAvailableStyleNames()); for (std::vector<NoteStyleName>::iterator i = styles.begin(); i != styles.end(); ++i) { QString styleQName(strtoqstr(*i)); m_untranslatedNoteStyle.append(styleQName); m_noteStyle->insertItem(i18n(styleQName.utf8())); if (styleQName == defaultStyle) { m_noteStyle->setCurrentItem(m_noteStyle->count() - 1); } } layout->addWidget(m_noteStyle, row, 2); ++row; layout->setRowSpacing(row, 20); ++row; layout->addWidget (new QLabel(i18n("When inserting notes..."), frame), row, 0); int defaultInsertType = m_cfg->readNumEntry("inserttype", 0); m_insertType = new KComboBox(frame); m_insertType->setEditable(false); m_insertType->insertItem (i18n("Split notes into ties to make durations match")); m_insertType->insertItem(i18n("Ignore existing durations")); m_insertType->setCurrentItem(defaultInsertType); layout->addMultiCellWidget(m_insertType, row, row, 1, 2); ++row; bool autoBeam = m_cfg->readBoolEntry("autobeam", true); layout->addMultiCellWidget (new QLabel (i18n("Auto-beam on insert when appropriate"), frame), row, row, 0, 1); m_autoBeam = new QCheckBox(frame); m_autoBeam->setChecked(autoBeam); layout->addMultiCellWidget(m_autoBeam, row, row, 2, 2); ++row; bool collapse = m_cfg->readBoolEntry("collapse", false); layout->addMultiCellWidget (new QLabel (i18n("Collapse rests after erase"), frame), row, row, 0, 1); m_collapseRests = new QCheckBox(frame); m_collapseRests->setChecked(collapse); layout->addMultiCellWidget(m_collapseRests, row, row, 2, 2); ++row; layout->setRowSpacing(row, 20); ++row; layout->addWidget (new QLabel(i18n("Default paste type"), frame), row, 0); m_pasteType = new KComboBox(frame); m_pasteType->setEditable(false); unsigned int defaultPasteType = m_cfg->readUnsignedNumEntry ("pastetype", PasteEventsCommand::Restricted); PasteEventsCommand::PasteTypeMap pasteTypes = PasteEventsCommand::getPasteTypes(); for (PasteEventsCommand::PasteTypeMap::iterator i = pasteTypes.begin(); i != pasteTypes.end(); ++i) { m_pasteType->insertItem(i->second); } m_pasteType->setCurrentItem(defaultPasteType); layout->addMultiCellWidget(m_pasteType, row, row, 1, 2); ++row; layout->setRowStretch(row, 10); addTab(frame, i18n("Editing")); frame = new QFrame(m_tabWidget); layout = new QGridLayout(frame, 4, 2, 10, 5); row = 0; layout->setRowSpacing(row, 15); ++row; layout->addWidget(new QLabel(i18n("Accidentals in one octave..."), frame), row, 0); m_accOctavePolicy = new KComboBox(frame); m_accOctavePolicy->insertItem(i18n("Affect only that octave")); m_accOctavePolicy->insertItem(i18n("Require cautionaries in other octaves")); m_accOctavePolicy->insertItem(i18n("Affect all subsequent octaves")); int accOctaveMode = m_cfg->readNumEntry("accidentaloctavemode", 1); if (accOctaveMode >= 0 && accOctaveMode < 3) { m_accOctavePolicy->setCurrentItem(accOctaveMode); } layout->addWidget(m_accOctavePolicy, row, 1); ++row; layout->addWidget(new QLabel(i18n("Accidentals in one bar..."), frame), row, 0); m_accBarPolicy = new KComboBox(frame); m_accBarPolicy->insertItem(i18n("Affect only that bar")); m_accBarPolicy->insertItem(i18n("Require cautionary resets in following bar"));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -