Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preset browser #1383

Merged
merged 23 commits into from
Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
5ddccd2
Initial working version of preset browser.
akimaze May 21, 2022
5e2fb51
Fix deadlock when we create instrument during remove another one.
akimaze May 21, 2022
e410e4a
Make preset browser smaller at start.
akimaze May 21, 2022
d1d0824
Added getPresedBrowserFrame().
akimaze May 21, 2022
98141d7
Ability to select the note that will be played after holding down the…
akimaze May 21, 2022
b5ef581
Code clean.
akimaze May 21, 2022
0557990
Check file extension.
akimaze May 21, 2022
8d244a8
Play preset only on left mouse button click
akimaze May 21, 2022
922bfeb
Ability to show/hide preset browser.
akimaze May 22, 2022
0687e7e
Ability to set preset root folder, preset browser tab in preferences.
akimaze May 22, 2022
5f49ce9
Clean up includes.
akimaze May 22, 2022
1dddb45
Remove uneeded log.
akimaze May 22, 2022
37bd848
Faster loading of presets when the previous preset was the same or us…
akimaze May 26, 2022
10579e5
Fix typos and comments.
akimaze May 26, 2022
b0a1639
Set preset player intrument name to "Preset Preview"
akimaze May 26, 2022
0b039f7
Comment debug.
akimaze May 26, 2022
0e30958
Use radium::ScopedIgnoreUndo, some comments updates.
akimaze Jun 12, 2022
05265fd
Fix compilation after rebase.
akimaze Jun 12, 2022
2b01f0f
Revert "Fix deadlock when we create instrument during remove another …
akimaze Jun 12, 2022
63a4273
Add deletePresetDemoInstrument() and remove preset instrument on pres…
akimaze Jun 12, 2022
324ae28
Quick fix for undo in preset demo instrument.
akimaze Jun 13, 2022
1220c4e
Delete preset instrument when open or create new song.
akimaze Jul 10, 2022
abf3513
Don't use FocusSnifferQTreeView for preset browser tree - let editor …
akimaze Jul 10, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion Makefile.Qt
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ OBJ11= $(T)undo.o $(T)undo_notes.o $(T)undo_fxs.o $(T)undo_temponodes.o $(T)undo
#OBJ12= $(T)X11_visual.o $(T)X11_error.o $(T)X11_Ptask2Mtask.o $(T)X11_Bs_edit.o $(T)X11_Main.o $(T)X11_endprogram.o $(T)X11_disk.o $(T)X11_Player.o $(T)X11_memory.o $(T)X11_ReqType.o $(T)X11_keyboard.o $(T)X11_MidiProperties.o

#Qt Spesific
OBJ12= $(T)Qt_instruments.o $(T)Qt_visual.o $(T)GTK_visual.o $(T)Qt_Main.o $(T)KeyboardFocus.o $(T)Qt_endprogram.o $(T)Qt_EventReceiver.o $(T)Qt_colors.o $(T)Qt_Menues.o $(T)Qt_Fonts.o $(T)Qt_ReqType.o $(T)Qt_PopupMenu.o $(T)Qt_Bs_edit.o $(T)Qt_PluginWidget.o $(T)Qt_SliderPainter.o $(T)Qt_memory.o $(T)Qt_path_resolver.o $(T)Qt_settings.o $(T)Qt_disk.o $(T)Qt_MainWindow.o $(T)Qt_Time.o $(T)Qt_sequencer.o $(T)GTK_ReqType.o $(T)GTK_PopupMenu.o $(T)Qt_soundfilesaver_widget_callbacks.o $(T)Qt_comment_dialog.o $(T)Qt_song_properties.o $(T)Qt_preferences_callbacks.o $(T)Qt_tools_callbacks.o $(T)Qt_Error.o $(T)Qt_progresswindow.o $(T)Qt_check_for_updates.o $(T)Rational.o $(T)Qt_AutoBackups.o $(T)flowlayout.o
OBJ12= $(T)Qt_instruments.o $(T)Qt_visual.o $(T)GTK_visual.o $(T)Qt_Main.o $(T)KeyboardFocus.o $(T)Qt_endprogram.o $(T)Qt_EventReceiver.o $(T)Qt_colors.o $(T)Qt_Menues.o $(T)Qt_Fonts.o $(T)Qt_ReqType.o $(T)Qt_PopupMenu.o $(T)Qt_Bs_edit.o $(T)Qt_PluginWidget.o $(T)Qt_SliderPainter.o $(T)Qt_memory.o $(T)Qt_path_resolver.o $(T)Qt_settings.o $(T)Qt_disk.o $(T)Qt_MainWindow.o $(T)Qt_Time.o $(T)Qt_sequencer.o $(T)GTK_ReqType.o $(T)GTK_PopupMenu.o $(T)Qt_soundfilesaver_widget_callbacks.o $(T)Qt_comment_dialog.o $(T)Qt_song_properties.o $(T)Qt_preferences_callbacks.o $(T)Qt_tools_callbacks.o $(T)Qt_Error.o $(T)Qt_progresswindow.o $(T)Qt_check_for_updates.o $(T)Rational.o $(T)Qt_AutoBackups.o $(T)flowlayout.o $(T)Qt_PresetBrowser.o

#X11_MidiProperties.o $(T)X11_ClientMessages.o $(T)
#Qt_Bs_edit.o $(T)
Expand Down Expand Up @@ -1631,6 +1631,19 @@ $(T)Qt_instruments.o: $(BUILD_DEPENDENCIES) $(P)Qt_instruments.cpp $(INSTRUMENTS
# clang++ $(P)Qt_instruments.cpp $(QTOPT)


$(T)Qt_PresetBrowser.o: $(BUILD_DEPENDENCIES) $(P)Qt_PresetBrowser.cpp $(INSTRUMENTS_DEPENDENCIES)
$(MOC) $(P)/Qt_PresetBrowser.cpp >$(P)/mQt_PresetBrowser.cpp
@echo
@echo "Changed (Qt_PresetBrowser.o):"
@echo $?
@echo
if [ $(BUILDTYPE) = RELEASE ] ; then \
$(CCC2) $(P)Qt_PresetBrowser.cpp $(QTOPT) $(SNDFILEOPT) -Wno-null-dereference $(NO_ANALYZER) ; \
else \
$(CCC2) $(P)Qt_PresetBrowser.cpp $(QTOPT) $(SNDFILEOPT) -O0 -Wno-null-dereference $(NO_ANALYZER) ; \
fi


$(P)mQt_instruments_widget_callbacks.h: $(BUILD_DEPENDENCIES) $(P)qt4_instruments_widget.ui $(P)create_source_from_ui.sh $(P)Qt_instruments_widget_callbacks.h
cd $(P) && ./create_source_from_ui.sh $(UIC) $(MOC) instruments_widget

Expand Down
4 changes: 4 additions & 0 deletions Qt/EditorWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ struct EditorLayoutWidget : public radium::KeyboardFocusFrame{
: radium::KeyboardFocusFrame(NULL, radium::KeyboardFocusFrameType::EDITOR, true)
{
set_widget_takes_care_of_painting_everything(this);
// set size policy to expanding with factor 10
QSizePolicy editorSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum);
editorSizePolicy.setHorizontalStretch(10);
setSizePolicy(editorSizePolicy);
}
};

Expand Down
2 changes: 2 additions & 0 deletions Qt/FocusSniffers.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <QTableWidgetItem>
#include <QKeyEvent>
#include <QComboBox>
#include <QTreeView>
//#include <QFileDialog>

#include "helpers.h"
Expand Down Expand Up @@ -80,6 +81,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
//MakeFocusSnifferClass(QSpinBox);
//MakeFocusSnifferClass(QDoubleSpinBox);
MakeFocusSnifferClass(QLineEdit);
MakeFocusSnifferClass(QTreeView);
//MakeFocusSnifferClass(QComboBox);
//MakeFocusSnifferClass(QFileDialog);
//MakeFocusSnifferClass(QTextEdit);
Expand Down
16 changes: 16 additions & 0 deletions Qt/Qt_Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "Qt_colors_proc.h"
#include "Qt_AutoBackups_proc.h"
#include "Qt_Bs_edit_proc.h"
#include "Qt_PresetBrowser.h"

#include "Timer.hpp"
#include "mTimer.hpp"
Expand Down Expand Up @@ -3603,6 +3604,8 @@ int radium_main(const char *arg){
if(xsplitter->_strip_on_left_side)
xsplitter->add_mixer_strip();

xsplitter->addWidget(createPresetBrowserWidget(SETTINGS_read_qstring("preset_root_folder", QDir::homePath() + QString::fromUtf8("/Radium Presets"))));

editor->editor_layout_widget = new EditorLayoutWidget();
editor->editor_layout_widget->setMinimumWidth(550);
editor->editor_layout_widget->setMinimumHeight(100);
Expand All @@ -3615,6 +3618,19 @@ int radium_main(const char *arg){

block_selector->resize(100,block_selector->height());

// resize browser at start - without this browser gets a lot of space
QList<int> sizes = xsplitter->sizes();
int browserIndex = xsplitter->indexOf(getPresetBrowserWidgetFrame());
int editorIndex = xsplitter->indexOf(editor->editor_layout_widget);

if (browserIndex != -1 && editorIndex != -1) {
int space = sizes.at(browserIndex) + sizes.at(editorIndex);

sizes[browserIndex] = space * 0.3;
sizes[editorIndex] = space - sizes.at(browserIndex);
xsplitter->setSizes(sizes);
}

{
SEQUENCER_WIDGET_initialize(main_window);
createInstrumentsWidget();
Expand Down
Loading