From e7f5fb89777fcdcacaeff4dd0c03c10e02e8cad4 Mon Sep 17 00:00:00 2001 From: Javier Serrano Polo Date: Mon, 7 May 2007 19:11:23 +0000 Subject: [PATCH] mutex, detuning helpers, GUI updates, play handles, many many changes... (2) git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@480 0778d3d1-df1d-0410-868b-ea421aaaa00d --- include/arp_and_chords_tab_widget.h | 20 ++++---- include/audio_device.h | 8 +++ include/audio_dummy.h | 8 +++ include/audio_jack.h | 4 -- include/audio_oss.h | 1 - include/audio_port.h | 2 - include/audio_sdl.h | 1 - include/automatable_object.h | 23 +++------ include/automatable_object_templates.h | 21 +++----- include/automatable_slider.h | 4 +- include/automation_editor.h | 8 +-- include/automation_pattern.h | 17 ++++--- include/config_mgr.h | 5 +- include/custom_events.h | 52 +++++++++++++++++++ include/detuning_helper.h | 51 +++++++++++++++++++ include/effect.h | 22 +------- include/effect_chain.h | 13 +---- include/effect_control_dialog.h | 8 ++- include/effect_label.h | 10 ++-- include/effect_tab_widget.h | 13 ++--- include/engine.h | 2 +- include/envelope_and_lfo_widget.h | 11 ---- include/envelope_tab_widget.h | 8 ++- include/fade_button.h | 13 +++-- include/fifo_buffer.h | 2 +- include/instrument.h | 24 ++------- include/instrument_play_handle.h | 27 +++------- include/instrument_track.h | 23 +++------ include/knob.h | 2 +- include/level_object.h | 11 ++-- include/main_window.h | 3 -- include/meter_dialog.h | 9 ++-- include/midi_client.h | 8 +++ include/midi_dummy.h | 10 +++- include/midi_event_processor.h | 6 +-- include/midi_port.h | 4 +- include/mixer.h | 47 ++++------------- include/mmp.h | 7 ++- include/note.h | 12 ++--- include/note_play_handle.h | 70 +++++++++++++++----------- include/oscillator.h | 28 +++++------ include/pattern.h | 10 +--- include/piano_roll.h | 8 +-- include/piano_widget.h | 17 +++---- include/play_handle.h | 14 ++---- include/plugin.h | 2 - include/preset_preview_play_handle.h | 3 +- include/project_version.h | 67 ++++++++++++++++++++++++ include/qt3support.h | 5 +- include/rack_plugin.h | 16 +++--- include/rack_view.h | 9 ++-- include/sample_buffer.h | 14 +----- include/sample_play_handle.h | 3 +- include/sample_track.h | 10 ++-- include/shared_object.h | 19 +------ include/side_bar.h | 3 +- include/song_editor.h | 2 - include/surround_area.h | 6 +-- include/tempo_sync_knob.h | 5 +- include/tool.h | 4 +- include/track.h | 8 ++- include/track_container.h | 5 -- include/update_event.h | 56 +++++++++++++++++++++ include/volume_knob.h | 13 +---- 64 files changed, 494 insertions(+), 423 deletions(-) create mode 100644 include/custom_events.h create mode 100644 include/detuning_helper.h create mode 100644 include/project_version.h create mode 100644 include/update_event.h diff --git a/include/arp_and_chords_tab_widget.h b/include/arp_and_chords_tab_widget.h index 46a26ce2c..89d62193a 100644 --- a/include/arp_and_chords_tab_widget.h +++ b/include/arp_and_chords_tab_widget.h @@ -47,6 +47,7 @@ #include "types.h" +class QLabel; class QPixmap; class automatableButtonGroup; @@ -66,6 +67,15 @@ class arpAndChordsTabWidget : public QWidget, public journallingObject { Q_OBJECT public: + enum arpDirections + { + OFF, + UP, + DOWN, + UP_AND_DOWN, + RANDOM + } ; + arpAndChordsTabWidget( instrumentTrack * _channel_track ); virtual ~arpAndChordsTabWidget(); @@ -97,16 +107,6 @@ public: private: - - enum arpDirections - { - OFF, - UP, - DOWN, - UP_AND_DOWN, - RANDOM - } ; - enum arpModes { FREE, diff --git a/include/audio_device.h b/include/audio_device.h index 1977c754e..d660d8017 100644 --- a/include/audio_device.h +++ b/include/audio_device.h @@ -126,6 +126,14 @@ public: virtual void saveSettings( void ) = 0; + + public slots: + virtual void show( void ) + { + parentWidget()->show(); + QWidget::show(); + } + } ; diff --git a/include/audio_dummy.h b/include/audio_dummy.h index 9e1ca5edc..ffcdfd4e8 100644 --- a/include/audio_dummy.h +++ b/include/audio_dummy.h @@ -68,6 +68,14 @@ public: { } + + public slots: + virtual void show( void ) + { + parentWidget()->hide(); + QWidget::show(); + } + } ; diff --git a/include/audio_jack.h b/include/audio_jack.h index 41725f915..51cb65378 100644 --- a/include/audio_jack.h +++ b/include/audio_jack.h @@ -41,14 +41,12 @@ #ifdef QT4 -#include #include #include #include #else -#include #include #include #include @@ -57,7 +55,6 @@ #include "audio_device.h" -#include "tab_widget.h" class QLineEdit; @@ -110,7 +107,6 @@ private: bool m_active; bool m_stopped; -// QMutex m_processCallbackMutex; QSemaphore m_stop_semaphore; vvector m_outputPorts; diff --git a/include/audio_oss.h b/include/audio_oss.h index 5071e4802..eb10aa462 100644 --- a/include/audio_oss.h +++ b/include/audio_oss.h @@ -36,7 +36,6 @@ #include "audio_device.h" -#include "tab_widget.h" diff --git a/include/audio_port.h b/include/audio_port.h index b36b702c4..2ca7464cb 100644 --- a/include/audio_port.h +++ b/include/audio_port.h @@ -38,8 +38,6 @@ #endif -#include "mixer.h" -#include "effect_board.h" #include "effect_chain.h" diff --git a/include/audio_sdl.h b/include/audio_sdl.h index 4dee0cec4..dc460bb02 100644 --- a/include/audio_sdl.h +++ b/include/audio_sdl.h @@ -42,7 +42,6 @@ #include "audio_device.h" -#include "tab_widget.h" class QLineEdit; diff --git a/include/automatable_object.h b/include/automatable_object.h index c69d126ae..46624996c 100644 --- a/include/automatable_object.h +++ b/include/automatable_object.h @@ -100,7 +100,12 @@ public: return( m_curLevel ); } - inline T fittedValue( T _value ); + inline T fittedValue( T _value ) const; + + T value( int _level ) const + { + return( fittedValue( _level * m_step ) ); + } virtual void setInitValue( const T _value ); @@ -132,16 +137,6 @@ public: return( "automatableobject" ); } - inline const QVariant & data( void ) const - { - return( m_data ); - } - - void setData( const QVariant & _data ) - { - m_data = _data; - } - inline automationPattern * getAutomationPattern( void ); inline bool nullTrack( void ) @@ -180,8 +175,6 @@ private: T m_oldValue; bool m_journalEntryReady; - QVariant m_data; - typedef vvector autoObjVector; autoObjVector m_linkedObjects; @@ -200,9 +193,9 @@ private: return( (int)roundf( _value / (float)m_step ) ); } - QString levelToLabel( int _level ) + QString levelToLabel( int _level ) const { - return( QString::number( _level * m_step ) ); + return( QString::number( value( _level ) ) ); } int labelToLevel( QString _label ) diff --git a/include/automatable_object_templates.h b/include/automatable_object_templates.h index 7853ac26e..f89f6437b 100644 --- a/include/automatable_object_templates.h +++ b/include/automatable_object_templates.h @@ -67,10 +67,7 @@ automatableObject::automatableObject( track * _track, template automatableObject::~automatableObject() { - if( m_automation_pattern ) - { - delete m_automation_pattern; - } + delete m_automation_pattern; while( m_linkedObjects.empty() == FALSE ) { m_linkedObjects.last()->unlinkObject( this ); @@ -82,7 +79,7 @@ automatableObject::~automatableObject() template -T automatableObject::fittedValue( T _value ) +T automatableObject::fittedValue( T _value ) const { _value = tLimit( _value, minValue(), maxValue() ); @@ -230,10 +227,7 @@ void automatableObject::linkObjects( autoObj * _object1, if( _object1->m_automation_pattern != _object2->m_automation_pattern ) { - if( _object2->m_automation_pattern ) - { - delete _object2->m_automation_pattern; - } + delete _object2->m_automation_pattern; _object2->m_automation_pattern = _object1->m_automation_pattern; } } @@ -264,7 +258,8 @@ void automatableObject::saveSettings( QDomDocument & _doc, QDomElement & _this, const QString & _name ) { - if( m_automation_pattern ) + if( m_automation_pattern && m_automation_pattern->getTimeMap().size() + > 1 ) { QDomElement pattern_element; QDomNode node = _this.namedItem( @@ -304,8 +299,7 @@ void automatableObject::loadSettings( if( node.isElement() ) { m_automation_pattern->loadSettings( node.toElement() ); - setLevel( m_automation_pattern->valueAt( - midiTime( 0 ) ) ); + setLevel( m_automation_pattern->valueAt( 0 ) ); return; } } @@ -399,8 +393,7 @@ void automatableObject::setFirstValue( void ) { if( m_automation_pattern && m_automation_pattern->updateFirst() ) { - m_automation_pattern->putValue( midiTime( 0 ), m_curLevel, - FALSE ); + m_automation_pattern->putValue( 0, m_curLevel, FALSE ); if( engine::getAutomationEditor() && engine::getAutomationEditor()->currentPattern() == m_automation_pattern ) diff --git a/include/automatable_slider.h b/include/automatable_slider.h index 7d562843c..cc3c23ed1 100644 --- a/include/automatable_slider.h +++ b/include/automatable_slider.h @@ -31,14 +31,16 @@ #ifdef QT4 #include +#include #else +#include #include #endif -#include "knob.h" +class knob; diff --git a/include/automation_editor.h b/include/automation_editor.h index bd617eb30..1dab3b44f 100644 --- a/include/automation_editor.h +++ b/include/automation_editor.h @@ -33,19 +33,17 @@ #include #include -#include #else #include #include -#include #endif #include "types.h" -#include "note.h" #include "journalling_object.h" +#include "midi_time.h" #include "automation_pattern.h" @@ -196,8 +194,6 @@ private: comboBox * m_zoomingYComboBox; comboBox * m_quantizeComboBox; - QPixmap m_paintPixmap; - automationPattern * m_pattern; int m_min_level; @@ -206,7 +202,7 @@ private: int m_bottom_level; int m_top_level; - void updatePaintPixmap( void ); + void updatePaintPixmap( QPixmap & _p ); void updateTopBottomLevels( void ); QScrollBar * m_leftRightScroll; diff --git a/include/automation_pattern.h b/include/automation_pattern.h index 07098ffd1..d8a866f99 100644 --- a/include/automation_pattern.h +++ b/include/automation_pattern.h @@ -27,9 +27,10 @@ #ifndef _AUTOMATION_PATTERN_H #define _AUTOMATION_PATTERN_H +#include + #include "qt3support.h" -#include "track.h" -#include "level_object.h" +#include "journalling_object.h" #ifdef QT3 @@ -38,6 +39,11 @@ #endif +class levelObject; +class midiTime; +class track; + + class automationPattern : public QObject, public journallingObject @@ -89,12 +95,12 @@ public: return( classNodeName() ); } - inline track * getTrack( void ) + inline const track * getTrack( void ) { return( m_track ); } - inline levelObject * object( void ) + inline const levelObject * object( void ) { return( m_object ); } @@ -127,8 +133,7 @@ private: levelObject * m_object; timeMap m_time_map; bool m_update_first; - - void init( void ); + bool m_dynamic; } ; diff --git a/include/config_mgr.h b/include/config_mgr.h index 06e35d3f7..ec6346bf1 100644 --- a/include/config_mgr.h +++ b/include/config_mgr.h @@ -1,7 +1,7 @@ /* * config_mgr.h - class configManager, a class for managing LMMS-configuration * - * Copyright (c) 2005-2006 Tobias Doerffel + * Copyright (c) 2005-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -257,9 +257,6 @@ private: QHBoxLayout * m_mainLayout; QVBoxLayout * m_contentLayout; - - friend class engine; - } ; #endif diff --git a/include/custom_events.h b/include/custom_events.h new file mode 100644 index 000000000..ec732759c --- /dev/null +++ b/include/custom_events.h @@ -0,0 +1,52 @@ +/* + * custom_events.h - custom event types list + * + * Copyright (c) 2007 Javier Serrano Polo + * + * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + + +#ifndef _CUSTOM_EVENTS_H +#define _CUSTOM_EVENTS_H + + +#ifdef QT3 + +#include + +#endif + + + + +namespace customEvents +{ + + enum Type + { + GUI_UPDATE = QEvent::User + } ; + +} + + + + +#endif diff --git a/include/detuning_helper.h b/include/detuning_helper.h new file mode 100644 index 000000000..1fd174d9b --- /dev/null +++ b/include/detuning_helper.h @@ -0,0 +1,51 @@ +/* + * detuning_helper.h - detuning automation helper + * + * Copyright (c) 2007 Javier Serrano Polo + * + * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + + +#ifndef _DETUNING_HELPER_H +#define _DETUNING_HELPER_H + + +#include "shared_object.h" + + +class detuningHelper : public automatableObject, public sharedObject +{ +public: + detuningHelper( void ) : + autoObj( NULL ) + { + } + + virtual QString displayName( void ) const + { + return( automationEditor::tr( "Note detuning" ) ); + } + +} ; + + + + +#endif diff --git a/include/effect.h b/include/effect.h index 4a8bed25a..53236d695 100644 --- a/include/effect.h +++ b/include/effect.h @@ -31,21 +31,17 @@ #include #endif -#ifdef QT4 +#ifndef QT3 -#include #include #else -#include #include #endif -#include "qt3support.h" - #include "plugin.h" #include "mixer.h" @@ -157,21 +153,6 @@ public: m_bufferCount++; } - inline bool tryLock( void ) - { - return( m_processLock.tryLock() ); - } - - inline void lock( void ) - { - m_processLock.lock(); - } - - inline void unlock( void ) - { - m_processLock.unlock(); - } - inline bool dontRun( void ) { return( m_noRun ); @@ -208,7 +189,6 @@ private: float m_wetDry; float m_gate; - QMutex m_processLock; } ; diff --git a/include/effect_chain.h b/include/effect_chain.h index b3a870d80..25d8a29d1 100644 --- a/include/effect_chain.h +++ b/include/effect_chain.h @@ -25,16 +25,6 @@ #ifndef _EFFECT_CHAIN_H #define _EFFECT_CHAIN_H -#ifdef QT4 - -#include - -#else - -#include - -#endif - #include "qt3support.h" #include "effect.h" @@ -48,7 +38,7 @@ public: virtual ~effectChain(); void FASTCALL appendEffect( effect * _effect ); - void FASTCALL deleteEffect( effect * _effect ); + void FASTCALL removeEffect( effect * _effect ); void FASTCALL moveDown( effect * _effect ); void FASTCALL moveUp( effect * _effect ); bool FASTCALL processAudioBuffer( surroundSampleFrame * _buf, @@ -70,7 +60,6 @@ private: effect_list_t m_effects; bool m_bypassed; - QMutex m_processLock; } ; diff --git a/include/effect_control_dialog.h b/include/effect_control_dialog.h index 441648aa9..a65f6909d 100644 --- a/include/effect_control_dialog.h +++ b/include/effect_control_dialog.h @@ -2,7 +2,7 @@ * effect_control_dialog.h - base-class for effect-dialogs for displaying and * editing control port values * - * Copyright (c) 2006 Tobias Doerffel + * Copyright (c) 2006-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -26,7 +26,7 @@ #ifndef _EFFECT_CONTROL_DIALOG_H #define _EFFECT_CONTROL_DIALOG_H -#ifdef QT4 +#ifndef QT3 #include @@ -36,12 +36,10 @@ #endif -#include "qt3support.h" - #include "journalling_object.h" -#include "effect.h" +class effect; class track; diff --git a/include/effect_label.h b/include/effect_label.h index 46cdeb044..a003c044a 100644 --- a/include/effect_label.h +++ b/include/effect_label.h @@ -43,11 +43,11 @@ #endif #include "journalling_object.h" -#include "tab_widget.h" -#include "effect_tab_widget.h" +class effectTabWidget; class sampleTrack; +class tabWidget; class effectLabel: public QWidget, public journallingObject @@ -58,10 +58,7 @@ public: sampleTrack * _track ); virtual ~effectLabel(); - inline const QString & text( void ) - { - return( m_text ); - } + QString text( void ) const; void FASTCALL setText( const QString & _text ); virtual void FASTCALL saveSettings( QDomDocument & _doc, @@ -89,7 +86,6 @@ protected: private: sampleTrack * m_track; - QString m_text; bool m_show; QLabel * m_label; diff --git a/include/effect_tab_widget.h b/include/effect_tab_widget.h index 664654b2a..fdddb56e4 100644 --- a/include/effect_tab_widget.h +++ b/include/effect_tab_widget.h @@ -50,15 +50,14 @@ #endif #include "journalling_object.h" -#include "rack_plugin.h" -#include "rack_view.h" -#include "audio_port.h" -#include "track.h" -class instrumentTrack; -class sampleTrack; +class audioPort; class groupBox; +class instrumentTrack; +class rackView; +class sampleTrack; +class track; class effectTabWidget : public QWidget, public journallingObject @@ -99,8 +98,6 @@ private: QPushButton * m_addButton; rackView * m_rack; - - friend class instrumentTrack; } ; diff --git a/include/engine.h b/include/engine.h index 6e217f17f..f130fafc7 100644 --- a/include/engine.h +++ b/include/engine.h @@ -30,7 +30,7 @@ #include #endif -#ifdef QT4 +#ifndef QT3 #include diff --git a/include/envelope_and_lfo_widget.h b/include/envelope_and_lfo_widget.h index c10a974cd..7eb384374 100644 --- a/include/envelope_and_lfo_widget.h +++ b/include/envelope_and_lfo_widget.h @@ -103,15 +103,6 @@ public: return( "el" ); } - void lock( void ) - { - m_busyMutex.lock(); - } - void unlock( void ) - { - m_busyMutex.unlock(); - } - public slots: void updateSampleVars( void ); @@ -191,8 +182,6 @@ private: USER } m_lfoShape; - QMutex m_busyMutex; - sample_t lfoShapeSample( fpab_t _frame_offset ); void updateLFOShapeData( void ); diff --git a/include/envelope_tab_widget.h b/include/envelope_tab_widget.h index 6817efaf2..9c8da86e1 100644 --- a/include/envelope_tab_widget.h +++ b/include/envelope_tab_widget.h @@ -3,7 +3,7 @@ * provides UI- and DSP-code for using envelopes, LFOs * and a filter * - * Copyright (c) 2004-2006 Tobias Doerffel + * Copyright (c) 2004-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -41,22 +41,20 @@ #endif -#include "basic_filters.h" -#include "envelope_and_lfo_widget.h" +#include "mixer.h" class QLabel; class instrumentTrack; class comboBox; +class envelopeAndLFOWidget; class groupBox; class knob; class notePlayHandle; class pixmapButton; class tabWidget; -class flpImport; - class envelopeTabWidget : public QWidget, public journallingObject { diff --git a/include/fade_button.h b/include/fade_button.h index b001d09f6..2c672fbb1 100644 --- a/include/fade_button.h +++ b/include/fade_button.h @@ -1,7 +1,7 @@ /* * fade_button.h - declaration of class fadeButton * - * Copyright (c) 2005-2006 Tobias Doerffel + * Copyright (c) 2005-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -58,18 +58,21 @@ public slots: protected: +#ifndef QT3 + virtual void customEvent( QEvent * ); +#else + virtual void customEvent( QCustomEvent * ); +#endif virtual void paintEvent( QPaintEvent * _pe ); -private slots: - void nextState( void ); - - private: float m_state; QColor m_normalColor; QColor m_activatedColor; + void signalUpdate( void ); + } ; diff --git a/include/fifo_buffer.h b/include/fifo_buffer.h index 7aea1292d..c614d9afc 100644 --- a/include/fifo_buffer.h +++ b/include/fifo_buffer.h @@ -26,7 +26,7 @@ #define _FIFO_BUFFER_H -#ifdef QT4 +#ifndef QT3 #include diff --git a/include/instrument.h b/include/instrument.h index f29185cc1..c9d38056e 100644 --- a/include/instrument.h +++ b/include/instrument.h @@ -48,15 +48,15 @@ #endif -#include "engine.h" #include "plugin.h" -#include "mixer.h" // forward-declarations class instrumentTrack; class notePlayHandle; class midiEvent; +class midiTime; +class track; class instrument : public QWidget, public plugin @@ -104,13 +104,6 @@ public: return( FALSE ); } - // instrument-play-handles use this for checking whether they can mark - // themselves as done, so that mixer trashes them - inline virtual bool valid( void ) const - { - return( m_valid ); - } - inline virtual bool notePlayHandleBased( void ) const { return( TRUE ); @@ -129,25 +122,18 @@ public: static instrument * FASTCALL instantiate( const QString & _plugin_name, instrumentTrack * _channel_track ); + virtual bool isFromTrack( const track * _track ) const; + + protected: inline instrumentTrack * getInstrumentTrack( void ) const { return( m_instrumentTrack ); } - // instruments can use this for invalidating themselves, which is for - // example neccessary when being destroyed and having instrument-play- - // handles running - inline void invalidate( void ) - { - m_valid = FALSE; - engine::getMixer()->checkValidityOfPlayHandles(); - } - private: instrumentTrack * m_instrumentTrack; - bool m_valid; } ; diff --git a/include/instrument_play_handle.h b/include/instrument_play_handle.h index 78c082bc1..2cc274812 100644 --- a/include/instrument_play_handle.h +++ b/include/instrument_play_handle.h @@ -1,7 +1,7 @@ /* * instrument_play_handle.h - play-handle for playing an instrument * - * Copyright (c) 2005-2006 Tobias Doerffel + * Copyright (c) 2005-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -46,40 +46,27 @@ public: inline virtual void play( bool _try_parallelizing ) { - if( m_instrument != NULL ) - { - m_instrument->play( _try_parallelizing ); - } + m_instrument->play( _try_parallelizing ); } inline virtual bool done( void ) const { - return( m_instrument == NULL ); + return( FALSE ); } - inline virtual void checkValidity( void ) + virtual bool isFromTrack( const track * _track ) const { - if( m_instrument != NULL && !m_instrument->valid() ) - { - m_instrument = NULL; - } + return( m_instrument->isFromTrack( _track ) ); } inline virtual bool supportsParallelizing( void ) const { - if( m_instrument != NULL ) - { - return( m_instrument->supportsParallelizing() ); - } - return( FALSE ); + return( m_instrument->supportsParallelizing() ); } inline virtual void waitForWorkerThread( void ) { - if( m_instrument != NULL ) - { - m_instrument->waitForWorkerThread(); - } + m_instrument->waitForWorkerThread(); } diff --git a/include/instrument_track.h b/include/instrument_track.h index 431d3b5ac..385082871 100644 --- a/include/instrument_track.h +++ b/include/instrument_track.h @@ -34,31 +34,28 @@ #include #include #include -#include #else #include #include #include -#include #endif -#include "track.h" -#include "mixer.h" #include "midi_event_processor.h" -#include "gui_templates.h" +#include "mixer.h" #include "tab_widget.h" -#include "volume_knob.h" -#include "instrument.h" +#include "track.h" class QLineEdit; class arpAndChordsTabWidget; class audioPort; -class instrumentTrackButton; +class effectTabWidget; class envelopeTabWidget; class fadeButton; +class instrument; +class instrumentTrackButton; class lcdSpinBox; class midiPort; class midiTabWidget; @@ -66,8 +63,7 @@ class notePlayHandle; class pianoWidget; class presetPreviewPlayHandle; class surroundArea; -class flpImport; -class effectTabWidget; +class volumeKnob; class instrumentTrack : public QWidget, public track, public midiEventProcessor @@ -94,10 +90,6 @@ public: const midiTime & _time ); - // returns the frequency of a given tone & octave. - // This function also includes base_tone & base_octave in - // its calculations - float FASTCALL frequency( notePlayHandle * _n ) const; f_cnt_t FASTCALL beatLen( notePlayHandle * _n ) const; @@ -187,7 +179,6 @@ public slots: signals: - void baseNoteChanged( void ); void noteDone( const note & _n ); @@ -225,8 +216,6 @@ private: notePlayHandle * m_notes[NOTES_PER_OCTAVE * OCTAVES]; - QMutex m_notesMutex; - tones m_baseTone; octaves m_baseOctave; diff --git a/include/knob.h b/include/knob.h index 91a5a1c09..075eec18e 100644 --- a/include/knob.h +++ b/include/knob.h @@ -96,7 +96,7 @@ public slots: signals: void valueChanged( float value ); - void valueChanged( const QVariant & _data ); + void valueChanged( void ); void sliderPressed( void ); void sliderReleased( void ); void sliderMoved( float value ); diff --git a/include/level_object.h b/include/level_object.h index 524079f34..f68b0d460 100644 --- a/include/level_object.h +++ b/include/level_object.h @@ -1,7 +1,7 @@ /* * level_object.h - declaration of class levelObject * - * Copyright (c) 2006 Javier Serrano Polo + * Copyright (c) 2006-2007 Javier Serrano Polo * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -26,8 +26,6 @@ #ifndef _LEVEL_OBJECT_H #define _LEVEL_OBJECT_H -#include "midi_time.h" - @@ -50,9 +48,14 @@ public: virtual void setLevel( int _level ) = 0; - virtual QString levelToLabel( int _level ) = 0; + virtual QString levelToLabel( int _level ) const = 0; virtual int labelToLevel( QString _label ) = 0; + virtual QString displayName( void ) const + { + return( NULL ); + } + protected: int m_minLevel; diff --git a/include/main_window.h b/include/main_window.h index 734cf3cd0..89e14a966 100644 --- a/include/main_window.h +++ b/include/main_window.h @@ -48,9 +48,6 @@ #endif -#include "types.h" - - class QDomElement; class QGridLayout; class QSplashScreen; diff --git a/include/meter_dialog.h b/include/meter_dialog.h index 89abfae96..4015cb4eb 100644 --- a/include/meter_dialog.h +++ b/include/meter_dialog.h @@ -1,7 +1,7 @@ /* - * meter_dialog.h - diloag for entering meter settings + * meter_dialog.h - dialog for entering meter settings * - * Copyright (c) 2006 Danny McRae + * Copyright (c) 2006-2007 Danny McRae * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -25,7 +25,7 @@ #ifndef _METER_DIALOG_H #define _METER_DIALOG_H -#ifdef QT4 +#ifndef QT3 #include @@ -36,11 +36,10 @@ #endif -#include "track.h" #include "lcd_spinbox.h" -class meterDialog: public QWidget +class meterDialog : public QWidget { Q_OBJECT public: diff --git a/include/midi_client.h b/include/midi_client.h index 5a496e31d..f23258e8b 100644 --- a/include/midi_client.h +++ b/include/midi_client.h @@ -130,6 +130,14 @@ public: virtual void saveSettings( void ) = 0; + + public slots: + virtual void show( void ) + { + parentWidget()->show(); + QWidget::show(); + } + } ; diff --git a/include/midi_dummy.h b/include/midi_dummy.h index 316bb5808..aeca5230e 100644 --- a/include/midi_dummy.h +++ b/include/midi_dummy.h @@ -28,8 +28,6 @@ #include "midi_client.h" -#include "midi_port.h" -#include "tab_widget.h" class midiDummy : public midiClientRaw @@ -65,6 +63,14 @@ public: { } + + public slots: + virtual void show( void ) + { + parentWidget()->hide(); + QWidget::show(); + } + } ; diff --git a/include/midi_event_processor.h b/include/midi_event_processor.h index a090ced1c..1db3959f0 100644 --- a/include/midi_event_processor.h +++ b/include/midi_event_processor.h @@ -1,7 +1,7 @@ /* * midi_event_processor.h - base-class for midi-processing classes * - * Copyright (c) 2005 Tobias Doerffel + * Copyright (c) 2005-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -31,10 +31,8 @@ #endif -#include "midi_time.h" - - class midiEvent; +class midiTime; // all classes being able to process MIDI-events should inherit from this diff --git a/include/midi_port.h b/include/midi_port.h index 727550eaa..aa9b2e167 100644 --- a/include/midi_port.h +++ b/include/midi_port.h @@ -2,7 +2,7 @@ * midi_port.h - abstraction of MIDI-ports which are part of LMMS's MIDI- * sequencing system * - * Copyright (c) 2005-2006 Tobias Doerffel + * Copyright (c) 2005-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -46,11 +46,11 @@ #include "types.h" #include "midi.h" -#include "midi_time.h" class midiClient; class midiEventProcessor; +class midiTime; // class for abstraction of MIDI-port diff --git a/include/mixer.h b/include/mixer.h index f52152f1e..ba480de87 100644 --- a/include/mixer.h +++ b/include/mixer.h @@ -49,11 +49,8 @@ #include "types.h" -#include "volume.h" -#include "panning.h" #include "note.h" #include "play_handle.h" -#include "effect_board.h" #include "fifo_buffer.h" @@ -113,7 +110,7 @@ class mixer : public QObject Q_OBJECT public: void initDevices( void ); - void FASTCALL clear( const bool _everything = FALSE ); + void FASTCALL clear( void ); // audio-device-stuff @@ -133,9 +130,9 @@ public: // audio-port-stuff inline void addAudioPort( audioPort * _port ) { - pause(); + lock(); m_audioPorts.push_back( _port ); - play(); + unlock(); } inline void removeAudioPort( audioPort * _port ) @@ -179,21 +176,16 @@ public: m_playHandlesToRemove.push_back( _ph ); } - inline const playHandleVector & playHandles( void ) const - { - return( m_playHandles ); - } - inline playHandleVector & playHandles( void ) { return( m_playHandles ); } - void checkValidityOfPlayHandles( void ); + void removePlayHandles( track * _track ); - inline bool haveNoRunningNotes( void ) const + inline bool hasPlayHandles( void ) const { - return( m_playHandles.size() == 0 ); + return( !m_playHandles.empty() ); } @@ -251,23 +243,15 @@ public: } - // methods for controlling mixer-state - void pause( void ) + // methods needed by other threads to alter knob values, waveforms, etc + void lock( void ) { - if( m_mixMutexLockLevel == 0 ) - { - m_mixMutex.lock(); - } - ++m_mixMutexLockLevel; + m_mixMutex.lock(); } - void play( void ) + void unlock( void ) { - if( m_mixMutexLockLevel == 1 ) - { - m_mixMutex.unlock(); - } - --m_mixMutexLockLevel; + m_mixMutex.unlock(); } @@ -331,13 +315,6 @@ private: void stopProcessing( void ); - // we don't allow to create mixer by using copy-ctor - mixer( const mixer & ) - { - } - - - audioDevice * tryAudioDevices( void ); midiClient * tryMIDIClients( void ); @@ -389,7 +366,6 @@ private: QMutex m_mixMutex; - Uint8 m_mixMutexLockLevel; fifo * m_fifo; @@ -397,7 +373,6 @@ private: friend class engine; - friend class fifoWriter; } ; diff --git a/include/mmp.h b/include/mmp.h index 819284575..497b442b2 100644 --- a/include/mmp.h +++ b/include/mmp.h @@ -1,7 +1,7 @@ /* * mmp.h - class for reading and writing multimedia-project-files * - * Copyright (c) 2004-2006 Tobias Doerffel + * Copyright (c) 2004-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -62,7 +62,8 @@ public: multimediaProject( const QString & _in_file_name, - bool _is_filename = TRUE ); + bool _is_filename = TRUE, + bool _upgrade = TRUE ); multimediaProject( projectTypes _project_type ); ~multimediaProject(); @@ -92,6 +93,8 @@ private: void cleanMetaNodes( QDomElement _de ); + void upgrade( void ); + struct typeDescStruct { diff --git a/include/note.h b/include/note.h index 5b72c0fe2..01c9ea6e3 100644 --- a/include/note.h +++ b/include/note.h @@ -48,6 +48,9 @@ #include "midi_time.h" #include "journalling_object.h" +class detuningHelper; + + enum tones { C = 0, @@ -88,8 +91,6 @@ const int NOTES_PER_OCTAVE = WHITE_KEYS_PER_OCTAVE + BLACK_KEYS_PER_OCTAVE; const int OCTAVES = MAX_OCTAVE+1; const int NOTES = OCTAVES*NOTES_PER_OCTAVE; -class knob; - class note : public journallingObject @@ -101,7 +102,7 @@ public: octaves _octave = DEFAULT_OCTAVE, volume _volume = DEFAULT_VOLUME, panning _panning = DEFAULT_PANNING, - knob * _detuning = NULL ) FASTCALL; + detuningHelper * _detuning = NULL ) FASTCALL; note( const note & _note ); virtual ~note(); @@ -168,7 +169,7 @@ public: static midiTime FASTCALL quantized( const midiTime & _m, const int _q_grid ); - knob * detuning( void ) const + detuningHelper * detuning( void ) const { return( m_detuning ); } @@ -204,10 +205,9 @@ private: panning m_panning; midiTime m_length; midiTime m_pos; - knob * m_detuning; + detuningHelper * m_detuning; void createDetuning( void ); - void FASTCALL setDetuning( knob * _detuning ); } ; diff --git a/include/note_play_handle.h b/include/note_play_handle.h index e5c69b5d0..6543d5f13 100644 --- a/include/note_play_handle.h +++ b/include/note_play_handle.h @@ -27,12 +27,11 @@ #ifndef _NOTE_PLAY_HANDLE_H #define _NOTE_PLAY_HANDLE_H -#include - #include "play_handle.h" #include "basic_filters.h" #include "bb_track.h" #include "note.h" +#include "instrument.h" #include "instrument_track.h" @@ -42,32 +41,36 @@ typedef vvector notePlayHandleVector; typedef vvector constNotePlayHandleVector; -class notePlayHandle : public QObject, public playHandle, public note +class notePlayHandle : public playHandle, public note { - Q_OBJECT public: void * m_pluginData; basicFilters<> * m_filter; - float m_frequency; - notePlayHandle( instrumentTrack * _chnl_trk, const f_cnt_t _frames_ahead, const f_cnt_t _frames, const note & _n, + notePlayHandle * _parent = NULL, const bool _arp_note = FALSE ); virtual ~notePlayHandle(); + const float & frequency( void ) + { + return( m_frequency ); + } + + void updateFrequency( void ); + virtual void play( bool _try_parallelizing ); virtual inline bool done( void ) const { return( ( m_released && m_framesBeforeRelease == 0 && - m_releaseFramesDone >= m_releaseFramesToDo ) || - m_instrumentTrack == NULL ); + m_releaseFramesDone >= m_releaseFramesToDo ) ); } - virtual void checkValidity( void ); + virtual bool isFromTrack( const track * _track ) const; void FASTCALL noteOff( const f_cnt_t _s = 0 ); @@ -114,17 +117,6 @@ public: // returns volume-level at frame _frame (envelope/LFO) float FASTCALL volumeLevel( const f_cnt_t _frame ); - // adds note-play-handle _n as subnote - inline void addSubNote( notePlayHandle * _n ) - { - m_subNotes.push_back( _n ); - _n->m_baseNote = FALSE; - // if there was an arp-note added and this note is a base-note - // we set arp-note-flag for indicating that this note is an - // arpeggio-base-note - m_arpNote = _n->arpNote() && baseNote(); - } - // returns instrument-track this note-play-handle plays inline instrumentTrack * getInstrumentTrack( void ) { @@ -182,15 +174,11 @@ public: { m_bbTrack = _bb_track; } - void setBBTrackFrom( notePlayHandle * _handle ) - { - m_bbTrack = _handle->m_bbTrack; - } virtual bool supportsParallelizing( void ) const { - return( m_instrumentTrack->m_instrument-> + return( m_instrumentTrack->getInstrument()-> supportsParallelizing() && // we must not parallelize note-play-handles, which @@ -198,7 +186,7 @@ public: // handle-driven, because then waitForWorkerThread() // would be additionally called for each // note-play-handle which results in hangups - m_instrumentTrack->m_instrument-> + m_instrumentTrack->getInstrument()-> notePlayHandleBased() ); } @@ -224,6 +212,32 @@ public: private: + class baseDetuning + { + public: + baseDetuning( detuningHelper * _detuning ); + + int level( void ) + { + return( m_level ); + } + + void setLevel( int _level ); + + float value( void ) + { + return( m_value ); + } + + + private: + int m_level; + float m_value; + detuningHelper * m_detuning; + + } ; + + instrumentTrack * m_instrumentTrack; // needed for calling // instrumentTrack::playNote f_cnt_t m_frames; // total frames to play @@ -255,9 +269,9 @@ private: bpm_t m_orig_bpm; // original bpm f_cnt_t m_orig_frames; // original m_frames + float m_frequency; -private slots: - void updateFrequency( void ); + baseDetuning * m_base_detuning; } ; diff --git a/include/oscillator.h b/include/oscillator.h index dc3030aae..41707ab98 100644 --- a/include/oscillator.h +++ b/include/oscillator.h @@ -60,19 +60,19 @@ public: PHASE_MODULATION, AMP_MODULATION, MIX, SYNC, FREQ_MODULATION } ; - oscillator( const waveShapes * _wave_shape, - const modulationAlgos * _modulation_algo, - const float * _freq, - const float * _detuning, - const float * _phase_offset, - const float * _volume, + oscillator( const waveShapes & _wave_shape, + const modulationAlgos & _modulation_algo, + const float & _freq, + const float & _detuning, + const float & _phase_offset, + const float & _volume, oscillator * _m_subOsc = NULL ) FASTCALL; virtual ~oscillator() { delete m_subOsc; } - inline void setUserWave( sampleBuffer * _wave ) + inline void setUserWave( const sampleBuffer * _wave ) { m_userWave = _wave; } @@ -154,16 +154,16 @@ public: private: - const waveShapes * m_waveShape; - const modulationAlgos * m_modulationAlgo; - const float * m_freq; - const float * m_detuning; - const float * m_volume; - const float * m_ext_phaseOffset; + const waveShapes & m_waveShape; + const modulationAlgos & m_modulationAlgo; + const float & m_freq; + const float & m_detuning; + const float & m_volume; + const float & m_ext_phaseOffset; oscillator * m_subOsc; float m_phaseOffset; float m_phase; - sampleBuffer * m_userWave; + const sampleBuffer * m_userWave; void updateNoSub( sampleFrame * _ab, const fpab_t _frames, diff --git a/include/pattern.h b/include/pattern.h index ff68855a3..a7f9de486 100644 --- a/include/pattern.h +++ b/include/pattern.h @@ -33,7 +33,6 @@ #include #include -#include #include #include #include @@ -42,7 +41,6 @@ #include #include -#include #include #include #include @@ -52,7 +50,6 @@ #include "note.h" #include "track.h" -#include "mixer.h" class QAction; @@ -97,15 +94,11 @@ public: void clearNotes( void ); - inline noteVector & notes( void ) + inline const noteVector & notes( void ) { return( m_notes ); } - note * FASTCALL noteAt( int _note_num ); - - void FASTCALL setNoteAt( int _note_num, note _new_note ); - // pattern-type stuff inline patternTypes type( void ) const { @@ -219,7 +212,6 @@ private: int m_steps; // pattern freezing - QMutex m_frozenPatternMutex; sampleBuffer * m_frozenPattern; bool m_freezing; volatile bool m_freezeAborted; diff --git a/include/piano_roll.h b/include/piano_roll.h index 93ef48871..510261239 100644 --- a/include/piano_roll.h +++ b/include/piano_roll.h @@ -33,13 +33,11 @@ #include #include -#include #else #include #include -#include #endif @@ -178,7 +176,7 @@ private: midiTime newNoteLen( void ) const; - void updatePaintPixmap( void ); + void updatePaintPixmap( QPixmap & _p ); static QPixmap * s_whiteKeyBigPm; @@ -212,8 +210,6 @@ private: comboBox * m_quantizeComboBox; comboBox * m_noteLenComboBox; - QPixmap m_paintPixmap; - pattern * m_pattern; QScrollBar * m_leftRightScroll; @@ -256,7 +252,7 @@ private: void drawDetuningInfo( QPainter & _p, note * _n, Uint16 _x, Uint16 _y ); bool mouseOverNote( void ); note * noteUnderMouse( void ); - noteVector::iterator noteIteratorUnderMouse( void ); + noteVector::const_iterator noteIteratorUnderMouse( void ); diff --git a/include/piano_widget.h b/include/piano_widget.h index b105317ff..0831cc8b8 100644 --- a/include/piano_widget.h +++ b/include/piano_widget.h @@ -2,7 +2,7 @@ * piano_widget.h - declaration of class pianoWidget, a widget which provides * an interactive piano/keyboard-widget * - * Copyright (c) 2004-2006 Tobias Doerffel + * Copyright (c) 2004-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -44,12 +44,11 @@ #endif -#include "knob.h" #include "note.h" -#include "templates.h" class instrumentTrack; +class knob; class notePlayHandle; @@ -67,12 +66,7 @@ public: pianoWidget( instrumentTrack * _channel_track ); virtual ~pianoWidget(); - inline void setKeyState( int _key, bool _on = FALSE ) - { - m_pressedKeys[tLimit( _key, 0, NOTES_PER_OCTAVE * - OCTAVES -1 )] = _on; - update(); - } + void setKeyState( int _key, bool _on = FALSE ); virtual void saveSettings( QDomDocument & _doc, QDomElement & _this, const QString & _name ); @@ -87,6 +81,11 @@ public: protected: virtual void contextMenuEvent( QContextMenuEvent * _me ); +#ifndef QT3 + virtual void customEvent( QEvent * ); +#else + virtual void customEvent( QCustomEvent * ); +#endif virtual void paintEvent( QPaintEvent * ); virtual void mousePressEvent( QMouseEvent * me ); virtual void mouseReleaseEvent( QMouseEvent * me ); diff --git a/include/play_handle.h b/include/play_handle.h index c2ce57ee4..3f7988e7f 100644 --- a/include/play_handle.h +++ b/include/play_handle.h @@ -2,7 +2,7 @@ * play_handle.h - base-class playHandle which is needed by * LMMS-Player-Engine * - * Copyright (c) 2004-2006 Tobias Doerffel + * Copyright (c) 2004-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -44,6 +44,9 @@ #endif +class track; + + class playHandle { public: @@ -72,14 +75,7 @@ public: virtual void play( bool _try_parallelizing = FALSE ) = 0; virtual bool done( void ) const = 0; - // play-handles can invalidate themselves if an object they depend on - // is going to be deleted or things like that - every of those objects - // has to call mixer::inst()->checkValidityOfPlayHandles() in it's dtor - // and set flag before, so LMMS doesn't crash because these play-handles - // would continue using pointers to deleted objects... - virtual void checkValidity( void ) - { - } + virtual bool isFromTrack( const track * _track ) const = 0; virtual bool supportsParallelizing( void ) const { diff --git a/include/plugin.h b/include/plugin.h index e8e8b262d..ae2cb6f31 100644 --- a/include/plugin.h +++ b/include/plugin.h @@ -46,9 +46,7 @@ #endif -#include "types.h" #include "journalling_object.h" -#include "embed.h" #include "base64.h" diff --git a/include/preset_preview_play_handle.h b/include/preset_preview_play_handle.h index 049c70f60..928518eec 100644 --- a/include/preset_preview_play_handle.h +++ b/include/preset_preview_play_handle.h @@ -34,7 +34,6 @@ class instrumentTrack; -class notePlayHandle; class previewTrackContainer; @@ -47,6 +46,8 @@ public: virtual void play( bool _try_parallelizing ); virtual bool done( void ) const; + virtual bool isFromTrack( const track * _track ) const; + static void cleanUp( void ); static constNotePlayHandleVector nphsOfInstrumentTrack( const instrumentTrack * _ct ); diff --git a/include/project_version.h b/include/project_version.h new file mode 100644 index 000000000..00de70448 --- /dev/null +++ b/include/project_version.h @@ -0,0 +1,67 @@ +/* + * project_version.h - version compared in import upgrades + * + * Copyright (c) 2007 Javier Serrano Polo + * + * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + + +#ifndef _PROJECT_VERSION_H +#define _PROJECT_VERSION_H + + +#ifndef QT3 + +#include + +#else + +#include + +#endif + + + + +class projectVersion : public QString +{ +public: + projectVersion( const QString & _s ) : + QString( _s ) + { + } + + static int compare( const projectVersion & _v1, + const projectVersion & _v2 ); + +} ; + + + + +inline bool operator<( const projectVersion & _v1, const char * _str ) +{ + return( projectVersion::compare( _v1, projectVersion( _str ) ) < 0 ); +} + + + + +#endif diff --git a/include/qt3support.h b/include/qt3support.h index 8687ef92f..6e10b26c9 100644 --- a/include/qt3support.h +++ b/include/qt3support.h @@ -1,7 +1,7 @@ /* * qt3support.h - layer for supporting Qt3 * - * Copyright (c) 2005-2006 Tobias Doerffel + * Copyright (c) 2005-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -26,9 +26,6 @@ #ifndef _QT3SUPPORT_H #define _QT3SUPPORT_H -// don't know why following line is neccessary, it's a bug in qt-headers - -// otherwise LMMS sometimes fails to compile -//#include #include #include diff --git a/include/rack_plugin.h b/include/rack_plugin.h index fa7f981c8..7cef2057f 100644 --- a/include/rack_plugin.h +++ b/include/rack_plugin.h @@ -2,7 +2,7 @@ * rack_plugin.h - tab-widget in channel-track-window for setting up * effects * - * Copyright (c) 2006 Danny McRae + * Copyright (c) 2006-2007 Danny McRae * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -25,7 +25,7 @@ #ifndef _RACK_PLUGIN_H #define _RACK_PLUGIN_H -#ifdef QT4 +#ifndef QT3 #include #include @@ -43,14 +43,15 @@ #include "journalling_object.h" -#include "led_checkbox.h" -#include "track.h" -#include "audio_port.h" -class knob; -class tempoSyncKnob; +class audioPort; +class effect; class effectControlDialog; +class knob; +class ledCheckBox; +class tempoSyncKnob; +class track; class rackPlugin: public QWidget, public journallingObject @@ -108,7 +109,6 @@ private: effectControlDialog * m_controlView; track * m_track; audioPort * m_port; - QMenu * m_contextMenu; bool m_show; } ; diff --git a/include/rack_view.h b/include/rack_view.h index 6e600ba6d..d6bc252bc 100644 --- a/include/rack_view.h +++ b/include/rack_view.h @@ -46,9 +46,12 @@ #include "types.h" #include "journalling_object.h" -#include "rack_plugin.h" -#include "track.h" -#include "audio_port.h" + + +class audioPort; +class effect; +class rackPlugin; +class track; class rackView: public QWidget, public journallingObject diff --git a/include/sample_buffer.h b/include/sample_buffer.h index db1d509f9..cd58aae41 100644 --- a/include/sample_buffer.h +++ b/include/sample_buffer.h @@ -31,12 +31,10 @@ #ifdef QT4 #include -#include #else #include -#include #endif @@ -195,7 +193,7 @@ public: void normalize_sample_rate( const sample_rate_t _src_sr, bool _keep_settings = FALSE ); - inline sample_t userWaveSample( const float _sample ) + inline sample_t userWaveSample( const float _sample ) const { // Precise implementation // const float frame = fraction( _sample ) * m_frames; @@ -216,15 +214,6 @@ public: return( m_data[f1][0] ); } - void lock( void ) - { - m_dataMutex.lock(); - } - void unlock( void ) - { - m_dataMutex.unlock(); - } - static QString tryToMakeRelative( const QString & _file ); static QString tryToMakeAbsolute( const QString & _file ); @@ -274,7 +263,6 @@ private: bool m_reversed; float m_frequency; sample_rate_t m_sample_rate; - QMutex m_dataMutex; #ifdef HAVE_SAMPLERATE_H void initResampling( void ); diff --git a/include/sample_play_handle.h b/include/sample_play_handle.h index f8a95abeb..b25b18e13 100644 --- a/include/sample_play_handle.h +++ b/include/sample_play_handle.h @@ -30,7 +30,6 @@ #include "play_handle.h" #include "sample_buffer.h" -#include "types.h" class bbTrack; class pattern; @@ -53,6 +52,8 @@ public: void play( const fpab_t _frame_base, bool _try_parallelizing ); virtual bool done( void ) const; + virtual bool isFromTrack( const track * _track ) const; + f_cnt_t totalFrames( void ) const; inline f_cnt_t framesDone( void ) const { diff --git a/include/sample_track.h b/include/sample_track.h index d30f93da2..dc2a6071a 100644 --- a/include/sample_track.h +++ b/include/sample_track.h @@ -2,7 +2,7 @@ * sample_track.h - class sampleTrack, a track which provides arrangement of * samples * - * Copyright (c) 2005-2006 Tobias Doerffel + * Copyright (c) 2005-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -41,12 +41,12 @@ #include "track.h" -#include "sample_buffer.h" -#include "volume_knob.h" -class effectLabel; -class audioPort; class QLabel; +class audioPort; +class effectLabel; +class sampleBuffer; +class volumeKnob; //class sampleTCOSettingsDialog; diff --git a/include/shared_object.h b/include/shared_object.h index d3c27c70c..d0d45a230 100644 --- a/include/shared_object.h +++ b/include/shared_object.h @@ -1,7 +1,7 @@ /* - * shared_object.h - class sharedObject for use among threads + * shared_object.h - class sharedObject for use among other objects * - * Copyright (c) 2006 Javier Serrano Polo + * Copyright (c) 2006-2007 Javier Serrano Polo * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -26,16 +26,6 @@ #ifndef _SHARED_OBJECT_H #define _SHARED_OBJECT_H -#ifdef QT4 - -#include - -#else - -#include - -#endif - @@ -51,18 +41,14 @@ public: static T * ref( T * _object ) { // TODO: Use QShared - _object->m_reference_mutex.lock(); ++_object->m_reference_count; - _object->m_reference_mutex.unlock(); return( _object ); } template static void unref( T * _object ) { - _object->m_reference_mutex.lock(); bool delete_object = --_object->m_reference_count == 0; - _object->m_reference_mutex.unlock(); if ( delete_object ) { delete _object; @@ -72,7 +58,6 @@ public: private: unsigned m_reference_count; - QMutex m_reference_mutex; } ; diff --git a/include/side_bar.h b/include/side_bar.h index 952e38811..9ff0b1fd6 100644 --- a/include/side_bar.h +++ b/include/side_bar.h @@ -1,7 +1,7 @@ /* * side_bar.h - code for side-bar in 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 * @@ -40,7 +40,6 @@ #include "kmultitabbar.h" -#include "side_bar_widget.h" class sideBar : public KMultiTabBar diff --git a/include/song_editor.h b/include/song_editor.h index 5184193db..969b72d71 100644 --- a/include/song_editor.h +++ b/include/song_editor.h @@ -293,8 +293,6 @@ private: track * m_automation_track; - bool m_destroyed; - enum ACTIONS diff --git a/include/surround_area.h b/include/surround_area.h index 319b1abb7..2feafe36a 100644 --- a/include/surround_area.h +++ b/include/surround_area.h @@ -41,13 +41,13 @@ #endif -#include "knob.h" -#include "types.h" #include "mixer.h" -#include "templates.h" class QPixmap; +class knob; +class track; + const int SURROUND_AREA_SIZE = 1024; diff --git a/include/tempo_sync_knob.h b/include/tempo_sync_knob.h index bb01a7b1c..01465698e 100644 --- a/include/tempo_sync_knob.h +++ b/include/tempo_sync_knob.h @@ -26,7 +26,7 @@ #ifndef _TEMPO_SYNC_KNOB_H #define _TEMPO_SYNC_KNOB_H -#ifdef QT4 +#ifndef QT3 #include @@ -37,11 +37,10 @@ #endif #include "knob.h" -#include "types.h" -#include "meter_dialog.h" class QAction; +class meterDialog; class tempoSyncKnob : public knob diff --git a/include/tool.h b/include/tool.h index 5c87625a2..3fcd5ccf8 100644 --- a/include/tool.h +++ b/include/tool.h @@ -1,7 +1,7 @@ /* * tool.h - declaration of class tool, standard interface for all tool plugins * - * Copyright (c) 2006 Javier Serrano Polo + * Copyright (c) 2006-2007 Javier Serrano Polo * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -27,7 +27,7 @@ #define _TOOL_H -#ifdef QT4 +#ifndef QT3 #include diff --git a/include/track.h b/include/track.h index 3cc78915b..e2552a8a6 100644 --- a/include/track.h +++ b/include/track.h @@ -268,7 +268,6 @@ private slots: void disableAutomation( void ); void enableAutomation( void ); void removeTrack( void ); - void removeTrackTimer( void ); void muteBtnRightClicked( void ); void updateMenu( void ); @@ -403,7 +402,6 @@ public: SAMPLE_TRACK, EVENT_TRACK, VIDEO_TRACK, - NULL_TRACK, AUTOMATION_TRACK, TOTAL_TRACK_TYPES } ; @@ -412,9 +410,9 @@ public: virtual ~track(); static track * FASTCALL create( trackTypes _tt, trackContainer * _tc ); - static track * FASTCALL create( const QDomElement & _this, + static void FASTCALL create( const QDomElement & _this, trackContainer * _tc ); - static track * FASTCALL clone( track * _track ); + void FASTCALL clone( void ); tact length( void ) const; @@ -467,7 +465,7 @@ public: return( m_trackWidget ); } - inline trackContainer * getTrackContainer( void ) + inline trackContainer * getTrackContainer( void ) const { return( m_trackContainer ); } diff --git a/include/track_container.h b/include/track_container.h index 89d839ba1..eae126a74 100644 --- a/include/track_container.h +++ b/include/track_container.h @@ -46,7 +46,6 @@ #include "track.h" #include "journalling_object.h" -#include "rubberband.h" @@ -96,7 +95,6 @@ public: virtual void updateAfterTrackAdd( void ); void FASTCALL setPixelsPerTact( Uint16 _ppt ); - void FASTCALL cloneTrack( track * _track ); void FASTCALL addTrack( track * _track ); void FASTCALL removeTrack( track * _track ); void FASTCALL moveTrackUp( track * _track ); @@ -190,9 +188,6 @@ private: QPoint m_origin; - friend class scrollArea; - - signals: void positionChanged( const midiTime & _pos ); diff --git a/include/update_event.h b/include/update_event.h new file mode 100644 index 000000000..f16250ad7 --- /dev/null +++ b/include/update_event.h @@ -0,0 +1,56 @@ +/* + * update_event.h - signal GUI updates + * + * Copyright (c) 2007 Javier Serrano Polo + * + * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + + +#ifndef _UPDATE_EVENT_H +#define _UPDATE_EVENT_H + + +#include "custom_events.h" + + + + +#ifndef QT3 +class updateEvent : public QEvent +#else +class updateEvent : public QCustomEvent +#endif +{ +public: + updateEvent( void ) : +#ifndef QT3 + QEvent( (QEvent::Type)customEvents::GUI_UPDATE ) +#else + QCustomEvent( customEvents::GUI_UPDATE ) +#endif + { + } + +} ; + + + + +#endif diff --git a/include/volume_knob.h b/include/volume_knob.h index 93fb36a85..bd4d1093e 100644 --- a/include/volume_knob.h +++ b/include/volume_knob.h @@ -26,21 +26,11 @@ #ifndef _VOLUME_KNOB_H #define _VOLUME_KNOB_H -#ifdef QT4 -#include - -#else - -#include - -#endif - -#include "types.h" #include "knob.h" -class volumeKnob: public knob +class volumeKnob : public knob { Q_OBJECT public: @@ -57,6 +47,7 @@ protected: virtual void mousePressEvent( QMouseEvent * _me ); virtual void mouseMoveEvent( QMouseEvent * _me ); virtual void wheelEvent( QWheelEvent * _we ); + } ; #endif