Browse Source

Minor SVG fix. Added manual reset option to WaitableEvent. Made AudioFilterStreamer update channel numbers when the audio device changes.

tags/2021-05-28
Julian Storer 15 years ago
parent
commit
ca348c06d7
8 changed files with 53 additions and 26 deletions
  1. +1
    -2
      build/win32/vc6/JUCE.dsp
  2. +5
    -0
      extras/audio plugins/wrapper/Standalone/juce_AudioFilterStreamer.cpp
  3. +23
    -12
      juce_amalgamated.cpp
  4. +1
    -1
      juce_amalgamated.h
  5. +3
    -0
      src/gui/graphics/drawables/juce_SVGParser.cpp
  6. +9
    -5
      src/native/common/juce_posix_SharedCode.h
  7. +2
    -2
      src/native/windows/juce_win32_Threads.cpp
  8. +9
    -4
      src/threads/juce_WaitableEvent.h

+ 1
- 2
build/win32/vc6/JUCE.dsp View File

@@ -65,8 +65,7 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "../../../bin/intermediate_win32/staticdebug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /G6 /MDd /W3 /Gm /GR /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR /FD /GZ /c
# SUBTRACT CPP /YX
# ADD CPP /nologo /G6 /MDd /W3 /Gm /GR /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_UNICODE" /D "UNICODE" /D "_LIB" /FR /FD /GZ /Zm1024 /c
# ADD BASE RSC /l 0x809 /d "_DEBUG"
# ADD RSC /l 0x809 /d "_DEBUG"
BSC32=bscmake.exe


+ 5
- 0
extras/audio plugins/wrapper/Standalone/juce_AudioFilterStreamer.cpp View File

@@ -99,6 +99,11 @@ void AudioFilterStreamer::audioDeviceAboutToStart (AudioIODevice* device)
{
sampleRate = device->getCurrentSampleRate();
filter.setPlayConfigDetails (device->getActiveInputChannels().countNumberOfSetBits(),
device->getActiveOutputChannels().countNumberOfSetBits(),
device->getCurrentSampleRate(),
device->getCurrentBufferSizeSamples());
isPlaying = true;
emptyBuffer.setSize (1 + filter.getNumOutputChannels(),


+ 23
- 12
juce_amalgamated.cpp View File

@@ -83556,7 +83556,10 @@ private:
}

if (lastCommandChar == 'M' || lastCommandChar == 'm')
{
path.startNewSubPath (x, y);
lastCommandChar = 'l';
}
else
path.lineTo (x, y);

@@ -211484,8 +211487,8 @@ void CriticalSection::exit() const throw()
LeaveCriticalSection ((CRITICAL_SECTION*) internal);
}

WaitableEvent::WaitableEvent() throw()
: internal (CreateEvent (0, FALSE, FALSE, 0))
WaitableEvent::WaitableEvent (const bool manualReset) throw()
: internal (CreateEvent (0, manualReset ? TRUE : FALSE, FALSE, 0))
{
}

@@ -227548,8 +227551,9 @@ void CriticalSection::exit() const throw()
class WaitableEventImpl
{
public:
WaitableEventImpl()
: triggered (false)
WaitableEventImpl (const bool manualReset_)
: triggered (false),
manualReset (manualReset_)
{
pthread_cond_init (&condition, 0);
pthread_mutex_init (&mutex, 0);
@@ -227602,7 +227606,9 @@ public:
}
}

triggered = false;
if (! manualReset)
triggered = false;

pthread_mutex_unlock (&mutex);
return true;
}
@@ -227626,13 +227632,14 @@ private:
pthread_cond_t condition;
pthread_mutex_t mutex;
bool triggered;
const bool manualReset;

WaitableEventImpl (const WaitableEventImpl&);
WaitableEventImpl& operator= (const WaitableEventImpl&);
};

WaitableEvent::WaitableEvent() throw()
: internal (new WaitableEventImpl())
WaitableEvent::WaitableEvent (const bool manualReset) throw()
: internal (new WaitableEventImpl (manualReset))
{
}

@@ -237595,8 +237602,9 @@ void CriticalSection::exit() const throw()
class WaitableEventImpl
{
public:
WaitableEventImpl()
: triggered (false)
WaitableEventImpl (const bool manualReset_)
: triggered (false),
manualReset (manualReset_)
{
pthread_cond_init (&condition, 0);
pthread_mutex_init (&mutex, 0);
@@ -237649,7 +237657,9 @@ public:
}
}

triggered = false;
if (! manualReset)
triggered = false;

pthread_mutex_unlock (&mutex);
return true;
}
@@ -237673,13 +237683,14 @@ private:
pthread_cond_t condition;
pthread_mutex_t mutex;
bool triggered;
const bool manualReset;

WaitableEventImpl (const WaitableEventImpl&);
WaitableEventImpl& operator= (const WaitableEventImpl&);
};

WaitableEvent::WaitableEvent() throw()
: internal (new WaitableEventImpl())
WaitableEvent::WaitableEvent (const bool manualReset) throw()
: internal (new WaitableEventImpl (manualReset))
{
}



+ 1
- 1
juce_amalgamated.h View File

@@ -8811,7 +8811,7 @@ class JUCE_API WaitableEvent
{
public:

WaitableEvent() throw();
WaitableEvent (bool manualReset = false) throw();

~WaitableEvent() throw();



+ 3
- 0
src/gui/graphics/drawables/juce_SVGParser.cpp View File

@@ -250,7 +250,10 @@ private:
}
if (lastCommandChar == 'M' || lastCommandChar == 'm')
{
path.startNewSubPath (x, y);
lastCommandChar = 'l';
}
else
path.lineTo (x, y);


+ 9
- 5
src/native/common/juce_posix_SharedCode.h View File

@@ -64,8 +64,9 @@ void CriticalSection::exit() const throw()
class WaitableEventImpl
{
public:
WaitableEventImpl()
: triggered (false)
WaitableEventImpl (const bool manualReset_)
: triggered (false),
manualReset (manualReset_)
{
pthread_cond_init (&condition, 0);
pthread_mutex_init (&mutex, 0);
@@ -118,7 +119,9 @@ public:
}
}
triggered = false;
if (! manualReset)
triggered = false;
pthread_mutex_unlock (&mutex);
return true;
}
@@ -142,13 +145,14 @@ private:
pthread_cond_t condition;
pthread_mutex_t mutex;
bool triggered;
const bool manualReset;
WaitableEventImpl (const WaitableEventImpl&);
WaitableEventImpl& operator= (const WaitableEventImpl&);
};
WaitableEvent::WaitableEvent() throw()
: internal (new WaitableEventImpl())
WaitableEvent::WaitableEvent (const bool manualReset) throw()
: internal (new WaitableEventImpl (manualReset))
{
}


+ 2
- 2
src/native/windows/juce_win32_Threads.cpp View File

@@ -79,8 +79,8 @@ void CriticalSection::exit() const throw()
}
//==============================================================================
WaitableEvent::WaitableEvent() throw()
: internal (CreateEvent (0, FALSE, FALSE, 0))
WaitableEvent::WaitableEvent (const bool manualReset) throw()
: internal (CreateEvent (0, manualReset ? TRUE : FALSE, FALSE, 0))
{
}


+ 9
- 4
src/threads/juce_WaitableEvent.h View File

@@ -41,8 +41,13 @@ class JUCE_API WaitableEvent
{
public:
//==============================================================================
/** Creates a WaitableEvent object. */
WaitableEvent() throw();
/** Creates a WaitableEvent object.
@param manualReset If this is false, the event will be reset automatically when the wait()
method is called. If manualReset is true, then once the event is signalled,
the only way to reset it will be by calling the reset() method.
*/
WaitableEvent (bool manualReset = false) throw();
/** Destructor.
@@ -57,8 +62,8 @@ public:
This will wait until the object's signal() method is called by another thread,
or until the timeout expires.
After the event has been signalled, this method will return true and reset
the event.
After the event has been signalled, this method will return true and if manualReset
was set to false in the WaitableEvent's constructor, then the event will be reset.
@param timeOutMilliseconds the maximum time to wait, in milliseconds. A negative
value will cause it to wait forever.


Loading…
Cancel
Save