Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 7ee4bd7a rédigé par Kubat's avatar Kubat
Parcourir les fichiers

[WIP] LIB: Make the 'fileName' a const member

parent fc32cbf9
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!18Implement the VivyDocument specification
#ifndef VIVY_AUDIO_H #pragma once
#define VIVY_AUDIO_H
#ifndef __cplusplus #ifndef __cplusplus
#error "This is a C++ header" #error "This is a C++ header"
...@@ -11,6 +10,7 @@ extern "C" { ...@@ -11,6 +10,7 @@ extern "C" {
#include <libavformat/avformat.h> #include <libavformat/avformat.h>
#include <libswresample/swresample.h> #include <libswresample/swresample.h>
#include <libavcodec/avfft.h> #include <libavcodec/avfft.h>
#include <memory.h>
} }
#include "Utils.hh" #include "Utils.hh"
...@@ -18,7 +18,6 @@ extern "C" { ...@@ -18,7 +18,6 @@ extern "C" {
#include <QMap> #include <QMap>
#include <QVector> #include <QVector>
#include <QString> #include <QString>
#include <memory.h>
namespace Vivy namespace Vivy
{ {
...@@ -111,14 +110,11 @@ public: ...@@ -111,14 +110,11 @@ public:
static constexpr uint resamplerSampleRate = 44100; static constexpr uint resamplerSampleRate = 44100;
}; };
using StreamPtr = std::shared_ptr<Stream>; using StreamPtr = std::shared_ptr<Stream>;
using StreamWeakPtr = std::weak_ptr<Stream>;
public: public:
AudioContext(const QString &path); AudioContext(const QString &path);
~AudioContext() noexcept = default;
// The stream non-owning view pointer
using StreamWeakPtr = std::weak_ptr<Stream>;
StreamWeakPtr getStream(int) const noexcept; StreamWeakPtr getStream(int) const noexcept;
StreamWeakPtr getDefaultStream() const noexcept; StreamWeakPtr getDefaultStream() const noexcept;
...@@ -134,7 +130,7 @@ private: ...@@ -134,7 +130,7 @@ private:
using AVFormatContextPtr = std::unique_ptr<AVFormatContext, decltype(avFormatContextDeleter)>; using AVFormatContextPtr = std::unique_ptr<AVFormatContext, decltype(avFormatContextDeleter)>;
AVFormatContextPtr format{ avformat_alloc_context(), avFormatContextDeleter }; AVFormatContextPtr format{ avformat_alloc_context(), avFormatContextDeleter };
QString filePath; // Usefull information const QString filePath; // Usefull information
QMap<uint, StreamPtr> audioStreams{}; // THe audio streams of the file QMap<uint, StreamPtr> audioStreams{}; // THe audio streams of the file
int defaultStreamIndex{ -1 }; int defaultStreamIndex{ -1 };
...@@ -144,5 +140,3 @@ private: ...@@ -144,5 +140,3 @@ private:
StreamPtr spareNullSreamPtr{ nullptr }; StreamPtr spareNullSreamPtr{ nullptr };
}; };
} }
#endif // VIVY_AUDIO_H
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter