Skip to content

Commit

Permalink
Add ARAModelUpdateControllerInterface::notifyDocumentDataChanged() an…
Browse files Browse the repository at this point in the history
…d related code
  • Loading branch information
sgretscher committed Jun 13, 2024
1 parent 029fdb5 commit 5bb57ee
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Changes since previous releases:
- IPC now also supports using VST3 or CLAP (was previously limited to Audio Units)
- IPC now also works on Windows (was previously limited to macOS)
- IPC now also supports using pugixml as encoder (was previously limited to the macOS-only CFDictionary)
- added API to notify the host when the private, opaque document state changes (to trigger saving it)
- added new partial persistency split archives test case to TestHost
- added various threading and state validations to TestHost
- various cleanups in macOS info.plist files
Expand Down
9 changes: 7 additions & 2 deletions MiniHost/MiniHost.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,14 @@ static void ARA_CALL ARANotifyPlaybackRegionContentChanged(ARAModelUpdateControl
else
ARA_LOG("playback region content was updated from start-head to start+duration+tail, flags %X", contentFlags);
}
static const ARAModelUpdateControllerInterface hostModelUpdateControllerInterface = { ARA_IMPLEMENTED_STRUCT_SIZE(ARAModelUpdateControllerInterface, notifyPlaybackRegionContentChanged),
static void ARA_CALL ARANotifyDocumentDataChanged(ARAModelUpdateControllerHostRef controllerHostRef)
{
ARA_LOG("document data was updated");
}
static const ARAModelUpdateControllerInterface hostModelUpdateControllerInterface = { ARA_IMPLEMENTED_STRUCT_SIZE(ARAModelUpdateControllerInterface, notifyDocumentDataChanged),
&ARANotifyAudioSourceAnalysisProgress, &ARANotifyAudioSourceContentChanged,
&ARANotifyAudioModificationContentChanged, &ARANotifyPlaybackRegionContentChanged };
&ARANotifyAudioModificationContentChanged, &ARANotifyPlaybackRegionContentChanged,
&ARANotifyDocumentDataChanged };

// asserts
#if ARA_VALIDATE_API_CALLS
Expand Down
8 changes: 8 additions & 0 deletions TestHost/ARAHostInterfaces/ARAModelUpdateController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,11 @@ void ARAModelUpdateController::notifyPlaybackRegionContentChanged (ARA::ARAPlayb
else
ARA::ContentLogger::logUpdatedContent (*_araDocumentController->getDocumentController (), _araDocumentController->getRef (playbackRegion), range, scopeFlags);
}

void ARAModelUpdateController::notifyDocumentDataChanged () noexcept
{
ARA_VALIDATE_API_STATE (_araDocumentController->isPollingModelUpdates ());
ARA_VALIDATE_API_THREAD (_araDocumentController->wasCreatedOnCurrentThread ());

ARA_LOG ("document data was updated");
}
2 changes: 2 additions & 0 deletions TestHost/ARAHostInterfaces/ARAModelUpdateController.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ class ARAModelUpdateController : public ARA::Host::ModelUpdateControllerInterfac
// Similar to notifyAudioSourceContentChanged but with a change in scope - now it's limited to a change with a playback region
void notifyPlaybackRegionContentChanged (ARA::ARAPlaybackRegionHostRef playbackRegionHostRef, const ARA::ARAContentTimeRange* range, ARA::ContentUpdateScopes scopeFlags) noexcept override;

void notifyDocumentDataChanged () noexcept override;

void setMinimalContentUpdateLogging (bool flag) { _minimalContentUpdateLogging = flag; }

private:
Expand Down

0 comments on commit 5bb57ee

Please sign in to comment.