Audacity 3.2.0
MockSampleBlock.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*!********************************************************************
3
4 Audacity: A Digital Audio Editor
5
6 MockSampleBlock.h
7
8 Matthieu Hodgkinson
9
10**********************************************************************/
11#pragma once
12
13#include "SampleBlock.h"
14
15class MockSampleBlock final : public SampleBlock
16{
17public:
19 long long id, constSamplePtr src, size_t numsamples,
20 sampleFormat srcformat);
21
22 void CloseLock() noexcept override;
23
24 SampleBlockID GetBlockID() const override;
25
26 sampleFormat GetSampleFormat() const override;
27
28 size_t GetSampleCount() const override;
29
30 bool
31 GetSummary256(float* dest, size_t frameoffset, size_t numframes) override;
32
33 bool
34 GetSummary64k(float* dest, size_t frameoffset, size_t numframes) override;
35
36 size_t GetSpaceUsage() const override;
37
38 void SaveXML(XMLWriter&) override;
39
40 size_t DoGetSamples(
41 samplePtr dest, sampleFormat destformat, size_t sampleoffset,
42 size_t numsamples) override;
43
44 MinMaxRMS DoGetMinMaxRMS(size_t start, size_t len) override;
45
46 MinMaxRMS DoGetMinMaxRMS() const override;
47
48 BlockSampleView GetFloatSampleView(bool mayThrow) override;
49
50 const long long id;
52 const std::vector<char> data;
53};
std::shared_ptr< std::vector< float > > BlockSampleView
long long SampleBlockID
Definition: CloudSyncDTO.h:26
sampleFormat
The ordering of these values with operator < agrees with the order of increasing bit width.
Definition: SampleFormat.h:30
char * samplePtr
Definition: SampleFormat.h:57
const char * constSamplePtr
Definition: SampleFormat.h:58
MockSampleBlock(long long id, constSamplePtr src, size_t numsamples, sampleFormat srcformat)
SampleBlockID GetBlockID() const override
const long long id
bool GetSummary64k(float *dest, size_t frameoffset, size_t numframes) override
Non-throwing, should fill with zeroes on failure.
MinMaxRMS DoGetMinMaxRMS() const override
sampleFormat GetSampleFormat() const override
void CloseLock() noexcept override
void SaveXML(XMLWriter &) override
bool GetSummary256(float *dest, size_t frameoffset, size_t numframes) override
Non-throwing, should fill with zeroes on failure.
size_t GetSampleCount() const override
size_t DoGetSamples(samplePtr dest, sampleFormat destformat, size_t sampleoffset, size_t numsamples) override
const sampleFormat srcFormat
const std::vector< char > data
BlockSampleView GetFloatSampleView(bool mayThrow) override
size_t GetSpaceUsage() const override
Abstract class allows access to contents of a block of sound samples, serialization as XML,...
Definition: SampleBlock.h:47
Base class for XMLFileWriter and XMLStringWriter that provides the general functionality for creating...
Definition: XMLWriter.h:25