* rewrote the way plugins can handle certain filetypes

* rewrote various parts of file-browser to be less redundant and more stable (closes #2071891)



git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1582 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-09-07 22:38:23 +00:00
parent 9667fecd8b
commit fa1a9f4967
23 changed files with 354 additions and 400 deletions

View File

@@ -143,9 +143,9 @@ public:
}
static void updateFramesPerTick( void );
static const QMap<QString, QString> & sampleExtensions( void )
static const QMap<QString, QString> & pluginFileHandling( void )
{
return( s_sampleExtensions );
return( s_pluginFileHandling );
}
@@ -172,9 +172,9 @@ private:
static projectNotes * s_projectNotes;
static ladspa2LMMS * s_ladspaManager;
static QMap<QString, QString> s_sampleExtensions;
static QMap<QString, QString> s_pluginFileHandling;
static void loadExtensions( void );
static void initPluginFileHandling( void );
} ;

View File

@@ -1,7 +1,7 @@
/*
* file_browser.h - include file for fileBrowser
*
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -38,6 +38,7 @@ class QColorGroup;
class QPixmap;
class fileItem;
class instrumentTrack;
class listView;
class playHandle;
class trackContainer;
@@ -90,6 +91,10 @@ protected:
private:
void handleFile( fileItem * _fi, instrumentTrack * _it );
void openInNewInstrumentTrack( trackContainer * _tc );
bool m_mousePressed;
QPoint m_pressPos;
@@ -98,8 +103,6 @@ private:
fileItem * m_contextMenuItem;
void openInNewInstrumentTrack( trackContainer * _tc );
private slots:
void activateListItem( QTreeWidgetItem * _item, int _column );
@@ -159,6 +162,28 @@ private:
class fileItem : public QTreeWidgetItem
{
public:
enum FileTypes
{
ProjectFile,
PresetFile,
SampleFile,
SoundFontFile,
PatchFile,
MidiFile,
FlpFile,
UnknownFile,
NumFileTypes
} ;
enum FileHandling
{
NotSupported,
LoadAsProject,
LoadAsPreset,
LoadByPlugin
} ;
fileItem( QTreeWidget * _parent, const QString & _name,
const QString & _path );
fileItem( QTreeWidgetItem * _parent, const QString & _name,
@@ -170,23 +195,16 @@ public:
text( 0 ) );
}
enum FileTypes
{
ProjectFile,
PresetFile,
SpecialPresetFile,
SampleFile,
MidiFile,
FlpFile,
UnknownFile,
NumFileTypes
} ;
inline FileTypes type( void )
inline FileTypes type( void ) const
{
return( m_type );
}
inline FileHandling handling( void ) const
{
return( m_handling );
}
QString extension( void );
static QString extension( const QString & _file );
@@ -201,11 +219,12 @@ private:
static QPixmap * s_midiFilePixmap;
static QPixmap * s_flpFilePixmap;
static QPixmap * s_unknownFilePixmap;
QString m_path;
FileTypes m_type;
FileHandling m_handling;
} ;
#endif

View File

@@ -167,10 +167,9 @@ public:
return( m_descriptor );
}
// plugins can overload this for making other classes able to change
// settings of the plugin without knowing the actual class
virtual void setParameter( const QString & _param,
const QString & _value );
// can be called if a file matching supportedFileTypes should be
// loaded/processed with the help of this plugin
virtual void loadFile( const QString & _file );
// plugins can overload this for making other classes able to query
// settings of the plugin without knowing the actual class

View File

@@ -1,6 +1,6 @@
/*
* preset_preview_play_handle.h - play-handle for playing a short preview-sound
* of a preset
* of a preset or a file processed by a plugin
*
* Copyright (c) 2005-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
@@ -38,7 +38,7 @@ class presetPreviewPlayHandle : public playHandle
{
public:
presetPreviewPlayHandle( const QString & _preset_file,
bool _special_preset = false );
bool _load_by_plugin = false );
virtual ~presetPreviewPlayHandle();
virtual void play( bool _try_parallelizing,

View File

@@ -850,7 +850,7 @@ remotePluginBase::message remotePluginBase::waitForMessage(
if( _busy_waiting && !messagesLeft() )
{
QCoreApplication::processEvents(
QEventLoop::AllEvents, 50 );
QEventLoop::ExcludeUserInputEvents, 50 );
continue;
}
#endif

View File

@@ -26,8 +26,6 @@
#ifndef _SAMPLE_PLAY_HANDLE_H
#define _SAMPLE_PLAY_HANDLE_H
#include <qobject.h>
#include "mixer.h"
#include "sample_buffer.h"
#include "automatable_model.h"