traverso-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Traverso-commit] traverso/src core/InputEngine.cpp core/Song.cpp...


From: Remon Sijrier
Subject: [Traverso-commit] traverso/src core/InputEngine.cpp core/Song.cpp...
Date: Thu, 24 May 2007 10:56:44 +0000

CVSROOT:        /sources/traverso
Module name:    traverso
Changes by:     Remon Sijrier <r_sijrier>       07/05/24 10:56:44

Modified files:
        src/core       : InputEngine.cpp Song.cpp Song.h Track.cpp 
        src/plugins/LV2: LV2Plugin.cpp LV2Plugin.h 
                         LV2PluginPropertiesDialog.cpp 
                         LV2PluginPropertiesDialog.h 
        src/plugins    : PluginChain.cpp PluginChain.h 
        src/traverso   : CorrelationMeterWidget.cpp 
                         SpectralMeterWidget.cpp 
        src/traverso/songcanvas: PluginChainView.cpp PluginView.h 

Log message:
        * maybe fix for Song export bug
        * Tracks render into an intermediate AudioBus now, on which the plugins 
process
        * if a Plugin only has 1 in - out, create a duplicate of the plugin
        and apply it to the second channel of a track.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/InputEngine.cpp?cvsroot=traverso&r1=1.54&r2=1.55
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/Song.cpp?cvsroot=traverso&r1=1.103&r2=1.104
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/Song.h?cvsroot=traverso&r1=1.54&r2=1.55
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/Track.cpp?cvsroot=traverso&r1=1.56&r2=1.57
http://cvs.savannah.gnu.org/viewcvs/traverso/src/plugins/LV2/LV2Plugin.cpp?cvsroot=traverso&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/traverso/src/plugins/LV2/LV2Plugin.h?cvsroot=traverso&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/traverso/src/plugins/LV2/LV2PluginPropertiesDialog.cpp?cvsroot=traverso&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/traverso/src/plugins/LV2/LV2PluginPropertiesDialog.h?cvsroot=traverso&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/traverso/src/plugins/PluginChain.cpp?cvsroot=traverso&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/traverso/src/plugins/PluginChain.h?cvsroot=traverso&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/CorrelationMeterWidget.cpp?cvsroot=traverso&r1=1.22&r2=1.23
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/SpectralMeterWidget.cpp?cvsroot=traverso&r1=1.40&r2=1.41
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/songcanvas/PluginChainView.cpp?cvsroot=traverso&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/songcanvas/PluginView.h?cvsroot=traverso&r1=1.8&r2=1.9

Patches:
Index: core/InputEngine.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/core/InputEngine.cpp,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -b -r1.54 -r1.55
--- core/InputEngine.cpp        17 May 2007 23:29:39 -0000      1.54
+++ core/InputEngine.cpp        24 May 2007 10:56:43 -0000      1.55
@@ -692,10 +692,10 @@
                
        if (isHolding) {
                if (eventcode != holdEventCode) {
-                       printf("release event during hold action, but NOT for 
holdaction itself!!\n");
+                       PMESG("release event during hold action, but NOT for 
holdaction itself!!");
                        return;
                } else {
-                       printf("release event for hold action detected!\n");
+                       PMESG("release event for hold action detected!");
                        holdEventCode = -100;
                }
        }

Index: core/Song.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/core/Song.cpp,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -b -r1.103 -r1.104
--- core/Song.cpp       17 May 2007 21:38:16 -0000      1.103
+++ core/Song.cpp       24 May 2007 10:56:43 -0000      1.104
@@ -113,6 +113,7 @@
 
        delete m_diskio;
        delete m_masterOut;
+       delete m_renderBus;
        delete m_hs;
        delete m_audiodeviceClient;
        delete snaplist;
@@ -138,6 +139,7 @@
 
        mixdown = gainbuffer = 0;
        m_masterOut = new AudioBus("Master Out", 2);
+       m_renderBus = new AudioBus("Master Out", 2);
        resize_buffer(false, audiodevice().get_buffer_size());
        m_hs = new QUndoStack(pm().get_undogroup());
        set_history_stack(m_hs);
@@ -415,7 +417,7 @@
        nframes_t nframes = spec->blocksize;
 
        if (!spec->running || spec->stop || (this_nframes = std::min 
((nframes_t)(spec->end_frame - spec->pos), nframes)) == 0) {
-               process (nframes);
+               process_export (nframes);
                /*              PWARN("Finished Rendering for this song");
                                PWARN("running is %d", spec->running);
                                PWARN("stop is %d", spec->stop);
@@ -842,10 +844,7 @@
                Mixer::mix_buffers_with_gain(m_playBackBus->get_buffer(1, 
nframes), m_masterOut->get_buffer(1, nframes), nframes, m_gain);
                
                // Process all the plugins for this Song
-               QList<Plugin* >* pluginList = m_pluginChain->get_plugin_list();
-               for (int i=0; i<pluginList->size(); ++i) {
-                       pluginList->at(i)->process(m_playBackBus, nframes);
-               }
+               m_pluginChain->process(m_playBackBus, nframes);
        }
 
        
@@ -1001,6 +1000,7 @@
        mixdown = new audio_sample_t[size];
        gainbuffer = new audio_sample_t[size];
        m_masterOut->set_buffer_size(size);
+       m_renderBus->set_buffer_size(size);
        
        if (updateArmStatus) {
                foreach(Track* track, m_tracks) {

Index: core/Song.h
===================================================================
RCS file: /sources/traverso/traverso/src/core/Song.h,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -b -r1.54 -r1.55
--- core/Song.h 17 May 2007 21:38:16 -0000      1.54
+++ core/Song.h 24 May 2007 10:56:43 -0000      1.55
@@ -94,6 +94,7 @@
        DiskIO* get_diskio() const;
        AudioClipManager* get_audioclip_manager() const;
        AudioBus* get_master_out() const {return m_masterOut;}
+       AudioBus* get_render_bus() const {return m_renderBus;}
        SnapList* get_snap_list() const;
        PluginChain* get_plugin_chain() const;
        TimeLine* get_timeline() const {return m_timeline;}
@@ -148,6 +149,7 @@
        AudioBus*               m_playBackBus;
        Client*                 m_audiodeviceClient;
        AudioBus*               m_masterOut;
+       AudioBus*               m_renderBus;
        DiskIO*                 m_diskio;
        AudioClipManager*       m_acmanager;
        PluginChain*            m_pluginChain;

Index: core/Track.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/core/Track.cpp,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -b -r1.56 -r1.57
--- core/Track.cpp      17 May 2007 21:38:16 -0000      1.56
+++ core/Track.cpp      24 May 2007 10:56:43 -0000      1.57
@@ -409,18 +409,16 @@
                return 0;
        }
                
-       AudioBus* bus = m_song->get_master_out();
+       // Get the 'render bus' from song, a bit hackish solution, but
+       // it avoids to have a dedicated render bus for each Track,
+       // or buffers located on the heap...
+       AudioBus* bus = m_song->get_render_bus();
+       bus->silence_buffers(nframes);
        
-       if (!bus) {
-               return 0;
-       }
-       
-       audio_sample_t* channelBuffer;
        audio_sample_t* mixdown = m_song->mixdown;
        int result;
        float gainFactor, panFactor;
        
-
        for (int i=0; i<audioClipList.size(); ++i) {
        
                memset (mixdown, 0, sizeof (audio_sample_t) * nframes);
@@ -434,8 +432,6 @@
                
                for (int chan=0; chan<bus->get_channel_count(); ++chan) {
                
-                       channelBuffer = bus->get_buffer(chan, nframes);
-                       
                        result = clip->process(nframes, mixdown, chan);
                        
                        if (result == 0) {
@@ -458,15 +454,14 @@
                                gainFactor *= panFactor;
                        }
                        
-                       Mixer::mix_buffers_with_gain(channelBuffer, mixdown, 
nframes, gainFactor);
+                       
Mixer::mix_buffers_with_gain(bus->get_channel(chan)->get_buffer(nframes), 
mixdown, nframes, gainFactor);
                }
        }
        
-       QList<Plugin* >* pluginList = pluginChain->get_plugin_list();
-       
+       pluginChain->process(bus, nframes);
        
-       for (int i=0; i<pluginList->size(); ++i) {
-               pluginList->at(i)->process(bus, nframes);
+       for (int i=0; i<bus->get_channel_count(); ++i) {
+               
Mixer::mix_buffers_no_gain(m_song->get_master_out()->get_buffer(i, nframes), 
bus->get_buffer(i, nframes), nframes);
        }
                
        return processResult;

Index: plugins/LV2/LV2Plugin.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/plugins/LV2/LV2Plugin.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- plugins/LV2/LV2Plugin.cpp   20 Apr 2007 12:17:31 -0000      1.5
+++ plugins/LV2/LV2Plugin.cpp   24 May 2007 10:56:43 -0000      1.6
@@ -33,11 +33,13 @@
 
 
 
-LV2Plugin::LV2Plugin()
+LV2Plugin::LV2Plugin(bool slave)
        : Plugin()
        , m_instance(0)
        , m_slv2plugin(0)
+       , m_slave(0)
 {
+       m_isSlave = slave;
 }
 
 
@@ -46,6 +48,8 @@
        , m_pluginUri((char*) pluginUri)
        , m_instance(0)
        , m_slv2plugin(0)
+       , m_slave(0)
+       , m_isSlave(false)
 {
 }
 
@@ -147,6 +151,12 @@
        /* Activate the plugin instance */
        slv2_instance_activate(m_instance);
        
+       // The default is 2 channels in - out, if there is only 1 in - out, 
duplicate
+       // this plugin, and use it on the second channel
+       if (!m_isSlave && m_audioInputPorts.size() == 1 && 
m_audioOutputPorts.size() == 1) {
+               m_slave = create_copy();
+       }
+       
        return 1;
 }
 
@@ -159,7 +169,7 @@
 
        /* Create ports */
        m_portcount  = slv2_plugin_get_num_ports(m_slv2plugin);
-       printf("numports is %d\n", (int) m_portcount);
+       PMESG("numports is %d", (int) m_portcount);
 
        for (int i=0; i < m_portcount; ++i) {
                LV2ControlPort* port = create_port(i);
@@ -183,13 +193,19 @@
                return -1;
        }
        
+       // The default is 2 channels in - out, if there is only 1 in - out, 
duplicate
+       // this plugin, and use it on the second channel
+       if (!m_isSlave && m_audioInputPorts.size() == 1 && 
m_audioOutputPorts.size() == 1) {
+               m_slave = create_copy();
+       }
+       
        return 1;
 }
 
 
 int LV2Plugin::create_instance()
 {
-       printf("URI:\t%s\n", QS_C(m_pluginUri));
+//     printf("URI:\t%s\n", QS_C(m_pluginUri));
 
        m_slv2plugin = 
slv2_plugins_get_by_uri(PluginManager::instance()->get_slv2_plugin_list(), 
QS_C(m_pluginUri));
 
@@ -202,7 +218,7 @@
        /* Get the plugin's name */
        char* name = slv2_plugin_get_name(m_slv2plugin);
 
-       printf("Name:\t%s\n", name);
+//     printf("Name:\t%s\n", name);
 
        /* Instantiate the plugin */
        int samplerate = audiodevice().get_sample_rate();
@@ -212,7 +228,7 @@
                printf("Failed to instantiate plugin.\n");
                return -1;
        } else {
-               printf("Succesfully instantiated plugin.\n\n");
+//             printf("Succesfully instantiated plugin.\n\n");
        }
        
        return 1;
@@ -228,17 +244,27 @@
        for (int i=0; i<m_audioInputPorts.size(); ++i) {
                AudioInputPort* port = m_audioInputPorts.at(i);
                int index = port->get_index();
+               // If we are a slave, then we are meant to operate on the 
second channel of the Bus!
+               if (m_isSlave) i = 1;
                slv2_instance_connect_port(m_instance, index, 
bus->get_buffer(i, (nframes_t)nframes));
        }
        
        for (int i=0; i<m_audioOutputPorts.size(); ++i) {
                AudioOutputPort* port = m_audioOutputPorts.at(i);
                int index = port->get_index();
+               // If we are a slave, then we are meant to operate on the 
second channel of the Bus!
+               if (m_isSlave) i = 1;
                slv2_instance_connect_port(m_instance, index, 
bus->get_buffer(i, (nframes_t)nframes));
        }
        
        /* Run plugin for this cycle */
        slv2_instance_run(m_instance, nframes);
+       
+       // If we have a slave, and the bus has 2 channels, process the slave 
too!
+       if (m_slave && bus->get_channel_count() == 2) {
+               m_slave->process(bus, nframes);
+       }       
+       
 }
 
 
@@ -259,11 +285,9 @@
        switch (portClass) {
                case SLV2_CONTROL_INPUT:
                        ctrlport = new LV2ControlPort(this, portIndex, 
slv2_port_get_default_value(m_slv2plugin, slvport));
-                       printf("Set %s to ", symbol);
                        break;
                case SLV2_CONTROL_OUTPUT:
                        ctrlport = new LV2ControlPort(this, portIndex, 0);
-                       printf("Set %s to ", symbol);
                        break;
                case SLV2_AUDIO_INPUT:
                        m_audioInputPorts.append(new AudioInputPort(this, 
portIndex));
@@ -355,4 +379,33 @@
 }
 
 
+LV2ControlPort * LV2Plugin::get_control_port_by_index(int index) const
+{
+       foreach(LV2ControlPort* port, m_controlPorts) {
+               if (port->get_index() == index) {
+                       return port;
+               }
+       }
+       return 0;
+}
+
+LV2Plugin * LV2Plugin::create_copy()
+{
+       QDomDocument doc("LV2Plugin");
+       QDomNode pluginState = get_state(doc);
+       LV2Plugin* plug = new LV2Plugin(true);
+       plug->set_state(pluginState);
+       return plug;
+}
+
+Command * LV2Plugin::toggle_bypass()
+{
+       Plugin::toggle_bypass();
+       if (m_slave) {
+               m_slave->toggle_bypass();
+       }
+       return  0;
+}
+
 //eof
+

Index: plugins/LV2/LV2Plugin.h
===================================================================
RCS file: /sources/traverso/traverso/src/plugins/LV2/LV2Plugin.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- plugins/LV2/LV2Plugin.h     20 Apr 2007 12:17:31 -0000      1.4
+++ plugins/LV2/LV2Plugin.h     24 May 2007 10:56:43 -0000      1.5
@@ -37,9 +37,10 @@
 
 class LV2Plugin : public Plugin
 {
+       Q_OBJECT
 
 public:
-       LV2Plugin();
+       LV2Plugin(bool slave=false);
        LV2Plugin(char* pluginUri);
        ~LV2Plugin();
 
@@ -47,6 +48,9 @@
 
        SLV2Instance  get_instance() const {return m_instance; }
        SLV2Plugin get_slv2_plugin() const {return m_slv2plugin; }
+       LV2ControlPort* get_control_port_by_index(int index) const;
+       LV2Plugin* create_copy();
+       LV2Plugin* get_slave() const {return m_slave;}
 
        QList<LV2ControlPort* > get_control_ports() const { return 
m_controlPorts; }
 
@@ -61,6 +65,8 @@
        SLV2Instance    m_instance;
        SLV2Plugin      m_slv2plugin;
        int             m_portcount;
+       LV2Plugin*      m_slave;
+       bool            m_isSlave;
        
        QList<LV2ControlPort* >         m_controlPorts;
        QList<AudioInputPort* >         m_audioInputPorts;
@@ -69,6 +75,9 @@
        LV2ControlPort* create_port(int portIndex);
 
        int create_instance();
+
+public slots:
+       Command* toggle_bypass();
 };
 
 

Index: plugins/LV2/LV2PluginPropertiesDialog.cpp
===================================================================
RCS file: 
/sources/traverso/traverso/src/plugins/LV2/LV2PluginPropertiesDialog.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- plugins/LV2/LV2PluginPropertiesDialog.cpp   21 Apr 2007 15:26:49 -0000      
1.5
+++ plugins/LV2/LV2PluginPropertiesDialog.cpp   24 May 2007 10:56:43 -0000      
1.6
@@ -17,7 +17,7 @@
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
 
-$Id: LV2PluginPropertiesDialog.cpp,v 1.5 2007/04/21 15:26:49 r_sijrier Exp $
+$Id: LV2PluginPropertiesDialog.cpp,v 1.6 2007/05/24 10:56:43 r_sijrier Exp $
 */
 
 
@@ -29,20 +29,34 @@
 #include <QVBoxLayout>
 #include <QHBoxLayout>
 #include <QWidget>
+#include <QPushButton>
 
 #include <PluginSlider.h>
-
+#include "Command.h"
 
 LV2PluginPropertiesDialog::LV2PluginPropertiesDialog(LV2Plugin* plugin)
        : QDialog()
        , m_plugin(plugin)
 {
+       setModal(true);
+       
        QWidget* sliderWidget = new QWidget(this);
        QVBoxLayout* sliderWidgetLayout = new QVBoxLayout;
        sliderWidget->setLayout(sliderWidgetLayout);
 
-       QHBoxLayout* dialogLayout = new QHBoxLayout;
+       QWidget* optionsWidget = new QWidget(this);
+       QHBoxLayout* optionsLayout = new QHBoxLayout;
+       optionsWidget->setLayout(optionsLayout);
+       QPushButton* bypassButton = new QPushButton(tr("Bypass"), 
optionsWidget);
+       QPushButton* closeButton = new QPushButton(tr("Close"), optionsWidget);
+       optionsLayout->addWidget(bypassButton);
+       optionsLayout->addStretch(10);
+       optionsLayout->addWidget(closeButton);
+       optionsLayout->setSpacing(0);
+       
+       QVBoxLayout* dialogLayout = new QVBoxLayout;
        dialogLayout->addWidget(sliderWidget);
+       dialogLayout->addWidget(optionsWidget);
        dialogLayout->setMargin(0);
        setLayout(dialogLayout);
 
@@ -61,26 +75,42 @@
                slider->set_value(port->get_control_value());
                connect(slider, SIGNAL(sliderValueChanged(float)), port, 
SLOT(set_control_value(float)));
 
+               // in case the plugin has a slave 'map' the signal to the slave 
port control slot too!
+               if (m_plugin->get_slave()) {
+                       connect(slider, SIGNAL(sliderValueChanged(float)), 
m_plugin->get_slave()->get_control_port_by_index(port->get_index()), 
SLOT(set_control_value(float)));
+               }
+               
                QLabel* minvalue = new QLabel();
                minvalue->setNum(port->get_min_control_value());
                minvalue->setFixedWidth(35);
+               minvalue->setAlignment(Qt::AlignRight);
 
                QLabel* maxvalue = new QLabel();
                maxvalue->setNum(port->get_max_control_value());
                maxvalue->setFixedWidth(35);
+               maxvalue->setAlignment(Qt::AlignRight);
 
                QLabel* controlname = new QLabel(port->get_description());
 
-               lay->addWidget(minvalue);
-               lay->addWidget(slider, 4);
-               lay->addWidget(maxvalue);
                lay->addWidget(controlname);
                lay->addStretch(1);
+               lay->addWidget(minvalue);
+               lay->addWidget(slider);
+               lay->addWidget(maxvalue);
 
                widget->setLayout(lay);
 
                sliderWidgetLayout->addWidget(widget);
        }
+       
+       connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
+       connect(bypassButton, SIGNAL(clicked()), this, 
SLOT(bypass_button_clicked()));
+}
+
+void LV2PluginPropertiesDialog::bypass_button_clicked()
+{
+       m_plugin->toggle_bypass();
 }
 
 //eof
+

Index: plugins/LV2/LV2PluginPropertiesDialog.h
===================================================================
RCS file: 
/sources/traverso/traverso/src/plugins/LV2/LV2PluginPropertiesDialog.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- plugins/LV2/LV2PluginPropertiesDialog.h     21 Apr 2007 15:26:49 -0000      
1.2
+++ plugins/LV2/LV2PluginPropertiesDialog.h     24 May 2007 10:56:43 -0000      
1.3
@@ -17,7 +17,7 @@
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
 
-$Id: LV2PluginPropertiesDialog.h,v 1.2 2007/04/21 15:26:49 r_sijrier Exp $
+$Id: LV2PluginPropertiesDialog.h,v 1.3 2007/05/24 10:56:43 r_sijrier Exp $
 */
 
 
@@ -30,6 +30,7 @@
 
 class LV2PluginPropertiesDialog : public QDialog
 {
+       Q_OBJECT
 
 public:
        LV2PluginPropertiesDialog(LV2Plugin* plugin);
@@ -38,6 +39,9 @@
 
 private:
        LV2Plugin*      m_plugin;
+       
+private slots:
+       void bypass_button_clicked();
 };
 
 #endif

Index: plugins/PluginChain.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/plugins/PluginChain.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- plugins/PluginChain.cpp     6 Mar 2007 15:27:42 -0000       1.9
+++ plugins/PluginChain.cpp     24 May 2007 10:56:43 -0000      1.10
@@ -27,6 +27,7 @@
 #include <InputEngine.h>
 #include <Song.h>
 #include <AddRemove.h>
+#include "AudioBus.h"
 
 // Always put me below _all_ includes, this is needed
 // in case we run with memory leak detection enabled!
@@ -117,3 +118,4 @@
 }
 
 //eof
+

Index: plugins/PluginChain.h
===================================================================
RCS file: /sources/traverso/traverso/src/plugins/PluginChain.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- plugins/PluginChain.h       1 Mar 2007 18:41:47 -0000       1.7
+++ plugins/PluginChain.h       24 May 2007 10:56:43 -0000      1.8
@@ -26,9 +26,10 @@
 #include <ContextItem.h>
 #include <QList>
 #include <QDomNode>
+#include "Plugin.h"
 
-class Plugin;
 class Song;
+class AudioBus;
 
 class PluginChain : public ContextItem
 {
@@ -43,8 +44,9 @@
        
        Command* add_plugin(Plugin* plugin, bool historable=true);
        Command* remove_plugin(Plugin* plugin, bool historable=true);
+       void process(AudioBus* bus, unsigned long nframes);
        
-       QList<Plugin* >* get_plugin_list() {return &m_pluginList;}
+       QList<Plugin* > get_plugin_list() {return m_pluginList;}
        
 private:
        QList<Plugin* > m_pluginList;
@@ -61,6 +63,13 @@
 
 };
 
+inline void PluginChain::process(AudioBus * bus, unsigned long nframes)
+{
+       for (int i=0; i<m_pluginList.size(); ++i) {
+               m_pluginList.at(i)->process(bus, nframes);
+       }
+}
+
 #endif
 
 //eof

Index: traverso/CorrelationMeterWidget.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/CorrelationMeterWidget.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- traverso/CorrelationMeterWidget.cpp 7 May 2007 18:14:38 -0000       1.22
+++ traverso/CorrelationMeterWidget.cpp 24 May 2007 10:56:43 -0000      1.23
@@ -261,9 +261,7 @@
        
        PluginChain* chain = m_song->get_plugin_chain();
        
-       QList<Plugin* >* pluginList = chain->get_plugin_list();
-       for (int i=0; i<pluginList->size(); ++i) {
-               Plugin* plugin = pluginList->at(i);
+       foreach(Plugin* plugin, chain->get_plugin_list()) {
                m_meter = dynamic_cast<CorrelationMeter*>(plugin);
                
                if (m_meter) {

Index: traverso/SpectralMeterWidget.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/SpectralMeterWidget.cpp,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -b -r1.40 -r1.41
--- traverso/SpectralMeterWidget.cpp    7 May 2007 18:14:38 -0000       1.40
+++ traverso/SpectralMeterWidget.cpp    24 May 2007 10:56:43 -0000      1.41
@@ -351,9 +351,7 @@
        connect(m_song, SIGNAL(transferStarted()), this, 
SLOT(transfer_started()));
        connect(m_song, SIGNAL(transferStopped()), this, 
SLOT(transfer_stopped()));
 
-       QList<Plugin* >* pluginList = chain->get_plugin_list();
-       for (int i=0; i<pluginList->size(); ++i) {
-               Plugin* plugin = pluginList->at(i);
+       foreach(Plugin* plugin, chain->get_plugin_list()) {
                m_meter = qobject_cast<SpectralMeter*>(plugin);
                
                if (m_meter) {

Index: traverso/songcanvas/PluginChainView.cpp
===================================================================
RCS file: 
/sources/traverso/traverso/src/traverso/songcanvas/PluginChainView.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- traverso/songcanvas/PluginChainView.cpp     7 May 2007 11:09:00 -0000       
1.12
+++ traverso/songcanvas/PluginChainView.cpp     24 May 2007 10:56:44 -0000      
1.13
@@ -45,8 +45,8 @@
 
 PluginChainView::PluginChainView(SongView* sv, ViewItem* parent, PluginChain* 
chain)
        : ViewItem(parent, parent)
-       , m_sv(sv)
        , m_pluginchain(chain)
+       , m_sv(sv)
 {
        PENTERCONS;
        
@@ -59,9 +59,7 @@
        
        hide();
        
-       QList<Plugin* >* pluginList = chain->get_plugin_list();
-       for (int i=0; i<pluginList->size(); ++i) {
-               Plugin* plugin = pluginList->at(i);
+       foreach(Plugin* plugin, chain->get_plugin_list()) {
                add_new_pluginview(plugin);
        }
        
@@ -86,7 +84,7 @@
        
        int x = 6;
        foreach(PluginView* view, m_pluginViews) {
-               x += view->boundingRect().width() + 6;
+               x += (int)view->boundingRect().width() + 6;
        }
        
        view->setPos(x, m_boundingRect.height() - 
view->boundingRect().height());
@@ -111,7 +109,7 @@
        int x = 6;
        foreach(PluginView* view, m_pluginViews) {
                view->setPos(x, m_boundingRect.height() - 
view->boundingRect().height());
-               x += view->boundingRect().width() + 6;
+               x += (int)view->boundingRect().width() + 6;
        }
        
        if (!m_pluginViews.size()) {

Index: traverso/songcanvas/PluginView.h
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/songcanvas/PluginView.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- traverso/songcanvas/PluginView.h    25 Apr 2007 13:45:18 -0000      1.8
+++ traverso/songcanvas/PluginView.h    24 May 2007 10:56:44 -0000      1.9
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
 
-    $Id: PluginView.h,v 1.8 2007/04/25 13:45:18 r_sijrier Exp $
+    $Id: PluginView.h,v 1.9 2007/05/24 10:56:44 r_sijrier Exp $
 */
 
 #ifndef PLUGIN_VIEW_H
@@ -39,7 +39,7 @@
 class PluginView : public ViewItem
 {
         Q_OBJECT
-       Q_CLASSINFO("edit_properties", tr("Settings..."))
+       Q_CLASSINFO("edit_properties", tr("Edit..."))
        Q_CLASSINFO("remove_plugin", tr("Remove"))
 
 public:




reply via email to

[Prev in Thread] Current Thread [Next in Thread]