diff --git a/ChangeLog b/ChangeLog index ac7843d6e..c6f841fd8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,32 @@ +2007-03-28 Javier Serrano Polo + + * include/mixer.h: + * include/note_play_handle.h: + * src/core/note_play_handle.cpp: + * src/core/song_editor.cpp: + fixed notes with dynamic tempo + + * include/main_window.h: + * src/core/main_window.cpp: + added online help + + * include/file_browser.h: + * src/core/file_browser.cpp: + - filter directories without relevant content + - simplified entry retrieval + + * include/basic_filters.h: + limit Moog instability + + * src/core/main.cpp: + updated year + + * src/widgets/knob.cpp: + initialize members according to last arrangement + + * data/locale/ca.ts: + updated translation + 2007-03-26 Tobias Doerffel * configure.in: diff --git a/configure.in b/configure.in index 11c56f93f..c5a3ab63b 100644 --- a/configure.in +++ b/configure.in @@ -2,8 +2,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.50) -AC_INIT(lmms, 0.2.1-svn20070325, lmms-devel/at/lists/dot/sf/dot/net) -AM_INIT_AUTOMAKE(lmms, 0.2.1-svn20070325) +AC_INIT(lmms, 0.2.1-svn20070328, lmms-devel/at/lists/dot/sf/dot/net) +AM_INIT_AUTOMAKE(lmms, 0.2.1-svn20070328) AM_CONFIG_HEADER(config.h) diff --git a/data/locale/ca.qm b/data/locale/ca.qm index a14147c3e..6d81a7767 100644 Binary files a/data/locale/ca.qm and b/data/locale/ca.qm differ diff --git a/data/locale/ca.ts b/data/locale/ca.ts index 4ca0a6238..91f70f2fd 100644 --- a/data/locale/ca.ts +++ b/data/locale/ca.ts @@ -2338,6 +2338,15 @@ Per favor, visita http://wiki.mindrules.net per a documentació sobre LMMS.MultiMedia Project (*.mmp *.mmpz);;MultiMedia Project Template (*.mpt) Projecte MultiMèdia (*.mmp *.mmpz);;Plantilla de Projecte MultiMèdia (*.mpt) + + Online help + Ajuda en línia + + + start + doku.php id + start + mallets diff --git a/include/basic_filters.h b/include/basic_filters.h index 66be90f55..a581a70ab 100644 --- a/include/basic_filters.h +++ b/include/basic_filters.h @@ -4,7 +4,7 @@ * original file by ??? * modified and enhanced by Tobias Doerffel * - * Copyright (c) 2004-2006 Tobias Doerffel + * Copyright (c) 2004-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -115,14 +115,22 @@ public: // four cascaded onepole filters // (bilinear transform) - m_y1[_chnl] = x*m_p + m_oldx[_chnl]*m_p - - m_k*m_y1[_chnl]; - m_y2[_chnl] = m_y1[_chnl]*m_p+m_oldy1[_chnl]* - m_p - m_k*m_y2[_chnl]; - m_y3[_chnl] = m_y2[_chnl]*m_p+m_oldy2[_chnl]* - m_p - m_k*m_y3[_chnl]; - m_y4[_chnl] = m_y3[_chnl]*m_p+m_oldy3[_chnl]* - m_p - m_k*m_y4[_chnl]; + m_y1[_chnl] = tLimit( + x*m_p + m_oldx[_chnl]*m_p - + m_k*m_y1[_chnl], + -10.0f, 10.0f ); + m_y2[_chnl] = tLimit( + m_y1[_chnl]*m_p+m_oldy1[_chnl]* + m_p - m_k*m_y2[_chnl], + -10.0f, 10.0f ); + m_y3[_chnl] = tLimit( + m_y2[_chnl]*m_p+m_oldy2[_chnl]* + m_p - m_k*m_y3[_chnl], + -10.0f, 10.0f ); + m_y4[_chnl] = tLimit( + m_y3[_chnl]*m_p+m_oldy3[_chnl]* + m_p - m_k*m_y4[_chnl], + -10.0f, 10.0f ); m_oldx[_chnl] = x; m_oldy1[_chnl] = m_y1[_chnl]; diff --git a/include/file_browser.h b/include/file_browser.h index e03057f35..28933c93f 100644 --- a/include/file_browser.h +++ b/include/file_browser.h @@ -1,7 +1,7 @@ /* * file_browser.h - include file for fileBrowser * - * Copyright (c) 2004-2006 Tobias Doerffel + * Copyright (c) 2004-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -68,6 +68,9 @@ public: QWidget * _parent, engine * _engine ); virtual ~fileBrowser(); + static bool isDirWithContent( const QString & _path, + const QString & _filter ); + public slots: void reloadTree( void ); diff --git a/include/main_window.h b/include/main_window.h index e6f78359f..a68ea71ba 100644 --- a/include/main_window.h +++ b/include/main_window.h @@ -1,7 +1,7 @@ /* * main_window.h - declaration of class mainWindow, the main window of LMMS * - * Copyright (c) 2004-2006 Tobias Doerffel + * Copyright (c) 2004-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -169,11 +169,14 @@ private: QMenu * m_tools_menu; vlist m_tools; + bool have_www_browser( void ); + friend class engine; private slots: + void browseHelp( void ); void fillTemplatesMenu( void ); void showTool( int _idx ); diff --git a/include/mixer.h b/include/mixer.h index 4e1a4b17d..df678ee2e 100644 --- a/include/mixer.h +++ b/include/mixer.h @@ -1,7 +1,7 @@ /* * mixer.h - audio-device-independent mixer for LMMS * - * Copyright (c) 2004-2006 Tobias Doerffel + * Copyright (c) 2004-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -182,6 +182,11 @@ public: return( m_playHandles ); } + inline playHandleVector & playHandles( void ) + { + return( m_playHandles ); + } + void checkValidityOfPlayHandles( void ); inline bool haveNoRunningNotes( void ) const diff --git a/include/note_play_handle.h b/include/note_play_handle.h index 90e45194e..e5c69b5d0 100644 --- a/include/note_play_handle.h +++ b/include/note_play_handle.h @@ -208,6 +208,7 @@ public: } void processMidiTime( const midiTime & _time ); + void resize( const bpm_t _new_bpm ); #if SINGERBOT_SUPPORT int patternIndex( void ) @@ -250,6 +251,10 @@ private: int m_patternIndex; // position among relevant notes #endif + // tempo reaction + bpm_t m_orig_bpm; // original bpm + f_cnt_t m_orig_frames; // original m_frames + private slots: void updateFrequency( void ); diff --git a/src/core/file_browser.cpp b/src/core/file_browser.cpp index 776ee29bd..33bc4745d 100644 --- a/src/core/file_browser.cpp +++ b/src/core/file_browser.cpp @@ -4,7 +4,7 @@ * file_browser.cpp - implementation of the project-, preset- and * sample-file-browser * - * Copyright (c) 2004-2006 Tobias Doerffel + * Copyright (c) 2004-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -160,7 +160,7 @@ void fileBrowser::reloadTree( void ) void fileBrowser::addItems( const QString & _path ) { QDir cdir( _path ); - QStringList files = cdir.entryList( QDir::NoFilter, QDir::Name ); + QStringList files = cdir.entryList( QDir::Files, QDir::Name ); // TODO: after dropping qt3-support we can use QStringList's iterator // which makes it possible to travel through the list in reverse @@ -169,9 +169,7 @@ void fileBrowser::addItems( const QString & _path ) for( csize i = 0; i < files.size(); ++i ) { QString cur_file = files[files.size() - i - 1]; - if( cur_file[0] != '.' && - QFileInfo( _path + QDir::separator() + - cur_file ).isDir() == FALSE + if( cur_file[0] != '.' #ifdef QT4 // TBD #else @@ -185,12 +183,13 @@ void fileBrowser::addItems( const QString & _path ) } } + files = cdir.entryList( QDir::Dirs, QDir::Name ); for( csize i = 0; i < files.size(); ++i ) { QString cur_file = files[files.size() - i - 1]; if( cur_file[0] != '.' && - QFileInfo( _path + QDir::separator() + - cur_file ).isDir() ) + isDirWithContent( _path + QDir::separator() + cur_file, + m_filter ) ) { QListViewItem * item = m_l->findItem( cur_file, 0 ); if( item == NULL ) @@ -210,6 +209,44 @@ void fileBrowser::addItems( const QString & _path ) +bool fileBrowser::isDirWithContent( const QString & _path, + const QString & _filter ) +{ + QDir cdir( _path ); + QStringList files = cdir.entryList( QDir::Files, QDir::Unsorted ); + for( QStringList::iterator it = files.begin(); it != files.end(); ++it ) + { + QString cur_file = *it; + if( cur_file[0] != '.' +#ifdef QT4 +// TBD +#else + && QDir::match( _filter, cur_file.lower() ) +#endif + ) + { + return( TRUE ); + } + } + + files = cdir.entryList( QDir::Dirs, QDir::Unsorted ); + for( QStringList::iterator it = files.begin(); it != files.end(); ++it ) + { + QString cur_file = *it; + if( cur_file[0] != '.' && + isDirWithContent( _path + QDir::separator() + cur_file, + _filter ) ) + { + return( TRUE ); + } + } + + return( FALSE ); +} + + + + void fileBrowser::keyPressEvent( QKeyEvent * _ke ) { if( _ke->key() == Qt::Key_F5 ) @@ -740,41 +777,34 @@ bool directory::addItems( const QString & _path ) bool added_something = FALSE; - QStringList files = thisDir.entryList( QDir::NoFilter, QDir::Name ); + QStringList files = thisDir.entryList( QDir::Files, QDir::Name ); for( csize i = 0; i < files.size(); ++i ) { QString cur_file = files[files.size() - i - 1]; + if( cur_file[0] != '.' #ifdef QT4 - if( cur_file[0] != '.' && !QFileInfo( - thisDir.absolutePath() + QDir::separator() + - cur_file ).isDir() && - thisDir.match( m_filter, cur_file.toLower() ) - /*QDir::match( FILE_FILTER, cur_file )*/ ) + && thisDir.match( m_filter, cur_file.toLower() ) #else - if( cur_file[0] != '.' && !QFileInfo( - thisDir.absPath() + QDir::separator() + - cur_file ).isDir() && - thisDir.match( m_filter, cur_file.lower() ) - /*QDir::match( FILE_FILTER, cur_file )*/ ) + && thisDir.match( m_filter, cur_file.lower() ) #endif + /*QDir::match( FILE_FILTER, cur_file )*/ ) { (void) new fileItem( this, cur_file, _path ); added_something = TRUE; } } + files = thisDir.entryList( QDir::Dirs, QDir::Name ); for( csize i = 0; i < files.size(); ++i ) { QString cur_file = files[files.size() - i - 1]; + if( cur_file[0] != '.' && fileBrowser::isDirWithContent( #ifdef QT4 - if( cur_file[0] != '.' && QFileInfo( thisDir.absolutePath() + QDir::separator() + - cur_file ).isDir() ) #else - if( cur_file[0] != '.' && QFileInfo( thisDir.absPath() + QDir::separator() + - cur_file ).isDir() ) #endif + cur_file, m_filter ) ) { new directory( this, cur_file, _path, m_filter ); added_something = TRUE; diff --git a/src/core/main.cpp b/src/core/main.cpp index 2da910f3c..53b0cf0f4 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -3,7 +3,7 @@ /* * main.cpp - just main.cpp which is starting up app... * - * Copyright (c) 2004-2006 Tobias Doerffel + * Copyright (c) 2004-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -101,7 +101,7 @@ int main( int argc, char * * argv ) QString( app.argv()[i] ) == "-v" ) { printf( "\nLinux MultiMedia Studio %s\n\n" - "Copyright (c) 2004-2006 Tobias Doerffel and others.\n\n" + "Copyright (c) 2004-2007 Tobias Doerffel and others.\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" @@ -115,7 +115,7 @@ int main( int argc, char * * argv ) QString( app.argv()[i] ) == "-h" ) ) { printf( "\nLinux MultiMedia Studio %s\n" - "Copyright (c) 2004-2006 Tobias Doerffel and others.\n\n" + "Copyright (c) 2004-2007 Tobias Doerffel and others.\n\n" "usage: lmms [ -r [ -o ] [ -h ] " "[ ]\n" "-r, --render render given file.\n" diff --git a/src/core/main_window.cpp b/src/core/main_window.cpp index 66771c3ab..653862664 100644 --- a/src/core/main_window.cpp +++ b/src/core/main_window.cpp @@ -3,7 +3,7 @@ /* * main_window.cpp - implementation of LMMS-main-window * - * Copyright (c) 2004-2006 Tobias Doerffel + * Copyright (c) 2004-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -550,8 +550,18 @@ void mainWindow::finalize( void ) #else menuBar()->insertItem( tr( "&Help" ), help_menu ); #endif - help_menu->addAction( embed::getIconPixmap( "help" ), tr( "Help" ), + if( have_www_browser() ) + { + help_menu->addAction( embed::getIconPixmap( "help" ), + tr( "Online help" ), + this, SLOT( browseHelp() ) ); + } + else + { + help_menu->addAction( embed::getIconPixmap( "help" ), + tr( "Help" ), this, SLOT( help() ) ); + } help_menu->addAction( embed::getIconPixmap( "whatsthis" ), tr( "What's this?" ), this, SLOT( enterWhatsThisMode() ) ); @@ -1089,6 +1099,41 @@ void mainWindow::showTool( int _idx ) +bool mainWindow::have_www_browser( void ) +{ + int ret = system( "which x-www-browser > /dev/null" ); + return( WIFEXITED( ret ) && WEXITSTATUS( ret ) == EXIT_SUCCESS ); +} + + + + +void mainWindow::browseHelp( void ) +{ + pid_t pid = fork(); + if( pid == -1 ) + { + perror( "fork" ); + } + else if( pid == 0 ) + { + QString url = "http://wiki.mindrules.net/doku.php?id=" + + tr( "start", "doku.php id" ); + execlp( "x-www-browser", "x-www-browser", url. +#ifdef QT4 + toAscii().constData(), +#else + ascii(), +#endif + NULL ); + perror( "execlp" ); + exit( EXIT_FAILURE ); + } +} + + + + #ifndef QT4 #undef addSeparator #endif diff --git a/src/core/note_play_handle.cpp b/src/core/note_play_handle.cpp index c9bb0aee5..cce8817ce 100644 --- a/src/core/note_play_handle.cpp +++ b/src/core/note_play_handle.cpp @@ -58,10 +58,11 @@ notePlayHandle::notePlayHandle( instrumentTrack * _it, m_baseNote( TRUE ), m_arpNote( _arp_note ), m_muted( FALSE ), - m_bbTrack( NULL ) + m_bbTrack( NULL ), #if SINGERBOT_SUPPORT - , m_patternIndex( 0 ) + m_patternIndex( 0 ), #endif + m_orig_bpm( _it->eng()->getSongEditor()->getTempo() ) { setDetuning( _n.detuning() ); if( detuning() ) @@ -320,6 +321,7 @@ void notePlayHandle::setFrames( const f_cnt_t _frames ) { m_frames = m_instrumentTrack->beatLen( this ); } + m_orig_frames = m_frames; } @@ -437,6 +439,23 @@ void notePlayHandle::processMidiTime( const midiTime & _time ) +void notePlayHandle::resize( const bpm_t _new_bpm ) +{ + double completed = m_totalFramesPlayed / (double)m_frames; + double new_frames = m_orig_frames * m_orig_bpm / (double)_new_bpm; + m_frames = (f_cnt_t)new_frames; + m_totalFramesPlayed = (f_cnt_t)( completed * new_frames ); + + for( notePlayHandleVector::iterator it = m_subNotes.begin(); + it != m_subNotes.end(); ++it ) + { + ( *it )->resize( _new_bpm ); + } +} + + + + #include "note_play_handle.moc" diff --git a/src/core/song_editor.cpp b/src/core/song_editor.cpp index b3913d6ec..2523f1d29 100644 --- a/src/core/song_editor.cpp +++ b/src/core/song_editor.cpp @@ -3,7 +3,7 @@ /* * song_editor.cpp - basic window for editing song * - * Copyright (c) 2004-2006 Tobias Doerffel + * Copyright (c) 2004-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -79,6 +79,7 @@ #include "instrument_track.h" #include "mmp.h" #include "midi_client.h" +#include "note_play_handle.h" #include "timeline.h" #include "pattern.h" #include "piano_roll.h" @@ -755,6 +756,17 @@ void songEditor::zoomingChanged( const QString & _zfac ) void songEditor::setTempo( int _new_bpm ) { + playHandleVector & phv = eng()->getMixer()->playHandles(); + for( playHandleVector::iterator it = phv.begin(); it != phv.end(); + ++it ) + { + notePlayHandle * nph = dynamic_cast( *it ); + if( nph && !nph->released() ) + { + nph->resize( _new_bpm ); + } + } + m_bpmSpinBox->setInitValue( _new_bpm ); eng()->updateFramesPerTact64th(); emit tempoChanged( _new_bpm ); diff --git a/src/widgets/knob.cpp b/src/widgets/knob.cpp index 88dfd7b38..fe16a0500 100644 --- a/src/widgets/knob.cpp +++ b/src/widgets/knob.cpp @@ -6,7 +6,7 @@ * This file is partly based on the knob-widget of the Qwt Widget Library by * Josef Wilgen. * - * Copyright (c) 2004-2006 Tobias Doerffel + * Copyright (c) 2004-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -95,12 +95,12 @@ knob::knob( int _knob_num, QWidget * _parent, const QString & _name, autoObj( _engine, _track ), m_mouseOffset( 0.0f ), m_buttonPressed( FALSE ), - m_angle( 0.0f ), - m_knobNum( _knob_num ), m_hintTextBeforeValue( "" ), m_hintTextAfterValue( "" ), - m_label( "" ), - m_initValue( 0.0f ) + m_initValue( 0.0f ), + m_angle( 0.0f ), + m_knobNum( _knob_num ), + m_label( "" ) { if( s_textFloat == NULL ) {