moved all LADSPA-base-code into LMMS-core and improved Qt4-port of project-notes-window

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@563 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2007-09-03 21:22:24 +00:00
parent aa22ea383e
commit b61de8a930
9 changed files with 97 additions and 117 deletions

View File

@@ -70,6 +70,8 @@ lmms_MOC = \
./group_box.moc \
./kmultitabbar.moc \
./knob.moc \
./ladspa_control.moc \
./ladspa_port_dialog.moc \
./lcd_spinbox.moc \
./led_checkbox.moc \
./main_window.moc \
@@ -165,6 +167,11 @@ lmms_SOURCES = \
$(srcdir)/src/core/file_browser.cpp \
$(srcdir)/src/core/import_filter.cpp \
$(srcdir)/src/core/instrument.cpp \
$(srcdir)/src/core/ladspa_base.cpp \
$(srcdir)/src/core/ladspa_port_dialog.cpp \
$(srcdir)/src/core/ladspa_2_lmms.cpp \
$(srcdir)/src/core/ladspa_manager.cpp \
$(srcdir)/src/core/ladspa_control.cpp \
$(srcdir)/src/core/main_window.cpp \
$(srcdir)/src/core/main.cpp \
$(srcdir)/src/core/meter_dialog.cpp \
@@ -370,16 +377,11 @@ lmms_SOURCES = \
$(srcdir)/include/sweep_oscillator.h \
$(srcdir)/include/meter_dialog.h \
$(srcdir)/include/effect_lib.h \
$(srcdir)/plugins/ladspa_base/ladspa_base.cpp \
$(srcdir)/plugins/ladspa_base/ladspa_port_dialog.cpp \
$(srcdir)/plugins/ladspa_base/ladspa_2_lmms.cpp \
$(srcdir)/plugins/ladspa_base/ladspa_manager.cpp \
$(srcdir)/plugins/ladspa_base/ladspa_control.cpp \
$(srcdir)/plugins/ladspa_base/ladspa_manager.h \
$(srcdir)/plugins/ladspa_base/ladspa_2_lmms.h \
$(srcdir)/plugins/ladspa_base/ladspa_control.h \
$(srcdir)/plugins/ladspa_base/ladspa_port_dialog.h \
$(srcdir)/plugins/ladspa_base/ladspa_base.h \
$(srcdir)/include/ladspa_manager.h \
$(srcdir)/include/ladspa_2_lmms.h \
$(srcdir)/include/ladspa_control.h \
$(srcdir)/include/ladspa_port_dialog.h \
$(srcdir)/include/ladspa_base.h \
$(THIRD_PARTY_CODE)

View File

@@ -2,8 +2,8 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.50)
AC_INIT(lmms, 0.4.0-svn20070823, lmms-devel/at/lists/dot/sf/dot/net)
AM_INIT_AUTOMAKE(lmms, 0.4.0-svn20070823)
AC_INIT(lmms, 0.4.0-svn20070903, lmms-devel/at/lists/dot/sf/dot/net)
AM_INIT_AUTOMAKE(lmms, 0.4.0-svn20070903)
AM_CONFIG_HEADER(config.h)
@@ -611,7 +611,6 @@ AC_CONFIG_FILES([Makefile
plugins/bit_invader/Makefile
plugins/flp_import/Makefile
plugins/kicker/Makefile
plugins/ladspa_base/Makefile
plugins/ladspa_effect/Makefile
plugins/ladspa_effect/caps/Makefile
plugins/lb302/Makefile

View File

@@ -33,6 +33,7 @@
class QAction;
class QComboBox;
class QTextCharFormat;
class QTextEdit;
@@ -68,8 +69,7 @@ private slots:
void textColor( void );
void textAlign( QAction * _a );
void fontChanged( const QFont & _f );
void colorChanged( const QColor & _c );
void formatChanged( const QTextCharFormat & _f );
void alignmentChanged( int _a );

View File

@@ -36,7 +36,6 @@
#include "instrument_track.h"
#include "note_play_handle.h"
#include "interpolation.h"
#include "file_browser.h"
#include "gui_templates.h"
#include "pixmap_button.h"
#include "knob.h"

View File

@@ -1,36 +0,0 @@
AUTOMAKE_OPTIONS = foreign 1.4
INCLUDES = -I$(top_srcdir)/include -I.
AM_CXXFLAGS := $(AM_CXXFLAGS) $(QT_CXXFLAGS) -DPLUGIN_NAME="ladspabase"
%.moc: ./%.h
$(MOC) -o $@ $<
MOC_FILES = ./ladspa_control.moc \
./ladspa_port_dialog.moc
BUILT_SOURCES = $(MOC_FILES)
CLEANFILES = $(MOC_FILES)
pkglib_LTLIBRARIES = libladspabase.la
libladspabase_la_SOURCES = ladspa_base.cpp \
ladspa_port_dialog.cpp \
ladspa_2_lmms.cpp \
ladspa_manager.cpp \
ladspa_control.cpp \
ladspa_manager.h \
ladspa_2_lmms.h \
ladspa_control.h \
ladspa_port_dialog.h \
ladspa_base.h

View File

@@ -5,7 +5,7 @@ SUBDIRS = caps
endif
INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/src/lib -I. -I../ladspa_base/
INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/src/lib -I.
AM_CXXFLAGS := $(AM_CXXFLAGS) $(QT_CXXFLAGS) -DPLUGIN_NAME="ladspaeffect"

View File

@@ -30,7 +30,6 @@
#include "patman.h"
#include "endian_handling.h"
#include "engine.h"
#include "file_browser.h"
#include "gui_templates.h"
#include "note_play_handle.h"
#include "pixmap_button.h"

View File

@@ -39,7 +39,7 @@
#include "song_editor.h"
#ifdef LADSPA_SUPPORT
#include "plugins/ladspa_base/ladspa_2_lmms.h"
#include "ladspa_2_lmms.h"
#endif

View File

@@ -47,7 +47,10 @@
projectNotes::projectNotes( void ) :
QMainWindow( engine::getMainWindow()->workspace() )
{
engine::getMainWindow()->workspace()->addWindow( this );
if( engine::getMainWindow()->workspace() )
{
engine::getMainWindow()->workspace()->addWindow( this );
}
m_edit = new QTextEdit( this );
m_edit->setAutoFillBackground( TRUE );
@@ -57,12 +60,11 @@ projectNotes::projectNotes( void ) :
clear();
connect( m_edit, SIGNAL( currentFontChanged( const QFont & ) ),
this, SLOT( fontChanged( const QFont & ) ) );
connect( m_edit, SIGNAL( currentColorChanged( const QColor & ) ),
this, SLOT( colorChanged( const QColor & ) ) );
connect( m_edit, SIGNAL( currentAlignmentChanged( int ) ),
this, SLOT( alignmentChanged( int ) ) );
connect( m_edit,
SIGNAL( currentCharFormatChanged( const QTextCharFormat & ) ),
this, SLOT( formatChanged( const QTextCharFormat & ) ) );
// connect( m_edit, SIGNAL( currentAlignmentChanged( int ) ),
// this, SLOT( alignmentChanged( int ) ) );
connect( m_edit, SIGNAL( textChanged() ),
engine::getSongEditor(), SLOT( setModified() ) );
@@ -103,7 +105,9 @@ void projectNotes::clear( void )
m_edit->setHtml( tr( "Put down your project notes here." ) );
m_edit->selectAll();
m_edit->setTextColor( QColor( 224, 224, 224 ) );
m_edit->setTextCursor( QTextCursor() );
QTextCursor cursor = m_edit->textCursor();
cursor.clearSelection();
m_edit->setTextCursor( cursor );
}
@@ -119,36 +123,41 @@ void projectNotes::setText( const QString & _text )
void projectNotes::setupActions()
{
QToolBar * tb = new QToolBar( tr( "Edit Actions" ), this );
QToolBar * tb = addToolBar( tr( "Edit Actions" ) );
QAction * a;
a = new QAction( embed::getIconPixmap( "edit_undo" ), tr( "&Undo" ),
tb );
this );
a->setShortcut( tr( "Ctrl+Z" ) );
connect( a, SIGNAL( activated() ), m_edit, SLOT( undo() ) );
connect( a, SIGNAL( triggered() ), m_edit, SLOT( undo() ) );
tb->addAction( a );
a = new QAction( embed::getIconPixmap( "edit_redo" ), tr( "&Redo" ),
tb );
this );
a->setShortcut( tr( "Ctrl+Y" ) );
connect( a, SIGNAL( activated() ), m_edit, SLOT( redo() ) );
connect( a, SIGNAL( triggered() ), m_edit, SLOT( redo() ) );
tb->addAction( a );
a = new QAction( embed::getIconPixmap( "edit_copy" ), tr( "&Copy" ),
tb );
this );
a->setShortcut( tr( "Ctrl+C" ) );
connect( a, SIGNAL( activated() ), m_edit, SLOT( copy() ) );
connect( a, SIGNAL( triggered() ), m_edit, SLOT( copy() ) );
tb->addAction( a );
a = new QAction( embed::getIconPixmap( "edit_cut" ), tr( "Cu&t" ),
tb );
this );
a->setShortcut( tr( "Ctrl+X" ) );
connect( a, SIGNAL( activated() ), m_edit, SLOT( cut() ) );
connect( a, SIGNAL( triggered() ), m_edit, SLOT( cut() ) );
tb->addAction( a );
a = new QAction( embed::getIconPixmap( "edit_paste" ), tr( "&Paste" ),
tb );
this );
a->setShortcut( tr( "Ctrl+V" ) );
connect( a, SIGNAL( activated() ), m_edit, SLOT( paste() ) );
connect( a, SIGNAL( triggered() ), m_edit, SLOT( paste() ) );
tb->addAction( a );
tb = new QToolBar( tr( "Format Actions" ), this );
tb = addToolBar( tr( "Format Actions" ) );
m_comboFont = new QComboBox( tb );
m_comboFont->setEditable( TRUE );
@@ -172,54 +181,79 @@ void projectNotes::setupActions()
QApplication::font().pointSize() ) );
m_actionTextBold = new QAction( embed::getIconPixmap( "text_bold" ),
tr( "&Bold" ), tb );
tr( "&Bold" ), this );
m_actionTextBold->setShortcut( tr( "Ctrl+B" ) );
connect( m_actionTextBold, SIGNAL( activated() ), this,
m_actionTextBold->setCheckable( TRUE );
connect( m_actionTextBold, SIGNAL( triggered() ), this,
SLOT( textBold() ) );
m_actionTextItalic = new QAction( embed::getIconPixmap( "text_italic" ),
tr( "&Italic" ), tb );
tr( "&Italic" ), this );
m_actionTextItalic->setShortcut( tr( "Ctrl+I" ) );
connect( m_actionTextItalic, SIGNAL( activated() ), this,
m_actionTextItalic->setCheckable( TRUE );
connect( m_actionTextItalic, SIGNAL( triggered() ), this,
SLOT( textItalic() ) );
m_actionTextUnderline = new QAction( embed::getIconPixmap(
"text_under" ),
tr( "&Underline" ), tb );
tr( "&Underline" ), this );
m_actionTextUnderline->setShortcut( tr( "Ctrl+U" ) );
connect( m_actionTextUnderline, SIGNAL( activated() ), this,
m_actionTextUnderline->setCheckable( TRUE );
connect( m_actionTextUnderline, SIGNAL( triggered() ), this,
SLOT( textUnderline() ) );
QActionGroup * grp = new QActionGroup( tb );
connect( grp, SIGNAL( selected( QAction* ) ), this,
SLOT( textAlign( QAction* ) ) );
connect( grp, SIGNAL( triggered( QAction * ) ), this,
SLOT( textAlign( QAction * ) ) );
m_actionAlignLeft = new QAction( embed::getIconPixmap( "text_left" ),
tr( "&Left" ), grp );
tr( "&Left" ), m_edit );
m_actionAlignLeft->setShortcut( tr( "Ctrl+L" ) );
m_actionAlignLeft->setCheckable( TRUE );
grp->addAction( m_actionAlignLeft );
m_actionAlignCenter = new QAction( embed::getIconPixmap(
"text_center" ),
tr( "C&enter" ), grp );
tr( "C&enter" ), m_edit );
m_actionAlignCenter->setShortcutContext( Qt::WidgetShortcut );
m_actionAlignCenter->setShortcut( tr( "Ctrl+E" ) );
m_actionAlignCenter->setCheckable( TRUE );
grp->addAction( m_actionAlignCenter );
m_actionAlignRight = new QAction( embed::getIconPixmap( "text_right" ),
tr( "&Right" ), grp );
tr( "&Right" ), m_edit );
m_actionAlignRight->setShortcutContext( Qt::WidgetShortcut );
m_actionAlignRight->setShortcut( tr( "Ctrl+R" ) );
m_actionAlignRight->setCheckable( TRUE );
grp->addAction( m_actionAlignRight );
m_actionAlignJustify = new QAction( embed::getIconPixmap(
"text_block" ),
tr( "&Justify" ), grp );
tr( "&Justify" ), m_edit );
m_actionAlignJustify->setShortcut( tr( "Ctrl+J" ) );
m_actionAlignJustify->setCheckable( TRUE );
grp->addAction( m_actionAlignJustify );
QPixmap pix( 16, 16 );
pix.fill( Qt::black );
m_actionTextColor = new QAction( pix, tr( "&Color..." ), tb );
connect( m_actionTextColor, SIGNAL( activated() ), this,
m_actionTextColor = new QAction( pix, tr( "&Color..." ), this );
connect( m_actionTextColor, SIGNAL( triggered() ), this,
SLOT( textColor() ) );
tb->addWidget( m_comboFont );
tb->addWidget( m_comboSize );
tb->addAction( m_actionTextBold );
tb->addAction( m_actionTextItalic );
tb->addAction( m_actionTextUnderline );
tb->addAction( m_actionAlignLeft );
tb->addAction( m_actionAlignCenter );
tb->addAction( m_actionAlignRight );
tb->addAction( m_actionAlignJustify );
tb->addAction( m_actionTextColor );
}
@@ -227,7 +261,8 @@ void projectNotes::setupActions()
void projectNotes::textBold()
{
m_edit->setFontWeight( m_actionTextBold->isChecked() );
m_edit->setFontWeight( m_actionTextBold->isChecked() ? QFont::Bold :
QFont::Normal );
engine::getSongEditor()->setModified();
}
@@ -311,24 +346,19 @@ void projectNotes::textAlign( QAction * _a )
void projectNotes::fontChanged( const QFont & _f )
void projectNotes::formatChanged( const QTextCharFormat & _f )
{
m_comboFont->lineEdit()->setText( _f.family() );
m_comboSize->lineEdit()->setText( QString::number( _f.pointSize() ) );
m_actionTextBold->setChecked( _f.bold() );
m_actionTextItalic->setChecked( _f.italic() );
m_actionTextUnderline->setChecked( _f.underline() );
engine::getSongEditor()->setModified();
}
QFont font = _f.font();
m_comboFont->lineEdit()->setText( font.family() );
m_comboSize->lineEdit()->setText( QString::number( font.pointSize() ) );
m_actionTextBold->setChecked( font.bold() );
m_actionTextItalic->setChecked( font.italic() );
m_actionTextUnderline->setChecked( font.underline() );
void projectNotes::colorChanged( const QColor & _c )
{
QPixmap pix( 16, 16 );
pix.fill( _c );
pix.fill( _f.foreground().color() );
m_actionTextColor->setIcon( pix );
engine::getSongEditor()->setModified();
}
@@ -380,17 +410,4 @@ void projectNotes::loadSettings( const QDomElement & _this )
#include "project_notes.moc"
#undef isChecked
#undef setChecked
#undef setFontWeight
#undef setFontUnderline
#undef setFontItalic
#undef setFontFamily
#undef setFontPointSize
#undef setTextColor
#undef setHtml
#undef toHtml
#endif