Audacity 3.2.0
LV2InstanceFeaturesList.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 @file LV2InstanceFeaturesList.h
6
7 Paul Licameli split from LV2Effect.h
8
9 Audacity(R) is copyright (c) 1999-2013 Audacity Team.
10 License: GPL v2 or later. See License.txt.
11
12*********************************************************************/
13
14#ifndef __AUDACITY_LV2_INSTANCE_FEATURES_LIST__
15#define __AUDACITY_LV2_INSTANCE_FEATURES_LIST__
16
17#if USE_LV2
18
19#include "LV2FeaturesList.h"
20#include "Callable.h"
21#include "GlobalVariable.h"
22#include "lv2/options/options.h"
23#include "lv2/worker/worker.h"
24
27 struct LV2_API ValidatePlugin : DefaultedGlobalHook<ValidatePlugin,
28 Callable::Constantly<true, const LilvPlugin &, LV2InstanceFeaturesList &>
29 ::Function
30 >{};
31
33 const LV2FeaturesList &baseFeatures);
34
35 const LV2FeaturesList &Base() const {
36 return static_cast<const LV2FeaturesList&>(mBaseFeatures);
37 }
38
40 bool InitializeOptions();
41
43 const LV2_Options_Option *NominalBlockLengthOption() const;
44
45 size_t AddOption(LV2_URID, uint32_t size, LV2_URID, const void *value);
46
51 bool ValidateOptions(const LilvNode *subject);
52
58 bool CheckOptions(const LilvNode *subject, bool required);
59
60 std::vector<LV2_Options_Option> mOptions;
61 size_t mBlockSizeOption{};
62
64 int mSeqSize{ DEFAULT_SEQSIZE };
65
66 bool mSupportsNominalBlockLength{ false };
67
68 size_t mMinBlockSize{ 1 };
69 size_t mMaxBlockSize{ mBlockSize };
70 float mSampleRate{ 44100.0f };
71
72 const bool mOk;
73};
74
77 LV2InstanceFeaturesList &baseFeatures, float sampleRate = 44100.0f,
78 const LV2_Worker_Schedule *pWorkerSchedule = nullptr);
79
81 return static_cast<const LV2InstanceFeaturesList&>(mBaseFeatures);
82 }
83};
84
85#endif
86#endif
Functions and classes that generate callable objects.
#define DEFAULT_SEQSIZE
Extends one (immutable) feature list (whose lifetime contains this one's)
const LV2FeaturesListBase & mBaseFeatures
constexpr auto DEFAULT_BLOCKSIZE
Maximum block size in number of samples (not bytes)
Perform extra initialization-time checks.
const LV2FeaturesList & Base() const
std::vector< LV2_Options_Option > mOptions
const LV2InstanceFeaturesList & Base() const