| @@ -1139,13 +1139,12 @@ public: | |||
| class JuceAUView : public AUCarbonViewBase | |||
| { | |||
| AudioProcessor* juceFilter; | |||
| Component* windowComp; | |||
| ScopedPointer<Component> windowComp; | |||
| public: | |||
| JuceAUView (AudioUnitCarbonView auview) | |||
| : AUCarbonViewBase (auview), | |||
| juceFilter (0), | |||
| windowComp (0) | |||
| juceFilter (0) | |||
| { | |||
| } | |||
| @@ -1206,7 +1205,7 @@ private: | |||
| if (windowComp != 0 && windowComp->getChildComponent(0) != 0) | |||
| juceFilter->editorBeingDeleted ((AudioProcessorEditor*) windowComp->getChildComponent(0)); | |||
| deleteAndZero (windowComp); | |||
| windowComp = 0; | |||
| } | |||
| } | |||
| @@ -157,9 +157,7 @@ class JucePlugInProcess : public CEffectProcessMIDI, | |||
| public: | |||
| //============================================================================== | |||
| JucePlugInProcess() | |||
| : midiBufferNode (0), | |||
| midiTransport (0), | |||
| prepared (false), | |||
| : prepared (false), | |||
| sampleRate (44100.0) | |||
| { | |||
| juceFilter = createPluginFilter(); | |||
| @@ -175,8 +173,8 @@ public: | |||
| if (mLoggedIn) | |||
| MIDILogOut(); | |||
| deleteAndZero (midiBufferNode); | |||
| deleteAndZero (midiTransport); | |||
| midiBufferNode = 0; | |||
| midiTransport = 0; | |||
| if (prepared) | |||
| juceFilter->releaseResources(); | |||
| @@ -204,9 +202,7 @@ public: | |||
| JuceCustomUIView (AudioProcessor* const filter_, | |||
| JucePlugInProcess* const process_) | |||
| : filter (filter_), | |||
| process (process_), | |||
| wrapper (0), | |||
| editorComp (0) | |||
| process (process_) | |||
| { | |||
| // setting the size in here crashes PT for some reason, so keep it simple.. | |||
| } | |||
| @@ -262,8 +258,7 @@ public: | |||
| #else | |||
| void* const hostWindow = (void*) GetWindowFromPort (port); | |||
| #endif | |||
| deleteAndZero (wrapper); | |||
| wrapper = 0; | |||
| wrapper = new EditorCompWrapper (hostWindow, editorComp, this); | |||
| process->touchAllParameters(); | |||
| @@ -296,8 +291,8 @@ public: | |||
| private: | |||
| AudioProcessor* const filter; | |||
| JucePlugInProcess* const process; | |||
| JUCE_NAMESPACE::Component* wrapper; | |||
| AudioProcessorEditor* editorComp; | |||
| ScopedPointer<JUCE_NAMESPACE::Component> wrapper; | |||
| ScopedPointer<AudioProcessorEditor> editorComp; | |||
| void deleteEditorComp() | |||
| { | |||
| @@ -314,8 +309,8 @@ public: | |||
| filter->editorBeingDeleted (editorComp); | |||
| deleteAndZero (editorComp); | |||
| deleteAndZero (wrapper); | |||
| editorComp = 0; | |||
| wrapper = 0; | |||
| } | |||
| } | |||
| @@ -550,22 +545,25 @@ protected: | |||
| const Cmn_UInt32 bufferSize = mRTGlobals->mHWBufferSizeInSamples; | |||
| if (midiBufferNode->GetAdvanceScheduleTime() != bufferSize) | |||
| midiBufferNode->SetAdvanceScheduleTime (bufferSize); | |||
| if (midiBufferNode->FillMIDIBuffer (mRTGlobals->mRunningTime, numSamples) == noErr) | |||
| if (midiBufferNode != 0) | |||
| { | |||
| jassert (midiBufferNode->GetBufferPtr() != 0); | |||
| const int numMidiEvents = midiBufferNode->GetBufferSize(); | |||
| if (midiBufferNode->GetAdvanceScheduleTime() != bufferSize) | |||
| midiBufferNode->SetAdvanceScheduleTime (bufferSize); | |||
| for (int i = 0; i < numMidiEvents; ++i) | |||
| if (midiBufferNode->FillMIDIBuffer (mRTGlobals->mRunningTime, numSamples) == noErr) | |||
| { | |||
| const DirectMidiPacket& m = midiBuffer[i]; | |||
| jassert (midiBufferNode->GetBufferPtr() != 0); | |||
| const int numMidiEvents = midiBufferNode->GetBufferSize(); | |||
| jassert ((int) m.mTimestamp < numSamples); | |||
| for (int i = 0; i < numMidiEvents; ++i) | |||
| { | |||
| const DirectMidiPacket& m = midiBuffer[i]; | |||
| midiEvents.addEvent (m.mData, m.mLength, | |||
| jlimit (0, (int) numSamples - 1, (int) m.mTimestamp)); | |||
| jassert ((int) m.mTimestamp < numSamples); | |||
| midiEvents.addEvent (m.mData, m.mLength, | |||
| jlimit (0, (int) numSamples - 1, (int) m.mTimestamp)); | |||
| } | |||
| } | |||
| } | |||
| #endif | |||
| @@ -809,8 +807,8 @@ protected: | |||
| private: | |||
| AudioProcessor* juceFilter; | |||
| MidiBuffer midiEvents; | |||
| CEffectMIDIOtherBufferedNode* midiBufferNode; | |||
| CEffectMIDITransport* midiTransport; | |||
| ScopedPointer<CEffectMIDIOtherBufferedNode> midiBufferNode; | |||
| ScopedPointer<CEffectMIDITransport> midiTransport; | |||
| DirectMidiPacket midiBuffer [midiBufferSize]; | |||
| JUCE_NAMESPACE::MemoryBlock tempFilterData; | |||
| @@ -39,16 +39,13 @@ StandaloneFilterWindow::StandaloneFilterWindow (const String& title, | |||
| : DocumentWindow (title, backgroundColour, | |||
| DocumentWindow::minimiseButton | |||
| | DocumentWindow::closeButton), | |||
| filter (0), | |||
| deviceManager (0), | |||
| optionsButton (0) | |||
| optionsButton ("options") | |||
| { | |||
| setTitleBarButtonsRequired (DocumentWindow::minimiseButton | DocumentWindow::closeButton, false); | |||
| optionsButton = new TextButton ("options"); | |||
| Component::addAndMakeVisible (optionsButton); | |||
| optionsButton->addButtonListener (this); | |||
| optionsButton->setTriggeredOnMouseDown (true); | |||
| Component::addAndMakeVisible (&optionsButton); | |||
| optionsButton.addButtonListener (this); | |||
| optionsButton.setTriggeredOnMouseDown (true); | |||
| JUCE_TRY | |||
| { | |||
| @@ -115,8 +112,6 @@ StandaloneFilterWindow::~StandaloneFilterWindow() | |||
| globalSettings->setValue ("windowX", getX()); | |||
| globalSettings->setValue ("windowY", getY()); | |||
| deleteAndZero (optionsButton); | |||
| if (globalSettings != 0 && deviceManager != 0) | |||
| { | |||
| XmlElement* const xml = deviceManager->createStateXml(); | |||
| @@ -124,7 +119,7 @@ StandaloneFilterWindow::~StandaloneFilterWindow() | |||
| delete xml; | |||
| } | |||
| deleteAndZero (deviceManager); | |||
| deviceManager = 0; | |||
| if (globalSettings != 0 && filter != 0) | |||
| { | |||
| @@ -149,7 +144,7 @@ void StandaloneFilterWindow::deleteFilter() | |||
| setContentComponent (0, true); | |||
| } | |||
| deleteAndZero (filter); | |||
| filter = 0; | |||
| } | |||
| void StandaloneFilterWindow::resetFilter() | |||
| @@ -258,8 +253,7 @@ void StandaloneFilterWindow::resized() | |||
| { | |||
| DocumentWindow::resized(); | |||
| if (optionsButton != 0) | |||
| optionsButton->setBounds (8, 6, 60, getTitleBarHeight() - 8); | |||
| optionsButton.setBounds (8, 6, 60, getTitleBarHeight() - 8); | |||
| } | |||
| void StandaloneFilterWindow::buttonClicked (Button*) | |||
| @@ -275,7 +269,7 @@ void StandaloneFilterWindow::buttonClicked (Button*) | |||
| m.addSeparator(); | |||
| m.addItem (4, TRANS("Reset to default state")); | |||
| switch (m.showAt (optionsButton)) | |||
| switch (m.showAt (&optionsButton)) | |||
| { | |||
| case 1: | |||
| showAudioSettingsDialog(); | |||
| @@ -77,9 +77,9 @@ public: | |||
| juce_UseDebuggingNewOperator | |||
| private: | |||
| AudioProcessor* filter; | |||
| AudioFilterStreamingDeviceManager* deviceManager; | |||
| Button* optionsButton; | |||
| ScopedPointer<AudioProcessor> filter; | |||
| ScopedPointer<AudioFilterStreamingDeviceManager> deviceManager; | |||
| TextButton optionsButton; | |||
| void deleteFilter(); | |||
| @@ -275,7 +275,6 @@ public: | |||
| filter_->getNumParameters()), | |||
| filter (filter_) | |||
| { | |||
| editorComp = 0; | |||
| chunkMemoryTime = 0; | |||
| isProcessing = false; | |||
| hasShutdown = false; | |||
| @@ -1128,7 +1127,7 @@ public: | |||
| filter->editorBeingDeleted (editorComp->getEditorComp()); | |||
| deleteAndZero (editorComp); | |||
| editorComp = 0; | |||
| // there's some kind of component currently modal, but the host | |||
| // is trying to delete our plugin. You should try to avoid this happening.. | |||
| @@ -1420,7 +1419,7 @@ private: | |||
| AudioProcessor* filter; | |||
| JUCE_NAMESPACE::MemoryBlock chunkMemory; | |||
| JUCE_NAMESPACE::uint32 chunkMemoryTime; | |||
| EditorCompWrapper* editorComp; | |||
| ScopedPointer<EditorCompWrapper> editorComp; | |||
| ERect editorSize; | |||
| MidiBuffer midiEvents; | |||
| VSTMidiEventList outgoingEvents; | |||
| @@ -7938,7 +7938,7 @@ DatagramSocket::~DatagramSocket() | |||
| { | |||
| close(); | |||
| delete ((struct sockaddr_in*) serverAddress); | |||
| delete static_cast <struct sockaddr_in*> (serverAddress); | |||
| serverAddress = 0; | |||
| } | |||
| @@ -30774,10 +30774,9 @@ class AudioUnitPluginWindowCocoa : public AudioProcessorEditor | |||
| public: | |||
| AudioUnitPluginWindowCocoa (AudioUnitPluginInstance& plugin_, const bool createGenericViewIfNeeded) | |||
| : AudioProcessorEditor (&plugin_), | |||
| plugin (plugin_), | |||
| wrapper (0) | |||
| plugin (plugin_) | |||
| { | |||
| addAndMakeVisible (wrapper = new NSViewComponent()); | |||
| addAndMakeVisible (&wrapper); | |||
| setOpaque (true); | |||
| setVisible (true); | |||
| @@ -30790,15 +30789,13 @@ public: | |||
| { | |||
| const bool wasValid = isValid(); | |||
| wrapper->setView (0); | |||
| wrapper.setView (0); | |||
| if (wasValid) | |||
| plugin.editorBeingDeleted (this); | |||
| delete wrapper; | |||
| } | |||
| bool isValid() const { return wrapper->getView() != 0; } | |||
| bool isValid() const { return wrapper.getView() != 0; } | |||
| void paint (Graphics& g) | |||
| { | |||
| @@ -30807,12 +30804,12 @@ public: | |||
| void resized() | |||
| { | |||
| wrapper->setSize (getWidth(), getHeight()); | |||
| wrapper.setSize (getWidth(), getHeight()); | |||
| } | |||
| private: | |||
| AudioUnitPluginInstance& plugin; | |||
| NSViewComponent* wrapper; | |||
| NSViewComponent wrapper; | |||
| bool createView (const bool createGenericViewIfNeeded) | |||
| { | |||
| @@ -30858,7 +30855,7 @@ private: | |||
| if (createGenericViewIfNeeded && (pluginView == 0)) | |||
| pluginView = [[AUGenericView alloc] initWithAudioUnit: plugin.audioUnit]; | |||
| wrapper->setView (pluginView); | |||
| wrapper.setView (pluginView); | |||
| if (pluginView != 0) | |||
| setSize ([pluginView frame].size.width, | |||
| @@ -57806,35 +57803,19 @@ FileChooserDialogBox::FileChooserDialogBox (const String& name, | |||
| : ResizableWindow (name, backgroundColour, true), | |||
| warnAboutOverwritingExistingFiles (warnAboutOverwritingExistingFiles_) | |||
| { | |||
| content = new ContentComponent(); | |||
| content->setName (name); | |||
| content->instructions = instructions; | |||
| content->chooserComponent = &chooserComponent; | |||
| content->addAndMakeVisible (&chooserComponent); | |||
| content->okButton = new TextButton (chooserComponent.getActionVerb()); | |||
| content->addAndMakeVisible (content->okButton); | |||
| content->okButton->addButtonListener (this); | |||
| content->okButton->setEnabled (chooserComponent.currentFileIsValid()); | |||
| content->okButton->addShortcut (KeyPress (KeyPress::returnKey, 0, 0)); | |||
| content->cancelButton = new TextButton (TRANS("Cancel")); | |||
| content->addAndMakeVisible (content->cancelButton); | |||
| content->cancelButton->addButtonListener (this); | |||
| content->cancelButton->addShortcut (KeyPress (KeyPress::escapeKey, 0, 0)); | |||
| setContentComponent (content); | |||
| setContentComponent (content = new ContentComponent (name, instructions, chooserComponent)); | |||
| setResizable (true, true); | |||
| setResizeLimits (300, 300, 1200, 1000); | |||
| content->chooserComponent->addListener (this); | |||
| content->okButton.addButtonListener (this); | |||
| content->cancelButton.addButtonListener (this); | |||
| content->chooserComponent.addListener (this); | |||
| } | |||
| FileChooserDialogBox::~FileChooserDialogBox() | |||
| { | |||
| content->chooserComponent->removeListener (this); | |||
| content->chooserComponent.removeListener (this); | |||
| } | |||
| bool FileChooserDialogBox::show (int w, int h) | |||
| @@ -57846,7 +57827,7 @@ bool FileChooserDialogBox::showAt (int x, int y, int w, int h) | |||
| { | |||
| if (w <= 0) | |||
| { | |||
| Component* const previewComp = content->chooserComponent->getPreviewComponent(); | |||
| Component* const previewComp = content->chooserComponent.getPreviewComponent(); | |||
| if (previewComp != 0) | |||
| w = 400 + previewComp->getWidth(); | |||
| else | |||
| @@ -57868,16 +57849,16 @@ bool FileChooserDialogBox::showAt (int x, int y, int w, int h) | |||
| void FileChooserDialogBox::buttonClicked (Button* button) | |||
| { | |||
| if (button == content->okButton) | |||
| if (button == &(content->okButton)) | |||
| { | |||
| if (warnAboutOverwritingExistingFiles | |||
| && content->chooserComponent->isSaveMode() | |||
| && content->chooserComponent->getSelectedFile(0).exists()) | |||
| && content->chooserComponent.isSaveMode() | |||
| && content->chooserComponent.getSelectedFile(0).exists()) | |||
| { | |||
| if (! AlertWindow::showOkCancelBox (AlertWindow::WarningIcon, | |||
| TRANS("File already exists"), | |||
| TRANS("There's already a file called:") | |||
| + "\n\n" + content->chooserComponent->getSelectedFile(0).getFullPathName() | |||
| + "\n\n" + content->chooserComponent.getSelectedFile(0).getFullPathName() | |||
| + "\n\n" + TRANS("Are you sure you want to overwrite it?"), | |||
| TRANS("overwrite"), | |||
| TRANS("cancel"))) | |||
| @@ -57888,8 +57869,10 @@ void FileChooserDialogBox::buttonClicked (Button* button) | |||
| exitModalState (1); | |||
| } | |||
| else if (button == content->cancelButton) | |||
| else if (button == &(content->cancelButton)) | |||
| { | |||
| closeButtonPressed(); | |||
| } | |||
| } | |||
| void FileChooserDialogBox::closeButtonPressed() | |||
| @@ -57899,7 +57882,7 @@ void FileChooserDialogBox::closeButtonPressed() | |||
| void FileChooserDialogBox::selectionChanged() | |||
| { | |||
| content->okButton->setEnabled (content->chooserComponent->currentFileIsValid()); | |||
| content->okButton.setEnabled (content->chooserComponent.currentFileIsValid()); | |||
| } | |||
| void FileChooserDialogBox::fileClicked (const File&, const MouseEvent&) | |||
| @@ -57909,18 +57892,29 @@ void FileChooserDialogBox::fileClicked (const File&, const MouseEvent&) | |||
| void FileChooserDialogBox::fileDoubleClicked (const File&) | |||
| { | |||
| selectionChanged(); | |||
| content->okButton->triggerClick(); | |||
| content->okButton.triggerClick(); | |||
| } | |||
| FileChooserDialogBox::ContentComponent::ContentComponent() | |||
| FileChooserDialogBox::ContentComponent::ContentComponent (const String& name, const String& instructions_, FileBrowserComponent& chooserComponent_) | |||
| : Component (name), instructions (instructions_), | |||
| chooserComponent (chooserComponent_), | |||
| okButton (chooserComponent_.getActionVerb()), | |||
| cancelButton (TRANS ("Cancel")) | |||
| { | |||
| addAndMakeVisible (&chooserComponent); | |||
| addAndMakeVisible (&okButton); | |||
| okButton.setEnabled (chooserComponent.currentFileIsValid()); | |||
| okButton.addShortcut (KeyPress (KeyPress::returnKey, 0, 0)); | |||
| addAndMakeVisible (&cancelButton); | |||
| cancelButton.addShortcut (KeyPress (KeyPress::escapeKey, 0, 0)); | |||
| setInterceptsMouseClicks (false, true); | |||
| } | |||
| FileChooserDialogBox::ContentComponent::~ContentComponent() | |||
| { | |||
| delete okButton; | |||
| delete cancelButton; | |||
| } | |||
| void FileChooserDialogBox::ContentComponent::paint (Graphics& g) | |||
| @@ -57939,13 +57933,13 @@ void FileChooserDialogBox::ContentComponent::resized() | |||
| const int buttonHeight = 26; | |||
| const int buttonY = getHeight() - buttonHeight - 8; | |||
| chooserComponent->setBounds (0, y, getWidth(), buttonY - y - 20); | |||
| chooserComponent.setBounds (0, y, getWidth(), buttonY - y - 20); | |||
| okButton->setBounds (proportionOfWidth (0.25f), buttonY, | |||
| proportionOfWidth (0.2f), buttonHeight); | |||
| okButton.setBounds (proportionOfWidth (0.25f), buttonY, | |||
| proportionOfWidth (0.2f), buttonHeight); | |||
| cancelButton->setBounds (proportionOfWidth (0.55f), buttonY, | |||
| proportionOfWidth (0.2f), buttonHeight); | |||
| cancelButton.setBounds (proportionOfWidth (0.55f), buttonY, | |||
| proportionOfWidth (0.2f), buttonHeight); | |||
| } | |||
| END_JUCE_NAMESPACE | |||
| @@ -61133,7 +61127,6 @@ public: | |||
| MultiDocumentPanel::MultiDocumentPanel() | |||
| : mode (MaximisedWindowsWithTabs), | |||
| tabComponent (0), | |||
| backgroundColour (Colours::lightblue), | |||
| maximumNumDocuments (0), | |||
| numDocsBeforeTabsUsed (0) | |||
| @@ -61326,7 +61319,7 @@ bool MultiDocumentPanel::closeDocument (Component* component, | |||
| delete component; | |||
| if (tabComponent != 0 && tabComponent->getNumTabs() <= numDocsBeforeTabsUsed) | |||
| deleteAndZero (tabComponent); | |||
| tabComponent = 0; | |||
| components.removeValue (component); | |||
| @@ -61426,7 +61419,7 @@ void MultiDocumentPanel::setLayoutMode (const LayoutMode newLayoutMode) | |||
| if (mode == FloatingWindows) | |||
| { | |||
| deleteAndZero (tabComponent); | |||
| tabComponent = 0; | |||
| } | |||
| else | |||
| { | |||
| @@ -77667,8 +77660,7 @@ ResizableWindow::~ResizableWindow() | |||
| { | |||
| resizableCorner = 0; | |||
| resizableBorder = 0; | |||
| delete static_cast <Component*> (contentComponent); | |||
| contentComponent = 0; | |||
| contentComponent.deleteAndZero(); | |||
| // have you been adding your own components directly to this window..? tut tut tut. | |||
| // Read the instructions for using a ResizableWindow! | |||
| @@ -77694,8 +77686,8 @@ void ResizableWindow::setContentComponent (Component* const newContentComponent, | |||
| if (newContentComponent != static_cast <Component*> (contentComponent)) | |||
| { | |||
| if (deleteOldOne) | |||
| delete static_cast <Component*> (contentComponent); // (avoid using a scoped pointer for this, so that it survives | |||
| // external deletion of the content comp) | |||
| contentComponent.deleteAndZero(); // (avoid using a scoped pointer for this, so that it survives | |||
| // external deletion of the content comp) | |||
| else | |||
| removeChildComponent (contentComponent); | |||
| @@ -87984,12 +87976,12 @@ private: | |||
| Path path; | |||
| Drawable* s = parseShape (*e, path); | |||
| delete s; | |||
| delete s; // xxx not finished! | |||
| } | |||
| else if (e->hasTagName ("tspan")) | |||
| { | |||
| Drawable* s = parseText (*e); | |||
| delete s; | |||
| delete s; // xxx not finished! | |||
| } | |||
| } | |||
| @@ -239638,7 +239630,6 @@ public: | |||
| isMouseOver (false), | |||
| hasCreatedCaret (false), | |||
| currentWindowIcon (0), | |||
| taskBarIcon (0), | |||
| dropTarget (0) | |||
| { | |||
| callFunctionIfNotLocked (&createWindowCallback, this); | |||
| @@ -239653,16 +239644,12 @@ public: | |||
| if (shadower != 0) | |||
| shadower->setOwner (component); | |||
| } | |||
| else | |||
| { | |||
| shadower = 0; | |||
| } | |||
| } | |||
| ~Win32ComponentPeer() | |||
| { | |||
| setTaskBarIcon (Image()); | |||
| deleteAndZero (shadower); | |||
| shadower = 0; | |||
| // do this before the next bit to avoid messages arriving for this window | |||
| // before it's destroyed | |||
| @@ -240022,7 +240009,7 @@ public: | |||
| taskBarIcon->uFlags = 0; | |||
| Shell_NotifyIcon (NIM_DELETE, taskBarIcon); | |||
| DestroyIcon (taskBarIcon->hIcon); | |||
| deleteAndZero (taskBarIcon); | |||
| taskBarIcon = 0; | |||
| } | |||
| } | |||
| @@ -240087,11 +240074,11 @@ public: | |||
| private: | |||
| HWND hwnd; | |||
| DropShadower* shadower; | |||
| ScopedPointer<DropShadower> shadower; | |||
| bool fullScreen, isDragging, isMouseOver, hasCreatedCaret; | |||
| BorderSize windowBorder; | |||
| HICON currentWindowIcon; | |||
| NOTIFYICONDATA* taskBarIcon; | |||
| ScopedPointer<NOTIFYICONDATA> taskBarIcon; | |||
| IDropTarget* dropTarget; | |||
| class TemporaryImage : public Timer | |||
| @@ -244011,7 +243998,6 @@ public: | |||
| HGLRC contextToShareWith, | |||
| const OpenGLPixelFormat& pixelFormat) | |||
| : renderContext (0), | |||
| nativeWindow (0), | |||
| dc (0), | |||
| component (component_) | |||
| { | |||
| @@ -244047,7 +244033,7 @@ public: | |||
| { | |||
| deleteContext(); | |||
| ReleaseDC ((HWND) nativeWindow->getNativeHandle(), dc); | |||
| delete nativeWindow; | |||
| nativeWindow = 0; | |||
| } | |||
| void deleteContext() | |||
| @@ -244200,7 +244186,7 @@ public: | |||
| // old one and create a new one.. | |||
| jassert (nativeWindow != 0); | |||
| ReleaseDC ((HWND) nativeWindow->getNativeHandle(), dc); | |||
| delete nativeWindow; | |||
| nativeWindow = 0; | |||
| createNativeWindow(); | |||
| @@ -244314,7 +244300,7 @@ public: | |||
| HGLRC renderContext; | |||
| private: | |||
| Win32ComponentPeer* nativeWindow; | |||
| ScopedPointer<Win32ComponentPeer> nativeWindow; | |||
| Component* const component; | |||
| HDC dc; | |||
| @@ -251418,9 +251404,7 @@ public: | |||
| Thread ("Juce WASAPI"), | |||
| isOpen_ (false), | |||
| isStarted (false), | |||
| outputDevice (0), | |||
| outputDeviceId (outputDeviceId_), | |||
| inputDevice (0), | |||
| inputDeviceId (inputDeviceId_), | |||
| useExclusiveMode (useExclusiveMode_), | |||
| currentBufferSizeSamples (0), | |||
| @@ -251432,9 +251416,6 @@ public: | |||
| ~WASAPIAudioIODevice() | |||
| { | |||
| close(); | |||
| deleteAndZero (inputDevice); | |||
| deleteAndZero (outputDevice); | |||
| } | |||
| bool initialise() | |||
| @@ -251458,7 +251439,8 @@ public: | |||
| } | |||
| else | |||
| { | |||
| WASAPIDeviceBase* const d = inputDevice != 0 ? (WASAPIDeviceBase*) inputDevice : (WASAPIDeviceBase*) outputDevice; | |||
| WASAPIDeviceBase* d = inputDevice != 0 ? static_cast<WASAPIDeviceBase*> (inputDevice) | |||
| : static_cast<WASAPIDeviceBase*> (outputDevice); | |||
| defaultSampleRate = d->defaultSampleRate; | |||
| minBufferSize = d->minBufferSize; | |||
| defaultBufferSize = d->defaultBufferSize; | |||
| @@ -251551,6 +251533,7 @@ public: | |||
| if (inputDevice != 0) | |||
| ResetEvent (inputDevice->clientEvent); | |||
| if (outputDevice != 0) | |||
| ResetEvent (outputDevice->clientEvent); | |||
| @@ -251722,8 +251705,8 @@ public: | |||
| private: | |||
| // Device stats... | |||
| WASAPIInputDevice* inputDevice; | |||
| WASAPIOutputDevice* outputDevice; | |||
| ScopedPointer<WASAPIInputDevice> inputDevice; | |||
| ScopedPointer<WASAPIOutputDevice> outputDevice; | |||
| const bool useExclusiveMode; | |||
| double defaultSampleRate; | |||
| int minBufferSize, defaultBufferSize; | |||
| @@ -253747,9 +253730,9 @@ struct NamedPipeInternal | |||
| void NamedPipe::cancelPendingReads() | |||
| { | |||
| while (internal != 0 && ((NamedPipeInternal*) internal)->blocked) | |||
| while (internal != 0 && static_cast <NamedPipeInternal*> (internal)->blocked) | |||
| { | |||
| NamedPipeInternal* const intern = (NamedPipeInternal*) internal; | |||
| NamedPipeInternal* const intern = static_cast <NamedPipeInternal*> (internal); | |||
| intern->stopReadOperation = true; | |||
| @@ -253767,7 +253750,7 @@ void NamedPipe::cancelPendingReads() | |||
| void NamedPipe::close() | |||
| { | |||
| NamedPipeInternal* const intern = (NamedPipeInternal*) internal; | |||
| NamedPipeInternal* const intern = static_cast <NamedPipeInternal*> (internal); | |||
| if (intern != 0) | |||
| { | |||
| @@ -253827,7 +253810,7 @@ bool NamedPipe::openInternal (const String& pipeName, const bool createPipe) | |||
| int NamedPipe::read (void* destBuffer, int maxBytesToRead, int /*timeOutMilliseconds*/) | |||
| { | |||
| int bytesRead = -1; | |||
| NamedPipeInternal* const intern = (NamedPipeInternal*) internal; | |||
| NamedPipeInternal* const intern = static_cast <NamedPipeInternal*> (internal); | |||
| if (intern != 0) | |||
| { | |||
| @@ -253875,7 +253858,7 @@ int NamedPipe::read (void* destBuffer, int maxBytesToRead, int /*timeOutMillisec | |||
| int NamedPipe::write (const void* sourceBuffer, int numBytesToWrite, int timeOutMilliseconds) | |||
| { | |||
| int bytesWritten = -1; | |||
| NamedPipeInternal* const intern = (NamedPipeInternal*) internal; | |||
| NamedPipeInternal* const intern = static_cast <NamedPipeInternal*> (internal); | |||
| if (intern != 0) | |||
| { | |||
| @@ -261104,8 +261087,7 @@ MidiOutput* MidiOutput::createNewDevice (const String& deviceName) | |||
| MidiOutput::~MidiOutput() | |||
| { | |||
| MidiOutputDevice* const device = (MidiOutputDevice*) internal; | |||
| delete device; | |||
| delete static_cast <MidiOutputDevice*> (internal); | |||
| } | |||
| void MidiOutput::reset() | |||
| @@ -261123,7 +261105,7 @@ void MidiOutput::setVolume (float leftVol, float rightVol) | |||
| void MidiOutput::sendMessageNow (const MidiMessage& message) | |||
| { | |||
| ((MidiOutputDevice*) internal)->sendMessageNow (message); | |||
| static_cast <MidiOutputDevice*> (internal)->sendMessageNow (message); | |||
| } | |||
| class MidiInputThread : public Thread | |||
| @@ -261215,18 +261197,17 @@ MidiInput::MidiInput (const String& name_) | |||
| MidiInput::~MidiInput() | |||
| { | |||
| stop(); | |||
| MidiInputThread* const thread = (MidiInputThread*) internal; | |||
| delete thread; | |||
| delete static_cast <MidiInputThread*> (internal); | |||
| } | |||
| void MidiInput::start() | |||
| { | |||
| ((MidiInputThread*) internal)->startThread(); | |||
| static_cast <MidiInputThread*> (internal)->startThread(); | |||
| } | |||
| void MidiInput::stop() | |||
| { | |||
| ((MidiInputThread*) internal)->stopThread (3000); | |||
| static_cast <MidiInputThread*> (internal)->stopThread (3000); | |||
| } | |||
| int MidiInput::getDefaultDeviceIndex() | |||
| @@ -262399,9 +262380,9 @@ struct NamedPipeInternal | |||
| void NamedPipe::cancelPendingReads() | |||
| { | |||
| while (internal != 0 && ((NamedPipeInternal*) internal)->blocked) | |||
| while (internal != 0 && static_cast <NamedPipeInternal*> (internal)->blocked) | |||
| { | |||
| NamedPipeInternal* const intern = (NamedPipeInternal*) internal; | |||
| NamedPipeInternal* const intern = static_cast <NamedPipeInternal*> (internal); | |||
| intern->stopReadOperation = true; | |||
| @@ -262419,7 +262400,7 @@ void NamedPipe::cancelPendingReads() | |||
| void NamedPipe::close() | |||
| { | |||
| NamedPipeInternal* const intern = (NamedPipeInternal*) internal; | |||
| NamedPipeInternal* const intern = static_cast <NamedPipeInternal*> (internal); | |||
| if (intern != 0) | |||
| { | |||
| @@ -262479,7 +262460,7 @@ bool NamedPipe::openInternal (const String& pipeName, const bool createPipe) | |||
| int NamedPipe::read (void* destBuffer, int maxBytesToRead, int /*timeOutMilliseconds*/) | |||
| { | |||
| int bytesRead = -1; | |||
| NamedPipeInternal* const intern = (NamedPipeInternal*) internal; | |||
| NamedPipeInternal* const intern = static_cast <NamedPipeInternal*> (internal); | |||
| if (intern != 0) | |||
| { | |||
| @@ -262527,7 +262508,7 @@ int NamedPipe::read (void* destBuffer, int maxBytesToRead, int /*timeOutMillisec | |||
| int NamedPipe::write (const void* sourceBuffer, int numBytesToWrite, int timeOutMilliseconds) | |||
| { | |||
| int bytesWritten = -1; | |||
| NamedPipeInternal* const intern = (NamedPipeInternal*) internal; | |||
| NamedPipeInternal* const intern = static_cast <NamedPipeInternal*> (internal); | |||
| if (intern != 0) | |||
| { | |||
| @@ -268369,7 +268350,7 @@ MidiOutput* MidiOutput::createNewDevice (const String& deviceName) | |||
| MidiOutput::~MidiOutput() | |||
| { | |||
| delete (MidiPortAndEndpoint*) internal; | |||
| delete static_cast<MidiPortAndEndpoint*> (internal); | |||
| } | |||
| void MidiOutput::reset() | |||
| @@ -268387,7 +268368,7 @@ void MidiOutput::setVolume (float /*leftVol*/, float /*rightVol*/) | |||
| void MidiOutput::sendMessageNow (const MidiMessage& message) | |||
| { | |||
| MidiPortAndEndpoint* const mpe = (MidiPortAndEndpoint*) internal; | |||
| MidiPortAndEndpoint* const mpe = static_cast<MidiPortAndEndpoint*> (internal); | |||
| if (message.isSysEx()) | |||
| { | |||
| @@ -268678,7 +268659,7 @@ MidiInput::MidiInput (const String& name_) | |||
| MidiInput::~MidiInput() | |||
| { | |||
| MidiPortAndCallback* const mpc = (MidiPortAndCallback*) internal; | |||
| MidiPortAndCallback* const mpc = static_cast<MidiPortAndCallback*> (internal); | |||
| mpc->active = false; | |||
| { | |||
| @@ -268696,13 +268677,13 @@ MidiInput::~MidiInput() | |||
| void MidiInput::start() | |||
| { | |||
| const ScopedLock sl (CoreMidiCallbacks::callbackLock); | |||
| ((MidiPortAndCallback*) internal)->active = true; | |||
| static_cast<MidiPortAndCallback*> (internal)->active = true; | |||
| } | |||
| void MidiInput::stop() | |||
| { | |||
| const ScopedLock sl (CoreMidiCallbacks::callbackLock); | |||
| ((MidiPortAndCallback*) internal)->active = false; | |||
| static_cast<MidiPortAndCallback*> (internal)->active = false; | |||
| } | |||
| #undef log | |||
| @@ -276825,7 +276806,7 @@ MidiOutput* MidiOutput::createNewDevice (const String& deviceName) | |||
| MidiOutput::~MidiOutput() | |||
| { | |||
| delete (MidiPortAndEndpoint*) internal; | |||
| delete static_cast<MidiPortAndEndpoint*> (internal); | |||
| } | |||
| void MidiOutput::reset() | |||
| @@ -276843,7 +276824,7 @@ void MidiOutput::setVolume (float /*leftVol*/, float /*rightVol*/) | |||
| void MidiOutput::sendMessageNow (const MidiMessage& message) | |||
| { | |||
| MidiPortAndEndpoint* const mpe = (MidiPortAndEndpoint*) internal; | |||
| MidiPortAndEndpoint* const mpe = static_cast<MidiPortAndEndpoint*> (internal); | |||
| if (message.isSysEx()) | |||
| { | |||
| @@ -277134,7 +277115,7 @@ MidiInput::MidiInput (const String& name_) | |||
| MidiInput::~MidiInput() | |||
| { | |||
| MidiPortAndCallback* const mpc = (MidiPortAndCallback*) internal; | |||
| MidiPortAndCallback* const mpc = static_cast<MidiPortAndCallback*> (internal); | |||
| mpc->active = false; | |||
| { | |||
| @@ -277152,13 +277133,13 @@ MidiInput::~MidiInput() | |||
| void MidiInput::start() | |||
| { | |||
| const ScopedLock sl (CoreMidiCallbacks::callbackLock); | |||
| ((MidiPortAndCallback*) internal)->active = true; | |||
| static_cast<MidiPortAndCallback*> (internal)->active = true; | |||
| } | |||
| void MidiInput::stop() | |||
| { | |||
| const ScopedLock sl (CoreMidiCallbacks::callbackLock); | |||
| ((MidiPortAndCallback*) internal)->active = false; | |||
| static_cast<MidiPortAndCallback*> (internal)->active = false; | |||
| } | |||
| #undef log | |||
| @@ -27298,6 +27298,9 @@ public: | |||
| /** Returns the component that this pointer refers to, or null if the component no longer exists. */ | |||
| const ComponentType* operator->() const throw() { jassert (comp != 0); return comp; } | |||
| /** If the component is valid, this deletes it and sets this pointer to null. */ | |||
| void deleteAndZero() { delete comp; jassert (comp == 0); } | |||
| juce_UseDebuggingNewOperator | |||
| private: | |||
| @@ -50521,7 +50524,7 @@ private: | |||
| class ContentComponent : public Component | |||
| { | |||
| public: | |||
| ContentComponent(); | |||
| ContentComponent (const String& name, const String& instructions, FileBrowserComponent& chooserComponent); | |||
| ~ContentComponent(); | |||
| void paint (Graphics& g); | |||
| @@ -50530,10 +50533,8 @@ private: | |||
| String instructions; | |||
| GlyphArrangement text; | |||
| FileBrowserComponent* chooserComponent; | |||
| FilePreviewComponent* previewComponent; | |||
| TextButton* okButton; | |||
| TextButton* cancelButton; | |||
| FileBrowserComponent& chooserComponent; | |||
| TextButton okButton, cancelButton; | |||
| }; | |||
| ContentComponent* content; | |||
| @@ -52830,7 +52831,7 @@ public: | |||
| private: | |||
| LayoutMode mode; | |||
| Array <Component*> components; | |||
| TabbedComponent* tabComponent; | |||
| ScopedPointer<TabbedComponent> tabComponent; | |||
| Colour backgroundColour; | |||
| int maximumNumDocuments, numDocsBeforeTabsUsed; | |||
| @@ -33,7 +33,7 @@ | |||
| */ | |||
| #define JUCE_MAJOR_VERSION 1 | |||
| #define JUCE_MINOR_VERSION 52 | |||
| #define JUCE_BUILDNUMBER 48 | |||
| #define JUCE_BUILDNUMBER 49 | |||
| /** Current Juce version number. | |||
| @@ -42,35 +42,19 @@ FileChooserDialogBox::FileChooserDialogBox (const String& name, | |||
| : ResizableWindow (name, backgroundColour, true), | |||
| warnAboutOverwritingExistingFiles (warnAboutOverwritingExistingFiles_) | |||
| { | |||
| content = new ContentComponent(); | |||
| content->setName (name); | |||
| content->instructions = instructions; | |||
| content->chooserComponent = &chooserComponent; | |||
| content->addAndMakeVisible (&chooserComponent); | |||
| content->okButton = new TextButton (chooserComponent.getActionVerb()); | |||
| content->addAndMakeVisible (content->okButton); | |||
| content->okButton->addButtonListener (this); | |||
| content->okButton->setEnabled (chooserComponent.currentFileIsValid()); | |||
| content->okButton->addShortcut (KeyPress (KeyPress::returnKey, 0, 0)); | |||
| content->cancelButton = new TextButton (TRANS("Cancel")); | |||
| content->addAndMakeVisible (content->cancelButton); | |||
| content->cancelButton->addButtonListener (this); | |||
| content->cancelButton->addShortcut (KeyPress (KeyPress::escapeKey, 0, 0)); | |||
| setContentComponent (content); | |||
| setContentComponent (content = new ContentComponent (name, instructions, chooserComponent)); | |||
| setResizable (true, true); | |||
| setResizeLimits (300, 300, 1200, 1000); | |||
| content->chooserComponent->addListener (this); | |||
| content->okButton.addButtonListener (this); | |||
| content->cancelButton.addButtonListener (this); | |||
| content->chooserComponent.addListener (this); | |||
| } | |||
| FileChooserDialogBox::~FileChooserDialogBox() | |||
| { | |||
| content->chooserComponent->removeListener (this); | |||
| content->chooserComponent.removeListener (this); | |||
| } | |||
| //============================================================================== | |||
| @@ -83,7 +67,7 @@ bool FileChooserDialogBox::showAt (int x, int y, int w, int h) | |||
| { | |||
| if (w <= 0) | |||
| { | |||
| Component* const previewComp = content->chooserComponent->getPreviewComponent(); | |||
| Component* const previewComp = content->chooserComponent.getPreviewComponent(); | |||
| if (previewComp != 0) | |||
| w = 400 + previewComp->getWidth(); | |||
| else | |||
| @@ -106,16 +90,16 @@ bool FileChooserDialogBox::showAt (int x, int y, int w, int h) | |||
| //============================================================================== | |||
| void FileChooserDialogBox::buttonClicked (Button* button) | |||
| { | |||
| if (button == content->okButton) | |||
| if (button == &(content->okButton)) | |||
| { | |||
| if (warnAboutOverwritingExistingFiles | |||
| && content->chooserComponent->isSaveMode() | |||
| && content->chooserComponent->getSelectedFile(0).exists()) | |||
| && content->chooserComponent.isSaveMode() | |||
| && content->chooserComponent.getSelectedFile(0).exists()) | |||
| { | |||
| if (! AlertWindow::showOkCancelBox (AlertWindow::WarningIcon, | |||
| TRANS("File already exists"), | |||
| TRANS("There's already a file called:") | |||
| + "\n\n" + content->chooserComponent->getSelectedFile(0).getFullPathName() | |||
| + "\n\n" + content->chooserComponent.getSelectedFile(0).getFullPathName() | |||
| + "\n\n" + TRANS("Are you sure you want to overwrite it?"), | |||
| TRANS("overwrite"), | |||
| TRANS("cancel"))) | |||
| @@ -126,8 +110,10 @@ void FileChooserDialogBox::buttonClicked (Button* button) | |||
| exitModalState (1); | |||
| } | |||
| else if (button == content->cancelButton) | |||
| else if (button == &(content->cancelButton)) | |||
| { | |||
| closeButtonPressed(); | |||
| } | |||
| } | |||
| void FileChooserDialogBox::closeButtonPressed() | |||
| @@ -137,7 +123,7 @@ void FileChooserDialogBox::closeButtonPressed() | |||
| void FileChooserDialogBox::selectionChanged() | |||
| { | |||
| content->okButton->setEnabled (content->chooserComponent->currentFileIsValid()); | |||
| content->okButton.setEnabled (content->chooserComponent.currentFileIsValid()); | |||
| } | |||
| void FileChooserDialogBox::fileClicked (const File&, const MouseEvent&) | |||
| @@ -147,19 +133,30 @@ void FileChooserDialogBox::fileClicked (const File&, const MouseEvent&) | |||
| void FileChooserDialogBox::fileDoubleClicked (const File&) | |||
| { | |||
| selectionChanged(); | |||
| content->okButton->triggerClick(); | |||
| content->okButton.triggerClick(); | |||
| } | |||
| //============================================================================== | |||
| FileChooserDialogBox::ContentComponent::ContentComponent() | |||
| FileChooserDialogBox::ContentComponent::ContentComponent (const String& name, const String& instructions_, FileBrowserComponent& chooserComponent_) | |||
| : Component (name), instructions (instructions_), | |||
| chooserComponent (chooserComponent_), | |||
| okButton (chooserComponent_.getActionVerb()), | |||
| cancelButton (TRANS ("Cancel")) | |||
| { | |||
| addAndMakeVisible (&chooserComponent); | |||
| addAndMakeVisible (&okButton); | |||
| okButton.setEnabled (chooserComponent.currentFileIsValid()); | |||
| okButton.addShortcut (KeyPress (KeyPress::returnKey, 0, 0)); | |||
| addAndMakeVisible (&cancelButton); | |||
| cancelButton.addShortcut (KeyPress (KeyPress::escapeKey, 0, 0)); | |||
| setInterceptsMouseClicks (false, true); | |||
| } | |||
| FileChooserDialogBox::ContentComponent::~ContentComponent() | |||
| { | |||
| delete okButton; | |||
| delete cancelButton; | |||
| } | |||
| void FileChooserDialogBox::ContentComponent::paint (Graphics& g) | |||
| @@ -178,13 +175,13 @@ void FileChooserDialogBox::ContentComponent::resized() | |||
| const int buttonHeight = 26; | |||
| const int buttonY = getHeight() - buttonHeight - 8; | |||
| chooserComponent->setBounds (0, y, getWidth(), buttonY - y - 20); | |||
| chooserComponent.setBounds (0, y, getWidth(), buttonY - y - 20); | |||
| okButton->setBounds (proportionOfWidth (0.25f), buttonY, | |||
| proportionOfWidth (0.2f), buttonHeight); | |||
| okButton.setBounds (proportionOfWidth (0.25f), buttonY, | |||
| proportionOfWidth (0.2f), buttonHeight); | |||
| cancelButton->setBounds (proportionOfWidth (0.55f), buttonY, | |||
| proportionOfWidth (0.2f), buttonHeight); | |||
| cancelButton.setBounds (proportionOfWidth (0.55f), buttonY, | |||
| proportionOfWidth (0.2f), buttonHeight); | |||
| } | |||
| @@ -145,7 +145,7 @@ private: | |||
| class ContentComponent : public Component | |||
| { | |||
| public: | |||
| ContentComponent(); | |||
| ContentComponent (const String& name, const String& instructions, FileBrowserComponent& chooserComponent); | |||
| ~ContentComponent(); | |||
| void paint (Graphics& g); | |||
| @@ -154,10 +154,8 @@ private: | |||
| String instructions; | |||
| GlyphArrangement text; | |||
| FileBrowserComponent* chooserComponent; | |||
| FilePreviewComponent* previewComponent; | |||
| TextButton* okButton; | |||
| TextButton* cancelButton; | |||
| FileBrowserComponent& chooserComponent; | |||
| TextButton okButton, cancelButton; | |||
| }; | |||
| ContentComponent* content; | |||
| @@ -1978,6 +1978,9 @@ public: | |||
| /** Returns the component that this pointer refers to, or null if the component no longer exists. */ | |||
| const ComponentType* operator->() const throw() { jassert (comp != 0); return comp; } | |||
| /** If the component is valid, this deletes it and sets this pointer to null. */ | |||
| void deleteAndZero() { delete comp; jassert (comp == 0); } | |||
| //============================================================================== | |||
| juce_UseDebuggingNewOperator | |||
| @@ -115,7 +115,6 @@ public: | |||
| //============================================================================== | |||
| MultiDocumentPanel::MultiDocumentPanel() | |||
| : mode (MaximisedWindowsWithTabs), | |||
| tabComponent (0), | |||
| backgroundColour (Colours::lightblue), | |||
| maximumNumDocuments (0), | |||
| numDocsBeforeTabsUsed (0) | |||
| @@ -309,7 +308,7 @@ bool MultiDocumentPanel::closeDocument (Component* component, | |||
| delete component; | |||
| if (tabComponent != 0 && tabComponent->getNumTabs() <= numDocsBeforeTabsUsed) | |||
| deleteAndZero (tabComponent); | |||
| tabComponent = 0; | |||
| components.removeValue (component); | |||
| @@ -410,7 +409,7 @@ void MultiDocumentPanel::setLayoutMode (const LayoutMode newLayoutMode) | |||
| if (mode == FloatingWindows) | |||
| { | |||
| deleteAndZero (tabComponent); | |||
| tabComponent = 0; | |||
| } | |||
| else | |||
| { | |||
| @@ -290,7 +290,7 @@ public: | |||
| private: | |||
| LayoutMode mode; | |||
| Array <Component*> components; | |||
| TabbedComponent* tabComponent; | |||
| ScopedPointer<TabbedComponent> tabComponent; | |||
| Colour backgroundColour; | |||
| int maximumNumDocuments, numDocsBeforeTabsUsed; | |||
| @@ -78,8 +78,7 @@ ResizableWindow::~ResizableWindow() | |||
| { | |||
| resizableCorner = 0; | |||
| resizableBorder = 0; | |||
| delete static_cast <Component*> (contentComponent); | |||
| contentComponent = 0; | |||
| contentComponent.deleteAndZero(); | |||
| // have you been adding your own components directly to this window..? tut tut tut. | |||
| // Read the instructions for using a ResizableWindow! | |||
| @@ -106,8 +105,8 @@ void ResizableWindow::setContentComponent (Component* const newContentComponent, | |||
| if (newContentComponent != static_cast <Component*> (contentComponent)) | |||
| { | |||
| if (deleteOldOne) | |||
| delete static_cast <Component*> (contentComponent); // (avoid using a scoped pointer for this, so that it survives | |||
| // external deletion of the content comp) | |||
| contentComponent.deleteAndZero(); // (avoid using a scoped pointer for this, so that it survives | |||
| // external deletion of the content comp) | |||
| else | |||
| removeChildComponent (contentComponent); | |||
| @@ -830,12 +830,12 @@ private: | |||
| Path path; | |||
| Drawable* s = parseShape (*e, path); | |||
| delete s; | |||
| delete s; // xxx not finished! | |||
| } | |||
| else if (e->hasTagName ("tspan")) | |||
| { | |||
| Drawable* s = parseText (*e); | |||
| delete s; | |||
| delete s; // xxx not finished! | |||
| } | |||
| } | |||
| @@ -546,7 +546,7 @@ DatagramSocket::~DatagramSocket() | |||
| { | |||
| close(); | |||
| delete ((struct sockaddr_in*) serverAddress); | |||
| delete static_cast <struct sockaddr_in*> (serverAddress); | |||
| serverAddress = 0; | |||
| } | |||
| @@ -40,9 +40,9 @@ struct NamedPipeInternal | |||
| void NamedPipe::cancelPendingReads() | |||
| { | |||
| while (internal != 0 && ((NamedPipeInternal*) internal)->blocked) | |||
| while (internal != 0 && static_cast <NamedPipeInternal*> (internal)->blocked) | |||
| { | |||
| NamedPipeInternal* const intern = (NamedPipeInternal*) internal; | |||
| NamedPipeInternal* const intern = static_cast <NamedPipeInternal*> (internal); | |||
| intern->stopReadOperation = true; | |||
| @@ -60,7 +60,7 @@ void NamedPipe::cancelPendingReads() | |||
| void NamedPipe::close() | |||
| { | |||
| NamedPipeInternal* const intern = (NamedPipeInternal*) internal; | |||
| NamedPipeInternal* const intern = static_cast <NamedPipeInternal*> (internal); | |||
| if (intern != 0) | |||
| { | |||
| @@ -120,7 +120,7 @@ bool NamedPipe::openInternal (const String& pipeName, const bool createPipe) | |||
| int NamedPipe::read (void* destBuffer, int maxBytesToRead, int /*timeOutMilliseconds*/) | |||
| { | |||
| int bytesRead = -1; | |||
| NamedPipeInternal* const intern = (NamedPipeInternal*) internal; | |||
| NamedPipeInternal* const intern = static_cast <NamedPipeInternal*> (internal); | |||
| if (intern != 0) | |||
| { | |||
| @@ -168,7 +168,7 @@ int NamedPipe::read (void* destBuffer, int maxBytesToRead, int /*timeOutMillisec | |||
| int NamedPipe::write (const void* sourceBuffer, int numBytesToWrite, int timeOutMilliseconds) | |||
| { | |||
| int bytesWritten = -1; | |||
| NamedPipeInternal* const intern = (NamedPipeInternal*) internal; | |||
| NamedPipeInternal* const intern = static_cast <NamedPipeInternal*> (internal); | |||
| if (intern != 0) | |||
| { | |||
| @@ -250,8 +250,7 @@ MidiOutput* MidiOutput::createNewDevice (const String& deviceName) | |||
| MidiOutput::~MidiOutput() | |||
| { | |||
| MidiOutputDevice* const device = (MidiOutputDevice*) internal; | |||
| delete device; | |||
| delete static_cast <MidiOutputDevice*> (internal); | |||
| } | |||
| void MidiOutput::reset() | |||
| @@ -269,7 +268,7 @@ void MidiOutput::setVolume (float leftVol, float rightVol) | |||
| void MidiOutput::sendMessageNow (const MidiMessage& message) | |||
| { | |||
| ((MidiOutputDevice*) internal)->sendMessageNow (message); | |||
| static_cast <MidiOutputDevice*> (internal)->sendMessageNow (message); | |||
| } | |||
| @@ -365,18 +364,17 @@ MidiInput::MidiInput (const String& name_) | |||
| MidiInput::~MidiInput() | |||
| { | |||
| stop(); | |||
| MidiInputThread* const thread = (MidiInputThread*) internal; | |||
| delete thread; | |||
| delete static_cast <MidiInputThread*> (internal); | |||
| } | |||
| void MidiInput::start() | |||
| { | |||
| ((MidiInputThread*) internal)->startThread(); | |||
| static_cast <MidiInputThread*> (internal)->startThread(); | |||
| } | |||
| void MidiInput::stop() | |||
| { | |||
| ((MidiInputThread*) internal)->stopThread (3000); | |||
| static_cast <MidiInputThread*> (internal)->stopThread (3000); | |||
| } | |||
| int MidiInput::getDefaultDeviceIndex() | |||
| @@ -308,7 +308,7 @@ MidiOutput* MidiOutput::createNewDevice (const String& deviceName) | |||
| MidiOutput::~MidiOutput() | |||
| { | |||
| delete (MidiPortAndEndpoint*) internal; | |||
| delete static_cast<MidiPortAndEndpoint*> (internal); | |||
| } | |||
| void MidiOutput::reset() | |||
| @@ -326,7 +326,7 @@ void MidiOutput::setVolume (float /*leftVol*/, float /*rightVol*/) | |||
| void MidiOutput::sendMessageNow (const MidiMessage& message) | |||
| { | |||
| MidiPortAndEndpoint* const mpe = (MidiPortAndEndpoint*) internal; | |||
| MidiPortAndEndpoint* const mpe = static_cast<MidiPortAndEndpoint*> (internal); | |||
| if (message.isSysEx()) | |||
| { | |||
| @@ -619,7 +619,7 @@ MidiInput::MidiInput (const String& name_) | |||
| MidiInput::~MidiInput() | |||
| { | |||
| MidiPortAndCallback* const mpc = (MidiPortAndCallback*) internal; | |||
| MidiPortAndCallback* const mpc = static_cast<MidiPortAndCallback*> (internal); | |||
| mpc->active = false; | |||
| { | |||
| @@ -637,13 +637,13 @@ MidiInput::~MidiInput() | |||
| void MidiInput::start() | |||
| { | |||
| const ScopedLock sl (CoreMidiCallbacks::callbackLock); | |||
| ((MidiPortAndCallback*) internal)->active = true; | |||
| static_cast<MidiPortAndCallback*> (internal)->active = true; | |||
| } | |||
| void MidiInput::stop() | |||
| { | |||
| const ScopedLock sl (CoreMidiCallbacks::callbackLock); | |||
| ((MidiPortAndCallback*) internal)->active = false; | |||
| static_cast<MidiPortAndCallback*> (internal)->active = false; | |||
| } | |||
| #undef log | |||
| @@ -81,7 +81,6 @@ public: | |||
| HGLRC contextToShareWith, | |||
| const OpenGLPixelFormat& pixelFormat) | |||
| : renderContext (0), | |||
| nativeWindow (0), | |||
| dc (0), | |||
| component (component_) | |||
| { | |||
| @@ -117,7 +116,7 @@ public: | |||
| { | |||
| deleteContext(); | |||
| ReleaseDC ((HWND) nativeWindow->getNativeHandle(), dc); | |||
| delete nativeWindow; | |||
| nativeWindow = 0; | |||
| } | |||
| void deleteContext() | |||
| @@ -270,7 +269,7 @@ public: | |||
| // old one and create a new one.. | |||
| jassert (nativeWindow != 0); | |||
| ReleaseDC ((HWND) nativeWindow->getNativeHandle(), dc); | |||
| delete nativeWindow; | |||
| nativeWindow = 0; | |||
| createNativeWindow(); | |||
| @@ -385,7 +384,7 @@ public: | |||
| HGLRC renderContext; | |||
| private: | |||
| Win32ComponentPeer* nativeWindow; | |||
| ScopedPointer<Win32ComponentPeer> nativeWindow; | |||
| Component* const component; | |||
| HDC dc; | |||
| @@ -584,9 +584,7 @@ public: | |||
| Thread ("Juce WASAPI"), | |||
| isOpen_ (false), | |||
| isStarted (false), | |||
| outputDevice (0), | |||
| outputDeviceId (outputDeviceId_), | |||
| inputDevice (0), | |||
| inputDeviceId (inputDeviceId_), | |||
| useExclusiveMode (useExclusiveMode_), | |||
| currentBufferSizeSamples (0), | |||
| @@ -598,9 +596,6 @@ public: | |||
| ~WASAPIAudioIODevice() | |||
| { | |||
| close(); | |||
| deleteAndZero (inputDevice); | |||
| deleteAndZero (outputDevice); | |||
| } | |||
| bool initialise() | |||
| @@ -624,7 +619,8 @@ public: | |||
| } | |||
| else | |||
| { | |||
| WASAPIDeviceBase* const d = inputDevice != 0 ? (WASAPIDeviceBase*) inputDevice : (WASAPIDeviceBase*) outputDevice; | |||
| WASAPIDeviceBase* d = inputDevice != 0 ? static_cast<WASAPIDeviceBase*> (inputDevice) | |||
| : static_cast<WASAPIDeviceBase*> (outputDevice); | |||
| defaultSampleRate = d->defaultSampleRate; | |||
| minBufferSize = d->minBufferSize; | |||
| defaultBufferSize = d->defaultBufferSize; | |||
| @@ -718,6 +714,7 @@ public: | |||
| if (inputDevice != 0) | |||
| ResetEvent (inputDevice->clientEvent); | |||
| if (outputDevice != 0) | |||
| ResetEvent (outputDevice->clientEvent); | |||
| @@ -891,8 +888,8 @@ public: | |||
| private: | |||
| // Device stats... | |||
| WASAPIInputDevice* inputDevice; | |||
| WASAPIOutputDevice* outputDevice; | |||
| ScopedPointer<WASAPIInputDevice> inputDevice; | |||
| ScopedPointer<WASAPIOutputDevice> outputDevice; | |||
| const bool useExclusiveMode; | |||
| double defaultSampleRate; | |||
| int minBufferSize, defaultBufferSize; | |||
| @@ -392,7 +392,6 @@ public: | |||
| isMouseOver (false), | |||
| hasCreatedCaret (false), | |||
| currentWindowIcon (0), | |||
| taskBarIcon (0), | |||
| dropTarget (0) | |||
| { | |||
| callFunctionIfNotLocked (&createWindowCallback, this); | |||
| @@ -407,16 +406,12 @@ public: | |||
| if (shadower != 0) | |||
| shadower->setOwner (component); | |||
| } | |||
| else | |||
| { | |||
| shadower = 0; | |||
| } | |||
| } | |||
| ~Win32ComponentPeer() | |||
| { | |||
| setTaskBarIcon (Image()); | |||
| deleteAndZero (shadower); | |||
| shadower = 0; | |||
| // do this before the next bit to avoid messages arriving for this window | |||
| // before it's destroyed | |||
| @@ -779,7 +774,7 @@ public: | |||
| taskBarIcon->uFlags = 0; | |||
| Shell_NotifyIcon (NIM_DELETE, taskBarIcon); | |||
| DestroyIcon (taskBarIcon->hIcon); | |||
| deleteAndZero (taskBarIcon); | |||
| taskBarIcon = 0; | |||
| } | |||
| } | |||
| @@ -846,11 +841,11 @@ public: | |||
| private: | |||
| HWND hwnd; | |||
| DropShadower* shadower; | |||
| ScopedPointer<DropShadower> shadower; | |||
| bool fullScreen, isDragging, isMouseOver, hasCreatedCaret; | |||
| BorderSize windowBorder; | |||
| HICON currentWindowIcon; | |||
| NOTIFYICONDATA* taskBarIcon; | |||
| ScopedPointer<NOTIFYICONDATA> taskBarIcon; | |||
| IDropTarget* dropTarget; | |||
| //============================================================================== | |||