Refactor ExportProjectDialog (#8215)

This refactors the export dialog to no longer use the export_project.ui file and moves it into standard C++ Qt code. This also brings minor changes to the dialog, such as horizontal labels instead of vertical ones.
This commit is contained in:
Sotonye Atemie
2026-01-22 19:07:25 -05:00
committed by GitHub
parent 64c346d513
commit 13ea2ee480
6 changed files with 299 additions and 680 deletions

View File

@@ -59,7 +59,8 @@ constexpr int BYTES_PER_FRAME = sizeof(SampleFrame);
constexpr float OUTPUT_SAMPLE_MULTIPLIER = 32767.0f;
constexpr auto SUPPORTED_SAMPLERATES = std::array{44100, 48000, 88200, 96000, 192000};
constexpr auto SUPPORTED_SAMPLERATES = std::array{44100, 48000, 88200, 96000, 192000};
constexpr auto SUPPORTED_BITRATES = std::array{64, 128, 160, 192, 256, 320};
class LMMS_EXPORT AudioEngine : public QObject
{

View File

@@ -27,45 +27,71 @@
#define LMMS_GUI_EXPORT_PROJECT_DIALOG_H
#include <QDialog>
#include <memory>
#include "ui_export_project.h"
#include "ProjectRenderer.h"
#include "RenderManager.h"
namespace lmms::gui
{
class QString;
class QLabel;
class QProgressBar;
class QCheckBox;
class QComboBox;
class QSpinBox;
class QFormLayout;
class QGroupBox;
namespace lmms::gui {
class ExportProjectDialog : public QDialog, public Ui::ExportProjectDialog
class ExportProjectDialog : public QDialog
{
Q_OBJECT
public:
ExportProjectDialog( const QString & _file_name, QWidget * _parent, bool multi_export );
enum class Mode
{
ExportProject,
ExportTracks,
};
protected:
void reject() override;
void closeEvent( QCloseEvent * _ce ) override;
private slots:
void startBtnClicked();
void updateTitleBar( int );
void accept() override;
void startExport();
void onFileFormatChanged(int);
ExportProjectDialog(const QString& path, Mode mode, QWidget* parent = nullptr);
private:
QString m_fileName;
QString m_dirName;
QString m_fileExtension;
bool m_multiExport;
void accept() override;
void reject() override;
void onFileFormatChanged(int index);
void onStartButtonClicked();
void updateTitleBar(int prog);
ProjectRenderer::ExportFileFormat m_ft;
QLabel* m_fileFormatLabel = nullptr;
QComboBox* m_fileFormatComboBox = nullptr;
QLabel* m_sampleRateLabel = nullptr;
QComboBox* m_sampleRateComboBox = nullptr;
QLabel* m_bitRateLabel = nullptr;
QComboBox* m_bitRateComboBox = nullptr;
QLabel* m_bitDepthLabel = nullptr;
QComboBox* m_bitDepthComboBox = nullptr;
QLabel* m_stereoModeLabel = nullptr;
QComboBox* m_stereoModeComboBox = nullptr;
QLabel* m_compressionLevelLabel = nullptr;
QComboBox* m_compressionLevelComboBox = nullptr;
QGroupBox* m_fileFormatSettingsGroupBox = nullptr;
QFormLayout* m_fileFormatSettingsLayout = nullptr;
QCheckBox* m_exportAsLoopBox = nullptr;
QCheckBox* m_exportBetweenLoopMarkersBox = nullptr;
QLabel* m_loopRepeatLabel = nullptr;
QSpinBox* m_loopRepeatBox = nullptr;
QPushButton* m_startButton = nullptr;
QPushButton* m_cancelButton = nullptr;
QProgressBar* m_progressBar = nullptr;
QString m_path;
Mode m_mode;
std::unique_ptr<RenderManager> m_renderManager;
} ;
};
} // namespace lmms::gui

View File

@@ -39,14 +39,16 @@ public:
{
Depth16Bit,
Depth24Bit,
Depth32Bit
Depth32Bit,
Count
};
enum class StereoMode
{
Mono,
Stereo,
JointStereo,
Mono
Count
};
public: