1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-06 04:00:08 +00:00

Removed the (rather pointless) granularity value from the array objects. Converted a few macros into functions and other misc code clean-ups.

This commit is contained in:
Julian Storer 2010-01-13 18:58:40 +00:00
parent c368805559
commit 97035bb3a1
69 changed files with 218 additions and 369 deletions

View file

@ -1723,7 +1723,6 @@ class ASIOAudioIODeviceType : public AudioIODeviceType
public:
ASIOAudioIODeviceType()
: AudioIODeviceType (T("ASIO")),
classIds (2),
hasScanned (false)
{
CoInitialize (0);

View file

@ -171,7 +171,7 @@ public:
HRESULT __stdcall GetWindowContext (LPOLEINPLACEFRAME* lplpFrame, LPOLEINPLACEUIWINDOW* lplpDoc, LPRECT, LPRECT, LPOLEINPLACEFRAMEINFO lpFrameInfo)
{
frame->AddRef();
// frame->AddRef(); // MS docs are unclear about whether this is needed, but it seems to lead to a memory leak..
*lplpFrame = frame;
*lplpDoc = 0;
lpFrameInfo->fMDIApp = FALSE;

View file

@ -960,8 +960,6 @@ public:
isStarted (false),
outputDeviceIndex (outputDeviceIndex_),
inputDeviceIndex (inputDeviceIndex_),
inChans (4),
outChans (4),
numInputBuffers (0),
numOutputBuffers (0),
totalSamplesOut (0),

View file

@ -32,16 +32,16 @@
static const unsigned int specialId = WM_APP + 0x4400;
static const unsigned int broadcastId = WM_APP + 0x4403;
static const unsigned int specialCallbackId = WM_APP + 0x4402;
static const TCHAR* const messageWindowName = _T("JUCEWindow");
HWND juce_messageWindowHandle = 0;
extern long improbableWindowNumber; // defined in windowing.cpp
#ifndef WM_APPCOMMAND
#define WM_APPCOMMAND 0x0319
#endif
#ifndef WM_APPCOMMAND
#define WM_APPCOMMAND 0x0319
#endif
//==============================================================================

View file

@ -415,7 +415,7 @@ struct MidiOutHandle
juce_UseDebuggingNewOperator
};
static VoidArray handles (4);
static Array <MidiOutHandle*> midiOutputHandles;
//==============================================================================
const StringArray MidiOutput::getDevices()
@ -485,9 +485,9 @@ MidiOutput* MidiOutput::openDevice (int index)
}
}
for (i = handles.size(); --i >= 0;)
for (i = midiOutputHandles.size(); --i >= 0;)
{
MidiOutHandle* const han = (MidiOutHandle*) handles.getUnchecked(i);
MidiOutHandle* const han = midiOutputHandles.getUnchecked(i);
if (han != 0 && han->deviceId == deviceId)
{
@ -510,7 +510,7 @@ MidiOutput* MidiOutput::openDevice (int index)
han->deviceId = deviceId;
han->refCount = 1;
han->handle = h;
handles.add (han);
midiOutputHandles.add (han);
MidiOutput* const out = new MidiOutput();
out->internal = (void*) han;
@ -533,10 +533,10 @@ MidiOutput::~MidiOutput()
{
MidiOutHandle* const h = (MidiOutHandle*) internal;
if (handles.contains ((void*) h) && --(h->refCount) == 0)
if (midiOutputHandles.contains (h) && --(h->refCount) == 0)
{
midiOutClose (h->handle);
handles.removeValue ((void*) h);
midiOutputHandles.removeValue (h);
delete h;
}
}

View file

@ -72,7 +72,7 @@ static HKEY findKeyForPath (String name,
const String PlatformUtilities::getRegistryValue (const String& regValuePath,
const String& defaultValue)
{
String valueName, s;
String valueName, result (defaultValue);
HKEY k = findKeyForPath (regValuePath, false, valueName);
if (k != 0)
@ -82,14 +82,17 @@ const String PlatformUtilities::getRegistryValue (const String& regValuePath,
DWORD type = REG_SZ;
if (RegQueryValueEx (k, valueName, 0, &type, (LPBYTE) buffer, &bufferSize) == ERROR_SUCCESS)
s = buffer;
else
s = defaultValue;
{
if (type == REG_SZ)
result = buffer;
else if (type == REG_DWORD)
result = String ((int) *(DWORD*) buffer);
}
RegCloseKey (k);
}
return s;
return result;
}
void PlatformUtilities::setRegistryValue (const String& regValuePath,