mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
fixed a seek bug in the flac reader; added a JucePlugin_TailLengthSeconds setting for plugins; made the colour class limit the HSV values that are passed into it
This commit is contained in:
parent
1573cad95a
commit
deeb652939
9 changed files with 51 additions and 24 deletions
|
|
@ -2100,12 +2100,12 @@
|
|||
isa = PBXGroup;
|
||||
children = (
|
||||
84F1EB2410403709006A1807 /* juce_Colour.cpp */,
|
||||
84F1EB2A10403709006A1807 /* juce_Colour.h */,
|
||||
84F1EB2510403709006A1807 /* juce_ColourGradient.cpp */,
|
||||
84F1EB2610403709006A1807 /* juce_ColourGradient.h */,
|
||||
84F1EB2710403709006A1807 /* juce_Colours.cpp */,
|
||||
84F1EB2810403709006A1807 /* juce_Colours.h */,
|
||||
84F1EB2910403709006A1807 /* juce_PixelFormats.h */,
|
||||
84F1EB2A10403709006A1807 /* juce_Colour.h */,
|
||||
);
|
||||
name = colour;
|
||||
path = ../../src/gui/graphics/colour;
|
||||
|
|
|
|||
|
|
@ -154,6 +154,12 @@
|
|||
*/
|
||||
#define JucePlugin_SilenceInProducesSilenceOut 0
|
||||
|
||||
/** If your plugin has a tail, you can set the length here and this information
|
||||
will be passed on to the host.
|
||||
(Not all formats/hosts might actually use this, though)
|
||||
*/
|
||||
#define JucePlugin_TailLengthSeconds 0
|
||||
|
||||
/** If set to 1, this hints that the host should ignore any keys that are pressed
|
||||
when the plugin has keyboard focus. If 0, then the host should still execute
|
||||
any shortcut keys that are pressed, even if the plugin does have focus.
|
||||
|
|
|
|||
|
|
@ -420,7 +420,7 @@ public:
|
|||
ComponentResult Version() { return JucePlugin_VersionCode; }
|
||||
|
||||
bool SupportsTail() { return true; }
|
||||
Float64 GetTailTime() { return 0; }
|
||||
Float64 GetTailTime() { return (JucePlugin_TailLengthSeconds); }
|
||||
|
||||
Float64 GetSampleRate()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -419,7 +419,7 @@ public:
|
|||
#endif
|
||||
|
||||
isSynth ((JucePlugin_IsSynth) != 0);
|
||||
noTail ((JucePlugin_SilenceInProducesSilenceOut) != 0);
|
||||
noTail (((JucePlugin_SilenceInProducesSilenceOut) != 0) && (JucePlugin_TailLengthSeconds <= 0));
|
||||
setInitialDelay (filter->getLatencySamples());
|
||||
programsAreChunks (true);
|
||||
|
||||
|
|
|
|||
|
|
@ -86,6 +86,10 @@
|
|||
#error "You need to define the JucePlugin_EditorRequiresKeyboardFocus value in your JucePluginCharacteristics.h file!"
|
||||
#endif
|
||||
|
||||
#ifndef JucePlugin_TailLengthSeconds
|
||||
#error "You need to define the JucePlugin_TailLengthSeconds value in your JucePluginCharacteristics.h file!"
|
||||
#endif
|
||||
|
||||
#if ! (JucePlugin_Build_VST || JucePlugin_Build_AU || JucePlugin_Build_RTAS || JucePlugin_Build_Standalone)
|
||||
#error "You need to define at least one plugin format value in your JucePluginCharacteristics.h file!"
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -75095,13 +75095,14 @@ const Colour Colour::fromRGBAFloat (const uint8 red,
|
|||
return Colour (red, green, blue, alpha);
|
||||
}
|
||||
|
||||
static void convertHSBtoRGB (float h, const float s, float v,
|
||||
static void convertHSBtoRGB (float h, float s, float v,
|
||||
uint8& r, uint8& g, uint8& b) throw()
|
||||
{
|
||||
v = jlimit (0.0f, 1.0f, v);
|
||||
v *= 255.0f;
|
||||
const uint8 intV = (uint8) roundFloatToInt (v);
|
||||
|
||||
if (s == 0)
|
||||
if (s <= 0)
|
||||
{
|
||||
r = intV;
|
||||
g = intV;
|
||||
|
|
@ -75109,6 +75110,8 @@ static void convertHSBtoRGB (float h, const float s, float v,
|
|||
}
|
||||
else
|
||||
{
|
||||
s = jmin (1.0f, s);
|
||||
h = jlimit (0.0f, 1.0f, h);
|
||||
h = (h - floorf (h)) * 6.0f + 0.00001f; // need a small adjustment to compensate for rounding errors
|
||||
const float f = h - floorf (h);
|
||||
|
||||
|
|
@ -122968,12 +122971,11 @@ public:
|
|||
{
|
||||
if (startSampleInFile < reservoirStart
|
||||
|| startSampleInFile > reservoirStart + jmax (samplesInReservoir, 511))
|
||||
{
|
||||
if (startSampleInFile >= (int) lengthInSamples)
|
||||
{
|
||||
samplesInReservoir = 0;
|
||||
|
||||
if (startSampleInFile >= (int) lengthInSamples)
|
||||
break;
|
||||
}
|
||||
|
||||
// had some problems with flac crashing if the read pos is aligned more
|
||||
// accurately than this. Probably fixed in newer versions of the library, though.
|
||||
|
|
@ -122983,11 +122985,9 @@ public:
|
|||
else
|
||||
{
|
||||
reservoirStart += samplesInReservoir;
|
||||
}
|
||||
|
||||
samplesInReservoir = 0;
|
||||
|
||||
FLAC__stream_decoder_process_single (decoder);
|
||||
}
|
||||
|
||||
if (samplesInReservoir == 0)
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -25228,7 +25228,17 @@ public:
|
|||
|
||||
/** Returns the timestamp associated with this message.
|
||||
|
||||
The units for the timestamp will be application-specific.
|
||||
The exact meaning of this time and its units will vary, as messages are used in
|
||||
a variety of different contexts.
|
||||
|
||||
If you're getting the message from a midi file, this could be a time in seconds, or
|
||||
a number of ticks - see MidiFile::convertTimestampTicksToSeconds().
|
||||
|
||||
If the message is being used in a MidiBuffer, it might indicate the number of
|
||||
audio samples from the start of the buffer.
|
||||
|
||||
If the message was created by a MidiInput, see MidiInputCallback::handleIncomingMidiMessage()
|
||||
for details of the way that it initialises this value.
|
||||
|
||||
@see setTimeStamp, addToTimeStamp
|
||||
*/
|
||||
|
|
@ -25236,7 +25246,7 @@ public:
|
|||
|
||||
/** Changes the message's associated timestamp.
|
||||
|
||||
The units for the timestamp will be application-specific.
|
||||
The units for the timestamp will be application-specific - see the notes for getTimeStamp().
|
||||
|
||||
@see addToTimeStamp, getTimeStamp
|
||||
*/
|
||||
|
|
@ -34425,6 +34435,8 @@ public:
|
|||
bool operator== (const AudioDeviceSetup& other) const;
|
||||
|
||||
/** The name of the audio device used for output.
|
||||
The name has to be one of the ones listed by the AudioDeviceManager's currently
|
||||
selected device type.
|
||||
This may be the same as the input device.
|
||||
*/
|
||||
String outputDeviceName;
|
||||
|
|
@ -34546,6 +34558,12 @@ public:
|
|||
*/
|
||||
const String getCurrentAudioDeviceType() const throw() { return currentDeviceType; }
|
||||
|
||||
/** Returns the currently active audio device type object.
|
||||
Don't keep a copy of this pointer - it's owned by the device manager and could
|
||||
change at any time.
|
||||
*/
|
||||
AudioIODeviceType* getCurrentDeviceTypeObject() const;
|
||||
|
||||
/** Changes the class of audio device being used.
|
||||
|
||||
This switches between, e.g. ASIO and DirectSound. On the Mac you probably won't ever call
|
||||
|
|
@ -34794,7 +34812,6 @@ private:
|
|||
void scanDevicesIfNeeded();
|
||||
void deleteCurrentDevice();
|
||||
double chooseBestSampleRate (double preferred) const;
|
||||
AudioIODeviceType* getCurrentDeviceTypeObject() const;
|
||||
void insertDefaultDeviceNames (AudioDeviceSetup& setup) const;
|
||||
|
||||
AudioIODeviceType* findType (const String& inputName, const String& outputName);
|
||||
|
|
|
|||
|
|
@ -179,12 +179,11 @@ public:
|
|||
{
|
||||
if (startSampleInFile < reservoirStart
|
||||
|| startSampleInFile > reservoirStart + jmax (samplesInReservoir, 511))
|
||||
{
|
||||
if (startSampleInFile >= (int) lengthInSamples)
|
||||
{
|
||||
samplesInReservoir = 0;
|
||||
|
||||
if (startSampleInFile >= (int) lengthInSamples)
|
||||
break;
|
||||
}
|
||||
|
||||
// had some problems with flac crashing if the read pos is aligned more
|
||||
// accurately than this. Probably fixed in newer versions of the library, though.
|
||||
|
|
@ -194,11 +193,9 @@ public:
|
|||
else
|
||||
{
|
||||
reservoirStart += samplesInReservoir;
|
||||
}
|
||||
|
||||
samplesInReservoir = 0;
|
||||
|
||||
FLAC__stream_decoder_process_single (decoder);
|
||||
}
|
||||
|
||||
if (samplesInReservoir == 0)
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -119,13 +119,14 @@ const Colour Colour::fromRGBAFloat (const uint8 red,
|
|||
}
|
||||
|
||||
//==============================================================================
|
||||
static void convertHSBtoRGB (float h, const float s, float v,
|
||||
static void convertHSBtoRGB (float h, float s, float v,
|
||||
uint8& r, uint8& g, uint8& b) throw()
|
||||
{
|
||||
v = jlimit (0.0f, 1.0f, v);
|
||||
v *= 255.0f;
|
||||
const uint8 intV = (uint8) roundFloatToInt (v);
|
||||
|
||||
if (s == 0)
|
||||
if (s <= 0)
|
||||
{
|
||||
r = intV;
|
||||
g = intV;
|
||||
|
|
@ -133,6 +134,8 @@ static void convertHSBtoRGB (float h, const float s, float v,
|
|||
}
|
||||
else
|
||||
{
|
||||
s = jmin (1.0f, s);
|
||||
h = jlimit (0.0f, 1.0f, h);
|
||||
h = (h - floorf (h)) * 6.0f + 0.00001f; // need a small adjustment to compensate for rounding errors
|
||||
const float f = h - floorf (h);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue