⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 quantizeparameters.cpp

📁 LINUX下的混音软件
💻 CPP
📖 第 1 页 / 共 2 页
字号:
/* -*- 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 "QuantizeParameters.h"#include <qlayout.h>#include <kapplication.h>#include <klocale.h>#include "base/NotationTypes.h"#include "base/Quantizer.h"#include "base/BasicQuantizer.h"#include "base/LegatoQuantizer.h"#include "base/NotationQuantizer.h"#include "gui/editors/notation/NotationStrings.h"#include "gui/editors/notation/NotePixmapFactory.h"#include <kcombobox.h>#include <kconfig.h>#include <qcheckbox.h>#include <qframe.h>#include <qgroupbox.h>#include <qhbox.h>#include <qlabel.h>#include <qobject.h>#include <qpixmap.h>#include <qpushbutton.h>#include <qstring.h>#include <qwidget.h>namespace Rosegarden{QuantizeParameters::QuantizeParameters(QWidget *parent,                                       QuantizerType defaultQuantizer,                                       bool showNotationOption,                                       bool showAdvancedButton,                                       QString configCategory,                                       QString preamble) :        QFrame(parent),        m_configCategory(configCategory),        m_standardQuantizations        (BasicQuantizer::getStandardQuantizations()){    m_mainLayout = new QGridLayout(this,                                   preamble ? 3 : 4, 2,                                   preamble ? 10 : 0,                                   preamble ? 5 : 4);    int zero = 0;    if (preamble) {        QLabel *label = new QLabel(preamble, this);        label->setAlignment(Qt::WordBreak);        m_mainLayout->addMultiCellWidget(label, 0, 0, 0, 1);        zero = 1;    }    QGroupBox *quantizerBox = new QGroupBox                              (1, Horizontal, i18n("Quantizer"), this);    m_mainLayout->addWidget(quantizerBox, zero, 0);    QFrame *typeFrame = new QFrame(quantizerBox);    QGridLayout *layout = new QGridLayout(typeFrame, 2, 2, 5, 3);    layout->addWidget(new QLabel(i18n("Quantizer type:"), typeFrame), 0, 0);    m_typeCombo = new KComboBox(typeFrame);    m_typeCombo->insertItem(i18n("Grid quantizer"));    m_typeCombo->insertItem(i18n("Legato quantizer"));    m_typeCombo->insertItem(i18n("Heuristic notation quantizer"));    layout->addWidget(m_typeCombo, 0, 1);    m_notationTarget = new QCheckBox                       (i18n("Quantize for notation only (leave performance unchanged)"),                        typeFrame);    layout->addMultiCellWidget(m_notationTarget, 1, 1, 0, 1);    if (!showNotationOption)        m_notationTarget->hide();    QHBox *parameterBox = new QHBox(this);    m_mainLayout->addWidget(parameterBox, zero + 1, 0);    m_notationBox = new QGroupBox                    (1, Horizontal, i18n("Notation parameters"), parameterBox);    QFrame *notationFrame = new QFrame(m_notationBox);    layout = new QGridLayout(notationFrame, 4, 2, 5, 3);    layout->addWidget(new QLabel(i18n("Base grid unit:"), notationFrame),                      1, 0);    m_notationUnitCombo = new KComboBox(notationFrame);    layout->addWidget(m_notationUnitCombo, 1, 1);    layout->addWidget(new QLabel(i18n("Complexity:"),                                 notationFrame), 0, 0);    m_simplicityCombo = new KComboBox(notationFrame);    m_simplicityCombo->insertItem(i18n("Very high"));    m_simplicityCombo->insertItem(i18n("High"));    m_simplicityCombo->insertItem(i18n("Normal"));    m_simplicityCombo->insertItem(i18n("Low"));    m_simplicityCombo->insertItem(i18n("Very low"));    layout->addWidget(m_simplicityCombo, 0, 1);    layout->addWidget(new QLabel(i18n("Tuplet level:"),                                 notationFrame), 2, 0);    m_maxTuplet = new KComboBox(notationFrame);    m_maxTuplet->insertItem(i18n("None"));    m_maxTuplet->insertItem(i18n("2-in-the-time-of-3"));    m_maxTuplet->insertItem(i18n("Triplet"));    /*        m_maxTuplet->insertItem(i18n("4-Tuplet"));        m_maxTuplet->insertItem(i18n("5-Tuplet"));        m_maxTuplet->insertItem(i18n("6-Tuplet"));        m_maxTuplet->insertItem(i18n("7-Tuplet"));        m_maxTuplet->insertItem(i18n("8-Tuplet"));    */    m_maxTuplet->insertItem(i18n("Any"));    layout->addWidget(m_maxTuplet, 2, 1);    m_counterpoint = new QCheckBox(i18n("Permit counterpoint"), notationFrame);    layout->addMultiCellWidget(m_counterpoint, 3, 3, 0, 1);    m_gridBox = new QGroupBox                (1, Horizontal, i18n("Grid parameters"), parameterBox);    QFrame *gridFrame = new QFrame(m_gridBox);    layout = new QGridLayout(gridFrame, 4, 2, 5, 3);    layout->addWidget(new QLabel(i18n("Base grid unit:"), gridFrame), 0, 0);    m_gridUnitCombo = new KComboBox(gridFrame);    layout->addWidget(m_gridUnitCombo, 0, 1);    m_swingLabel = new QLabel(i18n("Swing:"), gridFrame);    layout->addWidget(m_swingLabel, 1, 0);    m_swingCombo = new KComboBox(gridFrame);    layout->addWidget(m_swingCombo, 1, 1);    m_iterativeLabel = new QLabel(i18n("Iterative amount:"), gridFrame);    layout->addWidget(m_iterativeLabel, 2, 0);    m_iterativeCombo = new KComboBox(gridFrame);    layout->addWidget(m_iterativeCombo, 2, 1);    m_durationCheckBox = new QCheckBox                         (i18n("Quantize durations as well as start times"), gridFrame);    layout->addMultiCellWidget(m_durationCheckBox, 3, 3, 0, 1);    m_postProcessingBox = new QGroupBox                          (1, Horizontal, i18n("After quantization"), this);    if (preamble) {        m_mainLayout->addMultiCellWidget(m_postProcessingBox,                                         zero, zero + 1,                                         1, 1);    } else {        m_mainLayout->addWidget(m_postProcessingBox, zero + 3, 0);    }    bool advanced = true;    m_advancedButton = 0;    if (showAdvancedButton) {        m_advancedButton =            new QPushButton(i18n("Show advanced options"), this);        m_mainLayout->addWidget(m_advancedButton, zero + 2, 0, Qt::AlignLeft);        QObject::connect(m_advancedButton, SIGNAL(clicked()),                         this, SLOT(slotAdvancedChanged()));    }    QFrame *postFrame = new QFrame(m_postProcessingBox);    layout = new QGridLayout(postFrame, 4, 1, 5, 3);    m_rebeam = new QCheckBox(i18n("Re-beam"), postFrame);    m_articulate = new QCheckBox                   (i18n("Add articulations (staccato, tenuto, slurs)"), postFrame);    m_makeViable = new QCheckBox(i18n("Tie notes at barlines etc"), postFrame);    m_deCounterpoint = new QCheckBox(i18n("Split-and-tie overlapping chords"), postFrame);    layout->addWidget(m_rebeam, 0, 0);    layout->addWidget(m_articulate, 1, 0);    layout->addWidget(m_makeViable, 2, 0);    layout->addWidget(m_deCounterpoint, 3, 0);    QPixmap noMap = NotePixmapFactory::toQPixmap                    (NotePixmapFactory::makeToolbarPixmap("menu-no-note"));    int defaultType = 0;    timeT defaultUnit =        Note(Note::Demisemiquaver).getDuration();    if (!m_configCategory) {        if (defaultQuantizer == Notation)            m_configCategory = "Quantize Dialog Notation";        else            m_configCategory = "Quantize Dialog Grid";    }    int defaultSwing = 0;    int defaultIterate = 100;    if (m_configCategory) {        KConfig *config = kapp->config();        config->setGroup(m_configCategory);        defaultType =            config->readNumEntry("quantizetype",                                 (defaultQuantizer == Notation) ? 2 :                                 (defaultQuantizer == Legato) ? 1 :                                 0);        defaultUnit =            config->readNumEntry("quantizeunit", defaultUnit);        defaultSwing =            config->readNumEntry("quantizeswing", defaultSwing);        defaultIterate =            config->readNumEntry("quantizeiterate", defaultIterate);        m_notationTarget->setChecked        (config->readBoolEntry("quantizenotationonly",                               defaultQuantizer == Notation));        m_durationCheckBox->setChecked        (config->readBoolEntry("quantizedurations", false));        m_simplicityCombo->setCurrentItem        (config->readNumEntry("quantizesimplicity", 13) - 11);        m_maxTuplet->setCurrentItem        (config->readNumEntry("quantizemaxtuplet", 3) - 1);        m_counterpoint->setChecked        (config->readBoolEntry("quantizecounterpoint", false));        m_rebeam->setChecked        (config->readBoolEntry("quantizerebeam", true));        m_makeViable->setChecked        (config->readBoolEntry("quantizemakeviable", false));        m_deCounterpoint->setChecked

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -