hydrogen 1.2.6
SoundLibraryOpenDialog.cpp
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
24
26#include "../HydrogenApp.h"
27#include "../InstrumentRack.h"
28
29using namespace H2Core;
30
32 : QDialog( pParent )
33{
34
35 setWindowTitle( tr( "Open Sound Library" ) );
36 setFixedSize( 280, 380 );
37
38 QVBoxLayout *pVBox = new QVBoxLayout();
39 pVBox->setSpacing( 6 );
40 pVBox->setContentsMargins( 9, 9, 9, 9 );
41
42
43 // Sound Library Panel
44 m_pSoundLibraryPanel = new SoundLibraryPanel( nullptr, true );
45 pVBox->addWidget( m_pSoundLibraryPanel, 0 );
46
47
48 // Buttons
49 QHBoxLayout *pButtonsBox = new QHBoxLayout();
50
51 pButtonsBox->addStretch();
52
53 m_pOkBtn = new QPushButton( tr("Load") );
54 pButtonsBox->addWidget( m_pOkBtn );
55
56 m_pCancelBtn = new QPushButton( tr("Cancel") );
57 pButtonsBox->addWidget( m_pCancelBtn );
58
59 pButtonsBox->addStretch();
60
61 pVBox->addLayout( pButtonsBox );
62
63
64 this->setLayout( pVBox );
65
66 connect( m_pSoundLibraryPanel, SIGNAL( item_changed ( bool ) ), this, SLOT( on_soundLib_item_changed( bool ) ) );
67 connect( m_pOkBtn, SIGNAL( clicked ( ) ), this, SLOT( on_open_btn_clicked( ) ) );
68 connect( m_pCancelBtn, SIGNAL( clicked ( ) ), this, SLOT( on_cancel_btn_clicked( ) ) );
69}
70
71
76
77
79{
80 m_pOkBtn->setEnabled( bDrumkitSelected );
81}
82
83
85{
86 m_pSoundLibraryPanel->on_drumkitLoadAction();
87 accept();
88}
89
90
SoundLibraryOpenDialog(QWidget *pParent)
void on_soundLib_item_changed(bool bDrumkitSelected)
SoundLibraryPanel * m_pSoundLibraryPanel