Browse Source

small fixes to for problems in the amalgamated build with certain build flags.

tags/2021-05-28
jules 16 years ago
parent
commit
12a7489d32
7 changed files with 150 additions and 142 deletions
  1. +30
    -27
      extras/juce demo/src/binarydata/ThreadingDemo.cpp
  2. +3
    -1
      juce_amalgamated.cpp
  3. +101
    -101
      juce_amalgamated.h
  4. +9
    -9
      src/juce_app_includes.h
  5. +2
    -2
      src/juce_appframework/audio/audio_file_formats/juce_FlacAudioFormat.h
  6. +2
    -2
      src/juce_appframework/audio/audio_file_formats/juce_OggVorbisAudioFormat.h
  7. +3
    -0
      src/juce_appframework/gui/components/controls/juce_Slider.cpp

+ 30
- 27
extras/juce demo/src/binarydata/ThreadingDemo.cpp View File

@@ -33,13 +33,11 @@
//============================================================================== //==============================================================================
class BouncingBallComp : public Component,
public AsyncUpdater
class BouncingBallComp : public Component
{ {
float x, y, size, dx, dy, w, h, parentWidth, parentHeight; float x, y, size, dx, dy, w, h, parentWidth, parentHeight;
float innerX, innerY; float innerX, innerY;
Colour colour; Colour colour;
CriticalSection lock;
Thread::ThreadID threadId; Thread::ThreadID threadId;
public: public:
@@ -88,25 +86,8 @@ public:
parentHeight = getParentHeight() - size; parentHeight = getParentHeight() - size;
} }
void handleAsyncUpdate()
{
const ScopedLock sl (lock);
setBounds (((int) x) - 2,
((int) y) - 2,
((int) size) + 4,
((int) size) + 4);
innerX = x - getX();
innerY = y - getY();
repaint();
}
void moveBall() void moveBall()
{ {
const ScopedLock sl (lock);
threadId = Thread::getCurrentThreadId(); // this is so the component can print the thread ID inside the ball threadId = Thread::getCurrentThreadId(); // this is so the component can print the thread ID inside the ball
x += dx; x += dx;
@@ -124,10 +105,15 @@ public:
if (y > parentHeight) if (y > parentHeight)
dy = -fabsf (dy); dy = -fabsf (dy);
// this is called on a background thread, so we don't want to call
// any UI code from here - instead we'll trigger an event that will update
// the component's position later. This is a safe way to avoid deadlocks
triggerAsyncUpdate();
setBounds (((int) x) - 2,
((int) y) - 2,
((int) size) + 4,
((int) size) + 4);
innerX = x - getX();
innerY = y - getY();
repaint();
} }
juce_UseDebuggingNewOperator juce_UseDebuggingNewOperator
@@ -166,10 +152,18 @@ public:
// called, so we should check it often, and exit as soon as it gets flagged. // called, so we should check it often, and exit as soon as it gets flagged.
while (! threadShouldExit()) while (! threadShouldExit())
{ {
moveBall();
// sleep a bit so the threads don't all grind the CPU to a halt.. // sleep a bit so the threads don't all grind the CPU to a halt..
wait (interval); wait (interval);
// because this is a background thread, we mustn't do any UI work without
// first grabbing a MessageManagerLock..
const MessageManagerLock mml (Thread::getCurrentThread());
if (! mml.lockWasGained()) // if something is trying to kill this job, the lock
return; // will fail, in which case we'd better return..
// now we've got the UI thread locked, we can mess about with the components
moveBall();
} }
} }
@@ -196,9 +190,18 @@ public:
// this is the code that runs this job. It'll be repeatedly called until we return // this is the code that runs this job. It'll be repeatedly called until we return
// jobHasFinished instead of jobNeedsRunningAgain. // jobHasFinished instead of jobNeedsRunningAgain.
moveBall();
Thread::sleep (30); Thread::sleep (30);
// because this is a background thread, we mustn't do any UI work without
// first grabbing a MessageManagerLock..
const MessageManagerLock mml (this);
// before moving the ball, we need to check whether the lock was actually gained, because
// if something is trying to stop this job, it will have failed..
if (mml.lockWasGained())
moveBall();
return jobNeedsRunningAgain; return jobNeedsRunningAgain;
} }


+ 3
- 1
juce_amalgamated.cpp View File

@@ -37088,7 +37088,6 @@ MessageManagerLock::~MessageManagerLock() throw()
} }


END_JUCE_NAMESPACE END_JUCE_NAMESPACE

/********* End of inlined file: juce_MessageManager.cpp *********/ /********* End of inlined file: juce_MessageManager.cpp *********/


/********* Start of inlined file: juce_MultiTimer.cpp *********/ /********* Start of inlined file: juce_MultiTimer.cpp *********/
@@ -45353,6 +45352,9 @@ void Slider::lookAndFeelChanged()
decButton->setRepeatSpeed (300, 100, 20); decButton->setRepeatSpeed (300, 100, 20);
decButton->addMouseListener (incButton, false); decButton->addMouseListener (incButton, false);
} }

incButton->setTooltip (getTooltip());
decButton->setTooltip (getTooltip());
} }


setComponentEffect (lf.getSliderEffect()); setComponentEffect (lf.getSliderEffect());


+ 101
- 101
juce_amalgamated.h View File

@@ -36131,13 +36131,11 @@ private:
/********* End of inlined file: juce_PluginListComponent.h *********/ /********* End of inlined file: juce_PluginListComponent.h *********/


#endif #endif
#ifndef __JUCE_FLACAUDIOFORMAT_JUCEHEADER__

/********* Start of inlined file: juce_FlacAudioFormat.h *********/
#ifndef __JUCE_FLACAUDIOFORMAT_JUCEHEADER__
#define __JUCE_FLACAUDIOFORMAT_JUCEHEADER__
#ifndef __JUCE_WAVAUDIOFORMAT_JUCEHEADER__


#if JUCE_USE_FLAC || defined (DOXYGEN)
/********* Start of inlined file: juce_WavAudioFormat.h *********/
#ifndef __JUCE_WAVAUDIOFORMAT_JUCEHEADER__
#define __JUCE_WAVAUDIOFORMAT_JUCEHEADER__


/********* Start of inlined file: juce_AudioFormat.h *********/ /********* Start of inlined file: juce_AudioFormat.h *********/
#ifndef __JUCE_AUDIOFORMAT_JUCEHEADER__ #ifndef __JUCE_AUDIOFORMAT_JUCEHEADER__
@@ -36413,52 +36411,6 @@ private:
#endif // __JUCE_AUDIOFORMAT_JUCEHEADER__ #endif // __JUCE_AUDIOFORMAT_JUCEHEADER__
/********* End of inlined file: juce_AudioFormat.h *********/ /********* End of inlined file: juce_AudioFormat.h *********/


/**
Reads and writes the lossless-compression FLAC audio format.

To compile this, you'll need to set the JUCE_USE_FLAC flag in juce_Config.h,
and make sure your include search path and library search path are set up to find
the FLAC header files and static libraries.

@see AudioFormat
*/
class JUCE_API FlacAudioFormat : public AudioFormat
{
public:

FlacAudioFormat();
~FlacAudioFormat();

const Array <int> getPossibleSampleRates();
const Array <int> getPossibleBitDepths();
bool canDoStereo();
bool canDoMono();
bool isCompressed();

AudioFormatReader* createReaderFor (InputStream* sourceStream,
const bool deleteStreamIfOpeningFails);

AudioFormatWriter* createWriterFor (OutputStream* streamToWriteTo,
double sampleRateToUse,
unsigned int numberOfChannels,
int bitsPerSample,
const StringPairArray& metadataValues,
int qualityOptionIndex);

juce_UseDebuggingNewOperator
};

#endif
#endif // __JUCE_FLACAUDIOFORMAT_JUCEHEADER__
/********* End of inlined file: juce_FlacAudioFormat.h *********/

#endif
#ifndef __JUCE_WAVAUDIOFORMAT_JUCEHEADER__

/********* Start of inlined file: juce_WavAudioFormat.h *********/
#ifndef __JUCE_WAVAUDIOFORMAT_JUCEHEADER__
#define __JUCE_WAVAUDIOFORMAT_JUCEHEADER__

/** /**
Reads and Writes WAV format audio files. Reads and Writes WAV format audio files.


@@ -36574,6 +36526,52 @@ public:
#endif // __JUCE_WAVAUDIOFORMAT_JUCEHEADER__ #endif // __JUCE_WAVAUDIOFORMAT_JUCEHEADER__
/********* End of inlined file: juce_WavAudioFormat.h *********/ /********* End of inlined file: juce_WavAudioFormat.h *********/


#endif
#ifndef __JUCE_AIFFAUDIOFORMAT_JUCEHEADER__

/********* Start of inlined file: juce_AiffAudioFormat.h *********/
#ifndef __JUCE_AIFFAUDIOFORMAT_JUCEHEADER__
#define __JUCE_AIFFAUDIOFORMAT_JUCEHEADER__

/**
Reads and Writes AIFF format audio files.

@see AudioFormat
*/
class JUCE_API AiffAudioFormat : public AudioFormat
{
public:

/** Creates an format object. */
AiffAudioFormat();

/** Destructor. */
~AiffAudioFormat();

const Array <int> getPossibleSampleRates();
const Array <int> getPossibleBitDepths();
bool canDoStereo();
bool canDoMono();
#if JUCE_MAC
bool canHandleFile (const File& fileToTest);
#endif

AudioFormatReader* createReaderFor (InputStream* sourceStream,
const bool deleteStreamIfOpeningFails);

AudioFormatWriter* createWriterFor (OutputStream* streamToWriteTo,
double sampleRateToUse,
unsigned int numberOfChannels,
int bitsPerSample,
const StringPairArray& metadataValues,
int qualityOptionIndex);

juce_UseDebuggingNewOperator
};

#endif // __JUCE_AIFFAUDIOFORMAT_JUCEHEADER__
/********* End of inlined file: juce_AiffAudioFormat.h *********/

#endif #endif
#ifndef __JUCE_OGGVORBISAUDIOFORMAT_JUCEHEADER__ #ifndef __JUCE_OGGVORBISAUDIOFORMAT_JUCEHEADER__


@@ -36682,52 +36680,6 @@ public:
#endif // __JUCE_QUICKTIMEAUDIOFORMAT_JUCEHEADER__ #endif // __JUCE_QUICKTIMEAUDIOFORMAT_JUCEHEADER__
/********* End of inlined file: juce_QuickTimeAudioFormat.h *********/ /********* End of inlined file: juce_QuickTimeAudioFormat.h *********/


#endif
#ifndef __JUCE_AIFFAUDIOFORMAT_JUCEHEADER__

/********* Start of inlined file: juce_AiffAudioFormat.h *********/
#ifndef __JUCE_AIFFAUDIOFORMAT_JUCEHEADER__
#define __JUCE_AIFFAUDIOFORMAT_JUCEHEADER__

/**
Reads and Writes AIFF format audio files.

@see AudioFormat
*/
class JUCE_API AiffAudioFormat : public AudioFormat
{
public:

/** Creates an format object. */
AiffAudioFormat();

/** Destructor. */
~AiffAudioFormat();

const Array <int> getPossibleSampleRates();
const Array <int> getPossibleBitDepths();
bool canDoStereo();
bool canDoMono();
#if JUCE_MAC
bool canHandleFile (const File& fileToTest);
#endif

AudioFormatReader* createReaderFor (InputStream* sourceStream,
const bool deleteStreamIfOpeningFails);

AudioFormatWriter* createWriterFor (OutputStream* streamToWriteTo,
double sampleRateToUse,
unsigned int numberOfChannels,
int bitsPerSample,
const StringPairArray& metadataValues,
int qualityOptionIndex);

juce_UseDebuggingNewOperator
};

#endif // __JUCE_AIFFAUDIOFORMAT_JUCEHEADER__
/********* End of inlined file: juce_AiffAudioFormat.h *********/

#endif #endif
#ifndef __JUCE_AUDIOCDBURNER_JUCEHEADER__ #ifndef __JUCE_AUDIOCDBURNER_JUCEHEADER__


@@ -37377,6 +37329,54 @@ private:
#endif // __JUCE_AUDIOTHUMBNAILCACHE_JUCEHEADER__ #endif // __JUCE_AUDIOTHUMBNAILCACHE_JUCEHEADER__
/********* End of inlined file: juce_AudioThumbnailCache.h *********/ /********* End of inlined file: juce_AudioThumbnailCache.h *********/


#endif
#ifndef __JUCE_FLACAUDIOFORMAT_JUCEHEADER__

/********* Start of inlined file: juce_FlacAudioFormat.h *********/
#ifndef __JUCE_FLACAUDIOFORMAT_JUCEHEADER__
#define __JUCE_FLACAUDIOFORMAT_JUCEHEADER__

#if JUCE_USE_FLAC || defined (DOXYGEN)

/**
Reads and writes the lossless-compression FLAC audio format.

To compile this, you'll need to set the JUCE_USE_FLAC flag in juce_Config.h,
and make sure your include search path and library search path are set up to find
the FLAC header files and static libraries.

@see AudioFormat
*/
class JUCE_API FlacAudioFormat : public AudioFormat
{
public:

FlacAudioFormat();
~FlacAudioFormat();

const Array <int> getPossibleSampleRates();
const Array <int> getPossibleBitDepths();
bool canDoStereo();
bool canDoMono();
bool isCompressed();

AudioFormatReader* createReaderFor (InputStream* sourceStream,
const bool deleteStreamIfOpeningFails);

AudioFormatWriter* createWriterFor (OutputStream* streamToWriteTo,
double sampleRateToUse,
unsigned int numberOfChannels,
int bitsPerSample,
const StringPairArray& metadataValues,
int qualityOptionIndex);

juce_UseDebuggingNewOperator
};

#endif
#endif // __JUCE_FLACAUDIOFORMAT_JUCEHEADER__
/********* End of inlined file: juce_FlacAudioFormat.h *********/

#endif #endif
#ifndef __JUCE_INTERPROCESSCONNECTIONSERVER_JUCEHEADER__ #ifndef __JUCE_INTERPROCESSCONNECTIONSERVER_JUCEHEADER__


@@ -38212,9 +38212,6 @@ private:
#endif #endif
#ifndef __JUCE_INTERPROCESSCONNECTION_JUCEHEADER__ #ifndef __JUCE_INTERPROCESSCONNECTION_JUCEHEADER__


#endif
#ifndef __JUCE_SOLIDCOLOURBRUSH_JUCEHEADER__

#endif #endif
#ifndef __JUCE_BRUSH_JUCEHEADER__ #ifndef __JUCE_BRUSH_JUCEHEADER__


@@ -38740,6 +38737,9 @@ private:
#endif // __JUCE_IMAGEBRUSH_JUCEHEADER__ #endif // __JUCE_IMAGEBRUSH_JUCEHEADER__
/********* End of inlined file: juce_ImageBrush.h *********/ /********* End of inlined file: juce_ImageBrush.h *********/


#endif
#ifndef __JUCE_SOLIDCOLOURBRUSH_JUCEHEADER__

#endif #endif
#ifndef __JUCE_COLOUR_JUCEHEADER__ #ifndef __JUCE_COLOUR_JUCEHEADER__




+ 9
- 9
src/juce_app_includes.h View File

@@ -197,21 +197,18 @@
#ifndef __JUCE_PLUGINLISTCOMPONENT_JUCEHEADER__ #ifndef __JUCE_PLUGINLISTCOMPONENT_JUCEHEADER__
#include "juce_appframework/audio/plugins/juce_PluginListComponent.h" #include "juce_appframework/audio/plugins/juce_PluginListComponent.h"
#endif #endif
#ifndef __JUCE_FLACAUDIOFORMAT_JUCEHEADER__
#include "juce_appframework/audio/audio_file_formats/juce_FlacAudioFormat.h"
#endif
#ifndef __JUCE_WAVAUDIOFORMAT_JUCEHEADER__ #ifndef __JUCE_WAVAUDIOFORMAT_JUCEHEADER__
#include "juce_appframework/audio/audio_file_formats/juce_WavAudioFormat.h" #include "juce_appframework/audio/audio_file_formats/juce_WavAudioFormat.h"
#endif #endif
#ifndef __JUCE_AIFFAUDIOFORMAT_JUCEHEADER__
#include "juce_appframework/audio/audio_file_formats/juce_AiffAudioFormat.h"
#endif
#ifndef __JUCE_OGGVORBISAUDIOFORMAT_JUCEHEADER__ #ifndef __JUCE_OGGVORBISAUDIOFORMAT_JUCEHEADER__
#include "juce_appframework/audio/audio_file_formats/juce_OggVorbisAudioFormat.h" #include "juce_appframework/audio/audio_file_formats/juce_OggVorbisAudioFormat.h"
#endif #endif
#ifndef __JUCE_QUICKTIMEAUDIOFORMAT_JUCEHEADER__ #ifndef __JUCE_QUICKTIMEAUDIOFORMAT_JUCEHEADER__
#include "juce_appframework/audio/audio_file_formats/juce_QuickTimeAudioFormat.h" #include "juce_appframework/audio/audio_file_formats/juce_QuickTimeAudioFormat.h"
#endif #endif
#ifndef __JUCE_AIFFAUDIOFORMAT_JUCEHEADER__
#include "juce_appframework/audio/audio_file_formats/juce_AiffAudioFormat.h"
#endif
#ifndef __JUCE_AUDIOCDBURNER_JUCEHEADER__ #ifndef __JUCE_AUDIOCDBURNER_JUCEHEADER__
#include "juce_appframework/audio/audio_file_formats/juce_AudioCDBurner.h" #include "juce_appframework/audio/audio_file_formats/juce_AudioCDBurner.h"
#endif #endif
@@ -239,6 +236,9 @@
#ifndef __JUCE_AUDIOTHUMBNAILCACHE_JUCEHEADER__ #ifndef __JUCE_AUDIOTHUMBNAILCACHE_JUCEHEADER__
#include "juce_appframework/audio/audio_file_formats/juce_AudioThumbnailCache.h" #include "juce_appframework/audio/audio_file_formats/juce_AudioThumbnailCache.h"
#endif #endif
#ifndef __JUCE_FLACAUDIOFORMAT_JUCEHEADER__
#include "juce_appframework/audio/audio_file_formats/juce_FlacAudioFormat.h"
#endif
#ifndef __JUCE_INTERPROCESSCONNECTIONSERVER_JUCEHEADER__ #ifndef __JUCE_INTERPROCESSCONNECTIONSERVER_JUCEHEADER__
#include "juce_appframework/events/juce_InterprocessConnectionServer.h" #include "juce_appframework/events/juce_InterprocessConnectionServer.h"
#endif #endif
@@ -284,9 +284,6 @@
#ifndef __JUCE_INTERPROCESSCONNECTION_JUCEHEADER__ #ifndef __JUCE_INTERPROCESSCONNECTION_JUCEHEADER__
#include "juce_appframework/events/juce_InterprocessConnection.h" #include "juce_appframework/events/juce_InterprocessConnection.h"
#endif #endif
#ifndef __JUCE_SOLIDCOLOURBRUSH_JUCEHEADER__
#include "juce_appframework/gui/graphics/brushes/juce_SolidColourBrush.h"
#endif
#ifndef __JUCE_BRUSH_JUCEHEADER__ #ifndef __JUCE_BRUSH_JUCEHEADER__
#include "juce_appframework/gui/graphics/brushes/juce_Brush.h" #include "juce_appframework/gui/graphics/brushes/juce_Brush.h"
#endif #endif
@@ -296,6 +293,9 @@
#ifndef __JUCE_IMAGEBRUSH_JUCEHEADER__ #ifndef __JUCE_IMAGEBRUSH_JUCEHEADER__
#include "juce_appframework/gui/graphics/brushes/juce_ImageBrush.h" #include "juce_appframework/gui/graphics/brushes/juce_ImageBrush.h"
#endif #endif
#ifndef __JUCE_SOLIDCOLOURBRUSH_JUCEHEADER__
#include "juce_appframework/gui/graphics/brushes/juce_SolidColourBrush.h"
#endif
#ifndef __JUCE_COLOUR_JUCEHEADER__ #ifndef __JUCE_COLOUR_JUCEHEADER__
#include "juce_appframework/gui/graphics/colour/juce_Colour.h" #include "juce_appframework/gui/graphics/colour/juce_Colour.h"
#endif #endif


+ 2
- 2
src/juce_appframework/audio/audio_file_formats/juce_FlacAudioFormat.h View File

@@ -32,9 +32,9 @@
#ifndef __JUCE_FLACAUDIOFORMAT_JUCEHEADER__ #ifndef __JUCE_FLACAUDIOFORMAT_JUCEHEADER__
#define __JUCE_FLACAUDIOFORMAT_JUCEHEADER__ #define __JUCE_FLACAUDIOFORMAT_JUCEHEADER__
#if JUCE_USE_FLAC || defined (DOXYGEN)
#include "juce_AudioFormat.h" // (must keep this outside the conditional define)
#include "juce_AudioFormat.h"
#if JUCE_USE_FLAC || defined (DOXYGEN)
//============================================================================== //==============================================================================


+ 2
- 2
src/juce_appframework/audio/audio_file_formats/juce_OggVorbisAudioFormat.h View File

@@ -32,9 +32,9 @@
#ifndef __JUCE_OGGVORBISAUDIOFORMAT_JUCEHEADER__ #ifndef __JUCE_OGGVORBISAUDIOFORMAT_JUCEHEADER__
#define __JUCE_OGGVORBISAUDIOFORMAT_JUCEHEADER__ #define __JUCE_OGGVORBISAUDIOFORMAT_JUCEHEADER__
#if JUCE_USE_OGGVORBIS || defined (DOXYGEN)
#include "juce_AudioFormat.h" // (must keep this outside the conditional define)
#include "juce_AudioFormat.h"
#if JUCE_USE_OGGVORBIS || defined (DOXYGEN)
//============================================================================== //==============================================================================


+ 3
- 0
src/juce_appframework/gui/components/controls/juce_Slider.cpp View File

@@ -384,6 +384,9 @@ void Slider::lookAndFeelChanged()
decButton->setRepeatSpeed (300, 100, 20); decButton->setRepeatSpeed (300, 100, 20);
decButton->addMouseListener (incButton, false); decButton->addMouseListener (incButton, false);
} }
incButton->setTooltip (getTooltip());
decButton->setTooltip (getTooltip());
} }
setComponentEffect (lf.getSliderEffect()); setComponentEffect (lf.getSliderEffect());


Loading…
Cancel
Save