OSStatus VisualStageControl::handleKeyPressed(const char keyboadVal, const PlayerShowMode showMode) { OSStatus status = unimpErr; VisualNotification aNotification; switch (keyboadVal) { case 's': case 'S': if ((showMode & kIsShowing) == kIsShowing) { //VisualMessaging::post(kToggleShowProcessMonitorMsg); aNotification.setKey(kToggleShowProcessMonitorMsg); VisualStageControl::dispatchNotification(aNotification); } break; case 'a': case 'A': if ((showMode & kIsShowing) == kIsShowing) { //VisualMessaging::post(kToggleProcessMonitorAudioInfoMsg); aNotification.setKey(kToggleProcessMonitorAudioInfoMsg); VisualStageControl::dispatchNotification(aNotification); } break; default: // nothing break; } return status; }
OSStatus VisualImage::createHistogramOfRGBPixelsThread(void* visualImageHistogramPixelColors) { OSStatus retVal = noErr; #endif #if TARGET_OS_WIN DWORD VisualImage::createHistogramOfRGBPixelsThread(LPVOID visualImageHistogramPixelColors) { DWORD retVal = 0; #endif VisualHistogram::PixelColorHistogram aHistogram = VisualHistogram::createHistogramOfRGBPixels(((VisualImageHistogramPixelColors*)visualImageHistogramPixelColors)->pixelColorValuesVector); VisualImage* image = ((VisualImageHistogramPixelColors*)visualImageHistogramPixelColors)->visualImage; if (image->histogram != NULL) { delete image->histogram; image->histogram = NULL; } if (aHistogram.size() > 0) { image->histogram = new VisualHistogram::PixelColorHistogram(aHistogram); } delete (VisualImageHistogramPixelColors*)visualImageHistogramPixelColors; if (image->histogram != NULL) { VisualNotification aNotification; aNotification.setPointer(image); aNotification.setKey(kImageHistogramCompletedMsg); aNotification.post(); } return retVal; }
void VisualImage::writeToPNGFileAsyncAndDelete(VisualFile& aVisualFile) { // Only in the main thread we can transfer the memory of the graphics card to the CPU memory VisualNotification aNotification; aNotification.setPointer(this); aNotification.setObject(aVisualFile); aNotification.setKey(kImageWriteToPNGFileAndDeleteMsg); aNotification.post(); }