Small refactor in FxMixerView and FxMixer (#5577)

FxMixerView.cpp and FxMixer.cpp were inconsistent in their use of TrackContainer::TrackList vs QVector<Track *>. The former is a typedef of the latter, so this PR replaces all instances of QVector<Track *> with TrackContainer::TrackList.

Also, we were not including "TrackContainer.h" directly (the typedef was likely being included indirectly through one of the other include files), so we also include this header on both source codes.
This commit is contained in:
Spekular
2020-07-12 16:32:12 +02:00
committed by GitHub
2 changed files with 10 additions and 8 deletions

View File

@@ -34,6 +34,7 @@
#include "InstrumentTrack.h"
#include "SampleTrack.h"
#include "BBTrackContainer.h"
#include "TrackContainer.h" // For TrackContainer::TrackList typedef
FxRoute::FxRoute( FxChannel * from, FxChannel * to, float amount ) :
m_from( from ),
@@ -383,13 +384,13 @@ void FxMixer::moveChannelLeft( int index )
else if (m_lastSoloed == b) { m_lastSoloed = a; }
// go through every instrument and adjust for the channel index change
QVector<Track *> songTrackList = Engine::getSong()->tracks();
QVector<Track *> bbTrackList = Engine::getBBTrackContainer()->tracks();
TrackContainer::TrackList songTrackList = Engine::getSong()->tracks();
TrackContainer::TrackList bbTrackList = Engine::getBBTrackContainer()->tracks();
QVector<Track *> trackLists[] = {songTrackList, bbTrackList};
TrackContainer::TrackList trackLists[] = {songTrackList, bbTrackList};
for(int tl=0; tl<2; ++tl)
{
QVector<Track *> trackList = trackLists[tl];
TrackContainer::TrackList trackList = trackLists[tl];
for(int i=0; i<trackList.size(); ++i)
{
if( trackList[i]->type() == Track::InstrumentTrack )

View File

@@ -50,6 +50,7 @@
#include "SampleTrack.h"
#include "Song.h"
#include "BBTrackContainer.h"
#include "TrackContainer.h" // For TrackContainer::TrackList typedef
FxMixerView::FxMixerView() :
QWidget(),
@@ -237,13 +238,13 @@ void FxMixerView::refreshDisplay()
// update the and max. channel number for every instrument
void FxMixerView::updateMaxChannelSelector()
{
QVector<Track *> songTrackList = Engine::getSong()->tracks();
QVector<Track *> bbTrackList = Engine::getBBTrackContainer()->tracks();
TrackContainer::TrackList songTrackList = Engine::getSong()->tracks();
TrackContainer::TrackList bbTrackList = Engine::getBBTrackContainer()->tracks();
QVector<Track *> trackLists[] = {songTrackList, bbTrackList};
TrackContainer::TrackList trackLists[] = {songTrackList, bbTrackList};
for(int tl=0; tl<2; ++tl)
{
QVector<Track *> trackList = trackLists[tl];
TrackContainer::TrackList trackList = trackLists[tl];
for(int i=0; i<trackList.size(); ++i)
{
if( trackList[i]->type() == Track::InstrumentTrack )