1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Fix for subtle win32 mouse-button issue. Minor bwav fix.

This commit is contained in:
Julian Storer 2011-09-13 18:12:24 +01:00
parent dce7cd9cd1
commit 9332efc10d
4 changed files with 24 additions and 21 deletions

View file

@ -1083,10 +1083,14 @@ bool WavAudioFormat::replaceMetadataInFile (const File& wavFile, const StringPai
const int64 oldSize = wavFile.getSize();
{
ScopedPointer <FileOutputStream> out (wavFile.createOutputStream());
out->setPosition (bwavPos);
*out << chunk;
out->setPosition (oldSize);
FileOutputStream out (wavFile);
if (! out.failedToOpen())
{
out.setPosition (bwavPos);
out << chunk;
out.setPosition (oldSize);
}
}
jassert (wavFile.getSize() == oldSize);

View file

@ -52,7 +52,6 @@
if (out != nullptr)
{
out->write ( ...etc )
out->flush();
out = nullptr; // (deletes the stream)
// ..now we've finished writing, this will rename the temp file to

View file

@ -214,11 +214,11 @@ public:
{
GZIPCompressorOutputStream zipper (&compressed, rng.nextInt (10), false);
for (int j = rng.nextInt (100); --j >= 0;)
{
MemoryBlock data (rng.nextInt (2000) + 1);
for (int k = data.getSize(); --k >= 0;)
data[k] = (char) rng.nextInt (255);
@ -233,10 +233,10 @@ public:
uncompressed.writeFromInputStream (unzipper, -1);
}
expectEquals ((int) uncompressed.getDataSize(),
(int) original.getDataSize());
if (original.getDataSize() == uncompressed.getDataSize())
expect (memcmp (uncompressed.getData(),
original.getData(),

View file

@ -144,7 +144,6 @@ const int KeyPress::rewindKey = 0x30003;
class WindowsBitmapImage : public Image::SharedImage
{
public:
//==============================================================================
WindowsBitmapImage (const Image::PixelFormat format_,
const int w, const int h, const bool clearImage)
: Image::SharedImage (format_, w, h)
@ -155,24 +154,24 @@ public:
lineStride = -((w * pixelStride + 3) & ~3);
zerostruct (bitmapInfo);
bitmapInfo.bV4Size = sizeof (BITMAPV4HEADER);
bitmapInfo.bV4Width = w;
bitmapInfo.bV4Height = h;
bitmapInfo.bV4Planes = 1;
bitmapInfo.bV4CSType = 1;
bitmapInfo.bV4Size = sizeof (BITMAPV4HEADER);
bitmapInfo.bV4Width = w;
bitmapInfo.bV4Height = h;
bitmapInfo.bV4Planes = 1;
bitmapInfo.bV4CSType = 1;
bitmapInfo.bV4BitCount = (unsigned short) (pixelStride * 8);
if (format_ == Image::ARGB)
{
bitmapInfo.bV4AlphaMask = 0xff000000;
bitmapInfo.bV4RedMask = 0xff0000;
bitmapInfo.bV4GreenMask = 0xff00;
bitmapInfo.bV4BlueMask = 0xff;
bitmapInfo.bV4V4Compression = BI_BITFIELDS;
bitmapInfo.bV4AlphaMask = 0xff000000;
bitmapInfo.bV4RedMask = 0xff0000;
bitmapInfo.bV4GreenMask = 0xff00;
bitmapInfo.bV4BlueMask = 0xff;
bitmapInfo.bV4V4Compression = BI_BITFIELDS;
}
else
{
bitmapInfo.bV4V4Compression = BI_RGB;
bitmapInfo.bV4V4Compression = BI_RGB;
}
HDC dc = GetDC (0);
@ -1379,6 +1378,7 @@ private:
if (! isMouseOver)
{
isMouseOver = true;
ModifierKeys::getCurrentModifiersRealtime(); // (This avoids a rare stuck-button problem when focus is lost unexpectedly)
updateKeyModifiers();
TRACKMOUSEEVENT tme;