Revision 136:5cf745be1767 main/MainWindow.cpp
| main/MainWindow.cpp | ||
|---|---|---|
| 182 | 182 |
settings.setValue("melodicrange",
|
| 183 | 183 |
QString("<layer channel=\"-1\" gain=\"1\" normalizeVisibleArea=\"false\" columnNormalization=\"hybrid\" colourMap=\"Ice\" minFrequency=\"80\" maxFrequency=\"1500\" windowSize=\"8192\" windowOverlap=\"75\" binDisplay=\"0\" />"));
|
| 184 | 184 |
|
| 185 |
settings.setValue("colour3dplot",
|
|
| 186 |
QString("<layer channel=\"-1\" colourMap=\"Ice\" opaque=\"true\" smooth=\"true\" binScale=\"0\" columnNormalization=\"hybrid\"/>"));
|
|
| 187 |
|
|
| 185 | 188 |
settings.endGroup(); |
| 186 | 189 |
|
| 187 | 190 |
settings.beginGroup("MainWindow");
|
| ... | ... | |
| 258 | 261 |
connect(button, SIGNAL(clicked()), this, SLOT(curveModeSelected())); |
| 259 | 262 |
|
| 260 | 263 |
button = new QToolButton; |
| 264 |
button->setIcon(il.load("pitch"));
|
|
| 265 |
button->setToolTip(tr("Pitch Plot"));
|
|
| 266 |
button->setCheckable(true); |
|
| 267 |
button->setChecked(false); |
|
| 268 |
button->setAutoRaise(true); |
|
| 269 |
button->setFixedWidth(bottomButtonHeight); |
|
| 270 |
button->setFixedHeight(bottomButtonHeight); |
|
| 271 |
bg->addButton(button); |
|
| 272 |
buttonLayout->addWidget(button); |
|
| 273 |
connect(button, SIGNAL(clicked()), this, SLOT(pitchModeSelected())); |
|
| 274 |
|
|
| 275 |
button = new QToolButton; |
|
| 276 |
button->setIcon(il.load("azimuth"));
|
|
| 277 |
button->setToolTip(tr("Stereo Azimuth Plot"));
|
|
| 278 |
button->setCheckable(true); |
|
| 279 |
button->setChecked(false); |
|
| 280 |
button->setAutoRaise(true); |
|
| 281 |
button->setFixedWidth(bottomButtonHeight); |
|
| 282 |
button->setFixedHeight(bottomButtonHeight); |
|
| 283 |
bg->addButton(button); |
|
| 284 |
buttonLayout->addWidget(button); |
|
| 285 |
connect(button, SIGNAL(clicked()), this, SLOT(azimuthModeSelected())); |
|
| 286 |
|
|
| 287 |
button = new QToolButton; |
|
| 261 | 288 |
button->setIcon(il.load("spectrogram"));
|
| 262 | 289 |
button->setToolTip(tr("Full-Range Spectrogram"));
|
| 263 | 290 |
button->setCheckable(true); |
| ... | ... | |
| 1640 | 1667 |
} |
| 1641 | 1668 |
|
| 1642 | 1669 |
void |
| 1670 |
MainWindow::pitchModeSelected() |
|
| 1671 |
{
|
|
| 1672 |
QString name = tr("Pitch");
|
|
| 1673 |
|
|
| 1674 |
for (int i = 0; i < m_paneStack->getPaneCount(); ++i) {
|
|
| 1675 |
|
|
| 1676 |
Pane *pane = m_paneStack->getPane(i); |
|
| 1677 |
if (!pane) continue; |
|
| 1678 |
|
|
| 1679 |
Model *createFrom = nullptr; |
|
| 1680 |
if (!selectExistingLayerForMode(pane, name, &createFrom) && |
|
| 1681 |
createFrom) {
|
|
| 1682 |
|
|
| 1683 |
TransformId id = "vamp:pyin:pyin:smoothedpitchtrack"; |
|
| 1684 |
TransformFactory *tf = TransformFactory::getInstance(); |
|
| 1685 |
|
|
| 1686 |
if (tf->haveTransform(id)) {
|
|
| 1687 |
|
|
| 1688 |
Transform transform = tf->getDefaultTransformFor |
|
| 1689 |
(id, createFrom->getSampleRate()); |
|
| 1690 |
|
|
| 1691 |
ModelTransformer::Input input(createFrom, -1); |
|
| 1692 |
|
|
| 1693 |
Layer *newLayer = |
|
| 1694 |
m_document->createDerivedLayer(transform, createFrom); |
|
| 1695 |
|
|
| 1696 |
TimeValueLayer *values = |
|
| 1697 |
qobject_cast<TimeValueLayer *>(newLayer); |
|
| 1698 |
|
|
| 1699 |
if (values) {
|
|
| 1700 |
values->setPlotStyle(TimeValueLayer::PlotDiscreteCurves); |
|
| 1701 |
} |
|
| 1702 |
|
|
| 1703 |
if (newLayer) {
|
|
| 1704 |
newLayer->setObjectName(name); |
|
| 1705 |
m_document->addLayerToView(pane, newLayer); |
|
| 1706 |
m_paneStack->setCurrentLayer(pane, newLayer); |
|
| 1707 |
} |
|
| 1708 |
|
|
| 1709 |
} else {
|
|
| 1710 |
SVCERR << "ERROR: No PYin plugin available" << endl; |
|
| 1711 |
} |
|
| 1712 |
} |
|
| 1713 |
|
|
| 1714 |
TimeInstantLayer *salient = findSalientFeatureLayer(pane); |
|
| 1715 |
if (salient) {
|
|
| 1716 |
pane->propertyContainerSelected(pane, salient); |
|
| 1717 |
} |
|
| 1718 |
} |
|
| 1719 |
|
|
| 1720 |
m_displayMode = PitchMode; |
|
| 1721 |
} |
|
| 1722 |
|
|
| 1723 |
void |
|
| 1724 |
MainWindow::azimuthModeSelected() |
|
| 1725 |
{
|
|
| 1726 |
QString name = tr("Azimuth");
|
|
| 1727 |
|
|
| 1728 |
for (int i = 0; i < m_paneStack->getPaneCount(); ++i) {
|
|
| 1729 |
|
|
| 1730 |
Pane *pane = m_paneStack->getPane(i); |
|
| 1731 |
if (!pane) continue; |
|
| 1732 |
|
|
| 1733 |
Model *createFrom = nullptr; |
|
| 1734 |
if (!selectExistingLayerForMode(pane, name, &createFrom) && |
|
| 1735 |
createFrom) {
|
|
| 1736 |
|
|
| 1737 |
TransformId id = "vamp:azi:azi:plan"; |
|
| 1738 |
TransformFactory *tf = TransformFactory::getInstance(); |
|
| 1739 |
|
|
| 1740 |
if (tf->haveTransform(id)) {
|
|
| 1741 |
|
|
| 1742 |
Transform transform = tf->getDefaultTransformFor |
|
| 1743 |
(id, createFrom->getSampleRate()); |
|
| 1744 |
|
|
| 1745 |
ModelTransformer::Input input(createFrom, -1); |
|
| 1746 |
|
|
| 1747 |
Layer *newLayer = |
|
| 1748 |
m_document->createDerivedLayer(transform, createFrom); |
|
| 1749 |
|
|
| 1750 |
if (newLayer) {
|
|
| 1751 |
newLayer->setObjectName(name); |
|
| 1752 |
m_document->addLayerToView(pane, newLayer); |
|
| 1753 |
m_paneStack->setCurrentLayer(pane, newLayer); |
|
| 1754 |
} |
|
| 1755 |
|
|
| 1756 |
} else {
|
|
| 1757 |
SVCERR << "ERROR: No Azimuth plugin available" << endl; |
|
| 1758 |
} |
|
| 1759 |
} |
|
| 1760 |
|
|
| 1761 |
TimeInstantLayer *salient = findSalientFeatureLayer(pane); |
|
| 1762 |
if (salient) {
|
|
| 1763 |
pane->propertyContainerSelected(pane, salient); |
|
| 1764 |
} |
|
| 1765 |
} |
|
| 1766 |
|
|
| 1767 |
m_displayMode = AzimuthMode; |
|
| 1768 |
} |
|
| 1769 |
|
|
| 1770 |
void |
|
| 1643 | 1771 |
MainWindow::reselectMode() |
| 1644 | 1772 |
{
|
| 1645 | 1773 |
switch (m_displayMode) {
|
| ... | ... | |
| 1647 | 1775 |
case WaveformMode: waveformModeSelected(); break; |
| 1648 | 1776 |
case SpectrogramMode: spectrogramModeSelected(); break; |
| 1649 | 1777 |
case MelodogramMode: melodogramModeSelected(); break; |
| 1778 |
case AzimuthMode: azimuthModeSelected(); break; |
|
| 1650 | 1779 |
} |
| 1651 | 1780 |
} |
| 1652 | 1781 |
|
Also available in: Unified diff