From 5f47f86625bb31ecaee1f2ce09b38ffab85bce95 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sun, 9 Mar 2008 00:19:51 +0000 Subject: [PATCH] added definition for upcoming FX-mixer git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@783 0778d3d1-df1d-0410-868b-ea421aaaa00d --- include/effect_board.h | 35 ----------- include/fx_mixer.h | 103 ++++++++++++++++++++++++++++++++ src/tracks/instrument_track.cpp | 13 ++-- 3 files changed, 108 insertions(+), 43 deletions(-) delete mode 100644 include/effect_board.h create mode 100644 include/fx_mixer.h diff --git a/include/effect_board.h b/include/effect_board.h deleted file mode 100644 index af9a435f2..000000000 --- a/include/effect_board.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * effect_board.h - stuff for effect-board - * - * Copyright (c) 2004-2006 Tobias Doerffel - * - * 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 _EFFECT_BOARD_H -#define _EFFECT_BOARD_H - -#include "types.h" - -const fx_ch_t MIN_EFFECT_CHANNEL = 0; -const fx_ch_t MAX_EFFECT_CHANNEL = 63; -const fx_ch_t DEFAULT_EFFECT_CHANNEL = MIN_EFFECT_CHANNEL; - -#endif diff --git a/include/fx_mixer.h b/include/fx_mixer.h new file mode 100644 index 000000000..9ecc9148c --- /dev/null +++ b/include/fx_mixer.h @@ -0,0 +1,103 @@ +/* + * fx_mixer.h - effect-mixer for LMMS + * + * Copyright (c) 2008 Tobias Doerffel + * + * 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 _FX_MIXER_H +#define _FX_MIXER_H + +#ifdef HAVE_CONFIG_H +#include +#endif + + +#include "types.h" +#include "effect_chain.h" +#include "mv_base.h" +#include "journalling_object.h" + + +const int NUM_FX_CHANNELS = 64; + + +class fxMixer : public journallingObject, public model +{ +public: + fxMixer(); + virtual ~fxMixer(); + + void mixToChannel( const surroundSampleFrame * _buf, fx_ch_t _ch ); + void processChannel( fx_ch_t _ch ); + + void masterMix( surroundSampleFrame * _dest ); + + + virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); + virtual void loadSettings( const QDomElement & _this ); + + virtual QString nodeName( void ) const + { + return( "fxmixer" ); + } + + +private: + struct fxChannel + { + effectChain m_fxChain; + surroundSampleFrame * m_buffer; + boolModel m_muteModel; + boolModel m_soloModel; + QMutex m_lock; + } ; + + fxChannel m_fxChannels[NUM_FX_CHANNELS]; + fxChannel m_masterChannel; + + + friend class mixerWorkerThread; + friend class fxMixerView; + +} ; + + +class fxMixerView : public QWidget, public modelView +{ +public: + fxMixerView(); + virtual ~fxMixerView(); + +private: + struct fxChannelView + { + effectRackView * m_rackView; + pixmapButton * m_muteButton; + pixmapButton * m_soloButton; + } ; + + fxChannelView m_fxChannelViews[NUM_FX_CHANNELS]; + fxChannelView m_masterChannelView; + +} ; + +#endif diff --git a/src/tracks/instrument_track.cpp b/src/tracks/instrument_track.cpp index 10f0c8761..9f822f834 100644 --- a/src/tracks/instrument_track.cpp +++ b/src/tracks/instrument_track.cpp @@ -47,7 +47,6 @@ #include "automation_pattern.h" #include "config_mgr.h" #include "debug.h" -#include "effect_board.h" #include "effect_chain.h" #include "effect_rack_view.h" #include "embed.h" @@ -63,6 +62,7 @@ #include "main_window.h" #include "midi_client.h" #include "midi_port.h" +#include "fx_mixer.h" #include "instrument_midi_io.h" #include "mmp.h" #include "note_play_handle.h" @@ -104,14 +104,11 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) : tr( "unnamed_channel" ) ) ), m_audioPort( tr( "unnamed_channel" ), this ), m_notes(), - m_baseNoteModel( 0, 0, NOTES_PER_OCTAVE * OCTAVES - 1, 1/* this */ ), + m_baseNoteModel( 0, 0, NOTES_PER_OCTAVE * OCTAVES - 1, 1, this ), m_volumeModel( DEFAULT_VOLUME, MIN_VOLUME, MAX_VOLUME, - 1.0f /* this */ ), - m_surroundAreaModel( NULL /* this */, this ), - m_effectChannelModel( DEFAULT_EFFECT_CHANNEL, - MIN_EFFECT_CHANNEL, MAX_EFFECT_CHANNEL - /* this */ ), -// m_effects( /* this */ NULL ), + 1.0f, this ), + m_surroundAreaModel( this, this ), + m_effectChannelModel( 1, 1, NUM_FX_CHANNELS, 1, this ), m_instrument( NULL ), m_soundShaping( this ), m_arpeggiator( this ),