125
127
QString wdir = configManager::inst()->lmmsWorkingDir();
126
side_bar->appendTab( new browser( wdir+"projects", "*.xml",
128
side_bar->appendTab( new pluginBrowser( splitter ), ++id );
129
side_bar->appendTab( new fileBrowser( wdir+"projects",
127
131
tr( "My projects" ),
128
132
embed::getIconPixmap( "project_file" ),
129
133
splitter ), ++id );
130
side_bar->appendTab( new browser( wdir+"samples", "*.wav *.ogg *.voc "
131
"*.aif *.aiff *.au *.raw",
134
side_bar->appendTab( new fileBrowser( wdir+"samples", "*.wav *.ogg *.au"
135
"*.voc *.aif *.aiff *.flac *.raw",
132
136
tr( "My samples" ),
133
137
embed::getIconPixmap( "sound_file" ),
134
138
splitter ), ++id );
135
side_bar->appendTab( new browser( wdir+"presets", "*.cs.xml",
139
side_bar->appendTab( new fileBrowser( wdir+"presets", "*.cs.xml",
136
140
tr( "My presets" ),
137
141
embed::getIconPixmap( "preset_file" ),
138
142
splitter ), ++id );
139
side_bar->appendTab( new browser( QDir::homePath(), "*",
143
side_bar->appendTab( new fileBrowser( QDir::homePath(), "*",
141
145
embed::getIconPixmap( "home" ),
142
146
splitter ), ++id );
143
side_bar->appendTab( new browser( QDir::rootPath(), "*",
147
side_bar->appendTab( new fileBrowser( QDir::rootPath(), "*",
144
148
tr( "Root directory" ),
145
149
embed::getIconPixmap( "root" ),
146
150
splitter ), ++id );
148
m_workspace = new lmmsWorkspace( splitter );
149
m_workspace->setScrollBarsEnabled( TRUE );
152
if( no_mdi == FALSE )
154
m_workspace = new QWorkspace( splitter );
155
m_workspace->setScrollBarsEnabled( TRUE );
152
m_workspace->setBackground( embed::getIconPixmap(
153
"background_artwork" ) );
158
/* m_workspace->setBackground( embed::getIconPixmap(
159
"background_artwork" ) );*/
155
m_workspace->setPaletteBackgroundPixmap( embed::getIconPixmap(
161
m_workspace->setPaletteBackgroundPixmap( embed::getIconPixmap(
156
162
"background_artwork" ) );
159
166
hbox->addWidget( side_bar );
160
167
hbox->addWidget( splitter );
161
setCentralWidget( w );
170
// create global-toolbar at the top of our window
171
m_toolBar = new QWidget( main_widget );
172
m_toolBar->setFixedHeight( 64 );
173
m_toolBar->move( 0, 0 );
176
pal.setBrush( m_toolBar->backgroundRole(), QBrush(
177
embed::getIconPixmap( "main_toolbar_bg" ) ) );
178
m_toolBar->setPalette( pal );
180
m_toolBar->setPaletteBackgroundPixmap(
181
embed::getIconPixmap( "main_toolbar_bg" ) );
184
// add layout for organizing quite complex toolbar-layouting
185
m_toolBarLayout = new QGridLayout( m_toolBar/*, 2, 1*/ );
186
m_toolBarLayout->setMargin( 0 );
187
m_toolBarLayout->setSpacing( 0 );
189
vbox->addWidget( m_toolBar );
190
vbox->addWidget( w );
191
setCentralWidget( main_widget );
164
195
#if QT_VERSION >= 0x030200
186
217
resetWindowTitle( "" );
187
218
setWindowIcon( embed::getIconPixmap( "icon" ) );
189
// TODO: when dropping qt3-support clean up the whole menu- and toolbar
190
// code and create QAction's to be inserted in menu- and toolbar - the
191
// current situation is horrible.....!!!!!!!
194
m_projectTools = new QToolBar( this );
196
addToolBar( Qt::TopToolBarArea, m_projectTools );
198
addDockWindow( m_projectTools, tr( "Song management" ), DockTop,
205
a = new QAction( embed::getIconPixmap( "project_new" ),
206
tr( "Create new project" ),
208
a->setShortcut( tr( "Ctrl+N" ) );
209
connect( a, SIGNAL( activated() ), this, SLOT( createNewProject() ) );
211
a = new QAction( embed::getIconPixmap( "project_open" ),
212
tr( "Open existing project" ),
214
a->setShortcut( tr( "Ctrl+O" ) );
215
connect( a, SIGNAL( activated() ), this, SLOT( openProject() ) );
217
a = new QAction( embed::getIconPixmap( "project_save" ),
218
tr( "Save current project" ),
220
a->setShortcut( tr( "Ctrl+S" ) );
221
connect( a, SIGNAL( activated() ), this, SLOT( saveProject() ) );
223
a = new QAction( embed::getIconPixmap( "project_export" ),
224
tr( "Export current project" ),
226
a->setShortcut( tr( "Ctrl+E" ) );
227
connect( a, SIGNAL( activated() ), songEditor::inst(),
228
SLOT( exportProject() ) );
231
/* a = new QAction( embed::getIconPixmap( "project_new" ),
232
tr( "Create new project" ),
233
CTRL + Key_N, this );
234
connect( a, SIGNAL( activated() ), this, SLOT( createNewProject() ) );
235
a->addTo( m_projectTools );*/
236
QToolButton * t = new QToolButton( embed::getIconPixmap(
238
tr( "Create new project" ),
240
SLOT( createNewProject() ),
242
t->setAccel( Qt::Key_F6 );
221
// create tool-buttons
222
toolButton * project_new = new toolButton(
223
embed::getIconPixmap( "project_new" ),
224
tr( "Create new project" ),
225
this, SLOT( createNewProject() ),
243
228
QDir d( configManager::inst()->projectsDir() + "templates" );
244
QStringList templates = d.entryList( "*.xml",
229
QStringList templates = d.entryList(
231
QStringList( "*.mpt" ),
245
235
QDir::Files | QDir::Readable );
246
236
if( !templates.isEmpty() )
248
m_templatesMenu = new QMenu( t );
238
m_templatesMenu = new QMenu( project_new );
249
239
for( QStringList::iterator it = templates.begin();
250
240
it != templates.end(); ++it )
252
m_templatesMenu->insertItem(
242
m_templatesMenu->addAction(
253
243
embed::getIconPixmap( "project_file" ),
254
244
( *it ).left( ( *it ).length() - 4 ) );
256
246
connect( m_templatesMenu, SIGNAL( activated( int ) ),
257
247
this, SLOT( createNewProjectFromTemplate( int ) ) );
258
t->setMenu( m_templatesMenu );
259
t->setPopupDelay( 0 );
263
#if QT_VERSION < 0x030200
266
embed::getIconPixmap( "project_open" ),
267
tr( "Open existing project" ),
268
CTRL + Key_O, this );
269
connect( a, SIGNAL( activated() ), this, SLOT( openProject() ) );
270
a->addTo( m_projectTools );
273
#if QT_VERSION < 0x030200
276
embed::getIconPixmap( "project_save" ),
277
tr( "Save current project" ),
278
CTRL + Key_S, this );
279
connect( a, SIGNAL( activated() ), this, SLOT( saveProject() ) );
280
a->addTo( m_projectTools );
283
#if QT_VERSION < 0x030200
286
embed::getIconPixmap( "project_export" ),
287
tr( "Export current project" ),
288
CTRL + Key_E, this );
289
connect( a, SIGNAL( activated() ), songEditor::inst(),
290
SLOT( exportProject() ) );
291
a->addTo( m_projectTools );
297
m_windowTools = new QToolBar( tr( "Windows" ), this );
248
project_new->setMenu( m_templatesMenu );
299
addToolBar( Qt::TopToolBarArea, m_windowTools );
250
project_new->setPopupMode( toolButton::MenuButtonPopup );
301
addDockWindow( m_windowTools, tr( "Windows" ), Qt::DockTop, FALSE );
252
project_new->setPopupDelay( 0 );
257
toolButton * project_open = new toolButton(
258
embed::getIconPixmap( "project_open" ),
259
tr( "Open existing project" ),
260
this, SLOT( openProject() ),
264
toolButton * project_save = new toolButton(
265
embed::getIconPixmap( "project_save" ),
266
tr( "Save current project" ),
267
this, SLOT( saveProject() ),
271
toolButton * project_export = new toolButton(
272
embed::getIconPixmap( "project_export" ),
273
tr( "Export current project" ),
275
SLOT( exportProject() ),
279
m_toolBarLayout->addWidget( project_new, 0, 0 );
280
m_toolBarLayout->addWidget( project_open, 0, 1 );
281
m_toolBarLayout->addWidget( project_save, 0, 2 );
282
m_toolBarLayout->addWidget( project_export, 0, 3 );
307
286
// window-toolbar
308
m_bbEditorWindow = new QToolButton( embed::getIconPixmap( "bb_track" ),
309
tr( "Show/Hide Beat+Bassline "
310
"Editor" ) + " (F6)",
287
toolButton * bb_editor_window = new toolButton(
288
embed::getIconPixmap( "bb_track" ),
289
tr( "Show/hide Beat+Bassline Editor" ) +
312
291
this, SLOT( toggleBBEditorWin() ),
314
m_bbEditorWindow->setAccel( Qt::Key_F6 );
293
bb_editor_window->setShortcut( Qt::Key_F6 );
316
m_bbEditorWindow->setWhatsThis(
295
bb_editor_window->setWhatsThis(
318
QWhatsThis::add( m_bbEditorWindow,
297
QWhatsThis::add( bb_editor_window,
320
299
tr( "By pressing this button, you can show or hide the "
321
300
"Beat+Bassline Editor. The Beat+Bassline Editor is "
328
m_pianoRollWindow = new QToolButton( embed::getIconPixmap( "piano" ),
329
tr( "Show/Hide Piano-Roll" ) +
307
toolButton * piano_roll_window = new toolButton(
308
embed::getIconPixmap( "piano" ),
309
tr( "Show/hide Piano-Roll" ) +
332
311
this, SLOT( togglePianoRollWin() ),
334
m_pianoRollWindow->setAccel( Key_F7 );
335
QWhatsThis::add( m_pianoRollWindow, tr( "By pressing this button, you "
336
"can show or hide the "
337
"Piano-Roll. With the help of "
338
"the Piano-Roll you can edit "
339
"melody-patterns in an easy "
342
m_projectNotesWindow = new QToolButton( embed::getIconPixmap(
344
tr( "Show/Hide Project notes" )+
347
this, SLOT( toggleProjectNotesWin() ),
349
m_projectNotesWindow->setAccel( Key_F10 );
350
QWhatsThis::add( m_projectNotesWindow, tr( "By pressing this button, "
351
"you can show or hide "
354
"In this window you "
358
m_songEditorWindow = new QToolButton( embed::getIconPixmap(
360
tr( "Show/Hide Song-Editor" ) +
313
piano_roll_window->setShortcut( Qt::Key_F7 );
315
piano_roll_window->setWhatsThis(
317
QWhatsThis::add( piano_roll_window,
319
tr( "By pressing this button, you can show or hide the "
320
"Piano-Roll. With the help of the Piano-Roll "
321
"you can edit melody-patterns in an easy way."
324
toolButton * song_editor_window = new toolButton(
325
embed::getIconPixmap( "songeditor" ),
326
tr( "Show/hide Song-Editor" ) + " (F8)",
363
327
this, SLOT( toggleSongEditorWin() ),
365
m_songEditorWindow->setAccel( Qt::Key_F8 );
329
song_editor_window->setShortcut( Qt::Key_F8 );
367
m_songEditorWindow->setWhatsThis(
331
song_editor_window->setWhatsThis(
369
QWhatsThis::add( m_songEditorWindow,
333
QWhatsThis::add( song_editor_window,
371
335
tr( "By pressing this button, you can show or hide the "
372
"Song-Editor. With the Song-Editor you can edit the "
373
"song and set when and which track should be played. "
336
"Song-Editor. With the help of the Song-Editor you can "
337
"edit song-playlist and specify when which track "
374
339
"You can also insert and move samples (e.g. "
375
"rap-samples) directly in the playlist." ) );
378
m_effectBoardWindow = new QToolButton( embed::getIconPixmap(
380
tr( "Show/Hide EffectBoard" ) +
383
this, SLOT( emptySlot() ),
385
m_effectBoardWindow->setAccel( Qt::Key_F9 );
340
"rap-samples) directly into the playlist." ) );
343
toolButton * effect_board_window = new toolButton(
344
embed::getIconPixmap( "effect_board" ),
345
tr( "Show/hide EffectBoard" ) + " (F9)",
346
this, SLOT( emptySlot() ), m_toolBar );
347
effect_board_window->setShortcut( Qt::Key_F9 );
387
m_effectBoardWindow->setWhatsThis(
349
effect_board_window->setWhatsThis(
389
QWhatsThis::add( m_effectBoardWindow,
351
QWhatsThis::add( effect_board_window,
391
353
tr( "By pressing this button, you can show or hide the "
392
354
"EffectBoard. The EffectBoard is a very powerful tool "
393
355
"for managing effects for your song. You can insert "
394
356
"effects into different effect-channels." ) );
358
toolButton * project_notes_window = new toolButton(
359
embed::getIconPixmap( "project_notes" ),
360
tr( "Show/hide project notes" ) +
362
this, SLOT( toggleProjectNotesWin() ),
364
project_notes_window->setShortcut( Qt::Key_F10 );
366
project_notes_window->setWhatsThis(
368
QWhatsThis::add( project_notes_window,
399
// create a "What's this"-Button
400
// (void) QWhatsThis::whatsThisButton( m_windowTools );
370
tr( "By pressing this button, you can show or hide the "
371
"project notes window. In this window you can put "
372
"down your project notes.") );
374
m_toolBarLayout->addWidget( bb_editor_window, 1, 0 );
375
m_toolBarLayout->addWidget( piano_roll_window, 1, 1 );
376
m_toolBarLayout->addWidget( song_editor_window, 1, 2 );
377
m_toolBarLayout->addWidget( effect_board_window, 1, 3 );
378
m_toolBarLayout->addWidget( project_notes_window, 1, 4 );
380
m_toolBarLayout->setColumnStretch( 100, 1 );
403
384
// project-popup-menu
404
m_projectMenu = new QMenu( this );
385
QMenu * project_menu = new QMenu( this );
406
menuBar()->addMenu( m_projectMenu )->setText( tr( "&Project" ) );
387
menuBar()->addMenu( project_menu )->setText( tr( "&Project" ) );
408
menuBar()->insertItem( tr( "&Project" ), m_projectMenu );
389
menuBar()->insertItem( tr( "&Project" ), project_menu );
410
m_projectMenu->addAction( embed::getIconPixmap( "project_new" ),
391
project_menu->addAction( embed::getIconPixmap( "project_new" ),
412
393
this, SLOT( createNewProject() ),
413
394
Qt::CTRL + Qt::Key_N );
415
m_projectMenu->addAction( embed::getIconPixmap( "project_open" ),
396
project_menu->addAction( embed::getIconPixmap( "project_open" ),
416
397
tr( "&Open..." ),
417
398
this, SLOT( openProject() ),
418
399
Qt::CTRL + Qt::Key_O );
420
m_projectMenu->addAction( embed::getIconPixmap( "project_save" ),
401
project_menu->addAction( embed::getIconPixmap( "project_save" ),
422
403
this, SLOT( saveProject() ),
423
404
Qt::CTRL + Qt::Key_S );
425
m_projectMenu->addAction( embed::getIconPixmap( "project_saveas" ),
406
project_menu->addAction( embed::getIconPixmap( "project_saveas" ),
426
407
tr( "Save &As..." ),
427
408
this, SLOT( saveProjectAs() ),
428
409
Qt::CTRL + Qt::SHIFT + Qt::Key_S );
430
m_projectMenu->addSeparator();
411
project_menu->addSeparator();
432
m_projectMenu->insertSeparator();
413
project_menu->insertSeparator();
434
m_projectMenu->addAction( /*embed::getIconPixmap( "project_import" ),*/
415
project_menu->addAction( /*embed::getIconPixmap( "project_import" ),*/
435
416
tr( "Import file" ),
436
417
songEditor::inst(),
437
418
SLOT( importProject() ) );
439
m_projectMenu->addSeparator();
420
project_menu->addSeparator();
441
m_projectMenu->insertSeparator();
422
project_menu->insertSeparator();
443
m_projectMenu->addAction( embed::getIconPixmap( "project_export" ),
424
project_menu->addAction( embed::getIconPixmap( "project_export" ),
445
426
songEditor::inst(),
446
427
SLOT( exportProject() ),
447
428
Qt::CTRL + Qt::Key_E );
449
m_projectMenu->addSeparator();
430
project_menu->addSeparator();
451
m_projectMenu->insertSeparator();
432
project_menu->insertSeparator();
453
m_projectMenu->addAction( embed::getIconPixmap( "exit" ), tr( "&Quit" ),
434
project_menu->addAction( embed::getIconPixmap( "exit" ), tr( "&Quit" ),
454
435
qApp, SLOT( closeAllWindows() ),
455
436
Qt::CTRL+Qt::Key_Q );
458
QMenu * m_settingsMenu = new QMenu( this );
439
QMenu * settings_menu = new QMenu( this );
460
menuBar()->addMenu( m_settingsMenu )->setText( tr( "&Settings" ) );
441
menuBar()->addMenu( settings_menu )->setText( tr( "&Settings" ) );
462
menuBar()->insertItem( tr( "&Settings" ), m_settingsMenu );
443
menuBar()->insertItem( tr( "&Settings" ), settings_menu );
464
m_settingsMenu->addAction( embed::getIconPixmap( "setup_general" ),
445
settings_menu->addAction( embed::getIconPixmap( "setup_general" ),
465
446
tr( "Show settings dialog" ),
466
447
this, SLOT( showSettingsDialog() ) );
467
m_settingsMenu->addAction( embed::getIconPixmap( "wizard" ),
448
settings_menu->addAction( embed::getIconPixmap( "wizard" ),
468
449
tr( "Show setup wizard" ),
469
450
configManager::inst(), SLOT( exec() ) );
472
453
// help-popup-menu
473
m_helpMenu = new QMenu( this );
454
QMenu * help_menu = new QMenu( this );
475
menuBar()->addMenu( m_helpMenu )->setText( tr( "&Help" ) );
456
menuBar()->addMenu( help_menu )->setText( tr( "&Help" ) );
477
menuBar()->insertItem( tr( "&Help" ), m_helpMenu );
458
menuBar()->insertItem( tr( "&Help" ), help_menu );
479
m_helpMenu->addAction( embed::getIconPixmap( "help" ), tr( "Help" ),
460
help_menu->addAction( embed::getIconPixmap( "help" ), tr( "Help" ),
480
461
this, SLOT( help() ) );
481
m_helpMenu->addAction( embed::getIconPixmap( "whatsthis" ),
462
help_menu->addAction( embed::getIconPixmap( "whatsthis" ),
482
463
tr( "What's this?" ),
483
464
this, SLOT( enterWhatsThisMode() ) );
485
m_helpMenu->addSeparator();
466
help_menu->addSeparator();
487
m_helpMenu->insertSeparator();
468
help_menu->insertSeparator();
489
m_helpMenu->addAction( embed::getIconPixmap( "icon" ), tr( "About" ),
470
help_menu->addAction( embed::getIconPixmap( "icon" ), tr( "About" ),
490
471
this, SLOT( aboutLMMS() ) );
492
// now start mixer-thread
493
mixer::inst()->start(
494
#if QT_VERSION >= 0x030200
495
QThread::HighestPriority
499
473
// setup-dialog opened before?
500
474
if( !configManager::inst()->value( "app", "configured" ).toInt() )
502
476
// no, so show it that user can setup everything
503
setupDialog().exec();
504
configManager::inst()->setValue( "app", "configured", "1" );
477
/* setupDialog().exec();
478
configManager::inst()->setValue( "app", "configured", "1" );*/
506
480
// look whether mixer could use a audio-interface beside audioDummy
507
481
else if( mixer::inst()->audioDevName() == audioDummy::name() )