VSE: Add sound strip retiming support #105072

Merged
Richard Antalik merged 16 commits from iss/blender:retiming-sound-2 into main 2023-04-21 16:53:39 +02:00
4 changed files with 7 additions and 5 deletions
Showing only changes of commit 78d8b02a15 - Show all commits

View File

@ -198,12 +198,13 @@ public:
/**
* Adds a new entry to the scene.
* \param sound The sound this entry should play.
* \param sequence_data Reference to sequence_data. Mainly needed to get the FPS of the scene.
* \param begin The start time.
* \param end The end time or a negative value if determined by the sound.
* \param skip How much seconds should be skipped at the beginning.
* \return The entry added.
*/
std::shared_ptr<SequenceEntry> add(std::shared_ptr<ISound> sound, double begin, double end, double skip);
std::shared_ptr<SequenceEntry> add(std::shared_ptr<ISound> sound, std::shared_ptr<SequenceData> sequence_data, double begin, double end, double skip);
/**
* Removes an entry from the scene.

View File

@ -126,9 +126,10 @@ public:
* \param begin The start time.
* \param end The end time or a negative value if determined by the sound.
* \param skip How much seconds should be skipped at the beginning.
* \param sequence_data Reference to sequence_data. Mainly needed to get the FPS of the scene.
* \param id The ID of the entry.
*/
SequenceEntry(std::shared_ptr<ISound> sound, double begin, double end, double skip, std::shared_ptr<SequenceData> m_sequence_data, int id);
SequenceEntry(std::shared_ptr<ISound> sound, double begin, double end, double skip, std::shared_ptr<SequenceData> sequence_data, int id);
virtual ~SequenceEntry();
/**

View File

@ -92,7 +92,7 @@ AnimateableProperty* Sequence::getAnimProperty(AnimateablePropertyType type)
std::shared_ptr<SequenceEntry> Sequence::add(std::shared_ptr<ISound> sound, double begin, double end, double skip)
{
return m_sequence->add(sound, begin, end, skip);
return m_sequence->add(sound, m_sequence, begin, end, skip);
}
void Sequence::remove(std::shared_ptr<SequenceEntry> entry)

View File

@ -149,11 +149,11 @@ AnimateableProperty* SequenceData::getAnimProperty(AnimateablePropertyType type)
}
}
std::shared_ptr<SequenceEntry> SequenceData::add(std::shared_ptr<ISound> sound, double begin, double end, double skip)
std::shared_ptr<SequenceEntry> SequenceData::add(std::shared_ptr<ISound> sound, std::shared_ptr<SequenceData> sequence_data, double begin, double end, double skip)
{
std::lock_guard<std::recursive_mutex> lock(m_mutex);
std::shared_ptr<SequenceEntry> entry = std::shared_ptr<SequenceEntry>(new SequenceEntry(sound, begin, end, skip, std::shared_ptr<SequenceData>(this), m_id++));
std::shared_ptr<SequenceEntry> entry = std::shared_ptr<SequenceEntry>(new SequenceEntry(sound, begin, end, skip, sequence_data, m_id++));
m_entries.push_back(entry);
m_entry_status++;