hydrogen 1.2.6
AudioFileBrowser.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#ifndef AUDIOFILEBROWSER_H
24#define AUDIOFILEBROWSER_H
25
26#include "ui_AudioFileBrowser_UI.h"
28
29#include <QDialog>
30#include <core/Object.h>
32
33
34class Button;
36
40
41class AudioFileBrowser : public QDialog, public Ui_AudioFileBrowser_UI, public H2Core::Object<AudioFileBrowser>
42
43{
45 Q_OBJECT
46 public:
47
48 AudioFileBrowser( QWidget* pParent, bool bAllowMultiSelect,
49 bool bShowInstrumentManipulationControls,
50 QString sDefaultPath = "",
51 const QString& sFilename = "" );
53
54 QStringList getSelectedFiles();
55 QString getSelectedDirectory();
56
57 private slots:
59 void on_openBTN_clicked();
60 void clicked( const QModelIndex& index );
61 void doubleClicked( const QModelIndex& index );
64 void updateModelIndex();
69
70 virtual void keyPressEvent (QKeyEvent *ev) override;
71 virtual void keyReleaseEvent (QKeyEvent *ev) override;
72
73
74 private:
75 void browseTree( const QModelIndex& index );
76
77 void getEnvironment();
78 bool isFileSupported( QString filename );
79
81
83 QStringList m_pSelectedFile;
85
87 QFileSystemModel * m_pDirModel;
88
89 QModelIndex m_ModelIndex;
90
92 QStringList m_Filters;
93
96
97 QString m_sFilename;
98
99};
100
101
102#endif
#define H2_OBJECT(name)
Definition Object.h:227
void doubleClicked(const QModelIndex &index)
virtual void keyReleaseEvent(QKeyEvent *ev) override
QFileSystemModel * m_pDirModel
AudioFileBrowser(QWidget *pParent, bool bAllowMultiSelect, bool bShowInstrumentManipulationControls, QString sDefaultPath="", const QString &sFilename="")
QStringList getSelectedFiles()
void clicked(const QModelIndex &index)
void on_m_pPathUptoolButton_clicked()
virtual void keyPressEvent(QKeyEvent *ev) override
QString m_sEmptySampleFilename
bool isFileSupported(QString filename)
bool m_bShowInstrumentManipulationControls
void on_playSamplescheckBox_clicked()
void on_m_pPathHometoolButton_clicked()
QModelIndex m_ModelIndex
SampleWaveDisplay * m_pSampleWaveDisplay
void browseTree(const QModelIndex &index)
QStringList m_pSelectedFile
QStringList m_Filters
Generic Button with SVG icons or text.
Definition Button.h:60