2#include <Media/AudioArray.hpp>
4#include <halp/sound_set.hpp>
7#include <QFileSystemWatcher>
12#include <score_plugin_avnd_export.h>
26 halp::sound_decoding decoding{};
39 Media::audio_array data;
40 std::vector<const float*> channels;
42 halp::sound_status status{};
44 std::atomic<int32_t> pins{0};
45 std::atomic<bool> requested{
false};
51 std::vector<std::shared_ptr<SoundSetEntry>> entries;
52 std::vector<halp::sound_view> views;
54 uint64_t generation{};
61 halp::sound_set_view view() const noexcept
63 return {views, folder, generation};
86 = std::function<void(std::vector<std::shared_ptr<SoundSetSnapshot>>)>;
94 void setPath(
const QString& path);
96 const std::shared_ptr<SoundSetSnapshot>& current() const noexcept {
return m_current; }
97 std::size_t retiredCount() const noexcept {
return m_retired.size(); }
105 void scanned(uint64_t token, std::shared_ptr<SoundSetSnapshot> snapshot);
106 void decodeRequested();
107 void decoded(uint64_t token, std::shared_ptr<SoundSetEntry> entry);
108 void publishSnapshot(std::shared_ptr<SoundSetSnapshot> snapshot);
111 SoundSetOptions m_opts;
112 publish_function m_publish;
113 dispose_function m_dispose;
117 uint64_t m_generation{};
119 std::shared_ptr<SoundSetSnapshot> m_current;
120 std::vector<std::shared_ptr<SoundSetSnapshot>> m_retired;
121 std::vector<std::shared_ptr<SoundSetEntry>> m_decoding;
123 QFileSystemWatcher m_watcher;
Definition SoundSet.hpp:78
std::function< void(std::vector< std::shared_ptr< SoundSetSnapshot > >)> dispose_function
Definition SoundSet.hpp:86
std::function< void(std::shared_ptr< SoundSetSnapshot > next, SoundSetSnapshot *previous)> publish_function
Swaps next in, then flags previous as superseded, on the audio thread.
Definition SoundSet.hpp:82
Definition Controls.hpp:30
QStringList soundSetExtensions(std::string_view exts)
The extensions a sound_set port lists, from its extensions() string.
Definition SoundSet.cpp:138
Definition SoundSet.hpp:33
QString path
Absolute.
Definition SoundSet.hpp:34
std::string name
Relative to the folder.
Definition SoundSet.hpp:35
Definition SoundSet.hpp:23
QStringList extensions
Lowercase, without the dot; empty = every audio file.
Definition SoundSet.hpp:24
The set as the processor sees it between two changes.
Definition SoundSet.hpp:50
std::atomic< bool > superseded
Definition SoundSet.hpp:58