Browse Source

Added new FrameRateType fps23976 to AudioPlayHead

tags/2021-05-28
hogliux 7 years ago
parent
commit
86f9c11d15
10 changed files with 45 additions and 12 deletions
  1. +21
    -0
      BREAKING-CHANGES.txt
  2. +9
    -8
      modules/juce_audio_basics/audio_play_head/juce_AudioPlayHead.h
  3. +1
    -1
      modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp
  4. +1
    -0
      modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm
  5. +1
    -0
      modules/juce_audio_plugin_client/AU/juce_AUv3_Wrapper.mm
  6. +1
    -1
      modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp
  7. +1
    -1
      modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp
  8. +8
    -1
      modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp
  9. +1
    -0
      modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp
  10. +1
    -0
      modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp

+ 21
- 0
BREAKING-CHANGES.txt View File

@@ -4,6 +4,27 @@ JUCE breaking changes
Develop Branch
=============

Change
------
A new FrameRateType fps23976 has been added to AudioPlayHead

Possible Issues
---------------
Previously JUCE would report the FrameRateType fps24 for both 24 and
23.976 fps. If your code uses switch statements (or similar) to handle
all possible frame rate types, then this change may cause it to fall
through.

Workaround
----------
Add fps23976 to your switch statement and handle it appropriately.

Rationale
---------
JUCE should be able to handle all popular frame rate codes but was
missing support for 23.976.


Change
------
The String (bool) constructor and operator<< (String&, bool) have been


+ 9
- 8
modules/juce_audio_basics/audio_play_head/juce_AudioPlayHead.h View File

@@ -46,14 +46,15 @@ public:
/** Frame rate types. */
enum FrameRateType
{
fps24 = 0,
fps25 = 1,
fps2997 = 2,
fps30 = 3,
fps2997drop = 4,
fps30drop = 5,
fps60 = 6,
fps60drop = 7,
fps23976 = 0,
fps24 = 1,
fps25 = 2,
fps2997 = 3,
fps30 = 4,
fps2997drop = 5,
fps30drop = 6,
fps60 = 7,
fps60drop = 8,
fpsUnknown = 99
};


+ 1
- 1
modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp View File

@@ -900,7 +900,7 @@ namespace AAXClasses
case AAX_eFrameRate_2997DropFrame: info.frameRate = AudioPlayHead::fps2997drop; framesPerSec = 30.0 * 1000.0 / 1001.0; break;
case AAX_eFrameRate_30NonDrop: info.frameRate = AudioPlayHead::fps30; framesPerSec = 30.0; break;
case AAX_eFrameRate_30DropFrame: info.frameRate = AudioPlayHead::fps30drop; framesPerSec = 30.0; break;
case AAX_eFrameRate_23976: info.frameRate = AudioPlayHead::fps24; framesPerSec = 24.0 * 1000.0 / 1001.0; break;
case AAX_eFrameRate_23976: info.frameRate = AudioPlayHead::fps23976; framesPerSec = 24.0 * 1000.0 / 1001.0; break;
default: break;
}


+ 1
- 0
modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm View File

@@ -932,6 +932,7 @@ public:
switch (lastTimeStamp.mSMPTETime.mType)
{
case kSMPTETimeType2398: info.frameRate = AudioPlayHead::fps23976; break;
case kSMPTETimeType24: info.frameRate = AudioPlayHead::fps24; break;
case kSMPTETimeType25: info.frameRate = AudioPlayHead::fps25; break;
case kSMPTETimeType30Drop: info.frameRate = AudioPlayHead::fps30drop; break;


+ 1
- 0
modules/juce_audio_plugin_client/AU/juce_AUv3_Wrapper.mm View File

@@ -884,6 +884,7 @@ public:
switch (lastTimeStamp.mSMPTETime.mType)
{
case kSMPTETimeType2398: info.frameRate = AudioPlayHead::fps23976; break;
case kSMPTETimeType24: info.frameRate = AudioPlayHead::fps24; break;
case kSMPTETimeType25: info.frameRate = AudioPlayHead::fps25; break;
case kSMPTETimeType2997: info.frameRate = AudioPlayHead::fps2997; break;


+ 1
- 1
modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp View File

@@ -764,7 +764,7 @@ public:
case ficFrameRate_2997DropFrame: info.frameRate = AudioPlayHead::fps2997drop; framesPerSec = 30.0 * 1000.0 / 1001.0; break;
case ficFrameRate_30NonDrop: info.frameRate = AudioPlayHead::fps30; framesPerSec = 30.0; break;
case ficFrameRate_30DropFrame: info.frameRate = AudioPlayHead::fps30drop; framesPerSec = 30.0; break;
case ficFrameRate_23976: info.frameRate = AudioPlayHead::fps24; framesPerSec = 24.0 * 1000.0 / 1001.0; break;
case ficFrameRate_23976: info.frameRate = AudioPlayHead::fps23976; framesPerSec = 24.0 * 1000.0 / 1001.0; break;
default: info.frameRate = AudioPlayHead::fpsUnknown; break;
}


+ 1
- 1
modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp View File

@@ -656,6 +656,7 @@ public:
switch (ti->smpteRate)
{
case vstSmpteRateFps239: rate = AudioPlayHead::fps23976; fps = 24.0 * 1000.0 / 1001.0; break;
case vstSmpteRateFps24: rate = AudioPlayHead::fps24; fps = 24.0; break;
case vstSmpteRateFps25: rate = AudioPlayHead::fps25; fps = 25.0; break;
case vstSmpteRateFps2997: rate = AudioPlayHead::fps2997; fps = 30.0 * 1000.0 / 1001.0; break;
@@ -666,7 +667,6 @@ public:
case vstSmpteRate16mmFilm:
case vstSmpteRate35mmFilm: fps = 24.0; break;
case vstSmpteRateFps239: fps = 24.0 * 1000.0 / 1001.0; break;
case vstSmpteRateFps249: fps = 25.0 * 1000.0 / 1001.0; break;
case vstSmpteRateFps599: fps = 60.0 * 1000.0 / 1001.0; break;
case vstSmpteRateFps60: fps = 60; break;


+ 8
- 1
modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp View File

@@ -1669,7 +1669,14 @@ public:
{
switch (processContext.frameRate.framesPerSecond)
{
case 24: info.frameRate = AudioPlayHead::fps24; break;
case 24:
{
if ((processContext.frameRate.flags & Vst::FrameRate::kPullDownRate) != 0)
info.frameRate = AudioPlayHead::fps23976;
else
info.frameRate = AudioPlayHead::fps24;
}
break;
case 25: info.frameRate = AudioPlayHead::fps25; break;
case 29: info.frameRate = AudioPlayHead::fps30drop; break;


+ 1
- 0
modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp View File

@@ -207,6 +207,7 @@ static void toProcessContext (Vst::ProcessContext& context, AudioPlayHead* playH
switch (position.frameRate)
{
case AudioPlayHead::fps23976: fr.framesPerSecond = 24; fr.flags = FrameRate::kPullDownRate; break;
case AudioPlayHead::fps24: fr.framesPerSecond = 24; fr.flags = 0; break;
case AudioPlayHead::fps25: fr.framesPerSecond = 25; fr.flags = 0; break;
case AudioPlayHead::fps2997: fr.framesPerSecond = 30; fr.flags = FrameRate::kPullDownRate; break;


+ 1
- 0
modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp View File

@@ -1703,6 +1703,7 @@ private:
case AudioPlayHead::fps30: setHostTimeFrameRate (vstSmpteRateFps30, 30.0, position.timeInSeconds); break;
case AudioPlayHead::fps60: setHostTimeFrameRate (vstSmpteRateFps60, 60.0, position.timeInSeconds); break;
case AudioPlayHead::fps23976: setHostTimeFrameRateDrop (vstSmpteRateFps239, 24.0, position.timeInSeconds); break;
case AudioPlayHead::fps2997: setHostTimeFrameRateDrop (vstSmpteRateFps2997, 30.0, position.timeInSeconds); break;
case AudioPlayHead::fps2997drop: setHostTimeFrameRateDrop (vstSmpteRateFps2997drop, 30.0, position.timeInSeconds); break;
case AudioPlayHead::fps30drop: setHostTimeFrameRateDrop (vstSmpteRateFps30drop, 30.0, position.timeInSeconds); break;


Loading…
Cancel
Save