swift
Loading...
Searching...
No Matches
resourcesound.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) 2019 swift Project Community / Contributors
2// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
5
6#ifndef SWIFT_SOUND_SAMPLEPROVIDER_RESOURCESOUND_H
7#define SWIFT_SOUND_SAMPLEPROVIDER_RESOURCESOUND_H
8
9#include <atomic>
10
11#include <QExplicitlySharedDataPointer>
12#include <QString>
13#include <QVector>
14
15#include "misc/worker.h"
17#include "sound/wav/wavfile.h"
18
19namespace swift::sound::sample_provider
20{
28
31 {
32 public:
35
37 CResourceSound(const QString &audioFileName);
38
40 bool load();
41
43 bool isLoaded() { return m_data->isLoaded; }
44
46 const QVector<float> &audioData() const { return m_data->samples; }
47
49 const QString &getFileName() const;
50
52 bool isSameFileName(const QString &fn) const;
53
54 private:
56 };
57} // namespace swift::sound::sample_provider
58
59#endif // SWIFT_SOUND_SAMPLEPROVIDER_RESOURCESOUND_H
bool isLoaded()
Is resource already loaded?
const QString & getFileName() const
Corresponding file.
const QVector< float > & audioData() const
Audio data.
bool load()
Load the attached resource file.
bool isSameFileName(const QString &fn) const
Is same file?