From 8dfa2cf7d095d15b75447c0b34b57a229951b15e Mon Sep 17 00:00:00 2001 From: Dave French Date: Fri, 6 Mar 2015 14:35:47 +0000 Subject: [PATCH 1/6] Reorganised the paths dialog Wrapped the path selection widgets in a Scroll Area, to allow for the addition of addition paths. Where multipue paths are allowed the icon has been changed to refect this. Reordered the list. --- include/SetupDialog.h | 1 + src/gui/SetupDialog.cpp | 133 ++++++++++++++++++++++++---------------- 2 files changed, 80 insertions(+), 54 deletions(-) diff --git a/include/SetupDialog.h b/include/SetupDialog.h index 8b5abfeb7..77b4cc753 100644 --- a/include/SetupDialog.h +++ b/include/SetupDialog.h @@ -1,3 +1,4 @@ + /* * SetupDialog.h - dialog for setting up LMMS * diff --git a/src/gui/SetupDialog.cpp b/src/gui/SetupDialog.cpp index 91984f696..c58a50c32 100644 --- a/src/gui/SetupDialog.cpp +++ b/src/gui/SetupDialog.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include "SetupDialog.h" #include "TabBar.h" @@ -378,15 +379,34 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : dir_layout->setSpacing( 0 ); dir_layout->setMargin( 0 ); labelWidget( paths, tr( "Paths" ) ); + QLabel * title = new QLabel( tr( "Directories" ), paths ); + QFont f = title->font(); + f.setBold( true ); + title->setFont( pointSize<12>( f ) ); + + + QScrollArea *pathScroll = new QScrollArea( paths ); + + QWidget *pathSelectors = new QWidget( ws ); + QVBoxLayout *pathSelectorLayout = new QVBoxLayout; + pathScroll->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn ); + pathScroll->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); + pathScroll->resize( 360, pathsHeight - 50 ); + pathScroll->move( 0, 50 ); + pathSelectors->resize( 360, pathsHeight ); + + const int txtLength = 285; + const int btnStart = 305; + // working-dir TabWidget * lmms_wd_tw = new TabWidget( tr( "LMMS working directory" ).toUpper(), - paths ); + pathSelectors ); lmms_wd_tw->setFixedHeight( 48 ); m_wdLineEdit = new QLineEdit( m_workingDir, lmms_wd_tw ); - m_wdLineEdit->setGeometry( 10, 20, 300, 16 ); + m_wdLineEdit->setGeometry( 10, 20, txtLength, 16 ); connect( m_wdLineEdit, SIGNAL( textChanged( const QString & ) ), this, SLOT( setWorkingDir( const QString & ) ) ); @@ -394,37 +414,19 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : embed::getIconPixmap( "project_open", 16, 16 ), "", lmms_wd_tw ); workingdir_select_btn->setFixedSize( 24, 24 ); - workingdir_select_btn->move( 320, 16 ); + workingdir_select_btn->move( btnStart, 16 ); connect( workingdir_select_btn, SIGNAL( clicked() ), this, SLOT( openWorkingDir() ) ); - // vst-dir - TabWidget * vst_tw = new TabWidget( tr( - "VST-plugin directory" ).toUpper(), - paths ); - vst_tw->setFixedHeight( 48 ); - - m_vdLineEdit = new QLineEdit( m_vstDir, vst_tw ); - m_vdLineEdit->setGeometry( 10, 20, 300, 16 ); - connect( m_vdLineEdit, SIGNAL( textChanged( const QString & ) ), this, - SLOT( setVSTDir( const QString & ) ) ); - - QPushButton * vstdir_select_btn = new QPushButton( - embed::getIconPixmap( "project_open", 16, 16 ), - "", vst_tw ); - vstdir_select_btn->setFixedSize( 24, 24 ); - vstdir_select_btn->move( 320, 16 ); - connect( vstdir_select_btn, SIGNAL( clicked() ), this, - SLOT( openVSTDir() ) ); // artwork-dir TabWidget * artwork_tw = new TabWidget( tr( - "Artwork directory" ).toUpper(), - paths ); + "Themes directory" ).toUpper(), + pathSelectors ); artwork_tw->setFixedHeight( 48 ); m_adLineEdit = new QLineEdit( m_artworkDir, artwork_tw ); - m_adLineEdit->setGeometry( 10, 20, 300, 16 ); + m_adLineEdit->setGeometry( 10, 20, txtLength, 16 ); connect( m_adLineEdit, SIGNAL( textChanged( const QString & ) ), this, SLOT( setArtworkDir( const QString & ) ) ); @@ -432,7 +434,7 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : embed::getIconPixmap( "project_open", 16, 16 ), "", artwork_tw ); artworkdir_select_btn->setFixedSize( 24, 24 ); - artworkdir_select_btn->move( 320, 16 ); + artworkdir_select_btn->move( btnStart, 16 ); connect( artworkdir_select_btn, SIGNAL( clicked() ), this, SLOT( openArtworkDir() ) ); @@ -445,7 +447,7 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : m_baLineEdit = new QLineEdit( m_backgroundArtwork, backgroundArtwork_tw ); - m_baLineEdit->setGeometry( 10, 20, 300, 16 ); + m_baLineEdit->setGeometry( 10, 20, txtLength, 16 ); connect( m_baLineEdit, SIGNAL( textChanged( const QString & ) ), this, SLOT( setBackgroundArtwork( const QString & ) ) ); @@ -453,7 +455,7 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : embed::getIconPixmap( "project_open", 16, 16 ), "", backgroundArtwork_tw ); backgroundartworkdir_select_btn->setFixedSize( 24, 24 ); - backgroundartworkdir_select_btn->move( 320, 16 ); + backgroundartworkdir_select_btn->move( btnStart, 16 ); connect( backgroundartworkdir_select_btn, SIGNAL( clicked() ), this, SLOT( openBackgroundArtwork() ) ); @@ -468,7 +470,7 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : fl_tw->setFixedHeight( 48 ); m_fdLineEdit = new QLineEdit( m_flDir, fl_tw ); - m_fdLineEdit->setGeometry( 10, 20, 300, 16 ); + m_fdLineEdit->setGeometry( 10, 20, txtLength, 16 ); connect( m_fdLineEdit, SIGNAL( textChanged( const QString & ) ), this, SLOT( setFLDir( const QString & ) ) ); @@ -476,28 +478,49 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : embed::getIconPixmap( "project_open", 16, 16 ), "", fl_tw ); fldir_select_btn->setFixedSize( 24, 24 ); - fldir_select_btn->move( 320, 16 ); + fldir_select_btn->move( btnStart, 16 ); connect( fldir_select_btn, SIGNAL( clicked() ), this, SLOT( openFLDir() ) ); + + // vst-dir + TabWidget * vst_tw = new TabWidget( tr( + "VST-plugin directory" ).toUpper(), + pathSelectors ); + vst_tw->setFixedHeight( 48 ); + + m_vdLineEdit = new QLineEdit( m_vstDir, vst_tw ); + m_vdLineEdit->setGeometry( 10, 20, txtLength, 16 ); + connect( m_vdLineEdit, SIGNAL( textChanged( const QString & ) ), this, + SLOT( setVSTDir( const QString & ) ) ); + + QPushButton * vstdir_select_btn = new QPushButton( + embed::getIconPixmap( "project_open", 16, 16 ), + "", vst_tw ); + vstdir_select_btn->setFixedSize( 24, 24 ); + vstdir_select_btn->move( btnStart, 16 ); + connect( vstdir_select_btn, SIGNAL( clicked() ), this, + SLOT( openVSTDir() ) ); + // LADSPA-dir TabWidget * lad_tw = new TabWidget( tr( - "LADSPA plugin paths" ).toUpper(), + "LADSPA plugin directories" ).toUpper(), paths ); lad_tw->setFixedHeight( 48 ); m_ladLineEdit = new QLineEdit( m_ladDir, lad_tw ); - m_ladLineEdit->setGeometry( 10, 20, 300, 16 ); + m_ladLineEdit->setGeometry( 10, 20, txtLength, 16 ); connect( m_ladLineEdit, SIGNAL( textChanged( const QString & ) ), this, SLOT( setLADSPADir( const QString & ) ) ); QPushButton * laddir_select_btn = new QPushButton( - embed::getIconPixmap( "project_open", 16, 16 ), + embed::getIconPixmap( "project_new_from_template", 16, 16 ), "", lad_tw ); laddir_select_btn->setFixedSize( 24, 24 ); - laddir_select_btn->move( 320, 16 ); + laddir_select_btn->move( btnStart, 16 ); connect( laddir_select_btn, SIGNAL( clicked() ), this, SLOT( openLADSPADir() ) ); + #ifdef LMMS_HAVE_STK // STK-dir TabWidget * stk_tw = new TabWidget( tr( @@ -506,7 +529,7 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : stk_tw->setFixedHeight( 48 ); m_stkLineEdit = new QLineEdit( m_stkDir, stk_tw ); - m_stkLineEdit->setGeometry( 10, 20, 300, 16 ); + m_stkLineEdit->setGeometry( 10, 20, txtLength, 16 ); connect( m_stkLineEdit, SIGNAL( textChanged( const QString & ) ), this, SLOT( setSTKDir( const QString & ) ) ); @@ -514,7 +537,7 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : embed::getIconPixmap( "project_open", 16, 16 ), "", stk_tw ); stkdir_select_btn->setFixedSize( 24, 24 ); - stkdir_select_btn->move( 320, 16 ); + stkdir_select_btn->move( btnStart, 16 ); connect( stkdir_select_btn, SIGNAL( clicked() ), this, SLOT( openSTKDir() ) ); #endif @@ -526,7 +549,7 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : sf_tw->setFixedHeight( 48 ); m_sfLineEdit = new QLineEdit( m_defaultSoundfont, sf_tw ); - m_sfLineEdit->setGeometry( 10, 20, 300, 16 ); + m_sfLineEdit->setGeometry( 10, 20, txtLength, 16 ); connect( m_sfLineEdit, SIGNAL( textChanged( const QString & ) ), this, SLOT( setDefaultSoundfont( const QString & ) ) ); @@ -534,34 +557,37 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : embed::getIconPixmap( "project_open", 16, 16 ), "", sf_tw ); sf_select_btn->setFixedSize( 24, 24 ); - sf_select_btn->move( 320, 16 ); + sf_select_btn->move( btnStart, 16 ); connect( sf_select_btn, SIGNAL( clicked() ), this, SLOT( openDefaultSoundfont() ) ); #endif + pathSelectors->setLayout( pathSelectorLayout ); - dir_layout->addWidget( lmms_wd_tw ); - dir_layout->addSpacing( 10 ); - dir_layout->addWidget( vst_tw ); - dir_layout->addSpacing( 10 ); - dir_layout->addWidget( artwork_tw ); - dir_layout->addSpacing( 10 ); - dir_layout->addWidget( backgroundArtwork_tw ); - dir_layout->addSpacing( 10 ); - dir_layout->addWidget( fl_tw ); - dir_layout->addSpacing( 10 ); - dir_layout->addWidget( lad_tw ); + pathSelectorLayout->addWidget( lmms_wd_tw ); + pathSelectorLayout->addSpacing( 10 ); + pathSelectorLayout->addWidget( artwork_tw ); + pathSelectorLayout->addSpacing( 10 ); + pathSelectorLayout->addWidget( backgroundArtwork_tw ); + pathSelectorLayout->addSpacing( 10 ); + pathSelectorLayout->addWidget( fl_tw ); + pathSelectorLayout->addSpacing( 10 ); + pathSelectorLayout->addWidget( vst_tw ); + pathSelectorLayout->addSpacing( 10 ); + pathSelectorLayout->addWidget( lad_tw ); #ifdef LMMS_HAVE_STK - dir_layout->addSpacing( 10 ); - dir_layout->addWidget( stk_tw ); + pathSelectorLayout->addSpacing( 10 ); + pathSelectorLayout->addWidget( stk_tw ); #endif #ifdef LMMS_HAVE_FLUIDSYNTH - dir_layout->addSpacing( 10 ); - dir_layout->addWidget( sf_tw ); + pathSelectorLayout->addSpacing( 10 ); + pathSelectorLayout->addWidget( sf_tw ); #endif - dir_layout->addStretch(); + pathSelectorLayout->addStretch(); + dir_layout->addWidget( pathSelectors ); + pathScroll->setWidget( pathSelectors ); @@ -1218,7 +1244,6 @@ void SetupDialog::openLADSPADir() - void SetupDialog::openSTKDir() { #ifdef LMMS_HAVE_STK From 2271af81c41adf8faecfa26e8f1cb491ebaa221f Mon Sep 17 00:00:00 2001 From: Dave French Date: Fri, 6 Mar 2015 18:56:15 +0000 Subject: [PATCH 2/6] Added a Gig directory to user lmms folder Added option to set gig folder in setup dialog Gig player now opens at this location --- include/ConfigManager.h | 13 +++++++++++ include/SetupDialog.h | 4 ++++ plugins/GigPlayer/GigPlayer.cpp | 4 ++-- src/core/ConfigManager.cpp | 10 +++++++++ src/gui/SetupDialog.cpp | 39 +++++++++++++++++++++++++++++++++ 5 files changed, 68 insertions(+), 2 deletions(-) diff --git a/include/ConfigManager.h b/include/ConfigManager.h index 36fbdebb5..5eeda6a80 100644 --- a/include/ConfigManager.h +++ b/include/ConfigManager.h @@ -43,6 +43,7 @@ class Engine; const QString PROJECTS_PATH = "projects/"; const QString PRESETS_PATH = "presets/"; const QString SAMPLES_PATH = "samples/"; +const QString GIG_PATH = "samples/gig"; const QString DEFAULT_THEME_PATH = "themes/default/"; const QString TRACK_ICON_PATH = "track_icons/"; const QString LOCALE_PATH = "locale/"; @@ -86,6 +87,11 @@ public: return workingDir() + SAMPLES_PATH; } + QString userGigDir() const + { + return workingDir() + GIG_PATH; + } + QString factoryProjectsDir() const { return dataDir() + PROJECTS_PATH; @@ -126,6 +132,11 @@ public: return m_dataDir + LOCALE_PATH; } + const QString & gigDir() const + { + return m_gigDir; + } + const QString & pluginDir() const { return m_pluginDir; @@ -200,6 +211,7 @@ public: void setSTKDir( const QString & _fd ); void setDefaultSoundfont( const QString & _sf ); void setBackgroundArtwork( const QString & _ba ); + void setGIGDir( const QString & gd ); private: @@ -220,6 +232,7 @@ private: QString m_vstDir; QString m_flDir; QString m_ladDir; + QString m_gigDir; QString m_version; #ifdef LMMS_HAVE_STK QString m_stkDir; diff --git a/include/SetupDialog.h b/include/SetupDialog.h index 77b4cc753..2744c2756 100644 --- a/include/SetupDialog.h +++ b/include/SetupDialog.h @@ -72,6 +72,7 @@ private slots: // path settings widget void setWorkingDir( const QString & _wd ); void setVSTDir( const QString & _vd ); + void setGIGDir( const QString & _gd); void setArtworkDir( const QString & _ad ); void setFLDir( const QString & _fd ); void setLADSPADir( const QString & _ld ); @@ -97,6 +98,7 @@ private slots: void openWorkingDir(); void openVSTDir(); + void openGIGDir(); void openArtworkDir(); void openFLDir(); void openLADSPADir(); @@ -139,6 +141,7 @@ private: QLineEdit * m_adLineEdit; QLineEdit * m_fdLineEdit; QLineEdit * m_ladLineEdit; + QLineEdit * m_gigLineEdit; #ifdef LMMS_HAVE_FLUIDSYNTH QLineEdit * m_sfLineEdit; #endif @@ -152,6 +155,7 @@ private: QString m_artworkDir; QString m_flDir; QString m_ladDir; + QString m_gigDir; #ifdef LMMS_HAVE_FLUIDSYNTH QString m_defaultSoundfont; #endif diff --git a/plugins/GigPlayer/GigPlayer.cpp b/plugins/GigPlayer/GigPlayer.cpp index 8d17b1f2e..22d539a63 100644 --- a/plugins/GigPlayer/GigPlayer.cpp +++ b/plugins/GigPlayer/GigPlayer.cpp @@ -1069,7 +1069,7 @@ void GigInstrumentView::showFileDialog() if( QFileInfo( f ).isRelative() ) { - f = ConfigManager::inst()->userSamplesDir() + f; + f = ConfigManager::inst()->gigDir() + f; if( QFileInfo( f ).exists() == false ) { @@ -1082,7 +1082,7 @@ void GigInstrumentView::showFileDialog() } else { - ofd.setDirectory( ConfigManager::inst()->userSamplesDir() ); + ofd.setDirectory( ConfigManager::inst()->gigDir() ); } m_fileDialogButton->setEnabled( false ); diff --git a/src/core/ConfigManager.cpp b/src/core/ConfigManager.cpp index 1254977f0..6e77640b5 100644 --- a/src/core/ConfigManager.cpp +++ b/src/core/ConfigManager.cpp @@ -67,6 +67,7 @@ ConfigManager::ConfigManager() : #endif m_vstDir( m_workingDir + "vst" + QDir::separator() ), m_flDir( QDir::home().absolutePath() ), + m_gigDir( m_workingDir + GIG_PATH ), m_version( defaultVersion() ) { } @@ -179,6 +180,11 @@ void ConfigManager::setBackgroundArtwork( const QString & _ba ) #endif } +void ConfigManager::setGIGDir(const QString &gd) +{ + m_gigDir = gd; +} + @@ -339,6 +345,8 @@ void ConfigManager::loadConfigFile() } } setWorkingDir( value( "paths", "workingdir" ) ); + + setGIGDir( value( "paths", "gigdir" ) == "" ? gigDir() : value( "paths", "gigdir" ) ); setVSTDir( value( "paths", "vstdir" ) ); setFLDir( value( "paths", "fldir" ) ); setLADSPADir( value( "paths", "laddir" ) ); @@ -425,6 +433,7 @@ void ConfigManager::loadConfigFile() QDir().mkpath( userProjectsDir() ); QDir().mkpath( userSamplesDir() ); QDir().mkpath( userPresetsDir() ); + QDir().mkpath( userGigDir() ); } upgrade(); @@ -439,6 +448,7 @@ void ConfigManager::saveConfigFile() setValue( "paths", "workingdir", m_workingDir ); setValue( "paths", "vstdir", m_vstDir ); setValue( "paths", "fldir", m_flDir ); + setValue( "paths", "gigdir", m_gigDir ); setValue( "paths", "laddir", m_ladDir ); #ifdef LMMS_HAVE_STK setValue( "paths", "stkdir", m_stkDir ); diff --git a/src/gui/SetupDialog.cpp b/src/gui/SetupDialog.cpp index c58a50c32..edd8b63ff 100644 --- a/src/gui/SetupDialog.cpp +++ b/src/gui/SetupDialog.cpp @@ -106,6 +106,7 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : m_artworkDir( QDir::toNativeSeparators( ConfigManager::inst()->artworkDir() ) ), m_flDir( QDir::toNativeSeparators( ConfigManager::inst()->flDir() ) ), m_ladDir( QDir::toNativeSeparators( ConfigManager::inst()->ladspaDir() ) ), + m_gigDir( QDir::toNativeSeparators( ConfigManager::inst()->gigDir() ) ), #ifdef LMMS_HAVE_FLUIDSYNTH m_defaultSoundfont( QDir::toNativeSeparators( ConfigManager::inst()->defaultSoundfont() ) ), #endif @@ -501,6 +502,25 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : connect( vstdir_select_btn, SIGNAL( clicked() ), this, SLOT( openVSTDir() ) ); + // gig-dir + TabWidget * gig_tw = new TabWidget( tr( + "GIG directory" ).toUpper(), + pathSelectors ); + gig_tw->setFixedHeight( 48 ); + + m_gigLineEdit = new QLineEdit( m_gigDir, gig_tw ); + m_gigLineEdit->setGeometry( 10, 20, txtLength, 16 ); + connect( m_gigLineEdit, SIGNAL( textChanged( const QString & ) ), this, + SLOT( setGIGDir( const QString & ) ) ); + + QPushButton * gigdir_select_btn = new QPushButton( + embed::getIconPixmap( "project_open", 16, 16 ), + "", gig_tw ); + gigdir_select_btn->setFixedSize( 24, 24 ); + gigdir_select_btn->move( btnStart, 16 ); + connect( gigdir_select_btn, SIGNAL( clicked() ), this, + SLOT( openGIGDir() ) ); + // LADSPA-dir TabWidget * lad_tw = new TabWidget( tr( "LADSPA plugin directories" ).toUpper(), @@ -566,6 +586,8 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : pathSelectorLayout->addWidget( lmms_wd_tw ); pathSelectorLayout->addSpacing( 10 ); + pathSelectorLayout->addWidget( gig_tw ); + pathSelectorLayout->addSpacing( 10 ); pathSelectorLayout->addWidget( artwork_tw ); pathSelectorLayout->addSpacing( 10 ); pathSelectorLayout->addWidget( backgroundArtwork_tw ); @@ -931,6 +953,7 @@ void SetupDialog::accept() ConfigManager::inst()->setWorkingDir( m_workingDir ); ConfigManager::inst()->setVSTDir( m_vstDir ); + ConfigManager::inst()->setGIGDir( m_gigDir ); ConfigManager::inst()->setArtworkDir( m_artworkDir ); ConfigManager::inst()->setFLDir( m_flDir ); ConfigManager::inst()->setLADSPADir( m_ladDir ); @@ -1154,6 +1177,17 @@ void SetupDialog::openWorkingDir() } } +void SetupDialog::openGIGDir() +{ + QString new_dir = FileDialog::getExistingDirectory( this, + tr( "Choose your GIG directory" ), + m_gigDir ); + if( new_dir != QString::null ) + { + m_gigLineEdit->setText( new_dir ); + } +} + @@ -1184,6 +1218,11 @@ void SetupDialog::setVSTDir( const QString & _vd ) m_vstDir = _vd; } +void SetupDialog::setGIGDir(const QString &_gd) +{ + +} + From e9b15b51fb81e06454675f8a890ab484f240e87b Mon Sep 17 00:00:00 2001 From: Dave French Date: Sun, 8 Mar 2015 14:19:58 +0000 Subject: [PATCH 3/6] Path Dialog added icon artwork, minor ui tweek added add_folder.png icon to use for adding addition folders. this may need attention by others changed layout to correctly display scroll bar --- data/themes/default/add_folder.png | Bin 0 -> 818 bytes src/gui/SetupDialog.cpp | 6 +++--- 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 data/themes/default/add_folder.png diff --git a/data/themes/default/add_folder.png b/data/themes/default/add_folder.png new file mode 100644 index 0000000000000000000000000000000000000000..710c7e80ea2f26544eef5f9449481d9b95e3fc3d GIT binary patch literal 818 zcmV-21I_%2P)IYA^r*0>4Q_ zK~y-)m6J`2TtyUypHo%$c4sE@K^SB}F(ZU9#EcUfk!;-PM(_vt2bw@Y@(*0Nb)hT4 zg}Bon5Z8%3+kS#I_G`sy{FC*YNOZd znfD$usHCR91%vL~aMSsi|s@Z(3H z-~9B)2mH|e4Hd-+&@i412RQHeW%ZEHPQIiW18ZT4>)rK>3Gd#2-@kS1H5!Wr>J8@s zj3+0@td%QVT3h01IHY^jWheej)qUY&LR9Sc!+pwLNoWL$Lhw!DZ#r0&(U|F{Q<5sC zLp18egz?>nyX}YfIOudxRel{F@Xg>cte#LEN3Q;{L~HRX-U|TNmY(|$g^*s~d}W&K zo&Co=_@+*So}>sM*c_+LlGQCn9xJNjrk$cTsp^quqCoAuRq7W!T~7$3LLoDWt_SOs wbfj)_R*wS+Ii=!@k3Jake}>JkPt(-+2iR|^y<^9t+5i9m07*qoM6N<$f(w>_SO5S3 literal 0 HcmV?d00001 diff --git a/src/gui/SetupDialog.cpp b/src/gui/SetupDialog.cpp index edd8b63ff..064a263e8 100644 --- a/src/gui/SetupDialog.cpp +++ b/src/gui/SetupDialog.cpp @@ -393,8 +393,8 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : pathScroll->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn ); pathScroll->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); pathScroll->resize( 360, pathsHeight - 50 ); - pathScroll->move( 0, 50 ); - pathSelectors->resize( 360, pathsHeight ); + pathScroll->move( 0, 30 ); + pathSelectors->resize( 360, pathsHeight - 50 ); const int txtLength = 285; const int btnStart = 305; @@ -533,7 +533,7 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : SLOT( setLADSPADir( const QString & ) ) ); QPushButton * laddir_select_btn = new QPushButton( - embed::getIconPixmap( "project_new_from_template", 16, 16 ), + embed::getIconPixmap( "add_folder", 16, 16 ), "", lad_tw ); laddir_select_btn->setFixedSize( 24, 24 ); laddir_select_btn->move( btnStart, 16 ); From d9995f55488e0bd79ae8cbd8796e3ad7dc6a4612 Mon Sep 17 00:00:00 2001 From: Dave French Date: Sun, 8 Mar 2015 17:57:55 +0000 Subject: [PATCH 4/6] Add default path for SF2 added a default path for sf create folder add folder to setup dialog sf player now uses this location --- include/ConfigManager.h | 8 ++++++ include/SetupDialog.h | 6 ++++- plugins/sf2_player/sf2_player.cpp | 4 +-- src/core/ConfigManager.cpp | 9 +++++++ src/gui/SetupDialog.cpp | 44 ++++++++++++++++++++++++++++++- 5 files changed, 67 insertions(+), 4 deletions(-) diff --git a/include/ConfigManager.h b/include/ConfigManager.h index 5eeda6a80..026a64d02 100644 --- a/include/ConfigManager.h +++ b/include/ConfigManager.h @@ -44,6 +44,7 @@ const QString PROJECTS_PATH = "projects/"; const QString PRESETS_PATH = "presets/"; const QString SAMPLES_PATH = "samples/"; const QString GIG_PATH = "samples/gig"; +const QString SF2_PATH = "samples/sf2"; const QString DEFAULT_THEME_PATH = "themes/default/"; const QString TRACK_ICON_PATH = "track_icons/"; const QString LOCALE_PATH = "locale/"; @@ -137,6 +138,11 @@ public: return m_gigDir; } + const QString & sf2Dir() const + { + return m_sf2Dir; + } + const QString & pluginDir() const { return m_pluginDir; @@ -212,6 +218,7 @@ public: void setDefaultSoundfont( const QString & _sf ); void setBackgroundArtwork( const QString & _ba ); void setGIGDir( const QString & gd ); + void setSF2Dir( const QString & sfd ); private: @@ -233,6 +240,7 @@ private: QString m_flDir; QString m_ladDir; QString m_gigDir; + QString m_sf2Dir; QString m_version; #ifdef LMMS_HAVE_STK QString m_stkDir; diff --git a/include/SetupDialog.h b/include/SetupDialog.h index 2744c2756..3357bf54c 100644 --- a/include/SetupDialog.h +++ b/include/SetupDialog.h @@ -72,7 +72,8 @@ private slots: // path settings widget void setWorkingDir( const QString & _wd ); void setVSTDir( const QString & _vd ); - void setGIGDir( const QString & _gd); + void setGIGDir( const QString & _gd ); + void setSF2Dir( const QString & _sfd ); void setArtworkDir( const QString & _ad ); void setFLDir( const QString & _fd ); void setLADSPADir( const QString & _ld ); @@ -99,6 +100,7 @@ private slots: void openWorkingDir(); void openVSTDir(); void openGIGDir(); + void openSF2Dir(); void openArtworkDir(); void openFLDir(); void openLADSPADir(); @@ -142,6 +144,7 @@ private: QLineEdit * m_fdLineEdit; QLineEdit * m_ladLineEdit; QLineEdit * m_gigLineEdit; + QLineEdit * m_sf2LineEdit; #ifdef LMMS_HAVE_FLUIDSYNTH QLineEdit * m_sfLineEdit; #endif @@ -156,6 +159,7 @@ private: QString m_flDir; QString m_ladDir; QString m_gigDir; + QString m_sf2Dir; #ifdef LMMS_HAVE_FLUIDSYNTH QString m_defaultSoundfont; #endif diff --git a/plugins/sf2_player/sf2_player.cpp b/plugins/sf2_player/sf2_player.cpp index f2acd2f07..90264abed 100644 --- a/plugins/sf2_player/sf2_player.cpp +++ b/plugins/sf2_player/sf2_player.cpp @@ -1068,7 +1068,7 @@ void sf2InstrumentView::showFileDialog() QString f = k->m_filename; if( QFileInfo( f ).isRelative() ) { - f = ConfigManager::inst()->userSamplesDir() + f; + f = ConfigManager::inst()->sf2Dir() + f; if( QFileInfo( f ).exists() == false ) { f = ConfigManager::inst()->factorySamplesDir() + k->m_filename; @@ -1079,7 +1079,7 @@ void sf2InstrumentView::showFileDialog() } else { - ofd.setDirectory( ConfigManager::inst()->userSamplesDir() ); + ofd.setDirectory( ConfigManager::inst()->sf2Dir() ); } m_fileDialogButton->setEnabled( false ); diff --git a/src/core/ConfigManager.cpp b/src/core/ConfigManager.cpp index 6e77640b5..a7328e5ee 100644 --- a/src/core/ConfigManager.cpp +++ b/src/core/ConfigManager.cpp @@ -68,6 +68,7 @@ ConfigManager::ConfigManager() : m_vstDir( m_workingDir + "vst" + QDir::separator() ), m_flDir( QDir::home().absolutePath() ), m_gigDir( m_workingDir + GIG_PATH ), + m_sf2Dir( m_workingDir + SF2_PATH ), m_version( defaultVersion() ) { } @@ -185,6 +186,11 @@ void ConfigManager::setGIGDir(const QString &gd) m_gigDir = gd; } +void ConfigManager::setSF2Dir(const QString &sfd) +{ + m_sf2Dir = sfd; +} + @@ -347,6 +353,7 @@ void ConfigManager::loadConfigFile() setWorkingDir( value( "paths", "workingdir" ) ); setGIGDir( value( "paths", "gigdir" ) == "" ? gigDir() : value( "paths", "gigdir" ) ); + setSF2Dir( value( "paths", "sf2dir" ) == "" ? sf2Dir() : value( "paths", "sf2dir" ) ); setVSTDir( value( "paths", "vstdir" ) ); setFLDir( value( "paths", "fldir" ) ); setLADSPADir( value( "paths", "laddir" ) ); @@ -434,6 +441,7 @@ void ConfigManager::loadConfigFile() QDir().mkpath( userSamplesDir() ); QDir().mkpath( userPresetsDir() ); QDir().mkpath( userGigDir() ); + QDir().mkpath( sf2Dir() ); } upgrade(); @@ -449,6 +457,7 @@ void ConfigManager::saveConfigFile() setValue( "paths", "vstdir", m_vstDir ); setValue( "paths", "fldir", m_flDir ); setValue( "paths", "gigdir", m_gigDir ); + setValue( "paths", "sf2dir", m_sf2Dir ); setValue( "paths", "laddir", m_ladDir ); #ifdef LMMS_HAVE_STK setValue( "paths", "stkdir", m_stkDir ); diff --git a/src/gui/SetupDialog.cpp b/src/gui/SetupDialog.cpp index 064a263e8..9cbd1a6fa 100644 --- a/src/gui/SetupDialog.cpp +++ b/src/gui/SetupDialog.cpp @@ -107,6 +107,7 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : m_flDir( QDir::toNativeSeparators( ConfigManager::inst()->flDir() ) ), m_ladDir( QDir::toNativeSeparators( ConfigManager::inst()->ladspaDir() ) ), m_gigDir( QDir::toNativeSeparators( ConfigManager::inst()->gigDir() ) ), + m_sf2Dir( QDir::toNativeSeparators( ConfigManager::inst()->sf2Dir() ) ), #ifdef LMMS_HAVE_FLUIDSYNTH m_defaultSoundfont( QDir::toNativeSeparators( ConfigManager::inst()->defaultSoundfont() ) ), #endif @@ -392,7 +393,7 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : QVBoxLayout *pathSelectorLayout = new QVBoxLayout; pathScroll->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn ); pathScroll->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); - pathScroll->resize( 360, pathsHeight - 50 ); + pathScroll->resize( 362, pathsHeight - 50 ); pathScroll->move( 0, 30 ); pathSelectors->resize( 360, pathsHeight - 50 ); @@ -521,6 +522,27 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : connect( gigdir_select_btn, SIGNAL( clicked() ), this, SLOT( openGIGDir() ) ); + // sf2-dir + TabWidget * sf2_tw = new TabWidget( tr( + "SF2 directory" ).toUpper(), + pathSelectors ); + sf2_tw->setFixedHeight( 48 ); + + m_sf2LineEdit = new QLineEdit( m_sf2Dir, sf2_tw ); + m_sf2LineEdit->setGeometry( 10, 20, txtLength, 16 ); + connect( m_sf2LineEdit, SIGNAL( textChanged( const QString & ) ), this, + SLOT( setSF2Dir( const QString & ) ) ); + + QPushButton * sf2dir_select_btn = new QPushButton( + embed::getIconPixmap( "project_open", 16, 16 ), + "", sf2_tw ); + sf2dir_select_btn->setFixedSize( 24, 24 ); + sf2dir_select_btn->move( btnStart, 16 ); + connect( sf2dir_select_btn, SIGNAL( clicked() ), this, + SLOT( openSF2Dir() ) ); + + + // LADSPA-dir TabWidget * lad_tw = new TabWidget( tr( "LADSPA plugin directories" ).toUpper(), @@ -588,6 +610,8 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : pathSelectorLayout->addSpacing( 10 ); pathSelectorLayout->addWidget( gig_tw ); pathSelectorLayout->addSpacing( 10 ); + pathSelectorLayout->addWidget( sf2_tw ); + pathSelectorLayout->addSpacing( 10 ); pathSelectorLayout->addWidget( artwork_tw ); pathSelectorLayout->addSpacing( 10 ); pathSelectorLayout->addWidget( backgroundArtwork_tw ); @@ -610,6 +634,7 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : dir_layout->addWidget( pathSelectors ); pathScroll->setWidget( pathSelectors ); + pathScroll->setWidgetResizable( true ); @@ -954,6 +979,7 @@ void SetupDialog::accept() ConfigManager::inst()->setWorkingDir( m_workingDir ); ConfigManager::inst()->setVSTDir( m_vstDir ); ConfigManager::inst()->setGIGDir( m_gigDir ); + ConfigManager::inst()->setSF2Dir( m_sf2Dir ); ConfigManager::inst()->setArtworkDir( m_artworkDir ); ConfigManager::inst()->setFLDir( m_flDir ); ConfigManager::inst()->setLADSPADir( m_ladDir ); @@ -1188,6 +1214,17 @@ void SetupDialog::openGIGDir() } } +void SetupDialog::openSF2Dir() +{ + QString new_dir = FileDialog::getExistingDirectory( this, + tr( "Choose your SF2 directory" ), + m_sf2Dir ); + if( new_dir != QString::null ) + { + m_sf2LineEdit->setText( new_dir ); + } +} + @@ -1220,7 +1257,12 @@ void SetupDialog::setVSTDir( const QString & _vd ) void SetupDialog::setGIGDir(const QString &_gd) { + m_gigDir = _gd; +} +void SetupDialog::setSF2Dir(const QString &_sfd) +{ + m_sf2Dir = _sfd; } From 9516b7cf0ef7a8d6449c675e92b09a0bc6c82fee Mon Sep 17 00:00:00 2001 From: Dave French Date: Fri, 27 Mar 2015 15:19:57 +0000 Subject: [PATCH 5/6] Added user Vst and ladspa folders the user vst folder nowbecome the default vstfolder. this is configurable in the setup dialog. The user ladspa folder is added to the list of folder to search --- include/ConfigManager.h | 15 +++++++++++++-- src/core/ConfigManager.cpp | 8 ++++++-- src/gui/SetupDialog.cpp | 12 ++++++------ 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/include/ConfigManager.h b/include/ConfigManager.h index 026a64d02..f6ecbc577 100644 --- a/include/ConfigManager.h +++ b/include/ConfigManager.h @@ -43,8 +43,9 @@ class Engine; const QString PROJECTS_PATH = "projects/"; const QString PRESETS_PATH = "presets/"; const QString SAMPLES_PATH = "samples/"; -const QString GIG_PATH = "samples/gig"; -const QString SF2_PATH = "samples/sf2"; +const QString GIG_PATH = "samples/gig/"; +const QString SF2_PATH = "samples/sf2/"; +const QString LADSPA_PATH ="plugins/ladspa/"; const QString DEFAULT_THEME_PATH = "themes/default/"; const QString TRACK_ICON_PATH = "track_icons/"; const QString LOCALE_PATH = "locale/"; @@ -93,6 +94,16 @@ public: return workingDir() + GIG_PATH; } + QString userSf2Dir() const + { + return workingDir() + SF2_PATH; + } + + QString userLadspaDir() const + { + return workingDir() + LADSPA_PATH; + } + QString factoryProjectsDir() const { return dataDir() + PROJECTS_PATH; diff --git a/src/core/ConfigManager.cpp b/src/core/ConfigManager.cpp index a7328e5ee..cf485f4ab 100644 --- a/src/core/ConfigManager.cpp +++ b/src/core/ConfigManager.cpp @@ -384,7 +384,7 @@ void ConfigManager::loadConfigFile() m_vstDir = windowsConfigPath( CSIDL_PROGRAM_FILES ) + QDir::separator() + "VstPlugins"; #else - m_vstDir = ensureTrailingSlash( QDir::home().absolutePath() ); + m_vstDir = m_workingDir + "plugins/vst" + QDir::separator(); #endif } @@ -403,6 +403,7 @@ void ConfigManager::loadConfigFile() #else m_ladDir = qApp->applicationDirPath() + '/' + LIB_DIR + "/ladspa/"; #endif + m_ladDir += ","+userLadspaDir(); } #ifdef LMMS_HAVE_STK @@ -441,7 +442,10 @@ void ConfigManager::loadConfigFile() QDir().mkpath( userSamplesDir() ); QDir().mkpath( userPresetsDir() ); QDir().mkpath( userGigDir() ); - QDir().mkpath( sf2Dir() ); + QDir().mkpath( userSf2Dir() ); + QDir().mkpath( vstDir() ); + QDir().mkpath( userLadspaDir() ); + } upgrade(); diff --git a/src/gui/SetupDialog.cpp b/src/gui/SetupDialog.cpp index 9cbd1a6fa..7ca9911ce 100644 --- a/src/gui/SetupDialog.cpp +++ b/src/gui/SetupDialog.cpp @@ -612,12 +612,6 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : pathSelectorLayout->addSpacing( 10 ); pathSelectorLayout->addWidget( sf2_tw ); pathSelectorLayout->addSpacing( 10 ); - pathSelectorLayout->addWidget( artwork_tw ); - pathSelectorLayout->addSpacing( 10 ); - pathSelectorLayout->addWidget( backgroundArtwork_tw ); - pathSelectorLayout->addSpacing( 10 ); - pathSelectorLayout->addWidget( fl_tw ); - pathSelectorLayout->addSpacing( 10 ); pathSelectorLayout->addWidget( vst_tw ); pathSelectorLayout->addSpacing( 10 ); pathSelectorLayout->addWidget( lad_tw ); @@ -629,7 +623,13 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : pathSelectorLayout->addSpacing( 10 ); pathSelectorLayout->addWidget( sf_tw ); #endif + pathSelectorLayout->addWidget( fl_tw ); + pathSelectorLayout->addSpacing( 10 ); + pathSelectorLayout->addWidget( artwork_tw ); + pathSelectorLayout->addSpacing( 10 ); pathSelectorLayout->addStretch(); + pathSelectorLayout->addWidget( backgroundArtwork_tw ); + pathSelectorLayout->addSpacing( 10 ); dir_layout->addWidget( pathSelectors ); From 54ddfd3a2bda8fe3c3275727c08e9f535961cc6c Mon Sep 17 00:00:00 2001 From: Dave French Date: Mon, 30 Mar 2015 18:59:54 +0100 Subject: [PATCH 6/6] Config manager. added a userVstDir function Added a userVstDir function for consistancy use the userVstDir() function to create new folder --- include/ConfigManager.h | 5 +++++ src/core/ConfigManager.cpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/ConfigManager.h b/include/ConfigManager.h index f6ecbc577..26c9c5304 100644 --- a/include/ConfigManager.h +++ b/include/ConfigManager.h @@ -104,6 +104,11 @@ public: return workingDir() + LADSPA_PATH; } + QString userVstDir() const + { + return m_vstDir; + } + QString factoryProjectsDir() const { return dataDir() + PROJECTS_PATH; diff --git a/src/core/ConfigManager.cpp b/src/core/ConfigManager.cpp index cf485f4ab..21f773a3a 100644 --- a/src/core/ConfigManager.cpp +++ b/src/core/ConfigManager.cpp @@ -443,7 +443,7 @@ void ConfigManager::loadConfigFile() QDir().mkpath( userPresetsDir() ); QDir().mkpath( userGigDir() ); QDir().mkpath( userSf2Dir() ); - QDir().mkpath( vstDir() ); + QDir().mkpath( userVstDir() ); QDir().mkpath( userLadspaDir() ); }