Skip to content

Commit e4675c8

Browse files
committed
Add CoreServices method to get global timestamp source id
1 parent 80aab34 commit e4675c8

4 files changed

Lines changed: 20 additions & 1 deletion

File tree

Source/CoreServices.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ namespace CoreServices
8383
return getProcessorGraph()->getGlobalTimestamp(false);
8484
}
8585

86+
juce::uint32 getGlobalTimestampSourceFullId()
87+
{
88+
return getProcessorGraph()->getGlobalTimestampSourceFullId();
89+
}
90+
8691
juce::int64 getSoftwareTimestamp()
8792
{
8893
return getProcessorGraph()->getGlobalTimestamp(true);

Source/CoreServices.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,14 @@ no hardware timestamping is present*/
6464
PLUGIN_API juce::int64 getGlobalTimestamp();
6565

6666
/** Gets the sample rate selected on the MessageCenter interface
67-
Defaults to the dample rate of the first hardware source or
67+
Defaults to the dsmple rate of the first hardware source or
6868
the software high resolution timer if no hardware source is present*/
6969
PLUGIN_API float getGlobalSampleRate();
7070

71+
/** Gets the full id of the node generating global timestamps.
72+
Returns 0 if timestamps are provided by the software high resolution timer */
73+
PLUGIN_API uint32 getGlobalTimestampSourceFullId();
74+
7175
/** Gets the software timestamp based on a high resolution timer aligned to the start of each processing block */
7276
PLUGIN_API juce::int64 getSoftwareTimestamp();
7377

Source/Processors/ProcessorGraph/ProcessorGraph.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,14 @@ float ProcessorGraph::getGlobalSampleRate(bool softwareOnly) const
778778
}
779779
}
780780

781+
uint32 ProcessorGraph::getGlobalTimestampSourceFullId() const
782+
{
783+
if (!m_timestampSource)
784+
return 0;
785+
786+
return GenericProcessor::getProcessorFullId(m_timestampSource->getNodeId(), m_timestampSourceSubIdx);
787+
}
788+
781789
void ProcessorGraph::setTimestampWindow(TimestampSourceSelectionWindow* window)
782790
{
783791
m_timestampWindow = window;

Source/Processors/ProcessorGraph/ProcessorGraph.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ class ProcessorGraph : public AudioProcessorGraph
9797

9898
float getGlobalSampleRate(bool softwareOnly) const;
9999

100+
uint32 getGlobalTimestampSourceFullId() const;
101+
100102
void setTimestampWindow(TimestampSourceSelectionWindow* window);
101103

102104
private:

0 commit comments

Comments
 (0)