diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..596615322 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +.gitattributes export-ignore +.gitignore export-ignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..d8669fa1d --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/build +.*.sw? +*~ diff --git a/ChangeLog.old b/ChangeLog.old index dc103749c..f9ed32886 100644 --- a/ChangeLog.old +++ b/ChangeLog.old @@ -158,6 +158,11 @@ * plugins/flp_import/unrtf/convert.c: Avoid compile warnings +2009-01-03 Paul Giblock + + * src/gui/widgets/automatable_button.cpp: + fix drag support for button groups + 2008-12-22 Tobias Doerffel * CMakeLists.txt: @@ -247,6 +252,12 @@ * src/tracks/pattern.cpp: backport: added support for panning editing of notes +2008-12-15 Paul Giblock + + * src/core/track.cpp: + * include/track.h: + Cache background per-object instead of per-class. + 2008-12-14 Tobias Doerffel * CMakeLists.txt: diff --git a/include/mmp.h b/include/mmp.h index 55f289427..403f90f5e 100644 --- a/include/mmp.h +++ b/include/mmp.h @@ -2,6 +2,7 @@ * mmp.h - class for reading and writing multimedia-project-files * * Copyright (c) 2004-2009 Tobias Doerffel + * Copyright (c) 2012-2013 Paul Giblock

* * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -27,6 +28,7 @@ #define _MMP_H #include +#include #include "export.h" #include "lmms_basics.h" @@ -59,6 +61,7 @@ public: QString nameWithExtension( const QString & _fn ) const; + void write( QTextStream & _strm ); bool writeFile( const QString & _fn ); inline QDomElement & content() diff --git a/plugins/zynaddsubfx/fltk/fltk-config b/plugins/zynaddsubfx/fltk/fltk-config index 10330bf6f..97ed9a514 100755 --- a/plugins/zynaddsubfx/fltk/fltk-config +++ b/plugins/zynaddsubfx/fltk/fltk-config @@ -1,7 +1,7 @@ #!/bin/sh # # "$Id: fltk-config.in 6614 2009-01-01 16:11:32Z matt $" -# +# # FLTK configuration utility. # # Copyright 2000-2009 by Bill Spitzak and others. @@ -31,31 +31,31 @@ MAJOR_VERSION=1 MINOR_VERSION=3 PATCH_VERSION=0 -VERSION="$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION" -APIVERSION="$MAJOR_VERSION.$MINOR_VERSION" +VERSION=1.3.0 +APIVERSION=1.3 ### BEGIN fltk-config selfdir=`dirname "$0"` -prefix=/usr -exec_prefix=${prefix} +prefix=/usr/local +exec_prefix= exec_prefix_set=no -bindir=${exec_prefix}/bin -includedir=${prefix}/include -libdir=${exec_prefix}/lib +bindir=/usr/local/bin +includedir= +libdir=/usr/local/lib srcdir=. # compiler names CC="gcc" -CXX="g++" +CXX="c++" # flags for C++ compiler: ARCHFLAGS="" -CFLAGS=" -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_THREAD_SAFE -D_REENTRANT" -CXXFLAGS="-I/usr/include/freetype2 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_THREAD_SAFE -D_REENTRANT" -LDFLAGS=" " -LDLIBS="-lXext -lXft -lfontconfig -lXinerama -lpthread -ldl -lm -lX11 " -OPTIM=" -Os -Wall -Wunused -Wno-format-y2k -fno-exceptions -fno-strict-aliasing" +CFLAGS="-DUSE_X11 -D_THREAD_SAFE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE" +CXXFLAGS="-DUSE_X11 -D_THREAD_SAFE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE" +LDFLAGS="" +LDLIBS="-lX11 -lpthread -lXinerama -lXft -lXext" +OPTIM="" CAIROFLAGS="" # Check for local invocation, and update paths accordingly... @@ -91,11 +91,11 @@ if test -f "$libdir/libfltk_cairo.a"; then fi # libraries to link with: -LIBNAME="../lib/libfltk.a" +LIBNAME="" DSONAME="" DSOLINK="" -IMAGELIBS="-lpng -lz -ljpeg " -STATICIMAGELIBS="-lpng -lz -ljpeg " +IMAGELIBS="" +STATICIMAGELIBS="" CAIROLIBS="" SHAREDSUFFIX="" @@ -143,10 +143,10 @@ post= debug= # Parse command line options -while test $# -gt 0 +while test $# -gt 0 do case "$1" in - -*=*) + -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) @@ -239,8 +239,8 @@ if test x$use_forms = xyes; then LDSTATIC="$libdir/libfltk_forms.a $LDSTATIC" fi if test x$use_gl = xyes; then - LDLIBS="-lfltk_gl$SHAREDSUFFIX -lGLU -lGL $LDLIBS" - LDSTATIC="$libdir/libfltk_gl.a -lGLU -lGL $LDSTATIC" + LDLIBS="-lfltk_gl$SHAREDSUFFIX $LDLIBS" + LDSTATIC="$libdir/libfltk_gl.a $LDSTATIC" fi if test x$use_images = xyes; then LDLIBS="-lfltk_images$SHAREDSUFFIX $IMAGELIBS $LDLIBS" diff --git a/src/core/main.cpp b/src/core/main.cpp index 090f032ef..55490628d 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -1,8 +1,9 @@ /* * main.cpp - just main.cpp which is starting up app... * - * Copyright (c) 2004-2011 Tobias Doerffel - * + * Copyright (c) 2004-2013 Tobias Doerffel + * Copyright (c) 2012-2013 Paul Giblock

+ * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -61,6 +62,7 @@ #include "ImportFilter.h" #include "MainWindow.h" #include "ProjectRenderer.h" +#include "mmp.h" #include "song.h" #warning TODO: move somewhere else @@ -130,7 +132,7 @@ int main( int argc, char * * argv ) QString( argv[i] ) == "-v" ) { printf( "\nLinux MultiMedia Studio %s\n\n" - "Copyright (c) 2004-2008 LMMS developers.\n\n" + "Copyright (c) 2004-2013 LMMS developers.\n\n" "This program is free software; you can redistribute it and/or\n" "modify it under the terms of the GNU General Public\n" "License as published by the Free Software Foundation; either\n" @@ -143,7 +145,7 @@ int main( int argc, char * * argv ) QString( argv[i] ) == "-h" ) ) { printf( "\nLinux MultiMedia Studio %s\n" - "Copyright (c) 2004-2008 LMMS developers.\n\n" + "Copyright (c) 2004-2013 LMMS developers.\n\n" "usage: lmms [ -r ] [ options ]\n" " [ -u ]\n" " [ -d ]\n" @@ -166,7 +168,8 @@ int main( int argc, char * * argv ) "-x, --oversampling specify oversampling\n" " possible values: 1, 2, 4, 8\n" " default: 2\n" - "-u, --upgrade upgrade file and save as \n" + "-u, --upgrade [out] upgrade file and save as \n" + " standard out is used if no output file is specifed\n" "-d, --dump dump XML of compressed file \n" "-v, --version show version information and exit.\n" "-h, --help show this usage information and exit.\n\n", @@ -176,9 +179,18 @@ int main( int argc, char * * argv ) else if( argc > i+1 && ( QString( argv[i] ) == "--upgrade" || QString( argv[i] ) == "-u" ) ) { - file_to_load = argv[i + 1]; - file_to_save = argv[i + 2]; - i += 2; + multimediaProject mmp( QString( argv[i + 1] ) ); + if (argc > i+2) + { + mmp.writeFile( argv[i + 2] ); + } + else + { + QTextStream ts( stdout ); + mmp.write( ts ); + fflush( stdout ); + } + return( EXIT_SUCCESS ); } else if( argc > i && ( QString( argv[i] ) == "--dump" || QString( argv[i] ) == "-d" ) ) @@ -187,7 +199,7 @@ int main( int argc, char * * argv ) f.open( QIODevice::ReadOnly ); QString d = qUncompress( f.readAll() ); printf( "%s\n", d.toUtf8().constData() ); - return( 0 ); + return( EXIT_SUCCESS ); } else if( argc > i && ( QString( argv[i] ) == "--render" || QString( argv[i] ) == "-r" ) ) @@ -371,7 +383,7 @@ int main( int argc, char * * argv ) configManager::inst()->loadConfigFile(); - if( render_out.isEmpty() && file_to_save.isEmpty() ) + if( render_out.isEmpty() ) { // init style and palette QApplication::setStyle( new lmmsStyle() ); @@ -479,31 +491,23 @@ int main( int argc, char * * argv ) engine::getSong()->loadProject( file_to_load ); printf( "done\n" ); - if( !render_out.isEmpty() ) - { - // create renderer - ProjectRenderer * r = new ProjectRenderer( qs, os, eff, - render_out + - QString( ( eff == - ProjectRenderer::WaveFile ) ? - "wav" : "ogg" ) ); - QCoreApplication::instance()->connect( r, - SIGNAL( finished() ), SLOT( quit() ) ); + // create renderer + ProjectRenderer * r = new ProjectRenderer( qs, os, eff, + render_out + + QString( ( eff == + ProjectRenderer::WaveFile ) ? + "wav" : "ogg" ) ); + QCoreApplication::instance()->connect( r, + SIGNAL( finished() ), SLOT( quit() ) ); - // timer for progress-updates - QTimer * t = new QTimer( r ); - r->connect( t, SIGNAL( timeout() ), - SLOT( updateConsoleProgress() ) ); - t->start( 200 ); + // timer for progress-updates + QTimer * t = new QTimer( r ); + r->connect( t, SIGNAL( timeout() ), + SLOT( updateConsoleProgress() ) ); + t->start( 200 ); - // start now! - r->startProcessing(); - } - else - { - engine::getSong()->saveProjectFile( file_to_save ); - return( 0 ); - } + // start now! + r->startProcessing(); } const int ret = app->exec(); diff --git a/src/core/mmp.cpp b/src/core/mmp.cpp index 8200aeb50..adc438fdf 100644 --- a/src/core/mmp.cpp +++ b/src/core/mmp.cpp @@ -2,6 +2,7 @@ * mmp.cpp - implementation of class multimediaProject * * Copyright (c) 2004-2009 Tobias Doerffel + * Copyright (c) 2012-2013 Paul Giblock

* * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -66,6 +67,7 @@ multimediaProject::multimediaProject( ProjectTypes _project_type ) : m_head(), m_type( _project_type ) { + appendChild( createProcessingInstruction("xml", "version=\"1.0\"")); QDomElement root = createElement( "multimedia-project" ); root.setAttribute( "version", MMP_VERSION_STRING ); root.setAttribute( "type", typeName( _project_type ) ); @@ -163,7 +165,7 @@ QString multimediaProject::nameWithExtension( const QString & _fn ) const -bool multimediaProject::writeFile( const QString & _fn ) +void multimediaProject::write( QTextStream & _strm ) { if( type() == SongProject || type() == SongProjectTemplate || type() == InstrumentTrackSettings ) @@ -171,7 +173,14 @@ bool multimediaProject::writeFile( const QString & _fn ) cleanMetaNodes( documentElement() ); } + save(_strm, 2); +} + + + +bool multimediaProject::writeFile( const QString & _fn ) +{ QString fn = nameWithExtension( _fn ); QFile outfile( fn ); if( !outfile.open( QIODevice::WriteOnly | QIODevice::Truncate ) ) @@ -189,14 +198,18 @@ bool multimediaProject::writeFile( const QString & _fn ) ).arg( fn ) ); return false; } - QString xml = "\n" + toString( 2 ); + if( fn.section( '.', -1 ) == "mmpz" ) { + QString xml; + QTextStream ts( &xml ); + write( ts ); outfile.write( qCompress( xml.toUtf8() ) ); } else { - QTextStream( &outfile ) << xml; + QTextStream ts( &outfile ); + write( ts ); } outfile.close(); diff --git a/src/core/track.cpp b/src/core/track.cpp index 8f47dee16..82694aaf5 100644 --- a/src/core/track.cpp +++ b/src/core/track.cpp @@ -895,46 +895,46 @@ void trackContentWidget::updateBackground() // Assume even-pixels-per-tact. Makes sense, should be like this anyways int ppt = static_cast( tcv->pixelsPerTact() ); - int w = ppt * tactsPerBar; - int h = height(); - m_background = QPixmap( w * 2, height() ); - QPainter pmp( &m_background ); + int w = ppt * tactsPerBar; + int h = height(); + m_background = QPixmap( w * 2, height() ); + QPainter pmp( &m_background ); - QLinearGradient grad( 0, 1, 0, h-2 ); - pmp.fillRect( 0, 0, 1, h, QColor( 96, 96, 96 ) ); - pmp.fillRect( 1, 0, w+1, h, QColor( 128, 128, 128 ) ); - grad.setColorAt( 0.0, QColor( 64, 64, 64 ) ); - grad.setColorAt( 0.3, QColor( 128, 128, 128 ) ); - grad.setColorAt( 0.5, QColor( 128, 128, 128 ) ); - grad.setColorAt( 0.95, QColor( 160, 160, 160 ) ); - pmp.fillRect( 0, 1, w, h-2, grad ); + QLinearGradient grad( 0, 1, 0, h-2 ); + pmp.fillRect( 0, 0, 1, h, QColor( 96, 96, 96 ) ); + pmp.fillRect( 1, 0, w+1, h, QColor( 128, 128, 128 ) ); + grad.setColorAt( 0.0, QColor( 64, 64, 64 ) ); + grad.setColorAt( 0.3, QColor( 128, 128, 128 ) ); + grad.setColorAt( 0.5, QColor( 128, 128, 128 ) ); + grad.setColorAt( 0.95, QColor( 160, 160, 160 ) ); + pmp.fillRect( 0, 1, w, h-2, grad ); - QLinearGradient grad2( 0,1, 0, h-2 ); - pmp.fillRect( w+1, 0, w , h, QColor( 96, 96, 96 ) ); - grad2.setColorAt( 0.0, QColor( 48, 48, 48 ) ); - grad2.setColorAt( 0.3, QColor( 96, 96, 96 ) ); - grad2.setColorAt( 0.5, QColor( 96, 96, 96 ) ); - grad2.setColorAt( 0.95, QColor( 120, 120, 120 ) ); - pmp.fillRect( w, 1, w , h-2, grad2 ); + QLinearGradient grad2( 0,1, 0, h-2 ); + pmp.fillRect( w+1, 0, w , h, QColor( 96, 96, 96 ) ); + grad2.setColorAt( 0.0, QColor( 48, 48, 48 ) ); + grad2.setColorAt( 0.3, QColor( 96, 96, 96 ) ); + grad2.setColorAt( 0.5, QColor( 96, 96, 96 ) ); + grad2.setColorAt( 0.95, QColor( 120, 120, 120 ) ); + pmp.fillRect( w, 1, w , h-2, grad2 ); - // draw vertical lines - pmp.setPen( QPen( QColor( 0, 0, 0, 112 ), 1 ) ); - for( float x = 0.5; x < w * 2; x += ppt ) - { - pmp.drawLine( QLineF( x, 1.0, x, h-2.0 ) ); - } - pmp.drawLine( 0, 1, w*2, 1 ); + // draw vertical lines + pmp.setPen( QPen( QColor( 0, 0, 0, 112 ), 1 ) ); + for( float x = 0.5; x < w * 2; x += ppt ) + { + pmp.drawLine( QLineF( x, 1.0, x, h-2.0 ) ); + } + pmp.drawLine( 0, 1, w*2, 1 ); - pmp.setPen( QPen( QColor( 255, 255, 255, 32 ), 1 ) ); - for( float x = 1.5; x < w * 2; x += ppt ) - { - pmp.drawLine( QLineF( x, 1.0, x, h-2.0 ) ); - } - pmp.drawLine( 0, h-2, w*2, h-2 ); + pmp.setPen( QPen( QColor( 255, 255, 255, 32 ), 1 ) ); + for( float x = 1.5; x < w * 2; x += ppt ) + { + pmp.drawLine( QLineF( x, 1.0, x, h-2.0 ) ); + } + pmp.drawLine( 0, h-2, w*2, h-2 ); - pmp.end(); + pmp.end(); - // Force redraw + // Force redraw update(); } @@ -1206,7 +1206,9 @@ void trackContentWidget::paintEvent( QPaintEvent * _pe ) */ void trackContentWidget::resizeEvent( QResizeEvent * resizeEvent ) { + // Update backgroud updateBackground(); + // Force redraw QWidget::resizeEvent( resizeEvent ); } diff --git a/src/gui/AutomationEditor.cpp b/src/gui/AutomationEditor.cpp index e2a1d4b19..a99be753c 100644 --- a/src/gui/AutomationEditor.cpp +++ b/src/gui/AutomationEditor.cpp @@ -3,6 +3,7 @@ * actual setting of dynamic values * * Copyright (c) 2008-2013 Tobias Doerffel + * Copyright (c) 2008-2013 Paul Giblock * Copyright (c) 2006-2008 Javier Serrano Polo * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net @@ -89,6 +90,8 @@ AutomationEditor::AutomationEditor() : m_action( NONE ), m_moveStartLevel( 0 ), m_moveStartTick( 0 ), + m_drawLastLevel( 0.0f ), + m_drawLastTick( 0 ), m_ppt( DEFAULT_PPT ), m_y_delta( DEFAULT_Y_DELTA ), m_y_auto( TRUE ), diff --git a/src/gui/widgets/automatable_button.cpp b/src/gui/widgets/automatable_button.cpp index 776c0fc4f..d0687a0a6 100644 --- a/src/gui/widgets/automatable_button.cpp +++ b/src/gui/widgets/automatable_button.cpp @@ -32,7 +32,7 @@ #include "engine.h" #include "embed.h" #include "MainWindow.h" - +#include "string_pair_drag.h" @@ -115,6 +115,7 @@ void automatableButton::mousePressEvent( QMouseEvent * _me ) if( _me->button() == Qt::LeftButton && ! ( _me->modifiers() & Qt::ControlModifier ) ) { + // User simply clicked, toggle if needed if( isCheckable() ) { toggle(); @@ -123,8 +124,23 @@ void automatableButton::mousePressEvent( QMouseEvent * _me ) } else { - AutomatableModelView::mousePressEvent( _me ); - QPushButton::mousePressEvent( _me ); + // Ctrl-clicked, need to prepare drag-drop + if( m_group ) + { + // A group, we must get process it instead + AutomatableModelView* groupView = (AutomatableModelView*)m_group; + new stringPairDrag( "automatable_model", + QString::number( groupView->modelUntyped()->id() ), + QPixmap(), widget() ); + // TODO: ^^ Maybe use a predefined icon instead of the button they happened to select + _me->accept(); + } + else + { + // Otherwise, drag the standalone button + AutomatableModelView::mousePressEvent( _me ); + QPushButton::mousePressEvent( _me ); + } } }