From 42cd21a94382496b9d58b910b43e3669c67930f7 Mon Sep 17 00:00:00 2001 From: Lukas W Date: Wed, 3 Sep 2014 11:06:56 +0200 Subject: [PATCH 01/19] Change sidebar root to `/Volumes` on OS X --- src/gui/MainWindow.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index aba422251..f8be43b9c 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -119,15 +119,23 @@ MainWindow::MainWindow() : tr( "My home" ), embed::getIconPixmap( "home" ).transformed( QTransform().rotate( 90 ) ), splitter ) ); - QFileInfoList drives = QDir::drives(); + QStringList root_paths; +#ifdef LMMS_BUILD_APPLE + root_paths += "/Volumes"; +#else + QFileInfoList drives = QDir::drives(); foreach( const QFileInfo & drive, drives ) { root_paths += drive.absolutePath(); } +#endif sideBar->appendTab( new fileBrowser( root_paths.join( "*" ), "*", #ifdef LMMS_BUILD_WIN32 tr( "My computer" ), +#endif +#ifdef LMMS_BUILD_APPLE + tr( "Volumes" ), #else tr( "Root directory" ), #endif From 5245f6181c27d31a657bf7e3f1fe6c2ebda1208f Mon Sep 17 00:00:00 2001 From: Lukas W Date: Wed, 3 Sep 2014 11:19:45 +0200 Subject: [PATCH 02/19] Apply new coding conventions to file_browser.h --- include/file_browser.h | 86 +++++------ src/gui/MainWindow.cpp | 10 +- src/gui/TrackContainerView.cpp | 2 +- src/gui/file_browser.cpp | 258 ++++++++++++++++----------------- src/tracks/InstrumentTrack.cpp | 2 +- 5 files changed, 179 insertions(+), 179 deletions(-) diff --git a/include/file_browser.h b/include/file_browser.h index 3679b45a5..304c9da34 100644 --- a/include/file_browser.h +++ b/include/file_browser.h @@ -1,5 +1,5 @@ /* - * file_browser.h - include file for fileBrowser + * file_browser.h - include file for FileBrowser * * Copyright (c) 2004-2014 Tobias Doerffel * @@ -23,8 +23,8 @@ */ -#ifndef _FILE_BROWSER_H -#define _FILE_BROWSER_H +#ifndef FILE_BROWSER_H +#define FILE_BROWSER_H #include #include @@ -36,36 +36,36 @@ class QLineEdit; -class fileItem; +class FileItem; class InstrumentTrack; -class fileBrowserTreeWidget; +class FileBrowserTreeWidget; class PlayHandle; class TrackContainer; -class fileBrowser : public SideBarWidget +class FileBrowser : public SideBarWidget { Q_OBJECT public: - fileBrowser( const QString & _directories, const QString & _filter, - const QString & _title, const QPixmap & _pm, - QWidget * _parent, bool _dirs_as_items = false ); - virtual ~fileBrowser(); + FileBrowser( const QString & directories, const QString & filter, + const QString & title, const QPixmap & pm, + QWidget * parent, bool dirs_as_items = false ); + virtual ~FileBrowser(); public slots: - void filterItems( const QString & _filter ); + void filterItems( const QString & filter ); void reloadTree( void ); private: - bool filterItems( QTreeWidgetItem * _item, const QString & _filter ); - virtual void keyPressEvent( QKeyEvent * _ke ); + bool filterItems( QTreeWidgetItem * item, const QString & filter ); + virtual void keyPressEvent( QKeyEvent * ke ); - void addItems( const QString & _path ); + void addItems( const QString & path ); - fileBrowserTreeWidget * m_l; + FileBrowserTreeWidget * m_l; QLineEdit * m_filterEdit; @@ -79,23 +79,23 @@ private: -class fileBrowserTreeWidget : public QTreeWidget +class FileBrowserTreeWidget : public QTreeWidget { Q_OBJECT public: - fileBrowserTreeWidget( QWidget * _parent ); - virtual ~fileBrowserTreeWidget(); + FileBrowserTreeWidget( QWidget * parent ); + virtual ~FileBrowserTreeWidget(); protected: - virtual void contextMenuEvent( QContextMenuEvent * _e ); - virtual void mousePressEvent( QMouseEvent * _me ); - virtual void mouseMoveEvent( QMouseEvent * _me ); - virtual void mouseReleaseEvent( QMouseEvent * _me ); + virtual void contextMenuEvent( QContextMenuEvent * e ); + virtual void mousePressEvent( QMouseEvent * me ); + virtual void mouseMoveEvent( QMouseEvent * me ); + virtual void mouseReleaseEvent( QMouseEvent * me ); private: - void handleFile( fileItem * _fi, InstrumentTrack * _it ); + void handleFile( FileItem * fi, InstrumentTrack * it ); void openInNewInstrumentTrack( TrackContainer* tc ); @@ -105,53 +105,53 @@ private: PlayHandle* m_previewPlayHandle; QMutex m_pphMutex; - fileItem * m_contextMenuItem; + FileItem * m_contextMenuItem; private slots: - void activateListItem( QTreeWidgetItem * _item, int _column ); + void activateListItem( QTreeWidgetItem * item, int column ); void openInNewInstrumentTrackBBE( void ); void openInNewInstrumentTrackSE( void ); void sendToActiveInstrumentTrack( void ); - void updateDirectory( QTreeWidgetItem * _item ); + void updateDirectory( QTreeWidgetItem * item ); } ; -class directory : public QTreeWidgetItem +class Directory : public QTreeWidgetItem { public: - directory( const QString & _filename, const QString & _path, - const QString & _filter ); + Directory( const QString & filename, const QString & path, + const QString & filter ); void update( void ); - inline QString fullName( QString _path = QString::null ) + inline QString fullName( QString path = QString::null ) { - if( _path == QString::null ) + if( path == QString::null ) { - _path = m_directories[0]; + path = m_directories[0]; } - if( _path != QString::null ) + if( path != QString::null ) { - _path += QDir::separator(); + path += QDir::separator(); } - return( QDir::cleanPath( _path + text( 0 ) ) + + return( QDir::cleanPath( path + text( 0 ) ) + QDir::separator() ); } - inline void addDirectory( const QString & _dir ) + inline void addDirectory( const QString & dir ) { - m_directories.push_back( _dir ); + m_directories.push_back( dir ); } private: void initPixmaps( void ); - bool addItems( const QString & _path ); + bool addItems( const QString & path ); static QPixmap * s_folderPixmap; @@ -166,7 +166,7 @@ private: -class fileItem : public QTreeWidgetItem +class FileItem : public QTreeWidgetItem { public: enum FileTypes @@ -193,9 +193,9 @@ public: } ; - fileItem( QTreeWidget * _parent, const QString & _name, - const QString & _path ); - fileItem( const QString & _name, const QString & _path ); + FileItem( QTreeWidget * parent, const QString & name, + const QString & path ); + FileItem( const QString & name, const QString & path ); inline QString fullName( void ) const { @@ -214,7 +214,7 @@ public: } QString extension( void ); - static QString extension( const QString & _file ); + static QString extension( const QString & file ); private: diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index f8be43b9c..b645a4cf0 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -95,27 +95,27 @@ MainWindow::MainWindow() : QString wdir = configManager::inst()->workingDir(); sideBar->appendTab( new pluginBrowser( splitter ) ); - sideBar->appendTab( new fileBrowser( + sideBar->appendTab( new FileBrowser( configManager::inst()->userProjectsDir() + "*" + configManager::inst()->factoryProjectsDir(), "*.mmp *.mmpz *.xml *.mid *.flp", tr( "My projects" ), embed::getIconPixmap( "project_file" ).transformed( QTransform().rotate( 90 ) ), splitter ) ); - sideBar->appendTab( new fileBrowser( + sideBar->appendTab( new FileBrowser( configManager::inst()->userSamplesDir() + "*" + configManager::inst()->factorySamplesDir(), "*", tr( "My samples" ), embed::getIconPixmap( "sample_file" ).transformed( QTransform().rotate( 90 ) ), splitter ) ); - sideBar->appendTab( new fileBrowser( + sideBar->appendTab( new FileBrowser( configManager::inst()->userPresetsDir() + "*" + configManager::inst()->factoryPresetsDir(), "*.xpf *.cs.xml *.xiz", tr( "My presets" ), embed::getIconPixmap( "preset_file" ).transformed( QTransform().rotate( 90 ) ), splitter ) ); - sideBar->appendTab( new fileBrowser( QDir::homePath(), "*", + sideBar->appendTab( new FileBrowser( QDir::homePath(), "*", tr( "My home" ), embed::getIconPixmap( "home" ).transformed( QTransform().rotate( 90 ) ), splitter ) ); @@ -130,7 +130,7 @@ MainWindow::MainWindow() : root_paths += drive.absolutePath(); } #endif - sideBar->appendTab( new fileBrowser( root_paths.join( "*" ), "*", + sideBar->appendTab( new FileBrowser( root_paths.join( "*" ), "*", #ifdef LMMS_BUILD_WIN32 tr( "My computer" ), #endif diff --git a/src/gui/TrackContainerView.cpp b/src/gui/TrackContainerView.cpp index 8590d9585..ffddec24c 100644 --- a/src/gui/TrackContainerView.cpp +++ b/src/gui/TrackContainerView.cpp @@ -342,7 +342,7 @@ void TrackContainerView::dropEvent( QDropEvent * _de ) track::create( track::InstrumentTrack, m_tc ) ); Instrument * i = it->loadInstrument( - engine::pluginFileHandling()[fileItem::extension( + engine::pluginFileHandling()[FileItem::extension( value )]); i->loadFile( value ); //it->toggledInstrumentTrackButton( true ); diff --git a/src/gui/file_browser.cpp b/src/gui/file_browser.cpp index 87714ea89..f0cf5b740 100644 --- a/src/gui/file_browser.cpp +++ b/src/gui/file_browser.cpp @@ -60,16 +60,16 @@ enum TreeWidgetItemTypes -fileBrowser::fileBrowser( const QString & _directories, const QString & _filter, - const QString & _title, const QPixmap & _pm, - QWidget * _parent, bool _dirs_as_items ) : - SideBarWidget( _title, _pm, _parent ), - m_directories( _directories ), - m_filter( _filter ), - m_dirsAsItems( _dirs_as_items ) +FileBrowser::FileBrowser(const QString & directories, const QString & filter, + const QString & title, const QPixmap & pm, + QWidget * parent, bool dirs_as_items ) : + SideBarWidget( title, pm, parent ), + m_directories( directories ), + m_filter( filter ), + m_dirsAsItems( dirs_as_items ) { setWindowTitle( tr( "Browser" ) ); - m_l = new fileBrowserTreeWidget( contentParent() ); + m_l = new FileBrowserTreeWidget( contentParent() ); addContentWidget( m_l ); QWidget * ops = new QWidget( contentParent() ); @@ -101,16 +101,16 @@ fileBrowser::fileBrowser( const QString & _directories, const QString & _filter, -fileBrowser::~fileBrowser() +FileBrowser::~FileBrowser() { } -void fileBrowser::filterItems( const QString & _filter ) +void FileBrowser::filterItems( const QString & filter ) { - const bool show_all = _filter.isEmpty(); + const bool show_all = filter.isEmpty(); for( int i = 0; i < m_l->topLevelItemCount(); ++i ) { @@ -121,7 +121,7 @@ void fileBrowser::filterItems( const QString & _filter ) it->setHidden( false ); if( it->childCount() ) { - filterItems( it, _filter ); + filterItems( it, filter ); } } // is directory? @@ -129,7 +129,7 @@ void fileBrowser::filterItems( const QString & _filter ) { // matches filter? if( it->text( 0 ). - contains( _filter, Qt::CaseInsensitive ) ) + contains( filter, Qt::CaseInsensitive ) ) { // yes, then show everything below it->setHidden( false ); @@ -138,7 +138,7 @@ void fileBrowser::filterItems( const QString & _filter ) else { // only show if item below matches filter - it->setHidden( !filterItems( it, _filter ) ); + it->setHidden( !filterItems( it, filter ) ); } } // a standard item (i.e. no file or directory item?) @@ -151,7 +151,7 @@ void fileBrowser::filterItems( const QString & _filter ) { // file matches filter? it->setHidden( !it->text( 0 ). - contains( _filter, Qt::CaseInsensitive ) ); + contains( filter, Qt::CaseInsensitive ) ); } } @@ -160,14 +160,14 @@ void fileBrowser::filterItems( const QString & _filter ) -bool fileBrowser::filterItems( QTreeWidgetItem * _item, const QString & _filter ) +bool FileBrowser::filterItems(QTreeWidgetItem * item, const QString & filter ) { - const bool show_all = _filter.isEmpty(); + const bool show_all = filter.isEmpty(); bool matched = false; - for( int i = 0; i < _item->childCount(); ++i ) + for( int i = 0; i < item->childCount(); ++i ) { - QTreeWidgetItem * it = _item->child( i ); + QTreeWidgetItem * it = item->child( i ); bool cm = false; // whether current item matched // show all items if filter is empty if( show_all ) @@ -175,7 +175,7 @@ bool fileBrowser::filterItems( QTreeWidgetItem * _item, const QString & _filter it->setHidden( false ); if( it->childCount() ) { - filterItems( it, _filter ); + filterItems( it, filter ); } } // is directory? @@ -183,7 +183,7 @@ bool fileBrowser::filterItems( QTreeWidgetItem * _item, const QString & _filter { // matches filter? if( it->text( 0 ). - contains( _filter, Qt::CaseInsensitive ) ) + contains( filter, Qt::CaseInsensitive ) ) { // yes, then show everything below it->setHidden( false ); @@ -193,7 +193,7 @@ bool fileBrowser::filterItems( QTreeWidgetItem * _item, const QString & _filter else { // only show if item below matches filter - cm = filterItems( it, _filter ); + cm = filterItems( it, filter ); it->setHidden( !cm ); } } @@ -207,7 +207,7 @@ bool fileBrowser::filterItems( QTreeWidgetItem * _item, const QString & _filter { // file matches filter? cm = it->text( 0 ). - contains( _filter, Qt::CaseInsensitive ); + contains( filter, Qt::CaseInsensitive ); it->setHidden( !cm ); } @@ -223,7 +223,7 @@ bool fileBrowser::filterItems( QTreeWidgetItem * _item, const QString & _filter -void fileBrowser::reloadTree( void ) +void FileBrowser::reloadTree( void ) { const QString text = m_filterEdit->text(); m_filterEdit->clear(); @@ -240,16 +240,16 @@ void fileBrowser::reloadTree( void ) -void fileBrowser::addItems( const QString & _path ) +void FileBrowser::addItems(const QString & path ) { if( m_dirsAsItems ) { - m_l->addTopLevelItem( new directory( _path, + m_l->addTopLevelItem( new Directory( path, QString::null, m_filter ) ); return; } - QDir cdir( _path ); + QDir cdir( path ); QStringList files = cdir.entryList( QDir::Dirs, QDir::Name ); for( QStringList::const_iterator it = files.constBegin(); it != files.constEnd(); ++it ) @@ -260,27 +260,27 @@ void fileBrowser::addItems( const QString & _path ) bool orphan = true; for( int i = 0; i < m_l->topLevelItemCount(); ++i ) { - directory * d = dynamic_cast( + Directory * d = dynamic_cast( m_l->topLevelItem( i ) ); if( d == NULL || cur_file < d->text( 0 ) ) { m_l->insertTopLevelItem( i, - new directory( cur_file, _path, + new Directory( cur_file, path, m_filter ) ); orphan = false; break; } else if( cur_file == d->text( 0 ) ) { - d->addDirectory( _path ); + d->addDirectory( path ); orphan = false; break; } } if( orphan ) { - m_l->addTopLevelItem( new directory( cur_file, - _path, m_filter ) ); + m_l->addTopLevelItem( new Directory( cur_file, + path, m_filter ) ); } } } @@ -300,7 +300,7 @@ void fileBrowser::addItems( const QString & _path ) { delete existing.front(); } - (void) new fileItem( m_l, cur_file, _path ); + (void) new FileItem( m_l, cur_file, path ); } } } @@ -308,15 +308,15 @@ void fileBrowser::addItems( const QString & _path ) -void fileBrowser::keyPressEvent( QKeyEvent * _ke ) +void FileBrowser::keyPressEvent(QKeyEvent * ke ) { - if( _ke->key() == Qt::Key_F5 ) + if( ke->key() == Qt::Key_F5 ) { reloadTree(); } else { - _ke->ignore(); + ke->ignore(); } } @@ -327,8 +327,8 @@ void fileBrowser::keyPressEvent( QKeyEvent * _ke ) -fileBrowserTreeWidget::fileBrowserTreeWidget( QWidget * _parent ) : - QTreeWidget( _parent ), +FileBrowserTreeWidget::FileBrowserTreeWidget(QWidget * parent ) : + QTreeWidget( parent ), m_mousePressed( false ), m_pressPos(), m_previewPlayHandle( NULL ), @@ -352,18 +352,18 @@ fileBrowserTreeWidget::fileBrowserTreeWidget( QWidget * _parent ) : -fileBrowserTreeWidget::~fileBrowserTreeWidget() +FileBrowserTreeWidget::~FileBrowserTreeWidget() { } -void fileBrowserTreeWidget::contextMenuEvent( QContextMenuEvent * _e ) +void FileBrowserTreeWidget::contextMenuEvent(QContextMenuEvent * e ) { - fileItem * f = dynamic_cast( itemAt( _e->pos() ) ); - if( f != NULL && ( f->handling() == fileItem::LoadAsPreset || - f->handling() == fileItem::LoadByPlugin ) ) + FileItem * f = dynamic_cast( itemAt( e->pos() ) ); + if( f != NULL && ( f->handling() == FileItem::LoadAsPreset || + f->handling() == FileItem::LoadByPlugin ) ) { m_contextMenuItem = f; QMenu contextMenu( this ); @@ -378,7 +378,7 @@ void fileBrowserTreeWidget::contextMenuEvent( QContextMenuEvent * _e ) "B+B Editor" ), this, SLOT( openInNewInstrumentTrackBBE() ) ); - contextMenu.exec( _e->globalPos() ); + contextMenu.exec( e->globalPos() ); m_contextMenuItem = NULL; } } @@ -386,15 +386,15 @@ void fileBrowserTreeWidget::contextMenuEvent( QContextMenuEvent * _e ) -void fileBrowserTreeWidget::mousePressEvent( QMouseEvent * _me ) +void FileBrowserTreeWidget::mousePressEvent(QMouseEvent * me ) { - QTreeWidget::mousePressEvent( _me ); - if( _me->button() != Qt::LeftButton ) + QTreeWidget::mousePressEvent( me ); + if( me->button() != Qt::LeftButton ) { return; } - QTreeWidgetItem * i = itemAt( _me->pos() ); + QTreeWidgetItem * i = itemAt( me->pos() ); if ( i ) { // TODO: Restrict to visible selection @@ -404,12 +404,12 @@ void fileBrowserTreeWidget::mousePressEvent( QMouseEvent * _me ) // _me->x() < header()->cellPos( // header()->mapToActual( 0 ) ) ) // { - m_pressPos = _me->pos(); + m_pressPos = me->pos(); m_mousePressed = true; // } } - fileItem * f = dynamic_cast( i ); + FileItem * f = dynamic_cast( i ); if( f != NULL ) { m_pphMutex.lock(); @@ -422,7 +422,7 @@ void fileBrowserTreeWidget::mousePressEvent( QMouseEvent * _me ) // in special case of sample-files we do not care about // handling() rather than directly creating a SamplePlayHandle - if( f->type() == fileItem::SampleFile ) + if( f->type() == FileItem::SampleFile ) { textFloat * tf = textFloat::displayMessage( tr( "Loading sample" ), @@ -438,11 +438,11 @@ void fileBrowserTreeWidget::mousePressEvent( QMouseEvent * _me ) m_previewPlayHandle = s; delete tf; } - else if( f->type() != fileItem::VstPluginFile && - ( f->handling() == fileItem::LoadAsPreset || - f->handling() == fileItem::LoadByPlugin ) ) + else if( f->type() != FileItem::VstPluginFile && + ( f->handling() == FileItem::LoadAsPreset || + f->handling() == FileItem::LoadByPlugin ) ) { - m_previewPlayHandle = new PresetPreviewPlayHandle( f->fullName(), f->handling() == fileItem::LoadByPlugin ); + m_previewPlayHandle = new PresetPreviewPlayHandle( f->fullName(), f->handling() == FileItem::LoadByPlugin ); } if( m_previewPlayHandle != NULL ) { @@ -459,40 +459,40 @@ void fileBrowserTreeWidget::mousePressEvent( QMouseEvent * _me ) -void fileBrowserTreeWidget::mouseMoveEvent( QMouseEvent * _me ) +void FileBrowserTreeWidget::mouseMoveEvent( QMouseEvent * me ) { if( m_mousePressed == true && - ( m_pressPos - _me->pos() ).manhattanLength() > + ( m_pressPos - me->pos() ).manhattanLength() > QApplication::startDragDistance() ) { // make sure any playback is stopped mouseReleaseEvent( NULL ); - fileItem * f = dynamic_cast( itemAt( m_pressPos ) ); + FileItem * f = dynamic_cast( itemAt( m_pressPos ) ); if( f != NULL ) { switch( f->type() ) { - case fileItem::PresetFile: - new stringPairDrag( f->handling() == fileItem::LoadAsPreset ? + case FileItem::PresetFile: + new stringPairDrag( f->handling() == FileItem::LoadAsPreset ? "presetfile" : "pluginpresetfile", f->fullName(), embed::getIconPixmap( "preset_file" ), this ); break; - case fileItem::SampleFile: + case FileItem::SampleFile: new stringPairDrag( "samplefile", f->fullName(), embed::getIconPixmap( "sample_file" ), this ); break; - case fileItem::SoundFontFile: + case FileItem::SoundFontFile: new stringPairDrag( "soundfontfile", f->fullName(), embed::getIconPixmap( "soundfont_file" ), this ); break; - case fileItem::VstPluginFile: + case FileItem::VstPluginFile: new stringPairDrag( "vstpluginfile", f->fullName(), embed::getIconPixmap( "vst_plugin_file" ), this ); break; - case fileItem::MidiFile: + case FileItem::MidiFile: // don't allow dragging FLP-files as FLP import filter clears project // without asking // case fileItem::FlpFile: @@ -510,7 +510,7 @@ void fileBrowserTreeWidget::mouseMoveEvent( QMouseEvent * _me ) -void fileBrowserTreeWidget::mouseReleaseEvent( QMouseEvent * _me ) +void FileBrowserTreeWidget::mouseReleaseEvent(QMouseEvent * me ) { m_mousePressed = false; @@ -543,43 +543,43 @@ void fileBrowserTreeWidget::mouseReleaseEvent( QMouseEvent * _me ) -void fileBrowserTreeWidget::handleFile( fileItem * f, InstrumentTrack * _it ) +void FileBrowserTreeWidget::handleFile(FileItem * f, InstrumentTrack * it ) { engine::mixer()->lock(); switch( f->handling() ) { - case fileItem::LoadAsProject: + case FileItem::LoadAsProject: if( engine::mainWindow()->mayChangeProject() ) { engine::getSong()->loadProject( f->fullName() ); } break; - case fileItem::LoadByPlugin: + case FileItem::LoadByPlugin: { const QString e = f->extension(); - Instrument * i = _it->instrument(); + Instrument * i = it->instrument(); if( i == NULL || !i->descriptor()->supportsFileType( e ) ) { - i = _it->loadInstrument( + i = it->loadInstrument( engine::pluginFileHandling()[e] ); } i->loadFile( f->fullName() ); break; } - case fileItem::LoadAsPreset: + case FileItem::LoadAsPreset: { DataFile dataFile( f->fullName() ); InstrumentTrack::removeMidiPortNode( dataFile ); - _it->setSimpleSerializing(); - _it->loadSettings( dataFile.content().toElement() ); + it->setSimpleSerializing(); + it->loadSettings( dataFile.content().toElement() ); break; } - case fileItem::ImportAsProject: - if( f->type() == fileItem::FlpFile && + case FileItem::ImportAsProject: + if( f->type() == FileItem::FlpFile && !engine::mainWindow()->mayChangeProject() ) { break; @@ -588,7 +588,7 @@ void fileBrowserTreeWidget::handleFile( fileItem * f, InstrumentTrack * _it ) engine::getSong() ); break; - case fileItem::NotSupported: + case FileItem::NotSupported: default: break; @@ -599,21 +599,21 @@ void fileBrowserTreeWidget::handleFile( fileItem * f, InstrumentTrack * _it ) -void fileBrowserTreeWidget::activateListItem( QTreeWidgetItem * _item, - int _column ) +void FileBrowserTreeWidget::activateListItem(QTreeWidgetItem * item, + int column ) { - fileItem * f = dynamic_cast( _item ); + FileItem * f = dynamic_cast( item ); if( f == NULL ) { return; } - if( f->handling() == fileItem::LoadAsProject || - f->handling() == fileItem::ImportAsProject ) + if( f->handling() == FileItem::LoadAsProject || + f->handling() == FileItem::ImportAsProject ) { handleFile( f, NULL ); } - else if( f->handling() != fileItem::NotSupported ) + else if( f->handling() != FileItem::NotSupported ) { engine::mixer()->lock(); InstrumentTrack * it = dynamic_cast( @@ -627,10 +627,10 @@ void fileBrowserTreeWidget::activateListItem( QTreeWidgetItem * _item, -void fileBrowserTreeWidget::openInNewInstrumentTrack( TrackContainer* tc ) +void FileBrowserTreeWidget::openInNewInstrumentTrack( TrackContainer* tc ) { - if( m_contextMenuItem->handling() == fileItem::LoadAsPreset || - m_contextMenuItem->handling() == fileItem::LoadByPlugin ) + if( m_contextMenuItem->handling() == FileItem::LoadAsPreset || + m_contextMenuItem->handling() == FileItem::LoadByPlugin ) { engine::mixer()->lock(); InstrumentTrack * it = dynamic_cast( @@ -643,7 +643,7 @@ void fileBrowserTreeWidget::openInNewInstrumentTrack( TrackContainer* tc ) -void fileBrowserTreeWidget::openInNewInstrumentTrackBBE( void ) +void FileBrowserTreeWidget::openInNewInstrumentTrackBBE( void ) { openInNewInstrumentTrack( engine::getBBTrackContainer() ); } @@ -651,7 +651,7 @@ void fileBrowserTreeWidget::openInNewInstrumentTrackBBE( void ) -void fileBrowserTreeWidget::openInNewInstrumentTrackSE( void ) +void FileBrowserTreeWidget::openInNewInstrumentTrackSE( void ) { openInNewInstrumentTrack( engine::getSong() ); } @@ -659,7 +659,7 @@ void fileBrowserTreeWidget::openInNewInstrumentTrackSE( void ) -void fileBrowserTreeWidget::sendToActiveInstrumentTrack( void ) +void FileBrowserTreeWidget::sendToActiveInstrumentTrack( void ) { // get all windows opened in the workspace QList pl = @@ -685,9 +685,9 @@ void fileBrowserTreeWidget::sendToActiveInstrumentTrack( void ) -void fileBrowserTreeWidget::updateDirectory( QTreeWidgetItem * _item ) +void FileBrowserTreeWidget::updateDirectory(QTreeWidgetItem * item ) { - directory * dir = dynamic_cast( _item ); + Directory * dir = dynamic_cast( item ); if( dir != NULL ) { dir->update(); @@ -699,16 +699,16 @@ void fileBrowserTreeWidget::updateDirectory( QTreeWidgetItem * _item ) -QPixmap * directory::s_folderPixmap = NULL; -QPixmap * directory::s_folderOpenedPixmap = NULL; -QPixmap * directory::s_folderLockedPixmap = NULL; +QPixmap * Directory::s_folderPixmap = NULL; +QPixmap * Directory::s_folderOpenedPixmap = NULL; +QPixmap * Directory::s_folderLockedPixmap = NULL; -directory::directory( const QString & _name, const QString & _path, - const QString & _filter ) : - QTreeWidgetItem( QStringList( _name ), TypeDirectoryItem ), - m_directories( _path ), - m_filter( _filter ) +Directory::Directory(const QString & filename, const QString & path, + const QString & filter ) : + QTreeWidgetItem( QStringList( filename ), TypeDirectoryItem ), + m_directories( path ), + m_filter( filter ) { initPixmaps(); @@ -727,7 +727,7 @@ directory::directory( const QString & _name, const QString & _path, -void directory::initPixmaps( void ) +void Directory::initPixmaps( void ) { if( s_folderPixmap == NULL ) { @@ -751,7 +751,7 @@ void directory::initPixmaps( void ) -void directory::update( void ) +void Directory::update( void ) { if( !isExpanded() ) { @@ -772,7 +772,7 @@ void directory::update( void ) { QTreeWidgetItem * sep = new QTreeWidgetItem; sep->setText( 0, - fileBrowserTreeWidget::tr( + FileBrowserTreeWidget::tr( "--- Factory files ---" ) ); sep->setIcon( 0, embed::getIconPixmap( "factory_files" ) ); @@ -785,9 +785,9 @@ void directory::update( void ) -bool directory::addItems( const QString & _path ) +bool Directory::addItems(const QString & path ) { - QDir thisDir( _path ); + QDir thisDir( path ); if( !thisDir.isReadable() ) { return false; @@ -807,25 +807,25 @@ bool directory::addItems( const QString & _path ) bool orphan = true; for( int i = 0; i < childCount(); ++i ) { - directory * d = dynamic_cast( + Directory * d = dynamic_cast( child( i ) ); if( d == NULL || cur_file < d->text( 0 ) ) { - insertChild( i, new directory( cur_file, - _path, m_filter ) ); + insertChild( i, new Directory( cur_file, + path, m_filter ) ); orphan = false; break; } else if( cur_file == d->text( 0 ) ) { - d->addDirectory( _path ); + d->addDirectory( path ); orphan = false; break; } } if( orphan ) { - addChild( new directory( cur_file, _path, + addChild( new Directory( cur_file, path, m_filter ) ); } @@ -842,7 +842,7 @@ bool directory::addItems( const QString & _path ) if( cur_file[0] != '.' && thisDir.match( m_filter, cur_file.toLower() ) ) { - items << new fileItem( cur_file, _path ); + items << new FileItem( cur_file, path ); added_something = true; } } @@ -856,20 +856,20 @@ bool directory::addItems( const QString & _path ) -QPixmap * fileItem::s_projectFilePixmap = NULL; -QPixmap * fileItem::s_presetFilePixmap = NULL; -QPixmap * fileItem::s_sampleFilePixmap = NULL; -QPixmap * fileItem::s_soundfontFilePixmap = NULL; -QPixmap * fileItem::s_vstPluginFilePixmap = NULL; -QPixmap * fileItem::s_midiFilePixmap = NULL; -QPixmap * fileItem::s_flpFilePixmap = NULL; -QPixmap * fileItem::s_unknownFilePixmap = NULL; +QPixmap * FileItem::s_projectFilePixmap = NULL; +QPixmap * FileItem::s_presetFilePixmap = NULL; +QPixmap * FileItem::s_sampleFilePixmap = NULL; +QPixmap * FileItem::s_soundfontFilePixmap = NULL; +QPixmap * FileItem::s_vstPluginFilePixmap = NULL; +QPixmap * FileItem::s_midiFilePixmap = NULL; +QPixmap * FileItem::s_flpFilePixmap = NULL; +QPixmap * FileItem::s_unknownFilePixmap = NULL; -fileItem::fileItem( QTreeWidget * _parent, const QString & _name, - const QString & _path ) : - QTreeWidgetItem( _parent, QStringList( _name) , TypeFileItem ), - m_path( _path ) +FileItem::FileItem(QTreeWidget * parent, const QString & name, + const QString & path ) : + QTreeWidgetItem( parent, QStringList( name) , TypeFileItem ), + m_path( path ) { determineFileType(); initPixmaps(); @@ -878,9 +878,9 @@ fileItem::fileItem( QTreeWidget * _parent, const QString & _name, -fileItem::fileItem( const QString & _name, const QString & _path ) : - QTreeWidgetItem( QStringList( _name ), TypeFileItem ), - m_path( _path ) +FileItem::FileItem(const QString & name, const QString & path ) : + QTreeWidgetItem( QStringList( name ), TypeFileItem ), + m_path( path ) { determineFileType(); initPixmaps(); @@ -889,7 +889,7 @@ fileItem::fileItem( const QString & _name, const QString & _path ) : -void fileItem::initPixmaps( void ) +void FileItem::initPixmaps( void ) { if( s_projectFilePixmap == NULL ) { @@ -973,7 +973,7 @@ void fileItem::initPixmaps( void ) -void fileItem::determineFileType( void ) +void FileItem::determineFileType( void ) { m_handling = NotSupported; @@ -1037,7 +1037,7 @@ void fileItem::determineFileType( void ) -QString fileItem::extension( void ) +QString FileItem::extension( void ) { return extension( fullName() ); } @@ -1045,9 +1045,9 @@ QString fileItem::extension( void ) -QString fileItem::extension( const QString & _file ) +QString FileItem::extension(const QString & file ) { - return QFileInfo( _file ).suffix().toLower(); + return QFileInfo( file ).suffix().toLower(); } diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp index 87fd73a5a..6b69d6017 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -1511,7 +1511,7 @@ void InstrumentTrackWindow::dropEvent( QDropEvent* event ) } else if( type == "pluginpresetfile" ) { - const QString ext = fileItem::extension( value ); + const QString ext = FileItem::extension( value ); Instrument * i = m_track->instrument(); if( !i->descriptor()->supportsFileType( ext ) ) From efacfdfae90865c2d8e7e861b059a4052b98975c Mon Sep 17 00:00:00 2001 From: Lukas W Date: Wed, 3 Sep 2014 11:29:25 +0200 Subject: [PATCH 03/19] Rename file_browser.* to FileBrowser.* --- include/{file_browser.h => FileBrowser.h} | 0 src/gui/{file_browser.cpp => FileBrowser.cpp} | 0 src/gui/MainWindow.cpp | 2 +- src/gui/TrackContainerView.cpp | 2 +- src/tracks/InstrumentTrack.cpp | 2 +- 5 files changed, 3 insertions(+), 3 deletions(-) rename include/{file_browser.h => FileBrowser.h} (100%) rename src/gui/{file_browser.cpp => FileBrowser.cpp} (100%) diff --git a/include/file_browser.h b/include/FileBrowser.h similarity index 100% rename from include/file_browser.h rename to include/FileBrowser.h diff --git a/src/gui/file_browser.cpp b/src/gui/FileBrowser.cpp similarity index 100% rename from src/gui/file_browser.cpp rename to src/gui/FileBrowser.cpp diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index b645a4cf0..7adb8c8de 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -48,7 +48,7 @@ #include "PianoView.h" #include "about_dialog.h" #include "ControllerRackView.h" -#include "file_browser.h" +#include "FileBrowser.h" #include "plugin_browser.h" #include "SideBar.h" #include "config_mgr.h" diff --git a/src/gui/TrackContainerView.cpp b/src/gui/TrackContainerView.cpp index ffddec24c..979a311e2 100644 --- a/src/gui/TrackContainerView.cpp +++ b/src/gui/TrackContainerView.cpp @@ -36,7 +36,7 @@ #include "bb_track.h" #include "MainWindow.h" #include "debug.h" -#include "file_browser.h" +#include "FileBrowser.h" #include "ImportFilter.h" #include "Instrument.h" #include "InstrumentTrack.h" diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp index 6b69d6017..c6e5f2c1c 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -49,7 +49,7 @@ #include "EffectRackView.h" #include "embed.h" #include "engine.h" -#include "file_browser.h" +#include "FileBrowser.h" #include "FxMixer.h" #include "FxMixerView.h" #include "InstrumentSoundShaping.h" From 876642c342d7ab4b5c17b5d0d2649757e04e954e Mon Sep 17 00:00:00 2001 From: Lukas W Date: Wed, 3 Sep 2014 11:43:40 +0200 Subject: [PATCH 04/19] FileBrowser rename fixes --- include/FileBrowser.h | 2 +- src/gui/FileBrowser.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/FileBrowser.h b/include/FileBrowser.h index 304c9da34..9803cca44 100644 --- a/include/FileBrowser.h +++ b/include/FileBrowser.h @@ -1,5 +1,5 @@ /* - * file_browser.h - include file for FileBrowser + * FileBrowser.h - include file for FileBrowser * * Copyright (c) 2004-2014 Tobias Doerffel * diff --git a/src/gui/FileBrowser.cpp b/src/gui/FileBrowser.cpp index f0cf5b740..1899fc399 100644 --- a/src/gui/FileBrowser.cpp +++ b/src/gui/FileBrowser.cpp @@ -1,5 +1,5 @@ /* - * file_browser.cpp - implementation of the project-, preset- and + * FileBrowser.cpp - implementation of the project-, preset- and * sample-file-browser * * Copyright (c) 2004-2014 Tobias Doerffel @@ -32,7 +32,7 @@ #include #include -#include "file_browser.h" +#include "FileBrowser.h" #include "bb_track_container.h" #include "config_mgr.h" #include "debug.h" @@ -1053,5 +1053,5 @@ QString FileItem::extension(const QString & file ) -#include "moc_file_browser.cxx" +#include "moc_FileBrowser.cxx" From dc681604e04fc85163847e08af11b4a65d13233a Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Sun, 7 Sep 2014 16:02:52 -0400 Subject: [PATCH 05/19] Make start/end/loop knobs all responsive --- .../audio_file_processor.cpp | 44 +++++++++++++++---- .../audio_file_processor.h | 4 ++ 2 files changed, 40 insertions(+), 8 deletions(-) diff --git a/plugins/audio_file_processor/audio_file_processor.cpp b/plugins/audio_file_processor/audio_file_processor.cpp index 726665811..e3331f128 100644 --- a/plugins/audio_file_processor/audio_file_processor.cpp +++ b/plugins/audio_file_processor/audio_file_processor.cpp @@ -88,9 +88,9 @@ audioFileProcessor::audioFileProcessor( InstrumentTrack * _instrument_track ) : connect( &m_ampModel, SIGNAL( dataChanged() ), this, SLOT( ampModelChanged() ) ); connect( &m_startPointModel, SIGNAL( dataChanged() ), - this, SLOT( loopPointChanged() ) ); + this, SLOT( startPointChanged() ) ); connect( &m_endPointModel, SIGNAL( dataChanged() ), - this, SLOT( loopPointChanged() ) ); + this, SLOT( endPointChanged() ) ); connect( &m_loopPointModel, SIGNAL( dataChanged() ), this, SLOT( loopPointChanged() ) ); connect( &m_stutterModel, SIGNAL( dataChanged() ), @@ -102,7 +102,7 @@ audioFileProcessor::audioFileProcessor( InstrumentTrack * _instrument_track ) : m_interpolationModel.addItem( tr( "Sinc" ) ); m_interpolationModel.setValue( 1 ); - loopPointChanged(); + pointChanged(); } @@ -266,7 +266,7 @@ void audioFileProcessor::loadSettings( const QDomElement & _this ) m_interpolationModel.setValue( 1 ); //linear by default } - loopPointChanged(); + pointChanged(); } @@ -352,9 +352,7 @@ void audioFileProcessor::stutterModelChanged() } - - -void audioFileProcessor::loopPointChanged( void ) +void audioFileProcessor::startPointChanged( void ) { // check if start is over end and swap values if so if( m_startPointModel.value() > m_endPointModel.value() ) @@ -370,6 +368,26 @@ void audioFileProcessor::loopPointChanged( void ) m_endPointModel.setValue( qMin( m_endPointModel.value() + 0.001f, 1.0f ) ); } + // nudge loop point with start + if( m_loopPointModel.value() < m_startPointModel.value() ) + { + m_loopPointModel.setValue( m_startPointModel.value() ); + } + + pointChanged(); + +} + +void audioFileProcessor::endPointChanged( void ) +{ + // same as start + startPointChanged(); + +} + +void audioFileProcessor::loopPointChanged( void ) +{ + // check that loop point is between start-end points and not overlapping with endpoint // ...and move start/end points ahead if loop point is moved over them if( m_loopPointModel.value() >= m_endPointModel.value() ) @@ -380,11 +398,18 @@ void audioFileProcessor::loopPointChanged( void ) m_loopPointModel.setValue( 1.0f - 0.001f ); } } + + // nudge start point with loop if( m_loopPointModel.value() < m_startPointModel.value() ) { m_startPointModel.setValue( m_loopPointModel.value() ); } + pointChanged(); +} + +void audioFileProcessor::pointChanged( void ) +{ const f_cnt_t f_start = static_cast( m_startPointModel.value() * ( m_sampleBuffer.frames()-1 ) ); const f_cnt_t f_end = static_cast( m_endPointModel.value() * ( m_sampleBuffer.frames()-1 ) ); const f_cnt_t f_loop = static_cast( m_loopPointModel.value() * ( m_sampleBuffer.frames()-1 ) ); @@ -399,6 +424,8 @@ void audioFileProcessor::loopPointChanged( void ) + + QPixmap * AudioFileProcessorView::s_artwork = NULL; @@ -999,13 +1026,14 @@ void AudioFileProcessorWaveView::updateGraph() { reverse(); } - else if( m_last_from == m_from && m_last_to == m_to ) + else if( m_last_from == m_from && m_last_to == m_to && m_sampleBuffer.amplification() == m_last_amp ) { return; } m_last_from = m_from; m_last_to = m_to; + m_last_amp = m_sampleBuffer.amplification(); m_graph.fill( Qt::transparent ); QPainter p( &m_graph ); diff --git a/plugins/audio_file_processor/audio_file_processor.h b/plugins/audio_file_processor/audio_file_processor.h index a29ac51a0..f5d397fbb 100644 --- a/plugins/audio_file_processor/audio_file_processor.h +++ b/plugins/audio_file_processor/audio_file_processor.h @@ -75,6 +75,9 @@ private slots: void reverseModelChanged(); void ampModelChanged(); void loopPointChanged(); + void startPointChanged(); + void endPointChanged(); + void pointChanged(); void stutterModelChanged(); @@ -239,6 +242,7 @@ private: f_cnt_t m_to; f_cnt_t m_last_from; f_cnt_t m_last_to; + float m_last_amp; knob * m_startKnob; knob * m_endKnob; knob * m_loopKnob; From b33eceda7e553e541c8f5a6a199b6903c80879ec Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Sun, 7 Sep 2014 16:20:17 -0400 Subject: [PATCH 06/19] Make loop end move with sample end --- plugins/audio_file_processor/audio_file_processor.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/audio_file_processor/audio_file_processor.cpp b/plugins/audio_file_processor/audio_file_processor.cpp index e3331f128..f7b131b9e 100644 --- a/plugins/audio_file_processor/audio_file_processor.cpp +++ b/plugins/audio_file_processor/audio_file_processor.cpp @@ -373,6 +373,12 @@ void audioFileProcessor::startPointChanged( void ) { m_loopPointModel.setValue( m_startPointModel.value() ); } + + // nudge loop point with end + if( m_loopPointModel.value() > m_endPointModel.value() ) + { + m_loopPointModel.setValue( m_endPointModel.value() ); + } pointChanged(); @@ -380,7 +386,7 @@ void audioFileProcessor::startPointChanged( void ) void audioFileProcessor::endPointChanged( void ) { - // same as start + // same as start, for now startPointChanged(); } From 2ca84c15a17faa71a300bfa4de2fdffadf9627aa Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Sun, 7 Sep 2014 16:30:53 -0400 Subject: [PATCH 07/19] Invert loop button pixmaps --- plugins/audio_file_processor/audio_file_processor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/audio_file_processor/audio_file_processor.cpp b/plugins/audio_file_processor/audio_file_processor.cpp index f7b131b9e..14e14daf6 100644 --- a/plugins/audio_file_processor/audio_file_processor.cpp +++ b/plugins/audio_file_processor/audio_file_processor.cpp @@ -482,9 +482,9 @@ AudioFileProcessorView::AudioFileProcessorView( Instrument * _instrument, m_loopOffButton->setCheckable( TRUE ); m_loopOffButton->move( 190, 105 ); m_loopOffButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( - "loop_off_on" ) ); - m_loopOffButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "loop_off_off" ) ); + m_loopOffButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( + "loop_off_on" ) ); toolTip::add( m_loopOffButton, tr( "Disable loop" ) ); m_loopOffButton->setWhatsThis( tr( "This button disables looping. " From a278505cdadf077948d919e35284af8865157918 Mon Sep 17 00:00:00 2001 From: tresf Date: Sun, 7 Sep 2014 17:41:53 -0400 Subject: [PATCH 08/19] Fix win32 compilation --- src/gui/MainWindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 7adb8c8de..d72974079 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -133,12 +133,12 @@ MainWindow::MainWindow() : sideBar->appendTab( new FileBrowser( root_paths.join( "*" ), "*", #ifdef LMMS_BUILD_WIN32 tr( "My computer" ), -#endif -#ifdef LMMS_BUILD_APPLE +#elif LMMS_BUILD_APPLE tr( "Volumes" ), #else tr( "Root directory" ), #endif + embed::getIconPixmap( "computer" ).transformed( QTransform().rotate( 90 ) ), splitter, #ifdef LMMS_BUILD_WIN32 From 97c903e76cd6cb627492dbe8def0ae5eb43c1596 Mon Sep 17 00:00:00 2001 From: Umcaruje Date: Mon, 8 Sep 2014 00:14:02 +0200 Subject: [PATCH 09/19] Added some presets for Monstro, Bitinvader, Watsyn and Kicker. --- data/presets/BitInvader/invaders_must_die.xpf | 38 +++++++++ data/presets/Kicker/TrapKick.xpf | 21 +++++ data/presets/Monstro/Growl.xpf | 84 +++++++++++++++++++ data/presets/Monstro/HorrorLead.xpf | 52 ++++++++++++ data/presets/Monstro/ScaryBell.xpf | 52 ++++++++++++ data/presets/Watsyn/Pulse.xpf | 34 ++++++++ 6 files changed, 281 insertions(+) create mode 100644 data/presets/BitInvader/invaders_must_die.xpf create mode 100644 data/presets/Kicker/TrapKick.xpf create mode 100644 data/presets/Monstro/Growl.xpf create mode 100644 data/presets/Monstro/HorrorLead.xpf create mode 100644 data/presets/Monstro/ScaryBell.xpf create mode 100644 data/presets/Watsyn/Pulse.xpf diff --git a/data/presets/BitInvader/invaders_must_die.xpf b/data/presets/BitInvader/invaders_must_die.xpf new file mode 100644 index 000000000..78c50c360 --- /dev/null +++ b/data/presets/BitInvader/invaders_must_die.xpf @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/presets/Kicker/TrapKick.xpf b/data/presets/Kicker/TrapKick.xpf new file mode 100644 index 000000000..a8ad8976d --- /dev/null +++ b/data/presets/Kicker/TrapKick.xpf @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/data/presets/Monstro/Growl.xpf b/data/presets/Monstro/Growl.xpf new file mode 100644 index 000000000..97a098637 --- /dev/null +++ b/data/presets/Monstro/Growl.xpf @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/presets/Monstro/HorrorLead.xpf b/data/presets/Monstro/HorrorLead.xpf new file mode 100644 index 000000000..867693d91 --- /dev/null +++ b/data/presets/Monstro/HorrorLead.xpf @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/presets/Monstro/ScaryBell.xpf b/data/presets/Monstro/ScaryBell.xpf new file mode 100644 index 000000000..00466696f --- /dev/null +++ b/data/presets/Monstro/ScaryBell.xpf @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/presets/Watsyn/Pulse.xpf b/data/presets/Watsyn/Pulse.xpf new file mode 100644 index 000000000..129a584d2 --- /dev/null +++ b/data/presets/Watsyn/Pulse.xpf @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From c01799e998ff9a289c13af9603fdd41dc36da70d Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Mon, 8 Sep 2014 09:26:50 -0400 Subject: [PATCH 10/19] Fix AFP crash, bump version --- CMakeLists.txt | 2 +- .../audio_file_processor/audio_file_processor.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e88ffb53..bb4bfe7c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,7 @@ INCLUDE(FindPkgConfig) SET(VERSION_MAJOR "1") SET(VERSION_MINOR "0") -SET(VERSION_PATCH "93") +SET(VERSION_PATCH "95") #SET(VERSION_SUFFIX "") SET(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") IF(VERSION_SUFFIX) diff --git a/plugins/audio_file_processor/audio_file_processor.cpp b/plugins/audio_file_processor/audio_file_processor.cpp index 14e14daf6..d23377c8d 100644 --- a/plugins/audio_file_processor/audio_file_processor.cpp +++ b/plugins/audio_file_processor/audio_file_processor.cpp @@ -362,10 +362,10 @@ void audioFileProcessor::startPointChanged( void ) m_startPointModel.setValue( tmp ); } - // check if start & end overlap and nudge end up if so - if( m_startPointModel.value() == m_endPointModel.value() ) + // nudge loop point with end + if( m_loopPointModel.value() >= m_endPointModel.value() ) { - m_endPointModel.setValue( qMin( m_endPointModel.value() + 0.001f, 1.0f ) ); + m_loopPointModel.setValue( qMax( m_endPointModel.value() - 0.001f, 0.0f ) ); } // nudge loop point with start @@ -374,10 +374,10 @@ void audioFileProcessor::startPointChanged( void ) m_loopPointModel.setValue( m_startPointModel.value() ); } - // nudge loop point with end - if( m_loopPointModel.value() > m_endPointModel.value() ) + // check if start & end overlap and nudge end up if so + if( m_startPointModel.value() == m_endPointModel.value() ) { - m_loopPointModel.setValue( m_endPointModel.value() ); + m_endPointModel.setValue( qMin( m_endPointModel.value() + 0.001f, 1.0f ) ); } pointChanged(); From d95fea2d3f4f3899603b733516156c390b5015af Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Mon, 8 Sep 2014 10:53:59 -0400 Subject: [PATCH 11/19] Re-enable OPL2 on Apple, Disable SF2 --- plugins/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index d275b4f65..76990491d 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -14,14 +14,14 @@ ADD_SUBDIRECTORY(lb302) ADD_SUBDIRECTORY(midi_import) ADD_SUBDIRECTORY(monstro) ADD_SUBDIRECTORY(nes) -IF(NOT LMMS_BUILD_APPLE) - ADD_SUBDIRECTORY(opl2) -ENDIF() +ADD_SUBDIRECTORY(opl2) ADD_SUBDIRECTORY(organic) ADD_SUBDIRECTORY(papu) ADD_SUBDIRECTORY(patman) ADD_SUBDIRECTORY(peak_controller_effect) -ADD_SUBDIRECTORY(sf2_player) +IF(NOT LMMS_BUILD_APPLE) + ADD_SUBDIRECTORY(sf2_player) +ENDIF() ADD_SUBDIRECTORY(sfxr) ADD_SUBDIRECTORY(sid) ADD_SUBDIRECTORY(SpectrumAnalyzer) From 40f640951ce907803321dfbd23f97443f3e8e627 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Mon, 8 Sep 2014 11:13:50 -0400 Subject: [PATCH 12/19] Disable "Show GUI" button on Apple to prevent crash --- plugins/zynaddsubfx/ZynAddSubFx.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/zynaddsubfx/ZynAddSubFx.cpp b/plugins/zynaddsubfx/ZynAddSubFx.cpp index 40c2737c7..05e9946b8 100644 --- a/plugins/zynaddsubfx/ZynAddSubFx.cpp +++ b/plugins/zynaddsubfx/ZynAddSubFx.cpp @@ -533,6 +533,9 @@ ZynAddSubFxView::ZynAddSubFxView( Instrument * _instrument, QWidget * _parent ) m_toggleUIButton = new QPushButton( tr( "Show GUI" ), this ); m_toggleUIButton->setCheckable( true ); +#ifdef LMMS_BUILD_APPLE + m_toggleUIButton->setEnabled( false ); +#endif m_toggleUIButton->setChecked( false ); m_toggleUIButton->setIcon( embed::getIconPixmap( "zoom" ) ); m_toggleUIButton->setFont( pointSize<8>( m_toggleUIButton->font() ) ); From e17e84266dd93bd6ecde6c51bc9063364d894ada Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Mon, 8 Sep 2014 11:24:39 -0400 Subject: [PATCH 13/19] Fix bad #ifdef, make ANSI compliant `#elif LMMS_BUILD_APPLE` is not correct, it should be `#elif defined(LMMS_BUILD_APPLE)` --- src/gui/MainWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index d72974079..9529c45e4 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -133,7 +133,7 @@ MainWindow::MainWindow() : sideBar->appendTab( new FileBrowser( root_paths.join( "*" ), "*", #ifdef LMMS_BUILD_WIN32 tr( "My computer" ), -#elif LMMS_BUILD_APPLE +#elif defined(LMMS_BUILD_APPLE) tr( "Volumes" ), #else tr( "Root directory" ), From 74e53f835419f5b3b2dfba6a696d0d63898a08b1 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Mon, 8 Sep 2014 12:35:57 -0400 Subject: [PATCH 14/19] Set "WANT_SF2" to "OFF" for Apple --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bb4bfe7c3..9726c7cda 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,7 +45,8 @@ OPTION(WANT_WINMM "Include WinMM MIDI support" OFF) IF(LMMS_BUILD_APPLE) - SET(WANT_ALSA OFF) + SET(WANT_SF2 OFF) + SET(WANT_ALSA OFF) SET(WANT_PULSEAUDIO OFF) SET(WANT_VST OFF) SET(STATUS_ALSA "") From 84895a4f793f099a116ad5a5a2217c3e9c019ec1 Mon Sep 17 00:00:00 2001 From: Matthew Krafczyk Date: Tue, 9 Sep 2014 01:11:21 +0200 Subject: [PATCH 15/19] Fix for 'Crash double-clicking any knob in debug build (git master) (#948)' Conflicts: src/gui/widgets/knob.cpp --- include/JournallingObject.h | 3 +++ src/gui/widgets/knob.cpp | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/JournallingObject.h b/include/JournallingObject.h index 3f6e47a82..b9ada746e 100644 --- a/include/JournallingObject.h +++ b/include/JournallingObject.h @@ -77,6 +77,9 @@ public: return oldJournalling; } + inline bool isEmpty() { + return m_journallingStateStack.isEmpty(); + } protected: void changeID( jo_id_t _id ); diff --git a/src/gui/widgets/knob.cpp b/src/gui/widgets/knob.cpp index 7bb226795..dabd9cc49 100644 --- a/src/gui/widgets/knob.cpp +++ b/src/gui/widgets/knob.cpp @@ -592,7 +592,9 @@ void knob::mouseReleaseEvent( QMouseEvent* event ) AutomatableModel *thisModel = model(); if( thisModel ) { - thisModel->restoreJournallingState(); + if(!thisModel->isEmpty()) { + thisModel->restoreJournallingState(); + } } } From c628387cd22d2412178c2238af9ee8686ff87fbf Mon Sep 17 00:00:00 2001 From: Matthew Krafczyk Date: Tue, 9 Sep 2014 01:39:08 +0200 Subject: [PATCH 16/19] Make syntax for fix more consistent with existing code. --- include/JournallingObject.h | 3 ++- src/gui/widgets/knob.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/JournallingObject.h b/include/JournallingObject.h index b9ada746e..c3a93a1cd 100644 --- a/include/JournallingObject.h +++ b/include/JournallingObject.h @@ -77,7 +77,8 @@ public: return oldJournalling; } - inline bool isEmpty() { + inline bool isEmpty() const + { return m_journallingStateStack.isEmpty(); } diff --git a/src/gui/widgets/knob.cpp b/src/gui/widgets/knob.cpp index dabd9cc49..141ae143f 100644 --- a/src/gui/widgets/knob.cpp +++ b/src/gui/widgets/knob.cpp @@ -592,7 +592,8 @@ void knob::mouseReleaseEvent( QMouseEvent* event ) AutomatableModel *thisModel = model(); if( thisModel ) { - if(!thisModel->isEmpty()) { + if( !thisModel->isEmpty() ) + { thisModel->restoreJournallingState(); } } From 32eae51128597addfd6a42d02d246cd407824f95 Mon Sep 17 00:00:00 2001 From: Matthew Krafczyk Date: Tue, 9 Sep 2014 17:07:40 +0200 Subject: [PATCH 17/19] Made isEmpty function name more specific. Moved doubleclick fix to restoreJournallingState. --- include/JournallingObject.h | 6 ++++-- src/gui/widgets/knob.cpp | 5 +---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/JournallingObject.h b/include/JournallingObject.h index c3a93a1cd..441d27220 100644 --- a/include/JournallingObject.h +++ b/include/JournallingObject.h @@ -50,7 +50,9 @@ public: void restoreJournallingState() { - m_journalling = m_journallingStateStack.pop(); + if( !isJournallingStackEmpty()) { + m_journalling = m_journallingStateStack.pop(); + } } void addJournalCheckPoint(); @@ -77,7 +79,7 @@ public: return oldJournalling; } - inline bool isEmpty() const + inline bool isJournallingStackEmpty() const { return m_journallingStateStack.isEmpty(); } diff --git a/src/gui/widgets/knob.cpp b/src/gui/widgets/knob.cpp index 141ae143f..7bb226795 100644 --- a/src/gui/widgets/knob.cpp +++ b/src/gui/widgets/knob.cpp @@ -592,10 +592,7 @@ void knob::mouseReleaseEvent( QMouseEvent* event ) AutomatableModel *thisModel = model(); if( thisModel ) { - if( !thisModel->isEmpty() ) - { - thisModel->restoreJournallingState(); - } + thisModel->restoreJournallingState(); } } From 0cdfd7c354cfd1fa2276fdd73ef70ebe5e27c971 Mon Sep 17 00:00:00 2001 From: Matthew Krafczyk Date: Tue, 9 Sep 2014 17:15:54 +0200 Subject: [PATCH 18/19] Fix syntax a bit. --- include/JournallingObject.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/JournallingObject.h b/include/JournallingObject.h index 441d27220..5b266daad 100644 --- a/include/JournallingObject.h +++ b/include/JournallingObject.h @@ -50,7 +50,8 @@ public: void restoreJournallingState() { - if( !isJournallingStackEmpty()) { + if( !isJournallingStackEmpty()) + { m_journalling = m_journallingStateStack.pop(); } } From e20e863a99d9b2076041d93592986bfd268337c1 Mon Sep 17 00:00:00 2001 From: Matthew Krafczyk Date: Tue, 9 Sep 2014 20:08:14 +0200 Subject: [PATCH 19/19] Change isJournallingStackEmpty to isJournallingStateStackEmpty --- include/JournallingObject.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/JournallingObject.h b/include/JournallingObject.h index 5b266daad..8a2627716 100644 --- a/include/JournallingObject.h +++ b/include/JournallingObject.h @@ -50,7 +50,7 @@ public: void restoreJournallingState() { - if( !isJournallingStackEmpty()) + if( !isJournallingStateStackEmpty()) { m_journalling = m_journallingStateStack.pop(); } @@ -80,7 +80,7 @@ public: return oldJournalling; } - inline bool isJournallingStackEmpty() const + bool isJournallingStateStackEmpty() const { return m_journallingStateStack.isEmpty(); }