Merge branch 'master' of ssh://skiessi@lmms.git.sourceforge.net/gitroot/lmms
This commit is contained in:
@@ -26,12 +26,18 @@
|
||||
#ifndef _LV2_MANAGER_H
|
||||
#define _LV2_MANAGER_H
|
||||
|
||||
#include "lmmsconfig.h"
|
||||
|
||||
#ifdef LMMS_HAVE_LV2
|
||||
|
||||
#include <slv2/world.h>
|
||||
#include <slv2/plugin.h>
|
||||
#include <slv2/scalepoint.h>
|
||||
|
||||
#ifdef LMMS_HAVE_SLV2_SCALEPOINTS_H
|
||||
#include <slv2/scalepoints.h>
|
||||
#endif
|
||||
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QPair>
|
||||
#include <QtCore/QString>
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
#include <QtCore/QDateTime>
|
||||
#include <QtCore/QHash>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtXml/QDomDocument>
|
||||
|
||||
@@ -81,6 +82,48 @@ private:
|
||||
QDomElement & _de );
|
||||
void loadTreeItem( ResourcesTreeItem * _i, QDomElement & _de );
|
||||
|
||||
static inline QString typeName( ResourcesItem::Type _t )
|
||||
{
|
||||
return s_typeNames[_t];
|
||||
}
|
||||
|
||||
static inline QString baseDirName( ResourcesItem::BaseDirectory _bd )
|
||||
{
|
||||
return s_baseDirNames[_bd];
|
||||
}
|
||||
|
||||
static inline ResourcesItem::Type typeFromName( const QString & _n )
|
||||
{
|
||||
for( TypeStringMap::ConstIterator it = s_typeNames.begin();
|
||||
it != s_typeNames.end(); ++it )
|
||||
{
|
||||
if( it.value() == _n )
|
||||
{
|
||||
return it.key();
|
||||
}
|
||||
}
|
||||
return ResourcesItem::TypeUnknown;
|
||||
}
|
||||
|
||||
static inline ResourcesItem::BaseDirectory baseDirFromName(
|
||||
const QString & _n )
|
||||
{
|
||||
for( BaseDirStringMap::ConstIterator it =
|
||||
s_baseDirNames.begin();
|
||||
it != s_baseDirNames.end(); ++it )
|
||||
{
|
||||
if( it.value() == _n )
|
||||
{
|
||||
return it.key();
|
||||
}
|
||||
}
|
||||
return ResourcesItem::BaseRoot;
|
||||
}
|
||||
|
||||
typedef QMap<ResourcesItem::Type, QString> TypeStringMap;
|
||||
typedef QMap<ResourcesItem::BaseDirectory, QString> BaseDirStringMap;
|
||||
static TypeStringMap s_typeNames;
|
||||
static BaseDirStringMap s_baseDirNames;
|
||||
|
||||
ResourcesProvider * m_provider;
|
||||
ItemList m_items;
|
||||
|
||||
@@ -17,7 +17,7 @@ BEGIN
|
||||
VALUE "CompanyName", "LMMS Developers\0"
|
||||
VALUE "FileDescription", "Linux MultiMedia Studio\0"
|
||||
VALUE "FileVersion", "@VERSION@\0"
|
||||
VALUE "LegalCopyright", "Copyright (c) 2004-2008 LMMS Developers\0"
|
||||
VALUE "LegalCopyright", "Copyright (c) 2004-2009 LMMS Developers\0"
|
||||
VALUE "OriginalFilename", "lmms.exe\0"
|
||||
VALUE "ProductName", "LMMS\0"
|
||||
VALUE "ProductVersion", "@VERSION@\0"
|
||||
|
||||
@@ -41,17 +41,18 @@ controllerConnectionVector controllerConnection::s_connections;
|
||||
|
||||
|
||||
controllerConnection::controllerConnection( controller * _controller ) :
|
||||
m_controllerId( -1 ),
|
||||
m_controllerId( -1 ),
|
||||
m_ownsController( FALSE )
|
||||
{
|
||||
if( _controller != NULL )
|
||||
{
|
||||
setController( _controller );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_controller = controller::create( controller::DummyController, NULL );
|
||||
}
|
||||
if( _controller != NULL )
|
||||
{
|
||||
setController( _controller );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_controller = controller::create( controller::DummyController,
|
||||
NULL );
|
||||
}
|
||||
s_connections.append( this );
|
||||
}
|
||||
|
||||
@@ -60,7 +61,7 @@ controllerConnection::controllerConnection( controller * _controller ) :
|
||||
|
||||
controllerConnection::controllerConnection( int _controllerId ) :
|
||||
m_controller( controller::create( controller::DummyController, NULL ) ),
|
||||
m_controllerId( _controllerId ),
|
||||
m_controllerId( _controllerId ),
|
||||
m_ownsController( FALSE )
|
||||
{
|
||||
s_connections.append( this );
|
||||
@@ -145,13 +146,15 @@ inline void controllerConnection::setTargetName( const QString & _name )
|
||||
void controllerConnection::finalizeConnections( void )
|
||||
{
|
||||
for( int i = 0; i < s_connections.size(); ++i )
|
||||
{
|
||||
controllerConnection * c = s_connections[i];
|
||||
if ( !c->isFinalized() )
|
||||
{
|
||||
c->setController( engine::getSong()->controllers().at( c->m_controllerId ) );
|
||||
}
|
||||
}
|
||||
{
|
||||
controllerConnection * c = s_connections[i];
|
||||
if ( !c->isFinalized() && c->m_controllerId <
|
||||
engine::getSong()->controllers().size() )
|
||||
{
|
||||
c->setController( engine::getSong()->
|
||||
controllers().at( c->m_controllerId ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -159,7 +162,8 @@ void controllerConnection::finalizeConnections( void )
|
||||
|
||||
void controllerConnection::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
{
|
||||
if( engine::getSong() ) {
|
||||
if( engine::getSong() )
|
||||
{
|
||||
if( m_ownsController )
|
||||
{
|
||||
m_controller->saveState( _doc, _this );
|
||||
@@ -167,12 +171,12 @@ void controllerConnection::saveSettings( QDomDocument & _doc, QDomElement & _thi
|
||||
else
|
||||
{
|
||||
int id = engine::getSong()->controllers().indexOf( m_controller );
|
||||
if(id >= 0 )
|
||||
if( id >= 0 )
|
||||
{
|
||||
_this.setAttribute( "id", id );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -160,8 +160,6 @@ void engine::destroy( void )
|
||||
s_pianoRoll = NULL;
|
||||
delete s_automationEditor;
|
||||
s_automationEditor = NULL;
|
||||
delete s_automationRecorder;
|
||||
s_automationRecorder = NULL;
|
||||
|
||||
delete s_fxMixerView;
|
||||
s_fxMixerView = NULL;
|
||||
@@ -190,6 +188,9 @@ void engine::destroy( void )
|
||||
delete s_song;
|
||||
s_song = NULL;
|
||||
|
||||
delete s_automationRecorder;
|
||||
s_automationRecorder = NULL;
|
||||
|
||||
delete s_resourcesProvider;
|
||||
s_resourcesProvider = NULL;
|
||||
|
||||
|
||||
@@ -36,10 +36,6 @@
|
||||
|
||||
#ifdef LMMS_HAVE_LV2
|
||||
|
||||
#ifdef LMMS_HAVE_SLV2_SCALEPOINTS_H
|
||||
#include "slv2/scalepoints.h"
|
||||
#endif
|
||||
|
||||
|
||||
lv2Manager * static_lv2_manager=(lv2Manager *)NULL; // There is only one of these...
|
||||
|
||||
|
||||
@@ -30,6 +30,10 @@
|
||||
#include "mmp.h"
|
||||
|
||||
|
||||
QMap<ResourcesItem::Type, QString> ResourcesDB::s_typeNames;
|
||||
QMap<ResourcesItem::BaseDirectory, QString> ResourcesDB::s_baseDirNames;
|
||||
|
||||
|
||||
|
||||
ResourcesDB::ResourcesDB( ResourcesProvider * _provider ) :
|
||||
m_provider( _provider )
|
||||
@@ -37,6 +41,30 @@ ResourcesDB::ResourcesDB( ResourcesProvider * _provider ) :
|
||||
connect( m_provider, SIGNAL( itemsChanged() ),
|
||||
this, SIGNAL( itemsChanged() ) );
|
||||
|
||||
if( s_typeNames.isEmpty() )
|
||||
{
|
||||
s_typeNames[ResourcesItem::TypeUnknown] = "Unknown";
|
||||
s_typeNames[ResourcesItem::TypeDirectory] = "Directory";
|
||||
s_typeNames[ResourcesItem::TypeSample] = "Sample";
|
||||
s_typeNames[ResourcesItem::TypeSoundFont] = "SoundFont";
|
||||
s_typeNames[ResourcesItem::TypePreset] = "Preset";
|
||||
s_typeNames[ResourcesItem::TypeProject] = "Project";
|
||||
s_typeNames[ResourcesItem::TypeMidiFile] = "MidiFile";
|
||||
s_typeNames[ResourcesItem::TypeForeignProject] = "ForeignProject";
|
||||
s_typeNames[ResourcesItem::TypePlugin] = "Plugin";
|
||||
s_typeNames[ResourcesItem::TypeImage] = "Image";
|
||||
}
|
||||
|
||||
if( s_baseDirNames.isEmpty() )
|
||||
{
|
||||
s_baseDirNames[ResourcesItem::BaseRoot] = "Root";
|
||||
s_baseDirNames[ResourcesItem::BaseWorkingDir] = "WorkingDir";
|
||||
s_baseDirNames[ResourcesItem::BaseDataDir] = "DataDir";
|
||||
s_baseDirNames[ResourcesItem::BaseHome] = "Home";
|
||||
s_baseDirNames[ResourcesItem::BaseURL] = "URL";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -107,8 +135,8 @@ void ResourcesDB::saveTreeItem( const ResourcesTreeItem * _i,
|
||||
{
|
||||
const ResourcesItem * it = _i->item();
|
||||
e.setAttribute( "name", it->name() );
|
||||
e.setAttribute( "type", it->type() );
|
||||
e.setAttribute( "basedir", it->baseDir() );
|
||||
e.setAttribute( "type", typeName( it->type() ) );
|
||||
e.setAttribute( "basedir", baseDirName( it->baseDir() ) );
|
||||
e.setAttribute( "path", it->path() );
|
||||
e.setAttribute( "hash", it->hash() );
|
||||
e.setAttribute( "size", it->size() );
|
||||
@@ -135,9 +163,8 @@ void ResourcesDB::loadTreeItem( ResourcesTreeItem * _i, QDomElement & _de )
|
||||
{
|
||||
ResourcesItem * item = new ResourcesItem( m_provider,
|
||||
e.attribute( "name" ),
|
||||
static_cast<ResourcesItem::Type>( e.attribute( "type" ).toInt() ),
|
||||
static_cast<ResourcesItem::BaseDirectory>(
|
||||
e.attribute( "basedir" ).toInt() ),
|
||||
typeFromName( e.attribute( "type" ) ),
|
||||
baseDirFromName( e.attribute( "basedir" ) ),
|
||||
e.attribute( "path" ),
|
||||
h,
|
||||
e.attribute( "tags" ),
|
||||
|
||||
@@ -1175,16 +1175,16 @@ void trackContentWidget::updateBackground( void )
|
||||
|
||||
// Assume even-pixels-per-tact. Makes sense, should be like this anyways
|
||||
int ppt = static_cast<int>( tcv->pixelsPerTact() );
|
||||
int width = ppt * tactsPerBar;
|
||||
int width = ppt * tactsPerBar;
|
||||
|
||||
m_background = QPixmap( width * 2, height() );
|
||||
QPainter pmp;
|
||||
pmp.begin( &m_background );
|
||||
m_background = QPixmap( width * 2, height() );
|
||||
QPainter pmp;
|
||||
pmp.begin( &m_background );
|
||||
|
||||
engine::getLmmsStyle()->drawTrackContentBackground( &pmp,
|
||||
QSize( width, height() ), ppt );
|
||||
engine::getLmmsStyle()->drawTrackContentBackground( &pmp,
|
||||
QSize( width, height() ), ppt );
|
||||
|
||||
pmp.end();
|
||||
pmp.end();
|
||||
}
|
||||
|
||||
|
||||
@@ -1425,7 +1425,7 @@ void trackOperationsWidget::mousePressEvent( QMouseEvent * _me )
|
||||
void trackOperationsWidget::paintEvent( QPaintEvent * _pe )
|
||||
{
|
||||
QPainter p( this );
|
||||
p.fillRect( rect(), palette().brush(QPalette::Background) );
|
||||
p.fillRect( rect(), palette().brush( QPalette::Background ) );
|
||||
|
||||
if( m_trackView->isMovingTrack() == false )
|
||||
{
|
||||
@@ -2085,7 +2085,6 @@ trackView::trackView( track * _track, trackContainerView * _tcv ) :
|
||||
|
||||
setAcceptDrops( true );
|
||||
setAttribute( Qt::WA_DeleteOnClose, true );
|
||||
setAttribute( Qt::WA_OpaquePaintEvent, true );
|
||||
|
||||
|
||||
connect( m_track, SIGNAL( destroyedTrack() ), this, SLOT( close() ) );
|
||||
|
||||
@@ -223,7 +223,7 @@ void trackContainerView::realignTracks( void )
|
||||
{
|
||||
( *it )->show();
|
||||
( *it )->update();
|
||||
( *it )->getTrackContentWidget()->updateBackground();
|
||||
( *it )->getTrackContentWidget()->updateBackground();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user