comparison layer/SpectrogramLayer.cpp @ 71:72fa239a4880

* Modify to use Vamp SDK for proper feature extraction plugins. Requires that the vamp-plugin-sdk directory tree be present below plugin/ (it's separate in Subversion).
author Chris Cannam
date Fri, 31 Mar 2006 15:56:35 +0000
parents 7f608ec9a061
children dfdbf336bb37
comparison
equal deleted inserted replaced
70:bf306158803d 71:72fa239a4880
221 deft = (int)m_colourScale; 221 deft = (int)m_colourScale;
222 222
223 } else if (name == tr("Colour")) { 223 } else if (name == tr("Colour")) {
224 224
225 *min = 0; 225 *min = 0;
226 *max = 5; 226 *max = 6;
227 227
228 deft = (int)m_colourScheme; 228 deft = (int)m_colourScheme;
229 229
230 } else if (name == tr("Window Type")) { 230 } else if (name == tr("Window Type")) {
231 231
320 case 0: return tr("Default"); 320 case 0: return tr("Default");
321 case 1: return tr("White on Black"); 321 case 1: return tr("White on Black");
322 case 2: return tr("Black on White"); 322 case 2: return tr("Black on White");
323 case 3: return tr("Red on Blue"); 323 case 3: return tr("Red on Blue");
324 case 4: return tr("Yellow on Black"); 324 case 4: return tr("Yellow on Black");
325 case 5: return tr("Fruit Salad"); 325 case 5: return tr("Blue on Black");
326 case 6: return tr("Fruit Salad");
326 } 327 }
327 } 328 }
328 if (name == tr("Colour Scale")) { 329 if (name == tr("Colour Scale")) {
329 switch (value) { 330 switch (value) {
330 default: 331 default:
423 case 0: setColourScheme(DefaultColours); break; 424 case 0: setColourScheme(DefaultColours); break;
424 case 1: setColourScheme(WhiteOnBlack); break; 425 case 1: setColourScheme(WhiteOnBlack); break;
425 case 2: setColourScheme(BlackOnWhite); break; 426 case 2: setColourScheme(BlackOnWhite); break;
426 case 3: setColourScheme(RedOnBlue); break; 427 case 3: setColourScheme(RedOnBlue); break;
427 case 4: setColourScheme(YellowOnBlack); break; 428 case 4: setColourScheme(YellowOnBlack); break;
428 case 5: setColourScheme(Rainbow); break; 429 case 5: setColourScheme(BlueOnBlack); break;
430 case 6: setColourScheme(Rainbow); break;
429 } 431 }
430 } else if (name == tr("Window Type")) { 432 } else if (name == tr("Window Type")) {
431 setWindowType(WindowType(value)); 433 setWindowType(WindowType(value));
432 } else if (name == tr("Window Size")) { 434 } else if (name == tr("Window Size")) {
433 setWindowSize(32 << value); 435 setWindowSize(32 << value);
959 256 - px, 961 256 - px,
960 pixel, 962 pixel,
961 pixel / 4); 963 pixel / 4);
962 break; 964 break;
963 965
966 case BlueOnBlack:
967 colour = QColor::fromHsv
968 (240, pixel > 226 ? 256 - (pixel - 226) * 8 : 255,
969 (pixel * pixel) / 255);
970 break;
971
964 case Rainbow: 972 case Rainbow:
965 hue = 250 - pixel; 973 hue = 250 - pixel;
966 if (hue < 0) hue += 256; 974 if (hue < 0) hue += 256;
967 colour = QColor::fromHsv(pixel, 255, 255); 975 colour = QColor::fromHsv(pixel, 255, 255);
968 break; 976 break;
1199 { 1207 {
1200 } 1208 }
1201 1209
1202 SpectrogramLayer::Cache::~Cache() 1210 SpectrogramLayer::Cache::~Cache()
1203 { 1211 {
1212 std::cerr << "SpectrogramLayer::Cache[" << this << "]::~Cache" << std::endl;
1213
1204 for (size_t i = 0; i < m_width; ++i) { 1214 for (size_t i = 0; i < m_width; ++i) {
1205 if (m_magnitude && m_magnitude[i]) free(m_magnitude[i]); 1215 if (m_magnitude && m_magnitude[i]) free(m_magnitude[i]);
1206 if (m_phase && m_phase[i]) free(m_phase[i]); 1216 if (m_phase && m_phase[i]) free(m_phase[i]);
1207 } 1217 }
1208 1218