hydrogen 1.2.6
ExportSongDialog.h
Go to the documentation of this file.
1/*
2 * Hydrogen
3 * Copyright(c) 2002-2008 by Alex >Comix< Cominu [comix@users.sourceforge.net]
4 * Copyright(c) 2008-2025 The hydrogen development team [hydrogen-devel@lists.sourceforge.net]
5 *
6 * http://www.hydrogen-music.org
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY, without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see https://www.gnu.org/licenses
20 *
21 */
22
23
24#ifndef EXPORT_SONG_DIALOG_H
25#define EXPORT_SONG_DIALOG_H
26
27#include <memory>
28#include <map>
29
30#include "ui_ExportSongDialog_UI.h"
31#include "EventListener.h"
33#include <core/Object.h>
35
37
38namespace H2Core {
39 class Instrument;
40 class Hydrogen;
41 class Preferences;
42}
43
47
48class ExportSongDialog : public QDialog, public Ui_ExportSongDialog_UI, public EventListener, public H2Core::Object<ExportSongDialog>
49{
51 Q_OBJECT
52
53 public:
54 explicit ExportSongDialog(QWidget* parent);
56
57 virtual void progressEvent( int nValue ) override;
58 void closeEvent( QCloseEvent* event ) override;
59
60
61private slots:
64 void on_okBtn_clicked();
65 void on_exportNameTxt_textChanged(const QString& text);
66 void formatComboIndexChanged(int index);
67 void toggleRubberbandBatchMode(bool toggled);
68 void toggleTimeLineBPMMode(bool toggled);
69 void resampleComboBoIndexChanged(int index);
70
71private:
72
73 void setResamplerMode(int index);
75
78
80 QString findUniqueExportFilenameForInstrument( std::shared_ptr<H2Core::Instrument> pInstrument );
81
82 void exportTracks();
83 bool validateUserInput();
84 QString createDefaultFilename();
85
86 void closeExport();
87
92 QString m_sExtension;
99
100 std::map<int, H2Core::Filesystem::AudioFormat> m_formatMap;
101 static QString sLastFilename;
102};
103
104
105#endif
106
H2Core::Interpolation::InterpolateMode InterpolateMode
#define H2_OBJECT(name)
Definition Object.h:227
static QString sLastFilename
virtual void progressEvent(int nValue) override
void toggleRubberbandBatchMode(bool toggled)
void setResamplerMode(int index)
H2Core::Preferences * m_pPreferences
QString createDefaultFilename()
QString findUniqueExportFilenameForInstrument(std::shared_ptr< H2Core::Instrument > pInstrument)
std::map< int, H2Core::Filesystem::AudioFormat > m_formatMap
void closeEvent(QCloseEvent *event) override
void on_exportNameTxt_textChanged(const QString &text)
void formatComboIndexChanged(int index)
void restoreSettingsFromPreferences()
ExportSongDialog(QWidget *parent)
InterpolateMode m_OldInterpolationMode
void resampleComboBoIndexChanged(int index)
void toggleTimeLineBPMMode(bool toggled)
H2Core::Hydrogen * m_pHydrogen
Hydrogen Audio Engine.
Definition Hydrogen.h:54
Manager for User Preferences File (singleton)
Definition Preferences.h:79