20
20
* You should have received a copy of the GNU General Public
21
21
* License along with this program (see COPYING); if not, write to the
22
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23
* Boston, MA 02111-1307, USA.
22
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23
* Boston, MA 02110-1301 USA.
101
setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) :
103
engineObject( _engine ),
104
m_bufferSize( eng()->getMixer()->framesPerAudioBuffer() ),
103
setupDialog::setupDialog( configTabs _tab_to_open ) :
104
m_bufferSize( configManager::inst()->value( "mixer",
105
"framesperaudiobuffer" ).toInt() ),
105
106
m_disableToolTips( configManager::inst()->value( "tooltips",
106
107
"disabled" ).toInt() ),
107
108
m_classicalKnobUsability( configManager::inst()->value( "knobs",
113
114
"nomsgaftersetup" ).toInt() ),
114
115
m_displaydBV( configManager::inst()->value( "app",
115
116
"displaydbv" ).toInt() ),
117
m_noMMPZ( configManager::inst()->value( "app",
118
"nommpz" ).toInt() ),
116
119
m_workingDir( configManager::inst()->workingDir() ),
117
120
m_vstDir( configManager::inst()->vstDir() ),
118
121
m_artworkDir( configManager::inst()->artworkDir() ),
119
122
m_flDir( configManager::inst()->flDir() ),
123
m_ladDir( configManager::inst()->ladspaDir() ),
125
m_stkDir( configManager::inst()->stkDir() ),
120
127
m_disableChActInd( configManager::inst()->value( "ui",
121
128
"disablechannelactivityindicators" ).toInt() ),
122
129
m_manualChPiano( configManager::inst()->value( "ui",
123
"manualchannelpiano" ).toInt() )
130
"manualchannelpiano" ).toInt() ),
131
m_parLevel( configManager::inst()->value( "mixer",
132
"parallelizinglevel" ).toInt() )
126
135
setWindowIcon( embed::getIconPixmap( "setup_general" ) );
127
136
setWindowTitle( tr( "Setup LMMS" ) );
128
137
setModal( TRUE );
139
engine::getProjectJournal()->setJournalling( FALSE );
130
141
QVBoxLayout * vlayout = new QVBoxLayout( this );
131
142
vlayout->setSpacing( 0 );
132
143
vlayout->setMargin( 0 );
140
151
m_tabBar->setFixedWidth( 72 );
142
153
QWidget * ws = new QWidget( settings );
143
ws->setFixedSize( 360, 300 );
155
ws->setFixedSize( 360, 422 );
157
ws->setFixedSize( 360, 366 );
145
159
QWidget * general = new QWidget( ws );
146
160
general->setFixedSize( 360, 240 );
147
161
QVBoxLayout * gen_layout = new QVBoxLayout( general );
160
174
m_bufSizeSlider->setMinimum( 1 );
161
175
m_bufSizeSlider->setMaximum( 256 );
162
m_bufSizeSlider->setLineStep( 4 );
176
m_bufSizeSlider->setLineStep( 8 );
163
177
m_bufSizeSlider->setTickmarks( QSlider::Below );
165
m_bufSizeSlider->setPageStep( 4 );
179
m_bufSizeSlider->setPageStep( 8 );
166
180
m_bufSizeSlider->setTickInterval( 8 );
167
181
m_bufSizeSlider->setGeometry( 10, 16, 340, 18 );
168
182
m_bufSizeSlider->setValue( m_bufferSize / 64 );
191
205
tabWidget * misc_tw = new tabWidget( tr( "MISC" ), general );
192
misc_tw->setFixedHeight( 128 );
206
misc_tw->setFixedHeight( 150 );
194
208
ledCheckBox * disable_tooltips = new ledCheckBox(
195
209
tr( "Disable tooltips (no spurious "
196
210
"interrupts while playing)" ),
197
misc_tw, NULL, eng(), NULL );
211
misc_tw, NULL, NULL );
198
212
disable_tooltips->move( 10, 18 );
199
213
disable_tooltips->setChecked( m_disableToolTips );
200
214
connect( disable_tooltips, SIGNAL( toggled( bool ) ),
205
219
tr( "Classical knob usability (move "
206
220
"cursor around knob to change "
208
misc_tw, NULL, eng(), NULL );
222
misc_tw, NULL, NULL );
209
223
classical_knob_usability->move( 10, 36 );
210
224
classical_knob_usability->setChecked( m_classicalKnobUsability );
211
225
connect( classical_knob_usability, SIGNAL( toggled( bool ) ),
215
229
ledCheckBox * gimp_like_windows = new ledCheckBox(
216
230
tr( "GIMP-like windows (no MDI)" ),
217
misc_tw, NULL, eng(), NULL );
231
misc_tw, NULL, NULL );
218
232
gimp_like_windows->move( 10, 54 );
219
233
gimp_like_windows->setChecked( m_gimpLikeWindows );
220
234
connect( gimp_like_windows, SIGNAL( toggled( bool ) ),
224
238
ledCheckBox * no_wizard = new ledCheckBox(
225
239
tr( "Do not show wizard after up-/downgrade" ),
226
misc_tw, NULL, eng(), NULL );
240
misc_tw, NULL, NULL );
227
241
no_wizard->move( 10, 72 );
228
242
no_wizard->setChecked( m_noWizard );
229
243
connect( no_wizard, SIGNAL( toggled( bool ) ),
233
247
ledCheckBox * no_msg = new ledCheckBox(
234
248
tr( "Do not show message after "
235
"closing this dialog" ),
236
misc_tw, NULL, eng(), NULL );
249
"closing this dialog" ),
250
misc_tw, NULL, NULL );
237
251
no_msg->move( 10, 90 );
238
252
no_msg->setChecked( m_noMsgAfterSetup );
239
253
connect( no_msg, SIGNAL( toggled( bool ) ),
240
254
this, SLOT( toggleNoMsgAfterSetup( bool ) ) );
243
ledCheckBox * dbv = new ledCheckBox(
244
tr( "Display volume as dbV " ),
245
misc_tw, NULL, eng(), NULL );
257
ledCheckBox * dbv = new ledCheckBox( tr( "Display volume as dbV " ),
258
misc_tw, NULL, NULL );
246
259
dbv->move( 10, 108 );
247
260
dbv->setChecked( m_displaydBV );
248
261
connect( dbv, SIGNAL( toggled( bool ) ),
249
262
this, SLOT( toggleDisplaydBV( bool ) ) );
265
ledCheckBox * no_mmpz = new ledCheckBox(
266
tr( "Do not compress project files per default" ),
267
misc_tw, NULL, NULL );
268
no_mmpz->move( 10, 126 );
269
no_mmpz->setChecked( m_noMMPZ );
270
connect( no_mmpz, SIGNAL( toggled( bool ) ),
271
this, SLOT( toggleNoMMPZ( bool ) ) );
251
274
gen_layout->addWidget( bufsize_tw );
252
275
gen_layout->addSpacing( 10 );
253
276
gen_layout->addWidget( misc_tw );
258
281
QWidget * directories = new QWidget( ws );
259
directories->setFixedSize( 360, 260 );
283
directories->setFixedSize( 360, 372 );
285
directories->setFixedSize( 360, 326 );
260
287
QVBoxLayout * dir_layout = new QVBoxLayout( directories );
261
288
dir_layout->setSpacing( 0 );
262
289
dir_layout->setMargin( 0 );
337
364
fldir_select_btn->move( 320, 20 );
338
365
connect( fldir_select_btn, SIGNAL( clicked() ), this,
339
366
SLOT( openFLDir() ) );
368
tabWidget * lad_tw = new tabWidget( tr(
369
"LADSPA plugin directories" ).toUpper(),
371
lad_tw->setFixedHeight( 56 );
373
m_ladLineEdit = new QLineEdit( m_ladDir, lad_tw );
374
m_ladLineEdit->setGeometry( 10, 20, 300, 16 );
375
connect( m_ladLineEdit, SIGNAL( textChanged( const QString & ) ), this,
376
SLOT( setLADSPADir( const QString & ) ) );
378
QPushButton * laddir_select_btn = new QPushButton(
379
embed::getIconPixmap( "project_open", 16, 16 ),
381
laddir_select_btn->setFixedSize( 24, 24 );
382
laddir_select_btn->move( 320, 20 );
383
connect( laddir_select_btn, SIGNAL( clicked() ), this,
384
SLOT( openLADSPADir() ) );
388
tabWidget * stk_tw = new tabWidget( tr(
389
"STK rawwave directory" ).toUpper(),
391
stk_tw->setFixedHeight( 56 );
393
m_stkLineEdit = new QLineEdit( m_stkDir, stk_tw );
394
m_stkLineEdit->setGeometry( 10, 20, 300, 16 );
395
connect( m_stkLineEdit, SIGNAL( textChanged( const QString & ) ), this,
396
SLOT( setSTKDir( const QString & ) ) );
398
QPushButton * stkdir_select_btn = new QPushButton(
399
embed::getIconPixmap( "project_open", 16, 16 ),
401
stkdir_select_btn->setFixedSize( 24, 24 );
402
stkdir_select_btn->move( 320, 20 );
403
connect( stkdir_select_btn, SIGNAL( clicked() ), this,
404
SLOT( openSTKDir() ) );
342
407
dir_layout->addWidget( lmms_wd_tw );
343
408
dir_layout->addSpacing( 10 );
346
411
dir_layout->addWidget( artwork_tw );
347
412
dir_layout->addSpacing( 10 );
348
413
dir_layout->addWidget( fl_tw );
414
dir_layout->addSpacing( 10 );
415
dir_layout->addWidget( lad_tw );
417
dir_layout->addSpacing( 10 );
418
dir_layout->addWidget( stk_tw );
349
420
dir_layout->addStretch();
356
427
QWidget * performance = new QWidget( ws );
357
performance->setFixedSize( 360, 200 );
428
performance->setFixedSize( 360, 240 );
358
429
QVBoxLayout * perf_layout = new QVBoxLayout( performance );
359
430
perf_layout->setSpacing( 0 );
360
431
perf_layout->setMargin( 0 );
368
439
ledCheckBox * disable_ch_act_ind = new ledCheckBox(
369
440
tr( "Disable channel activity indicators" ),
370
ui_fx_tw, NULL, eng(), NULL );
441
ui_fx_tw, NULL, NULL );
371
442
disable_ch_act_ind->move( 10, 20 );
372
443
disable_ch_act_ind->setChecked( m_disableChActInd );
373
444
connect( disable_ch_act_ind, SIGNAL( toggled( bool ) ),
377
448
ledCheckBox * manual_ch_piano = new ledCheckBox(
378
449
tr( "Only press keys on channel-piano manually" ),
379
ui_fx_tw, NULL, eng(), NULL );
450
ui_fx_tw, NULL, NULL );
380
451
manual_ch_piano->move( 10, 40 );
381
452
manual_ch_piano->setChecked( m_manualChPiano );
382
453
connect( manual_ch_piano, SIGNAL( toggled( bool ) ),
458
tabWidget * smp_supp_tw = new tabWidget( tr( "SMP support" ).toUpper(),
460
smp_supp_tw->setFixedHeight( 200 );
462
QLabel * par_level_lbl = new QLabel( tr( "Parallelizing level" ),
464
par_level_lbl->move( 10, 15 );
465
par_level_lbl->setFixedSize( 120, 16 );
466
lcdSpinBox * par_level = new lcdSpinBox( 1, 16, 2, smp_supp_tw, NULL,
468
par_level->setValue( m_parLevel );
469
connect( par_level, SIGNAL( valueChanged( int ) ),
470
this, SLOT( setParallelizingLevel( int ) ) );
472
par_level->move( 140, 20 );
474
QLabel * smp_help = new QLabel(
475
tr( "If you have a machine with more then one processor "
476
"(e.g. dual-core systems) you should use a "
477
"parallelizing-level above 1 which means that LMMS "
478
"will try to split up sound-processing into several "
479
"threads which should should be run on several cores "
480
"by the underlaying operating-system.\n"
481
"Please note that in some cases parallelizing won't "
482
"work with small buffer-sizes. If you experience "
483
"problems (i.e. lot of xruns), try to increase buffer-"
484
"size." ), smp_supp_tw );
485
smp_help->setFixedSize( performance->width() - 20, 140 );
487
smp_help->setWordWrap( TRUE );
489
smp_help->setAlignment( Qt::WordBreak );
491
smp_help->move( 10, 55 );
388
494
perf_layout->addWidget( ui_fx_tw );
495
perf_layout->addSpacing( 15 );
496
perf_layout->addWidget( smp_supp_tw );
389
497
perf_layout->addStretch();
450
558
for( aswMap::iterator it = m_audioIfaceSetupWidgets.begin();
451
559
it != m_audioIfaceSetupWidgets.end(); ++it )
561
m_audioIfaceNames[tr( it.key()
567
for( trMap::iterator it = m_audioIfaceNames.begin();
568
it != m_audioIfaceNames.end(); ++it )
455
asw_layout->addWidget( it.value() );
571
QWidget * audioWidget = m_audioIfaceSetupWidgets[it.value()];
458
asw_layout->addWidget( it.data() );
573
QWidget * audioWidget = m_audioIfaceSetupWidgets[it.data()];
576
asw_layout->addWidget( audioWidget );
460
577
m_audioInterfaces->addItem( it.key() );
463
580
m_audioInterfaces->setCurrentIndex( m_audioInterfaces->findText(
464
eng()->getMixer()->audioDevName() ) );
581
tr( engine::getMixer()->audioDevName().toAscii() ) ) );
466
m_audioInterfaces->setCurrentText( eng()->getMixer()->audioDevName() );
583
m_audioInterfaces->setCurrentText(
584
tr( engine::getMixer()->audioDevName() ) );
468
m_audioIfaceSetupWidgets[eng()->getMixer()->audioDevName()]->show();
586
m_audioIfaceSetupWidgets[engine::getMixer()->audioDevName()]->show();
470
588
connect( m_audioInterfaces, SIGNAL( activated( const QString & ) ),
471
589
this, SLOT( audioInterfaceChanged( const QString & ) ) );
530
648
for( mswMap::iterator it = m_midiIfaceSetupWidgets.begin();
531
649
it != m_midiIfaceSetupWidgets.end(); ++it )
651
m_midiIfaceNames[tr( it.key()
657
for( trMap::iterator it = m_midiIfaceNames.begin();
658
it != m_midiIfaceNames.end(); ++it )
535
msw_layout->addWidget( it.value() );
661
QWidget * midiWidget = m_midiIfaceSetupWidgets[it.value()];
537
msw_layout->addWidget( it.data() );
663
QWidget * midiWidget = m_midiIfaceSetupWidgets[it.data()];
666
msw_layout->addWidget( midiWidget );
540
667
m_midiInterfaces->addItem( it.key() );
544
671
m_midiInterfaces->setCurrentIndex( m_midiInterfaces->findText(
545
eng()->getMixer()->midiClientName() ) );
672
tr( engine::getMixer()->midiClientName().toAscii() ) ) );
547
m_midiInterfaces->setCurrentText( eng()->getMixer()->midiClientName() );
674
m_midiInterfaces->setCurrentText(
675
tr( engine::getMixer()->midiClientName() ) );
549
m_midiIfaceSetupWidgets[eng()->getMixer()->midiClientName()]->show();
677
m_midiIfaceSetupWidgets[engine::getMixer()->midiClientName()]->show();
551
679
connect( m_midiInterfaces, SIGNAL( activated( const QString & ) ),
552
680
this, SLOT( midiInterfaceChanged( const QString & ) ) );
632
761
configManager::inst()->setValue( "mixer", "framesperaudiobuffer",
633
762
QString::number( m_bufferSize ) );
634
763
configManager::inst()->setValue( "mixer", "audiodev",
635
m_audioInterfaces->currentText() );
764
m_audioIfaceNames[m_audioInterfaces->currentText()] );
636
765
configManager::inst()->setValue( "mixer", "mididev",
637
m_midiInterfaces->currentText() );
766
m_midiIfaceNames[m_midiInterfaces->currentText()] );
638
767
configManager::inst()->setValue( "tooltips", "disabled",
639
768
QString::number( m_disableToolTips ) );
640
769
configManager::inst()->setValue( "knobs", "classicalusability",
647
776
QString::number( m_noMsgAfterSetup ) );
648
777
configManager::inst()->setValue( "app", "displaydbv",
649
778
QString::number( m_displaydBV ) );
779
configManager::inst()->setValue( "app", "nommpz",
780
QString::number( m_noMMPZ ) );
650
781
configManager::inst()->setValue( "ui",
651
782
"disablechannelactivityindicators",
652
783
QString::number( m_disableChActInd ) );
653
784
configManager::inst()->setValue( "ui", "manualchannelpiano",
654
785
QString::number( m_manualChPiano ) );
786
configManager::inst()->setValue( "mixer", "parallelizinglevel",
787
QString::number( m_parLevel ) );
656
789
configManager::inst()->setWorkingDir( m_workingDir );
657
790
configManager::inst()->setVSTDir( m_vstDir );
658
791
configManager::inst()->setArtworkDir( m_artworkDir );
659
792
configManager::inst()->setFLDir( m_flDir );
793
configManager::inst()->setLADSPADir( m_ladDir );
795
configManager::inst()->setSTKDir( m_stkDir );
661
798
// tell all audio-settings-widget to save their settings
662
799
for( aswMap::iterator it = m_audioIfaceSetupWidgets.begin();
698
835
void setupDialog::setBufferSize( int _value )
837
const int step = DEFAULT_BUFFER_SIZE / 64;
838
if( _value > step && _value % step )
840
int mod_value = _value % step;
841
if( mod_value < step / 2 )
843
m_bufSizeSlider->setValue( _value - mod_value );
847
m_bufSizeSlider->setValue( _value + step - mod_value );
700
852
if( m_bufSizeSlider->value() != _value )
702
854
m_bufSizeSlider->setValue( _value );
1078
void setupDialog::openLADSPADir( void )
1081
QString new_dir = QFileDialog::getExistingDirectory( this,
1082
tr( "Choose LADSPA plugin directory" ),
1085
QString new_dir = QFileDialog::getExistingDirectory( m_ladDir, 0, 0,
1086
tr( "Choose LADSPA plugin directory" ), TRUE );
1088
if( new_dir != QString::null )
1090
if( m_ladLineEdit->text() == "" )
1092
m_ladLineEdit->setText( new_dir );
1096
m_ladLineEdit->setText( m_ladLineEdit->text() + ":" +
1105
void setupDialog::openSTKDir( void )
1109
QString new_dir = QFileDialog::getExistingDirectory( this,
1110
tr( "Choose STK rawwave directory" ),
1113
QString new_dir = QFileDialog::getExistingDirectory( m_ladDir, 0, 0,
1114
tr( "Choose STK rawwave directory" ), TRUE );
1116
if( new_dir != QString::null )
1118
m_stkLineEdit->setText( new_dir );
911
1126
void setupDialog::setFLDir( const QString & _fd )