From 0edae2d9e7753085a7b65d2f914539b508cdd289 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Tue, 4 Mar 2008 11:30:19 +0000 Subject: [PATCH] reduced dependencies from automatable_model_templates.h and fixed according compiler-warnings git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@767 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 52 +++++++++++++++++++++++- include/automatable_model.h | 6 +-- include/graph.h | 2 +- include/surround_area.h | 13 ++---- src/audio/audio_alsa.cpp | 1 - src/audio/audio_file_device.cpp | 1 - src/audio/audio_jack.cpp | 1 - src/audio/audio_oss.cpp | 1 - src/audio/audio_port.cpp | 1 - src/core/automation_editor.cpp | 1 - src/core/effect.cpp | 1 - src/core/effect_control_dialog.cpp | 1 - src/core/effect_select_dialog.cpp | 1 - src/core/envelope_and_lfo_parameters.cpp | 1 - src/core/import_filter.cpp | 1 - src/core/instrument.cpp | 1 - src/core/instrument_midi_io.cpp | 1 - src/core/main.cpp | 1 - src/core/meter_dialog.cpp | 3 +- src/core/mixer.cpp | 1 - src/core/preset_preview_play_handle.cpp | 3 +- src/core/sample_play_handle.cpp | 1 - src/core/setup_dialog.cpp | 1 - src/core/surround_area.cpp | 11 +++++ src/core/timeline.cpp | 1 - src/core/track.cpp | 1 + src/core/track_container.cpp | 1 - src/lib/mmp.cpp | 1 - src/lib/oscillator.cpp | 3 +- src/lib/project_journal.cpp | 1 - src/midi/midi_alsa_seq.cpp | 1 - src/tracks/automation_track.cpp | 1 - src/tracks/bb_track.cpp | 2 +- src/tracks/instrument_track.cpp | 1 - src/widgets/envelope_and_lfo_view.cpp | 1 - src/widgets/graph.cpp | 6 +-- src/widgets/group_box.cpp | 1 - src/widgets/instrument_midi_io_view.cpp | 1 - src/widgets/ladspa_control_view.cpp | 1 - src/widgets/lcd_spinbox.cpp | 2 - src/widgets/volume_knob.cpp | 1 - 41 files changed, 77 insertions(+), 56 deletions(-) diff --git a/ChangeLog b/ChangeLog index 550f9e600..dcc577ea7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,53 @@ +2008-03-04 Tobias Doerffel + + * src/widgets/graph.cpp: + fixed compiler-warnings + + * include/automatable_model.h: + * include/graph.h: + * include/surround_area.h: + * src/audio/audio_file_device.cpp: + * src/audio/audio_alsa.cpp: + * src/audio/audio_oss.cpp: + * src/audio/audio_port.cpp: + * src/audio/audio_jack.cpp: + * src/midi/midi_alsa_seq.cpp: + * src/lib/project_journal.cpp: + * src/lib/mmp.cpp: + * src/lib/oscillator.cpp: + * src/widgets/ladspa_control_view.cpp: + * src/widgets/envelope_and_lfo_view.cpp: + * src/widgets/instrument_midi_io_view.cpp: + * src/widgets/lcd_spinbox.cpp: + * src/widgets/group_box.cpp: + * src/widgets/volume_knob.cpp: + * src/tracks/automation_track.cpp: + * src/tracks/bb_track.cpp: + * src/tracks/instrument_track.cpp: + * src/core/preset_preview_play_handle.cpp: + * src/core/track_container.cpp: + * src/core/effect_control_dialog.cpp: + * src/core/import_filter.cpp: + * src/core/setup_dialog.cpp: + * src/core/sample_play_handle.cpp: + * src/core/envelope_and_lfo_parameters.cpp: + * src/core/main.cpp: + * src/core/mixer.cpp: + * src/core/effect.cpp: + * src/core/instrument_midi_io.cpp: + * src/core/track.cpp: + * src/core/timeline.cpp: + * src/core/instrument.cpp: + * src/core/surround_area.cpp: + * src/core/effect_select_dialog.cpp: + * src/core/automation_editor.cpp: + * src/core/meter_dialog.cpp: + reduced dependencies from automatable_model_templates.h and fixed + according compiler-warnings + + * include/shared_object.h: + added mutex to protect reference-counter + 2008-03-03 Tobias Doerffel * src/core/piano_roll.cpp: @@ -2755,7 +2805,7 @@ * include/pattern.h: * include/sample_buffer.h: * include/shared_object.h: - * plugins/ladspa_bas:e/ladspa_control.cpp: + * plugins/ladspa_base/ladspa_control.cpp: * plugins/ladspa_base/ladspa_control.h: * plugins/ladspa_effect/ladspa_effect.cpp: * src/audio/audio_jack.cpp: diff --git a/include/automatable_model.h b/include/automatable_model.h index d610fc669..86d1d11b4 100644 --- a/include/automatable_model.h +++ b/include/automatable_model.h @@ -127,7 +127,7 @@ public: return( m_curLevel ); } - inline T fittedValue( T _value ) const; + T fittedValue( T _value ) const; inline T value( int _level ) const { @@ -215,11 +215,11 @@ private: inline void unlinkModel( autoModel * _model ); - inline static T attributeValue( QString _value ); + static T attributeValue( QString _value ); inline void syncAutomationPattern( void ); - inline void setLevel( int _level ); + void setLevel( int _level ); inline int level( T _value ) const { diff --git a/include/graph.h b/include/graph.h index b4d2bf876..1ca997d82 100644 --- a/include/graph.h +++ b/include/graph.h @@ -140,8 +140,8 @@ signals: private: QVector m_samples; - float m_maxValue; float m_minValue; + float m_maxValue; friend class graph; diff --git a/include/surround_area.h b/include/surround_area.h index c7b40d178..bbd7bb312 100644 --- a/include/surround_area.h +++ b/include/surround_area.h @@ -3,7 +3,7 @@ * position of a channel + calculation of volume for each * speaker * - * Copyright (c) 2004-2007 Tobias Doerffel + * Copyright (c) 2004-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -70,15 +70,8 @@ public: m_posY.addJournalEntryFromOldToCurVal(); } - automationPattern * automationPatternX( void ) - { - return( m_posX.getAutomationPattern() ); - } - - automationPattern * automationPatternY( void ) - { - return( m_posY.getAutomationPattern() ); - } + automationPattern * automationPatternX( void ); + automationPattern * automationPatternY( void ); private: diff --git a/src/audio/audio_alsa.cpp b/src/audio/audio_alsa.cpp index 25d34ed54..965b5a087 100644 --- a/src/audio/audio_alsa.cpp +++ b/src/audio/audio_alsa.cpp @@ -36,7 +36,6 @@ #ifdef ALSA_SUPPORT #include "endian_handling.h" -#include "automatable_model_templates.h" #include "config_mgr.h" #include "lcd_spinbox.h" #include "gui_templates.h" diff --git a/src/audio/audio_file_device.cpp b/src/audio/audio_file_device.cpp index f28e68fc9..6e3179183 100644 --- a/src/audio/audio_file_device.cpp +++ b/src/audio/audio_file_device.cpp @@ -30,7 +30,6 @@ #include "audio_file_device.h" #include "export_project_dialog.h" -#include "automatable_model_templates.h" audioFileDevice::audioFileDevice( const sample_rate_t _sample_rate, diff --git a/src/audio/audio_jack.cpp b/src/audio/audio_jack.cpp index 90eada53b..9da05c9f2 100644 --- a/src/audio/audio_jack.cpp +++ b/src/audio/audio_jack.cpp @@ -40,7 +40,6 @@ #include "debug.h" #include "templates.h" -#include "automatable_model_templates.h" #include "gui_templates.h" #include "config_mgr.h" #include "lcd_spinbox.h" diff --git a/src/audio/audio_oss.cpp b/src/audio/audio_oss.cpp index 02ae2ecb4..515f1da49 100644 --- a/src/audio/audio_oss.cpp +++ b/src/audio/audio_oss.cpp @@ -35,7 +35,6 @@ #include #include "endian_handling.h" -#include "automatable_model_templates.h" #include "lcd_spinbox.h" #include "gui_templates.h" #include "templates.h" diff --git a/src/audio/audio_port.cpp b/src/audio/audio_port.cpp index 00510aa13..97a13e4dd 100644 --- a/src/audio/audio_port.cpp +++ b/src/audio/audio_port.cpp @@ -31,7 +31,6 @@ #include "audio_port.h" #include "audio_device.h" #include "engine.h" -#include "automatable_model_templates.h" audioPort::audioPort( const QString & _name, track * _track ) : diff --git a/src/core/automation_editor.cpp b/src/core/automation_editor.cpp index 4dd1c74d0..50a46c5ee 100644 --- a/src/core/automation_editor.cpp +++ b/src/core/automation_editor.cpp @@ -49,7 +49,6 @@ #include "song_editor.h" -#include "automatable_model_templates.h" #include "main_window.h" #include "embed.h" #include "engine.h" diff --git a/src/core/effect.cpp b/src/core/effect.cpp index ddbb7f2d8..1eb1cc369 100644 --- a/src/core/effect.cpp +++ b/src/core/effect.cpp @@ -31,7 +31,6 @@ #include "dummy_effect.h" #include "effect_chain.h" #include "effect_view.h" -#include "automatable_model_templates.h" effect::effect( const plugin::descriptor * _desc, diff --git a/src/core/effect_control_dialog.cpp b/src/core/effect_control_dialog.cpp index 4d471b3ab..980eb631f 100644 --- a/src/core/effect_control_dialog.cpp +++ b/src/core/effect_control_dialog.cpp @@ -32,7 +32,6 @@ #include "effect_control_dialog.h" #include "effect_controls.h" #include "effect.h" -#include "automatable_model_templates.h" effectControlDialog::effectControlDialog( effectControls * _controls ) : diff --git a/src/core/effect_select_dialog.cpp b/src/core/effect_select_dialog.cpp index c82510c9c..82c62a6b7 100644 --- a/src/core/effect_select_dialog.cpp +++ b/src/core/effect_select_dialog.cpp @@ -33,7 +33,6 @@ #include "effect_select_dialog.h" #include "gui_templates.h" -#include "automatable_model_templates.h" #include "embed.h" diff --git a/src/core/envelope_and_lfo_parameters.cpp b/src/core/envelope_and_lfo_parameters.cpp index 326b05420..fd09863e4 100644 --- a/src/core/envelope_and_lfo_parameters.cpp +++ b/src/core/envelope_and_lfo_parameters.cpp @@ -34,7 +34,6 @@ #include "engine.h" #include "mmp.h" #include "oscillator.h" -#include "automatable_model_templates.h" diff --git a/src/core/import_filter.cpp b/src/core/import_filter.cpp index 1a5a18ebc..640b26e4d 100644 --- a/src/core/import_filter.cpp +++ b/src/core/import_filter.cpp @@ -31,7 +31,6 @@ #include "engine.h" #include "track_container.h" #include "project_journal.h" -#include "automatable_model_templates.h" diff --git a/src/core/instrument.cpp b/src/core/instrument.cpp index 350f8481f..9e51a9496 100644 --- a/src/core/instrument.cpp +++ b/src/core/instrument.cpp @@ -27,7 +27,6 @@ #include "instrument.h" #include "instrument_view.h" -#include "automatable_model_templates.h" #include "instrument_track.h" #include "dummy_instrument.h" #include "note_play_handle.h" diff --git a/src/core/instrument_midi_io.cpp b/src/core/instrument_midi_io.cpp index ca7e88bd6..dc3b852ce 100644 --- a/src/core/instrument_midi_io.cpp +++ b/src/core/instrument_midi_io.cpp @@ -34,7 +34,6 @@ #include "midi_client.h" #include "midi_port.h" #include "song.h" -#include "automatable_model_templates.h" diff --git a/src/core/main.cpp b/src/core/main.cpp index 1a5055674..74d1cf16e 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -44,7 +44,6 @@ #include "export_project_dialog.h" #include "song.h" #include "gui_templates.h" -#include "automatable_model_templates.h" #include "lmms_style.h" #warning TODO: move somewhere else diff --git a/src/core/meter_dialog.cpp b/src/core/meter_dialog.cpp index ead0eb36b..382f95926 100644 --- a/src/core/meter_dialog.cpp +++ b/src/core/meter_dialog.cpp @@ -3,7 +3,7 @@ /* * meter_dialog.cpp - dialog for entering meter settings * - * Copyright (c) 2006-2007 Danny McRae + * Copyright (c) 2006-2008 Danny McRae * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -31,7 +31,6 @@ #include "meter_dialog.h" #include "embed.h" #include "gui_templates.h" -#include "automatable_model_templates.h" meterModel::meterModel( ::model * _parent, track * _track ) : diff --git a/src/core/mixer.cpp b/src/core/mixer.cpp index 1b99192c8..75bb64f9e 100644 --- a/src/core/mixer.cpp +++ b/src/core/mixer.cpp @@ -44,7 +44,6 @@ #include "sample_play_handle.h" #include "piano_roll.h" #include "micro_timer.h" -#include "automatable_model_templates.h" #include "audio_device.h" #include "midi_client.h" diff --git a/src/core/preset_preview_play_handle.cpp b/src/core/preset_preview_play_handle.cpp index 47f9231d7..1dba14fff 100644 --- a/src/core/preset_preview_play_handle.cpp +++ b/src/core/preset_preview_play_handle.cpp @@ -4,7 +4,7 @@ * preset_preview_play_handle.cpp - implementation of class * presetPreviewPlayHandle * - * Copyright (c) 2005-2007 Tobias Doerffel + * Copyright (c) 2005-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -30,7 +30,6 @@ #include #include "preset_preview_play_handle.h" -#include "automatable_model_templates.h" #include "debug.h" #include "engine.h" #include "instrument_track.h" diff --git a/src/core/sample_play_handle.cpp b/src/core/sample_play_handle.cpp index b58a269f1..fbb7a5c9f 100644 --- a/src/core/sample_play_handle.cpp +++ b/src/core/sample_play_handle.cpp @@ -26,7 +26,6 @@ #include "sample_play_handle.h" -#include "automatable_model_templates.h" #include "audio_port.h" #include "bb_track.h" #include "engine.h" diff --git a/src/core/setup_dialog.cpp b/src/core/setup_dialog.cpp index 1c26df701..a821c7b64 100644 --- a/src/core/setup_dialog.cpp +++ b/src/core/setup_dialog.cpp @@ -49,7 +49,6 @@ #include "tooltip.h" #include "led_checkbox.h" #include "lcd_spinbox.h" -#include "automatable_model_templates.h" // platform-specific audio-interface-classes diff --git a/src/core/surround_area.cpp b/src/core/surround_area.cpp index 303a4bf28..cb98ba06f 100644 --- a/src/core/surround_area.cpp +++ b/src/core/surround_area.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include "automatable_model_templates.h" @@ -271,6 +272,16 @@ void surroundAreaModel::loadSettings( const QDomElement & _this, +automationPattern * surroundAreaModel::automationPatternX( void ) +{ + return( m_posX.getAutomationPattern() ); +} + +automationPattern * surroundAreaModel::automationPatternY( void ) +{ + return( m_posY.getAutomationPattern() ); +} + diff --git a/src/core/timeline.cpp b/src/core/timeline.cpp index 53afba87b..d0f4c71ee 100644 --- a/src/core/timeline.cpp +++ b/src/core/timeline.cpp @@ -40,7 +40,6 @@ #include "nstate_button.h" #include "main_window.h" #include "text_float.h" -#include "automatable_model_templates.h" diff --git a/src/core/track.cpp b/src/core/track.cpp index c10d319ed..386ea2e72 100644 --- a/src/core/track.cpp +++ b/src/core/track.cpp @@ -39,6 +39,7 @@ #include "automation_pattern.h" #include "automation_track.h" +#include "automatable_model_templates.h" #include "bb_editor.h" #include "bb_track.h" #include "clipboard.h" diff --git a/src/core/track_container.cpp b/src/core/track_container.cpp index 6eb7a140e..a46792617 100644 --- a/src/core/track_container.cpp +++ b/src/core/track_container.cpp @@ -36,7 +36,6 @@ #include -#include "automatable_model_templates.h" #include "bb_track.h" #include "config_mgr.h" #include "debug.h" diff --git a/src/lib/mmp.cpp b/src/lib/mmp.cpp index ae8b75c69..4292ee88d 100644 --- a/src/lib/mmp.cpp +++ b/src/lib/mmp.cpp @@ -36,7 +36,6 @@ #include "config_mgr.h" #include "project_version.h" #include "song_editor.h" -#include "automatable_model_templates.h" multimediaProject::typeDescStruct diff --git a/src/lib/oscillator.cpp b/src/lib/oscillator.cpp index b4414d0e1..7fe9aa5a2 100644 --- a/src/lib/oscillator.cpp +++ b/src/lib/oscillator.cpp @@ -3,7 +3,7 @@ /* * oscillator.cpp - implementation of powerful oscillator-class * - * Copyright (c) 2004-2007 Tobias Doerffel + * Copyright (c) 2004-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -26,7 +26,6 @@ #include "oscillator.h" -#include "automatable_model_templates.h" diff --git a/src/lib/project_journal.cpp b/src/lib/project_journal.cpp index 6986fffbe..c460e19ec 100644 --- a/src/lib/project_journal.cpp +++ b/src/lib/project_journal.cpp @@ -31,7 +31,6 @@ #include "engine.h" #include "journalling_object.h" #include "song.h" -#include "automatable_model_templates.h" projectJournal::projectJournal( void ) : diff --git a/src/midi/midi_alsa_seq.cpp b/src/midi/midi_alsa_seq.cpp index c7fd98cc6..d175eed9c 100644 --- a/src/midi/midi_alsa_seq.cpp +++ b/src/midi/midi_alsa_seq.cpp @@ -36,7 +36,6 @@ #include "song.h" #include "midi_port.h" #include "note.h" -#include "automatable_model_templates.h" #ifdef ALSA_SUPPORT diff --git a/src/tracks/automation_track.cpp b/src/tracks/automation_track.cpp index aa3728dd6..1a302b7de 100644 --- a/src/tracks/automation_track.cpp +++ b/src/tracks/automation_track.cpp @@ -27,7 +27,6 @@ #include "automation_track.h" -#include "automatable_model_templates.h" diff --git a/src/tracks/bb_track.cpp b/src/tracks/bb_track.cpp index 1496048b0..fc823967b 100644 --- a/src/tracks/bb_track.cpp +++ b/src/tracks/bb_track.cpp @@ -585,7 +585,7 @@ bbTrackView::~bbTrackView() bool bbTrackView::close( void ) { engine::getBBEditor()->removeBBView( bbTrack::s_infoMap[m_bbTrack] ); - trackView::close(); + return( trackView::close() ); } diff --git a/src/tracks/instrument_track.cpp b/src/tracks/instrument_track.cpp index 45d70cc01..10f0c8761 100644 --- a/src/tracks/instrument_track.cpp +++ b/src/tracks/instrument_track.cpp @@ -44,7 +44,6 @@ #include "audio_port.h" -#include "automatable_model_templates.h" #include "automation_pattern.h" #include "config_mgr.h" #include "debug.h" diff --git a/src/widgets/envelope_and_lfo_view.cpp b/src/widgets/envelope_and_lfo_view.cpp index 751d57a59..d6a380e13 100644 --- a/src/widgets/envelope_and_lfo_view.cpp +++ b/src/widgets/envelope_and_lfo_view.cpp @@ -47,7 +47,6 @@ #include "text_float.h" #include "tooltip.h" #include "track.h" -#include "automatable_model_templates.h" diff --git a/src/widgets/graph.cpp b/src/widgets/graph.cpp index 8d05df230..6ed9dcaff 100644 --- a/src/widgets/graph.cpp +++ b/src/widgets/graph.cpp @@ -308,9 +308,9 @@ graphModel::graphModel( float _min, float _max, Uint32 _length, ::model * _parent, track * _track, bool _default_constructed ) : model( _parent, _default_constructed ), + m_samples( _length ), m_minValue( _min ), - m_maxValue( _max ), - m_samples( _length ) + m_maxValue( _max ) { } @@ -332,7 +332,7 @@ void graphModel::setRange( float _min, float _max ) if( !m_samples.isEmpty() ) { // Trim existing values - for( int i=0; i < length(); i++ ) + for( Uint32 i=0; i < length(); i++ ) { m_samples[i] = fmaxf( _min, fminf( m_samples[i], _max ) ); } diff --git a/src/widgets/group_box.cpp b/src/widgets/group_box.cpp index aa3cf4443..e88871291 100644 --- a/src/widgets/group_box.cpp +++ b/src/widgets/group_box.cpp @@ -42,7 +42,6 @@ #include "embed.h" #include "gui_templates.h" -#include "automatable_model_templates.h" QPixmap * groupBox::s_ledBg = NULL; diff --git a/src/widgets/instrument_midi_io_view.cpp b/src/widgets/instrument_midi_io_view.cpp index 91db2d30c..dbddf0904 100644 --- a/src/widgets/instrument_midi_io_view.cpp +++ b/src/widgets/instrument_midi_io_view.cpp @@ -41,7 +41,6 @@ #include "lcd_spinbox.h" #include "tab_widget.h" #include "tooltip.h" -#include "automatable_model_templates.h" diff --git a/src/widgets/ladspa_control_view.cpp b/src/widgets/ladspa_control_view.cpp index f6894efb5..9fc2618ac 100644 --- a/src/widgets/ladspa_control_view.cpp +++ b/src/widgets/ladspa_control_view.cpp @@ -31,7 +31,6 @@ #include "led_checkbox.h" #include "tempo_sync_knob.h" #include "tooltip.h" -#include "automatable_model_templates.h" ladspaControlView::ladspaControlView( QWidget * _parent, diff --git a/src/widgets/lcd_spinbox.cpp b/src/widgets/lcd_spinbox.cpp index 1f52603bf..f701f465a 100644 --- a/src/widgets/lcd_spinbox.cpp +++ b/src/widgets/lcd_spinbox.cpp @@ -107,8 +107,6 @@ void lcdSpinBox::paintEvent( QPaintEvent * _me ) QRect cellRect( 0, 0, m_cellWidth, m_cellHeight ); - int i; - int margin = 1;// QStyle::PM_DefaultFrameWidth; int lcdWidth = m_cellWidth * (m_numDigits+1) + (margin*2); diff --git a/src/widgets/volume_knob.cpp b/src/widgets/volume_knob.cpp index d5b48c1b7..66d990595 100644 --- a/src/widgets/volume_knob.cpp +++ b/src/widgets/volume_knob.cpp @@ -33,7 +33,6 @@ #include #include "volume_knob.h" -#include "automatable_model_templates.h" #include "main_window.h" #include "config_mgr.h" #include "engine.h"