44 static std::optional<AudioInfo> do_probe(
const QString& path);
45 void decode(
const QString& path,
int track, audio_handle hdl);
47 static std::optional<std::pair<AudioInfo, audio_array>>
48 decode_synchronous(
const QString& path,
int rate);
50 static QHash<QString, AudioInfo>& database();
52 int32_t fileSampleRate{};
53 int32_t convertedSampleRate{};
56 std::size_t decoded{};
59 void newData() W_SIGNAL(newData);
60 void finishedDecoding(audio_handle hdl) W_SIGNAL(finishedDecoding, hdl);
62 void startDecode(QString str, audio_handle hdl) W_SIGNAL(startDecode, str, hdl);
65 void on_startDecode(QString, audio_handle hdl);
66 W_SLOT(on_startDecode);
69 static double read_length(
const QString& path);
71 QThread* m_baseThread{};
72 QThread m_decodeThread;
74 template <
typename Decoder>
75 void decodeFrame(Decoder dec, audio_array& data, AVFrame& frame);
77 template <
typename Decoder>
78 void decodeRemaining(Decoder dec, audio_array& data, AVFrame& frame);
79 std::vector<SwrContext*> resampler;