ClipListEdit::ClipListEdit(QWidget* parent) : TopWin(TopWin::CLIPLIST, parent, "cliplist", Qt::Window) { setWindowTitle(tr("MusE: Clip List Editor")); editor = new ClipListEditorBaseWidget; setCentralWidget(editor); QMenu* settingsMenu = menuBar()->addMenu(tr("Window &Config")); settingsMenu->addAction(subwinAction); settingsMenu->addAction(shareAction); settingsMenu->addAction(fullscreenAction); QFontMetrics fm(editor->view->font()); int fw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth,0, this); // ddskrjo 0 int w = 2 + fm.width('9') * 9 + fm.width(':') * 3 + fw * 4; editor->view->setColumnWidth(COL_SAMPLERATE, w); editor->view->setColumnWidth(COL_LEN, w); connect(editor->view, SIGNAL(itemSelectionChanged()), SLOT(clipSelectionChanged())); connect(editor->view, SIGNAL(itemClicked(QTreeWidgetItem*, int)), SLOT(clicked(QTreeWidgetItem*, int))); connect(MusEGlobal::song, SIGNAL(songChanged(MusECore::SongChangedFlags_t)), SLOT(songChanged(MusECore::SongChangedFlags_t))); connect(editor->start, SIGNAL(valueChanged(const MusECore::Pos&)), SLOT(startChanged(const MusECore::Pos&))); connect(editor->len, SIGNAL(valueChanged(const MusECore::Pos&)), SLOT(lenChanged(const MusECore::Pos&))); updateList(); finalizeInit(); }
void ClipListEdit::updateList() { editor->view->clear(); for (MusECore::iSndFile f = MusECore::SndFile::sndFiles.begin(); f != MusECore::SndFile::sndFiles.end(); ++f) { new ClipItem(editor->view, *f); } clipSelectionChanged(); }
ClipListEdit::ClipListEdit(QWidget* parent) : TopWin(TopWin::CLIPLIST, parent, "cliplist", Qt::Window) { setWindowTitle(tr("MusE: Clip List Editor")); editor = new ClipListEditorBaseWidget; setCentralWidget(editor); QMenu* settingsMenu = menuBar()->addMenu(tr("Window &Config")); settingsMenu->addAction(subwinAction); settingsMenu->addAction(shareAction); settingsMenu->addAction(fullscreenAction); // NOTICE: Please ensure that any tool bar object names here match the names assigned // to identical or similar toolbars in class MusE or other TopWin classes. // This allows MusE::setCurrentMenuSharingTopwin() to do some magic // to retain the original toolbar layout. If it finds an existing // toolbar with the same object name, it /replaces/ it using insertToolBar(), // instead of /appending/ with addToolBar(). QFontMetrics fm(editor->view->font()); int fw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth,0, this); // ddskrjo 0 int w = 2 + fm.width('9') * 9 + fm.width(':') * 3 + fw * 4; editor->view->setColumnWidth(COL_SAMPLERATE, w); editor->view->setColumnWidth(COL_LEN, w); connect(editor->view, SIGNAL(itemSelectionChanged()), SLOT(clipSelectionChanged())); connect(editor->view, SIGNAL(itemClicked(QTreeWidgetItem*, int)), SLOT(clicked(QTreeWidgetItem*, int))); connect(MusEGlobal::song, SIGNAL(songChanged(MusECore::SongChangedStruct_t)), SLOT(songChanged(MusECore::SongChangedStruct_t))); connect(editor->start, SIGNAL(valueChanged(const MusECore::Pos&)), SLOT(startChanged(const MusECore::Pos&))); connect(editor->len, SIGNAL(valueChanged(const MusECore::Pos&)), SLOT(lenChanged(const MusECore::Pos&))); updateList(); finalizeInit(); }