hydrogen 1.2.3
SoundLibraryPanel.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-2024 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 SOUND_LIBRARY_PANEL_H
24#define SOUND_LIBRARY_PANEL_H
25
26
27#include <QtGui>
28#include <QtWidgets>
29
30#include <core/Object.h>
32
34#include "../EventListener.h"
35
37class ToggleButton;
38
40class SoundLibraryPanel : public QWidget, protected WidgetWithScalableFont<8, 10, 12>, private H2Core::Object<SoundLibraryPanel>, public EventListener
41{
43Q_OBJECT
44public:
45 SoundLibraryPanel( QWidget* parent, bool bInItsOwnDialog );
47
48 QString getDrumkitLabel( const QString& sDrumkitPath ) const;
49 QString getDrumkitPath( const QString& sDrumkitLabel ) const;
50
51 virtual void drumkitLoadedEvent() override;
52 virtual void updateSongEvent( int nValue ) override;
53 virtual void selectedInstrumentChangedEvent() override;
54 virtual void soundLibraryChangedEvent() override;
55
56public slots:
58
59private slots:
60 void on_DrumkitList_ItemChanged( QTreeWidgetItem* current, QTreeWidgetItem* previous );
61 void on_DrumkitList_itemActivated( QTreeWidgetItem* item, int column );
62 void on_DrumkitList_leftClicked( QPoint pos );
63 void on_DrumkitList_rightClicked( QPoint pos );
64 void on_DrumkitList_mouseMove( QMouseEvent* event );
65
69 void on_songLoadAction();
73
74signals:
75 void item_changed(bool bDrumkitSelected);
76
77private:
78 void updateTree();
79 void test_expandedItems();
81
83 //FileBrowser *m_pFileBrowser;
84
91
92 QTreeWidgetItem* m_pTreeSystemDrumkitsItem;
93 QTreeWidgetItem* m_pTreeUserDrumkitsItem;
95 QTreeWidgetItem* __song_item;
96 QTreeWidgetItem* __pattern_item;
97 QTreeWidgetItem* __pattern_item_list;
98
103
110 std::map<QString,QString> m_drumkitRegister;
114 QStringList m_drumkitLabels;
115
120};
121
122#endif
#define H2_OBJECT(name)
Definition Object.h:224
Changes
Bitwise or-able options showing which part of the Preferences were altered using the PreferencesDialo...
std::map< QString, QString > m_drumkitRegister
Used to uniquely identify the drumkit corresponding to an item in the tree.
QString getDrumkitLabel(const QString &sDrumkitPath) const
QTreeWidgetItem * m_pTreeSessionDrumkitsItem
void on_DrumkitList_ItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous)
SoundLibraryPanel(QWidget *parent, bool bInItsOwnDialog)
void on_DrumkitList_leftClicked(QPoint pos)
QTreeWidgetItem * __pattern_item
void onPreferencesChanged(H2Core::Preferences::Changes changes)
virtual void updateSongEvent(int nValue) override
virtual void soundLibraryChangedEvent() override
virtual void drumkitLoadedEvent() override
QTreeWidgetItem * __pattern_item_list
bool m_bInItsOwnDialog
Whether the dialog was constructed via a click in the MainForm or as part of the GUI.
QStringList m_drumkitLabels
List of all labels used for drumkits in the tree.
void item_changed(bool bDrumkitSelected)
QString getDrumkitPath(const QString &sDrumkitLabel) const
SoundLibraryTree * __sound_library_tree
virtual void selectedInstrumentChangedEvent() override
QTreeWidgetItem * m_pTreeSystemDrumkitsItem
QTreeWidgetItem * __song_item
void on_DrumkitList_mouseMove(QMouseEvent *event)
void on_DrumkitList_itemActivated(QTreeWidgetItem *item, int column)
QTreeWidgetItem * m_pTreeUserDrumkitsItem
void on_DrumkitList_rightClicked(QPoint pos)
Widget is affected by the "Font size" settings in the PreferencesDialog.