~ubuntu-branches/ubuntu/hardy/lmms/hardy

« back to all changes in this revision

Viewing changes to src/core/setup_dialog.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Tobias Doerffel
  • Date: 2007-09-17 15:00:24 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070917150024-mo0zk4ks81jawqii
Tags: 0.3.0-1ubuntu1
* Resynchronized with Debian (LP: #139759, LP: #90806, LP: #102639,
  LP: #113447, LP: #121172, LP: #124890)
* reverted changes from 0.2.1-1.1ubuntu1 as upstream merged/included them

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
/*
4
4
 * setup_dialog.cpp - dialog for setting up LMMS
5
5
 *
6
 
 * Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
 
6
 * Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
7
7
 * 
8
8
 * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
9
9
 *
19
19
 *
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.
24
24
 *
25
25
 */
26
26
 
58
58
#include "tab_widget.h"
59
59
#include "gui_templates.h"
60
60
#include "mixer.h"
 
61
#include "project_journal.h"
61
62
#include "config_mgr.h"
62
63
#include "embed.h"
 
64
#include "engine.h"
63
65
#include "debug.h"
64
66
#include "tooltip.h"
65
67
#include "led_checkbox.h"
 
68
#include "lcd_spinbox.h"
66
69
 
67
70
 
68
71
// platform-specific audio-interface-classes
79
82
#include "midi_dummy.h"
80
83
 
81
84
 
82
 
 
83
85
inline void labelWidget( QWidget * _w, const QString & _txt )
84
86
{
85
87
        QLabel * title = new QLabel( _txt, _w );
98
100
 
99
101
 
100
102
 
101
 
setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) :
102
 
        QDialog(),
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() ),
 
124
#ifdef HAVE_STK_H
 
125
        m_stkDir( configManager::inst()->stkDir() ),
 
126
#endif
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() )
124
133
                                        
125
134
{
126
135
        setWindowIcon( embed::getIconPixmap( "setup_general" ) );
127
136
        setWindowTitle( tr( "Setup LMMS" ) );
128
137
        setModal( TRUE );
129
138
 
 
139
        engine::getProjectJournal()->setJournalling( FALSE );
 
140
 
130
141
        QVBoxLayout * vlayout = new QVBoxLayout( this );
131
142
        vlayout->setSpacing( 0 );
132
143
        vlayout->setMargin( 0 );
140
151
        m_tabBar->setFixedWidth( 72 );
141
152
 
142
153
        QWidget * ws = new QWidget( settings );
143
 
        ws->setFixedSize( 360, 300 );
144
 
 
 
154
#ifdef HAVE_STK_H
 
155
        ws->setFixedSize( 360, 422 );
 
156
#else
 
157
        ws->setFixedSize( 360, 366 );
 
158
#endif
145
159
        QWidget * general = new QWidget( ws );
146
160
        general->setFixedSize( 360, 240 );
147
161
        QVBoxLayout * gen_layout = new QVBoxLayout( general );
159
173
#else
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 );
164
178
#endif
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 );
189
203
 
190
204
 
191
205
        tabWidget * misc_tw = new tabWidget( tr( "MISC" ), general );
192
 
        misc_tw->setFixedHeight( 128 );
 
206
        misc_tw->setFixedHeight( 150 );
193
207
 
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 "
207
221
                                                "value)" ),
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 ) ),
214
228
 
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 ) ),
223
237
 
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 ) ),
232
246
 
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 ) ) );
241
255
 
242
256
 
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 ) ) );
250
263
 
 
264
 
 
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 ) ) );
 
272
 
 
273
 
251
274
        gen_layout->addWidget( bufsize_tw );
252
275
        gen_layout->addSpacing( 10 );
253
276
        gen_layout->addWidget( misc_tw );
256
279
 
257
280
 
258
281
        QWidget * directories = new QWidget( ws );
259
 
        directories->setFixedSize( 360, 260 );
 
282
#ifdef HAVE_STK_H
 
283
        directories->setFixedSize( 360, 372 );
 
284
#else
 
285
        directories->setFixedSize( 360, 326 );
 
286
#endif
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() ) );
340
 
 
 
367
        // LADSPA-dir
 
368
        tabWidget * lad_tw = new tabWidget( tr(
 
369
                        "LADSPA plugin directories" ).toUpper(),
 
370
                                                        directories );
 
371
        lad_tw->setFixedHeight( 56 );
 
372
 
 
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 & ) ) );
 
377
 
 
378
        QPushButton * laddir_select_btn = new QPushButton(
 
379
                                embed::getIconPixmap( "project_open", 16, 16 ),
 
380
                                                                "", lad_tw );
 
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() ) );
 
385
 
 
386
#ifdef HAVE_STK_H
 
387
        // STK-dir
 
388
        tabWidget * stk_tw = new tabWidget( tr(
 
389
                        "STK rawwave directory" ).toUpper(),
 
390
                                                        directories );
 
391
        stk_tw->setFixedHeight( 56 );
 
392
 
 
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 & ) ) );
 
397
 
 
398
        QPushButton * stkdir_select_btn = new QPushButton(
 
399
                        embed::getIconPixmap( "project_open", 16, 16 ),
 
400
                                                                "", stk_tw );
 
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() ) );
 
405
#endif
341
406
 
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 );
 
416
#ifdef HAVE_STK_H
 
417
        dir_layout->addSpacing( 10 );
 
418
        dir_layout->addWidget( stk_tw );
 
419
#endif  
349
420
        dir_layout->addStretch();
350
421
 
351
422
 
354
425
 
355
426
 
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 );
367
438
 
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 ) ),
376
447
 
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 ) ),
384
455
 
385
456
 
386
457
 
 
458
        tabWidget * smp_supp_tw = new tabWidget( tr( "SMP support" ).toUpper(),
 
459
                                                                performance );
 
460
        smp_supp_tw->setFixedHeight( 200 );
 
461
 
 
462
        QLabel * par_level_lbl = new QLabel( tr( "Parallelizing level" ),
 
463
                                                                smp_supp_tw );
 
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,
 
467
                                                                        NULL );
 
468
        par_level->setValue( m_parLevel );
 
469
        connect( par_level, SIGNAL( valueChanged( int ) ),
 
470
                        this, SLOT( setParallelizingLevel( int ) ) );
 
471
 
 
472
        par_level->move( 140, 20 );
 
473
 
 
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 );
 
486
#ifndef QT3
 
487
        smp_help->setWordWrap( TRUE );
 
488
#else
 
489
        smp_help->setAlignment( Qt::WordBreak );
 
490
#endif
 
491
        smp_help->move( 10, 55 );
 
492
 
387
493
 
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();
390
498
 
391
499
 
450
558
        for( aswMap::iterator it = m_audioIfaceSetupWidgets.begin();
451
559
                                it != m_audioIfaceSetupWidgets.end(); ++it )
452
560
        {
 
561
                m_audioIfaceNames[tr( it.key()
 
562
#ifndef QT3
 
563
                                                .toAscii()
 
564
#endif
 
565
                                                                )] = it.key();
 
566
        }
 
567
        for( trMap::iterator it = m_audioIfaceNames.begin();
 
568
                                it != m_audioIfaceNames.end(); ++it )
 
569
        {
453
570
#ifdef QT4
454
 
                it.value()->hide();
455
 
                asw_layout->addWidget( it.value() );
 
571
                QWidget * audioWidget = m_audioIfaceSetupWidgets[it.value()];
456
572
#else
457
 
                it.data()->hide();
458
 
                asw_layout->addWidget( it.data() );
 
573
                QWidget * audioWidget = m_audioIfaceSetupWidgets[it.data()];
459
574
#endif
 
575
                audioWidget->hide();
 
576
                asw_layout->addWidget( audioWidget );
460
577
                m_audioInterfaces->addItem( it.key() );
461
578
        }
462
579
#ifdef QT4
463
580
        m_audioInterfaces->setCurrentIndex( m_audioInterfaces->findText(
464
 
                                        eng()->getMixer()->audioDevName() ) );
 
581
                        tr( engine::getMixer()->audioDevName().toAscii() ) ) );
465
582
#else
466
 
        m_audioInterfaces->setCurrentText( eng()->getMixer()->audioDevName() );
 
583
        m_audioInterfaces->setCurrentText(
 
584
                                tr( engine::getMixer()->audioDevName() ) );
467
585
#endif
468
 
        m_audioIfaceSetupWidgets[eng()->getMixer()->audioDevName()]->show();
 
586
        m_audioIfaceSetupWidgets[engine::getMixer()->audioDevName()]->show();
469
587
 
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 )
532
650
        {
 
651
                m_midiIfaceNames[tr( it.key()
 
652
#ifndef QT3
 
653
                                                .toAscii()
 
654
#endif
 
655
                                                                )] = it.key();
 
656
        }
 
657
        for( trMap::iterator it = m_midiIfaceNames.begin();
 
658
                                it != m_midiIfaceNames.end(); ++it )
 
659
        {
533
660
#ifdef QT4
534
 
                it.value()->hide();
535
 
                msw_layout->addWidget( it.value() );
 
661
                QWidget * midiWidget = m_midiIfaceSetupWidgets[it.value()];
536
662
#else
537
 
                msw_layout->addWidget( it.data() );
538
 
                it.data()->hide();
 
663
                QWidget * midiWidget = m_midiIfaceSetupWidgets[it.data()];
539
664
#endif
 
665
                midiWidget->hide();
 
666
                msw_layout->addWidget( midiWidget );
540
667
                m_midiInterfaces->addItem( it.key() );
541
668
        }
542
669
 
543
670
#ifdef QT4
544
671
        m_midiInterfaces->setCurrentIndex( m_midiInterfaces->findText(
545
 
                                        eng()->getMixer()->midiClientName() ) );
 
672
                tr( engine::getMixer()->midiClientName().toAscii() ) ) );
546
673
#else
547
 
        m_midiInterfaces->setCurrentText( eng()->getMixer()->midiClientName() );
 
674
        m_midiInterfaces->setCurrentText(
 
675
                                tr( engine::getMixer()->midiClientName() ) );
548
676
#endif
549
 
        m_midiIfaceSetupWidgets[eng()->getMixer()->midiClientName()]->show();
 
677
        m_midiIfaceSetupWidgets[engine::getMixer()->midiClientName()]->show();
550
678
 
551
679
        connect( m_midiInterfaces, SIGNAL( activated( const QString & ) ),
552
680
                this, SLOT( midiInterfaceChanged( const QString & ) ) );
622
750
 
623
751
setupDialog::~setupDialog()
624
752
{
 
753
        engine::getProjectJournal()->setJournalling( TRUE );
625
754
}
626
755
 
627
756
 
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 ) );
655
788
 
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 );
 
794
#ifdef HAVE_STK_H
 
795
        configManager::inst()->setSTKDir( m_stkDir );
 
796
#endif  
660
797
 
661
798
        // tell all audio-settings-widget to save their settings
662
799
        for( aswMap::iterator it = m_audioIfaceSetupWidgets.begin();
697
834
 
698
835
void setupDialog::setBufferSize( int _value )
699
836
{
 
837
        const int step = DEFAULT_BUFFER_SIZE / 64;
 
838
        if( _value > step && _value % step )
 
839
        {
 
840
                int mod_value = _value % step;
 
841
                if( mod_value < step / 2 )
 
842
                {
 
843
                        m_bufSizeSlider->setValue( _value - mod_value );
 
844
                }
 
845
                else
 
846
                {
 
847
                        m_bufSizeSlider->setValue( _value + step - mod_value );
 
848
                }
 
849
                return;
 
850
        }
 
851
 
700
852
        if( m_bufSizeSlider->value() != _value )
701
853
        {
702
854
                m_bufSizeSlider->setValue( _value );
706
858
        m_bufSizeLbl->setText( tr( "Frames: %1\nLatency: %2 ms" ).arg(
707
859
                                        m_bufferSize ).arg(
708
860
                                                1000.0f * m_bufferSize /
709
 
                                                eng()->getMixer()->sampleRate(),
 
861
                                        engine::getMixer()->sampleRate(),
710
862
                                                0, 'f', 1 ) );
711
863
}
712
864
 
788
940
 
789
941
 
790
942
 
 
943
void setupDialog::toggleNoMMPZ( bool _enabled )
 
944
{
 
945
        m_noMMPZ = _enabled;
 
946
}
 
947
 
 
948
 
 
949
 
 
950
 
791
951
void setupDialog::toggleDisableChActInd( bool _disabled )
792
952
{
793
953
        m_disableChActInd = _disabled;
803
963
 
804
964
 
805
965
 
 
966
void setupDialog::setParallelizingLevel( int _level )
 
967
{
 
968
        m_parLevel = _level;
 
969
}
 
970
 
 
971
 
 
972
 
806
973
 
807
974
void setupDialog::openWorkingDir( void )
808
975
{
908
1075
 
909
1076
 
910
1077
 
 
1078
void setupDialog::openLADSPADir( void )
 
1079
{
 
1080
#ifdef QT4
 
1081
        QString new_dir = QFileDialog::getExistingDirectory( this,
 
1082
                                tr( "Choose LADSPA plugin directory" ),
 
1083
                                                        m_ladDir );
 
1084
#else
 
1085
        QString new_dir = QFileDialog::getExistingDirectory( m_ladDir, 0, 0,
 
1086
                        tr( "Choose LADSPA plugin directory" ), TRUE );
 
1087
#endif
 
1088
        if( new_dir != QString::null )
 
1089
        {
 
1090
                if( m_ladLineEdit->text() == "" )
 
1091
                {
 
1092
                        m_ladLineEdit->setText( new_dir );
 
1093
                }
 
1094
                else
 
1095
                {
 
1096
                        m_ladLineEdit->setText( m_ladLineEdit->text() + ":" +
 
1097
                                                                new_dir );
 
1098
                }
 
1099
        }
 
1100
}
 
1101
 
 
1102
 
 
1103
 
 
1104
 
 
1105
void setupDialog::openSTKDir( void )
 
1106
{
 
1107
#ifdef HAVE_STK_H
 
1108
#ifdef QT4
 
1109
        QString new_dir = QFileDialog::getExistingDirectory( this,
 
1110
                                tr( "Choose STK rawwave directory" ),
 
1111
                                                        m_ladDir );
 
1112
#else
 
1113
        QString new_dir = QFileDialog::getExistingDirectory( m_ladDir, 0, 0,
 
1114
                        tr( "Choose STK rawwave directory" ), TRUE );
 
1115
#endif
 
1116
        if( new_dir != QString::null )
 
1117
        {
 
1118
                m_stkLineEdit->setText( new_dir );
 
1119
        }
 
1120
#endif
 
1121
}
 
1122
 
 
1123
 
 
1124
 
 
1125
 
911
1126
void setupDialog::setFLDir( const QString & _fd )
912
1127
{
913
1128
        m_flDir = _fd;
916
1131
 
917
1132
 
918
1133
 
 
1134
void setupDialog::setLADSPADir( const QString & _fd )
 
1135
{
 
1136
        m_ladDir = _fd;
 
1137
}
 
1138
 
 
1139
 
 
1140
 
 
1141
 
 
1142
void setupDialog::setSTKDir( const QString & _fd )
 
1143
{
 
1144
#ifdef HAVE_STK_H
 
1145
        m_stkDir = _fd;
 
1146
#endif
 
1147
}
 
1148
 
 
1149
 
 
1150
 
 
1151
 
919
1152
void setupDialog::audioInterfaceChanged( const QString & _iface )
920
1153
{
921
1154
        for( aswMap::iterator it = m_audioIfaceSetupWidgets.begin();
928
1161
#endif
929
1162
        }
930
1163
 
931
 
        m_audioIfaceSetupWidgets[_iface]->show();
 
1164
        m_audioIfaceSetupWidgets[m_audioIfaceNames[_iface]]->show();
932
1165
}
933
1166
 
934
1167
 
966
1199
#endif
967
1200
        }
968
1201
 
969
 
        m_midiIfaceSetupWidgets[_iface]->show();
 
1202
        m_midiIfaceSetupWidgets[m_midiIfaceNames[_iface]]->show();
970
1203
}
971
1204
 
972
1205