Mercurial > hg > sonic-visualiser
comparison main/OSCHandler.cpp @ 2442:b3330c31ea0e spectrogram-export
Add layer export of selected region as well as whole layer
author | Chris Cannam |
---|---|
date | Wed, 08 Jan 2020 15:41:46 +0000 |
parents | 3612bfc24950 |
children | e9506f77388d |
comparison
equal
deleted
inserted
replaced
2441:3612bfc24950 | 2442:b3330c31ea0e |
---|---|
154 } else { | 154 } else { |
155 Pane *currentPane = nullptr; | 155 Pane *currentPane = nullptr; |
156 Layer *currentLayer = nullptr; | 156 Layer *currentLayer = nullptr; |
157 if (m_paneStack) currentPane = m_paneStack->getCurrentPane(); | 157 if (m_paneStack) currentPane = m_paneStack->getCurrentPane(); |
158 if (currentPane) currentLayer = currentPane->getSelectedLayer(); | 158 if (currentPane) currentLayer = currentPane->getSelectedLayer(); |
159 MultiSelection ms = m_viewManager->getSelection(); | |
159 if (currentLayer) { | 160 if (currentLayer) { |
160 QString error; | 161 QString error; |
161 if (!exportLayerTo(currentLayer, currentPane, path, error)) { | 162 if (exportLayerTo |
162 SVCERR << "OSCHandler: Failed to export current layer to " << path << ": " << error << endl; | 163 (currentLayer, currentPane, |
164 ms.getSelections().empty() ? nullptr : &ms, | |
165 path, error)) { | |
166 SVDEBUG << "OSCHandler: Exported layer \"" | |
167 << currentLayer->getLayerPresentationName() | |
168 << "\" to path \"" << path << "\"" << endl; | |
169 } else { | |
170 SVCERR << "OSCHandler: Export failed to path \"" | |
171 << path << "\"" << endl; | |
163 } | 172 } |
164 } else { | 173 } else { |
165 SVCERR << "OSCHandler: No current layer to export" << endl; | 174 SVCERR << "OSCHandler: No current layer to export" << endl; |
166 } | 175 } |
167 } | 176 } |