Skip to content

Commit 41e7f67

Browse files
committed
Various minor documentation cleanups/improvements
1 parent fbc1665 commit 41e7f67

File tree

11 files changed

+49
-36
lines changed

11 files changed

+49
-36
lines changed

ChangeLog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ ARA SDK 2.0 draft 15 (aka 1.9.15) (2021/??/??)
2020
Plug-Ins vendors that have relied on the previous behavior must update their code accordingly -
2121
running the test host will trigger all relevant code paths to validate the changed code.
2222
- refactored StoreObjectsFilter c'tor to make it usable without a DocumentController*
23+
- various minor documentation cleanups/improvements
2324

2425
ARA SDK 2.0 draft 14 (aka 1.9.14) (2021/02/26)
2526
- applied Apache License 2.0

Debug/ARAContentValidator.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,8 @@ struct ContentReaderValidatorImplementation<kARAContentTypeStaticTuning>
113113
template <>
114114
struct ContentReaderValidatorImplementation<kARAContentTypeKeySignatures>
115115
{
116-
//! \todo this can currently fail in Studio One
117-
// static inline void validateEventCount (ARAInt32 eventCount) { ARA_VALIDATE_API_CONDITION (eventCount > 0); }
118-
static inline void validateEventCount (ARAInt32 eventCount) { ARA_VALIDATE_API_CONDITION (eventCount >= 0); }
116+
// this may fail in older versions of Studio One if no key has been set for the song - fixed in version 5.2.1
117+
static inline void validateEventCount (ARAInt32 eventCount) { ARA_VALIDATE_API_CONDITION (eventCount > 0); }
119118

120119
static inline void validateEvent (const ARAContentKeySignature* /*event*/) {}
121120

Debug/ARADebug.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ extern "C"
5959
kARADebugLevelAssert = 2 // output indicates programming error
6060
} ARADebugLevel;
6161

62-
// primitve macro for all debug output
62+
// primitive macro for all debug output
6363
// can be overridden by SDK clients to use their own custom logging system
6464
// typically not called directly - instead ARA_LOG, ARA_WARN or asserts are used
6565
#if !defined(ARA_DEBUG_MESSAGE)

Dispatch/ARAContentReader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ struct ContentTypeMapper;
5656

5757
/*******************************************************************************/
5858
// ContentReaderFunctionMapper
59-
// Map to allow templated content reader code to pick the proper non-polymporhic ARA interface calls.
59+
// Map to allow templated content reader code to pick the proper non-polymorphic ARA interface calls.
6060
/*******************************************************************************/
6161

6262
template <typename ControllerType, typename ModelObjectRefType> struct ContentReaderFunctionMapper;

Dispatch/ARAHostDispatch.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -450,24 +450,24 @@ ARARegionSequenceRef DocumentController::createRegionSequence (ARARegionSequence
450450
return getInterface ()->createRegionSequence (getRef (), hostRef, properties);
451451
}
452452

453-
void DocumentController::updateRegionSequenceProperties (ARARegionSequenceRef regionSequencRef, const ARARegionSequenceProperties* properties) noexcept
453+
void DocumentController::updateRegionSequenceProperties (ARARegionSequenceRef regionSequenceRef, const ARARegionSequenceProperties* properties) noexcept
454454
{
455455
#if ARA_SUPPORT_VERSION_1
456456
if (!getInterface ().implements<ARA_STRUCT_MEMBER (ARADocumentControllerInterface, destroyRegionSequence)> ())
457457
return;
458458
#endif
459459

460-
return getInterface ()->updateRegionSequenceProperties (getRef (), regionSequencRef, properties);
460+
return getInterface ()->updateRegionSequenceProperties (getRef (), regionSequenceRef, properties);
461461
}
462462

463-
void DocumentController::destroyRegionSequence (ARARegionSequenceRef regionSequencRef) noexcept
463+
void DocumentController::destroyRegionSequence (ARARegionSequenceRef regionSequenceRef) noexcept
464464
{
465465
#if ARA_SUPPORT_VERSION_1
466466
if (!getInterface ().implements<ARA_STRUCT_MEMBER (ARADocumentControllerInterface, destroyRegionSequence)> ())
467467
return;
468468
#endif
469469

470-
return getInterface ()->destroyRegionSequence (getRef (), regionSequencRef);
470+
return getInterface ()->destroyRegionSequence (getRef (), regionSequenceRef);
471471
}
472472

473473
ARAAudioSourceRef DocumentController::createAudioSource (ARAAudioSourceHostRef hostRef, const ARAAudioSourceProperties* properties) noexcept
@@ -784,14 +784,14 @@ void EditorRenderer::removePlaybackRegion (ARAPlaybackRegionRef playbackRegionRe
784784
getInterface ()->removePlaybackRegion (getRef (), playbackRegionRef);
785785
}
786786

787-
void EditorRenderer::addRegionSequence (ARARegionSequenceRef regionSequencRef) noexcept
787+
void EditorRenderer::addRegionSequence (ARARegionSequenceRef regionSequenceRef) noexcept
788788
{
789-
getInterface ()->addRegionSequence (getRef (), regionSequencRef);
789+
getInterface ()->addRegionSequence (getRef (), regionSequenceRef);
790790
}
791791

792-
void EditorRenderer::removeRegionSequence (ARARegionSequenceRef regionSequencRef) noexcept
792+
void EditorRenderer::removeRegionSequence (ARARegionSequenceRef regionSequenceRef) noexcept
793793
{
794-
getInterface ()->removeRegionSequence (getRef (), regionSequencRef);
794+
getInterface ()->removeRegionSequence (getRef (), regionSequenceRef);
795795
}
796796

797797
//************************************************************************************************

Dispatch/ARAHostDispatch.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,9 @@ class DocumentController : public InterfaceInstance<ARADocumentControllerRef, AR
344344
//! \copydoc ARADocumentControllerInterface::createRegionSequence
345345
ARARegionSequenceRef createRegionSequence (ARARegionSequenceHostRef hostRef, const ARARegionSequenceProperties* properties) noexcept;
346346
//! \copydoc ARADocumentControllerInterface::updateRegionSequenceProperties
347-
void updateRegionSequenceProperties (ARARegionSequenceRef regionSequencRef, const ARARegionSequenceProperties* properties) noexcept;
347+
void updateRegionSequenceProperties (ARARegionSequenceRef regionSequenceRef, const ARARegionSequenceProperties* properties) noexcept;
348348
//! \copydoc ARADocumentControllerInterface::destroyRegionSequence
349-
void destroyRegionSequence (ARARegionSequenceRef regionSequencRef) noexcept;
349+
void destroyRegionSequence (ARARegionSequenceRef regionSequenceRef) noexcept;
350350
//@}
351351

352352
//! @name Audio Source Management
@@ -526,8 +526,8 @@ class EditorRenderer : public InterfaceInstance<ARAEditorRendererRef, ARAEditorR
526526
//@{
527527
void addPlaybackRegion (ARAPlaybackRegionRef playbackRegionRef) noexcept;
528528
void removePlaybackRegion (ARAPlaybackRegionRef playbackRegionRef) noexcept;
529-
void addRegionSequence (ARARegionSequenceRef regionSequencRef) noexcept;
530-
void removeRegionSequence (ARARegionSequenceRef regionSequencRef) noexcept;
529+
void addRegionSequence (ARARegionSequenceRef regionSequenceRef) noexcept;
530+
void removeRegionSequence (ARARegionSequenceRef regionSequenceRef) noexcept;
531531
//@}
532532
};
533533

Dispatch/ARAPlugInDispatch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ void HostArchivingController::notifyDocumentUnarchivingProgress (float value) no
615615

616616
ARAPersistentID HostArchivingController::getDocumentArchiveID (ARAArchiveReaderHostRef archiveReaderHostRef) noexcept
617617
{
618-
// getDocumentArchiveID was added in the ARA 2.0 final, so check its presence here to support older hosts
618+
// getDocumentArchiveID() was added in the ARA 2.0 final release, so check its presence here to support older hosts
619619
if (getInterface ().implements<ARA_STRUCT_MEMBER (ARAArchivingControllerInterface, getDocumentArchiveID)> ())
620620
return getInterface ()->getDocumentArchiveID (getRef (), archiveReaderHostRef);
621621
return nullptr;

Dispatch/ARAPlugInDispatch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ namespace PlugIn {
7575
#endif
7676

7777
/*******************************************************************************/
78-
/** Tag objects maintained by the host to prevent accidently copying/moving them. */
78+
/** Tag objects maintained by the host to prevent accidentally copying/moving them. */
7979
/*******************************************************************************/
8080

8181
#if !defined (ARA_HOST_MANAGED_OBJECT)

PlugIn/ARAPlug.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ void logToStream (const PlaybackRegion* playbackRegion, std::ostringstream& oss,
157157
if (detailed)
158158
{
159159
oss << ", modification:" << playbackRegion->getStartInAudioModificationTime () << " to " << playbackRegion->getEndInAudioModificationTime ()
160-
<< ", timestretching:" << (playbackRegion->isTimestretchEnabled () ? (playbackRegion->isTimeStretchReflectingTempo () ? "musical" : "linear") : "off)")
160+
<< ", time-stretching:" << (playbackRegion->isTimestretchEnabled () ? (playbackRegion->isTimeStretchReflectingTempo () ? "musical" : "linear") : "off)")
161161
<< ", content based fades:" << (playbackRegion->hasContentBasedFadeAtHead () ? (playbackRegion->hasContentBasedFadeAtTail () ? "both" : "head only") : (playbackRegion->hasContentBasedFadeAtTail () ? "tail only" : "none"))
162162
<< ", regionSequence:" << playbackRegion->getRegionSequence ()->getName ()
163163
<< ", color:" << playbackRegion->getColor ();
@@ -596,13 +596,12 @@ void PlaybackRegion::updateProperties (PropertiesPtr<ARAPlaybackRegionProperties
596596
_durationInPlaybackTime = properties->durationInPlaybackTime;
597597

598598
#if ARA_VALIDATE_API_CALLS
599-
//! \todo these currently fail in Studio One: they enable the time stretching flag even if not supported (but don't stretch),
600-
//! and in some configurations also send slightly different time ranges even though not stretching.
601-
// const auto supportedTransformationFlags = DocumentController::getARAFactory ()->supportedPlaybackTransformationFlags;
602-
// ARA_VALIDATE_API_ARGUMENT (properties, (properties->transformationFlags & ~supportedTransformationFlags) == 0);
603-
// if (((properties->transformationFlags & kARAPlaybackTransformationTimestretch) == 0) ||
604-
// ((supportedTransformationFlags & kARAPlaybackTransformationTimestretch) == 0))
605-
// ARA_VALIDATE_API_ARGUMENT (properties, properties->durationInModificationTime == properties->durationInPlaybackTime);
599+
const auto supportedTransformationFlags { getDocumentController ()->getFactory ()->supportedPlaybackTransformationFlags };
600+
// this may fail in older versions of Studio One which always set the flag (despite never actually stretching if not supported) - fixed in version 5.2.1
601+
ARA_VALIDATE_API_ARGUMENT (properties, (properties->transformationFlags & ~supportedTransformationFlags) == 0);
602+
if (((properties->transformationFlags & kARAPlaybackTransformationTimestretch) == 0) ||
603+
((supportedTransformationFlags & kARAPlaybackTransformationTimestretch) == 0))
604+
ARA_VALIDATE_API_ARGUMENT (properties, properties->durationInModificationTime == properties->durationInPlaybackTime);
606605
#endif
607606

608607
_timestretchEnabled = ((properties->transformationFlags & kARAPlaybackTransformationTimestretch) != 0);
@@ -2695,7 +2694,7 @@ void PlugInEntry::initializeARAWithConfiguration (const ARAInterfaceConfiguratio
26952694
#if ARA_VALIDATE_API_CALLS
26962695
++_assertInitCount;
26972696
#if defined (NDEBUG)
2698-
// when not debugging from our side, use host asserts if possible
2697+
// when not debugging from our side, use host asserts (if provided)
26992698
ARASetExternalAssertReference (ptr->assertFunctionAddress);
27002699
#else
27012700
// when debugging from our side, switch host to our asserts

PlugIn/ARAPlug.h

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ class AudioModification
519519
//! provide a matching c'tor if subclassing AudioModification.
520520
//! \p optionalModificationToClone will be nullptr when creating new modifications with
521521
//! default state from scratch, or will point to a modification (referencing the same
522-
//! \p audioSource) from which the internal state should be cloned into the new modifiction.
522+
//! \p audioSource) from which the internal state should be cloned into the new modification.
523523
explicit AudioModification (AudioSource* audioSource, ARAAudioModificationHostRef hostRef, const AudioModification* optionalModificationToClone) noexcept;
524524
//@}
525525

@@ -1195,10 +1195,15 @@ class DocumentController : public DocumentControllerInterface,
11951195

11961196
//! @name Host Interface Access
11971197
//@{
1198+
//! Returns the audio access controller that the host has provided for this document controller.
11981199
HostAudioAccessController* getHostAudioAccessController () noexcept { return &_hostAudioAccessController; }
1200+
//! Returns the archiving controller that the host has provided for this document controller.
11991201
HostArchivingController* getHostArchivingController () noexcept { return &_hostArchivingController; }
1202+
//! Returns the optional content access controller that the host has provided for this document controller.
12001203
HostContentAccessController* getHostContentAccessController () noexcept { return (_hostContentAccessController.isProvided ()) ? &_hostContentAccessController : nullptr; }
1204+
//! Returns the optional model update controller that the host has provided for this document controller.
12011205
HostModelUpdateController* getHostModelUpdateController () noexcept { return (_hostModelUpdateController.isProvided ()) ? &_hostModelUpdateController : nullptr; }
1206+
//! Returns the optional playback controller that the host has provided for this document controller.
12021207
HostPlaybackController* getHostPlaybackController () noexcept { return (_hostPlaybackController.isProvided ()) ? &_hostPlaybackController : nullptr; }
12031208
//@}
12041209

@@ -1277,13 +1282,15 @@ class DocumentController : public DocumentControllerInterface,
12771282
friend class PlugInEntry;
12781283

12791284
// Creation Helper
1280-
// Only to be called by ARAFactory::createDocumentControllerWithDocument () implementations.
1285+
// Only to be called by the ARAFactory::createDocumentControllerWithDocument () implementations
1286+
// provided via PlugInEntry.
12811287
// Must be called directly after construction of the DocumentController
12821288
// (cannot be called from constructor because it calls virtual functions).
12831289
void initializeDocument (const ARADocumentProperties* properties) noexcept;
12841290

12851291
// Creation Helper
1286-
// Only to be called by ARAFactory::createDocumentControllerWithDocument () implementations.
1292+
// Only to be called by the ARAFactory::createDocumentControllerWithDocument () implementations
1293+
// provided via PlugInEntry.
12871294
const ARADocumentControllerInstance* getInstance () const noexcept { return &_instance; }
12881295
#endif
12891296

@@ -1698,14 +1705,14 @@ class EditorView : public EditorViewInterface
16981705

16991706
/*******************************************************************************/
17001707
//! Utility class that wraps an ARAPlugInExtensionInstance.
1701-
//! Each Companion API plug-in instance owns one PlugInExtension (or custom subclass thereof).
1708+
//! Each companion API plug-in instance owns one PlugInExtension (or custom subclass thereof).
17021709
class PlugInExtension
17031710
{
17041711
public:
17051712
PlugInExtension () noexcept = default;
17061713
virtual ~PlugInExtension () noexcept;
17071714

1708-
//! Establish the binding to ARA when requested through the Companion API,
1715+
//! Establish the binding to ARA when requested through the companion API,
17091716
//! switching the plug-in from regular processing to ARA mode.
17101717
const ARAPlugInExtensionInstance* bindToARA (ARADocumentControllerRef documentControllerRef, ARAPlugInInstanceRoleFlags knownRoles, ARAPlugInInstanceRoleFlags assignedRoles) noexcept;
17111718

0 commit comments

Comments
 (0)