rather large commit, it now handles memory and threading properly.
--- more thorough commit message which was generated by the wonderful copilot AI tool: Refactor and enhance audio encoding and decoding pipelines - Introduced CodecUtils.h for utility functions related to audio codec selection, including sample format and bitrate clamping. - Added DecoderPipeline.h to manage audio decoding, including opening files and retrieving audio stream information. - Implemented EncoderPipeline.h to handle audio encoding, including encoder setup, resampling, and writing output files. - Created OutputPathBuilder.h to generate output file paths based on reencode job specifications. - Refactored SpectrogramWidget to improve OpenGL handling and ensure safe context usage. - Updated ReencodeDialog.h to enhance code readability and maintainability. - Improved error handling and logging throughout the audio processing components.
This commit is contained in:
+22
-17
@@ -1,6 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <QDialog>
|
||||
#include <QList>
|
||||
|
||||
#include "engine/Track.h"
|
||||
#include "engine/encoder/ReencodeJob.h"
|
||||
|
||||
@@ -12,20 +14,23 @@ class QLabel;
|
||||
class QProgressBar;
|
||||
|
||||
namespace engine { class AlbumReencoder; }
|
||||
class ReencodeDialog : public QDialog {
|
||||
|
||||
class ReencodeDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ReencodeDialog(const QList<engine::Track> &tracks,
|
||||
QWidget *parent = nullptr);
|
||||
~ReencodeDialog();
|
||||
~ReencodeDialog() override;
|
||||
|
||||
private slots:
|
||||
void onPresetChanged(int index);
|
||||
void onBrowseOutput();
|
||||
void onStartStop();
|
||||
void onTrackStarted (int index, const QString &title);
|
||||
void onTrackFinished(int index, bool ok, const QString &outPath,
|
||||
const QString &err);
|
||||
void onTrackFinished(int index, bool ok,
|
||||
const QString &outPath, const QString &err);
|
||||
void onAllFinished (int succeeded, int failed);
|
||||
|
||||
private:
|
||||
@@ -34,21 +39,21 @@ private:
|
||||
void setRunning(bool running);
|
||||
void updateOverallProgress();
|
||||
|
||||
QList<engine::Track> m_tracks;
|
||||
QList<engine::EncodePreset> m_presets;
|
||||
QList<engine::Track> m_tracks;
|
||||
QList<engine::EncodePreset> m_presets;
|
||||
|
||||
QComboBox *m_presetCombo { nullptr };
|
||||
QLabel *m_presetDesc { nullptr };
|
||||
QLineEdit *m_outputDir { nullptr };
|
||||
QPushButton *m_browseBtn { nullptr };
|
||||
QTableWidget *m_table { nullptr };
|
||||
QProgressBar *m_overallBar { nullptr };
|
||||
QLabel *m_statusLabel { nullptr };
|
||||
QPushButton *m_startStopBtn { nullptr };
|
||||
QPushButton *m_closeBtn { nullptr };
|
||||
QComboBox *m_presetCombo { nullptr };
|
||||
QLabel *m_presetDesc { nullptr };
|
||||
QLineEdit *m_outputDir { nullptr };
|
||||
QPushButton *m_browseBtn { nullptr };
|
||||
QTableWidget *m_table { nullptr };
|
||||
QProgressBar *m_overallBar { nullptr };
|
||||
QLabel *m_statusLabel { nullptr };
|
||||
QPushButton *m_startStopBtn { nullptr };
|
||||
QPushButton *m_closeBtn { nullptr };
|
||||
|
||||
engine::AlbumReencoder *m_reencoder { nullptr };
|
||||
|
||||
int m_doneCount { 0 };
|
||||
int m_totalCount { 0 };
|
||||
qsizetype m_doneCount { 0 };
|
||||
qsizetype m_totalCount { 0 };
|
||||
};
|
||||
Reference in New Issue
Block a user