PlayHandle: use QList instead of QVector for PlayHandle array

Use QList instead of QVector when using a set of PlayHandle's. QList
has faster insert/remove operations and in most cases we iterate through
the array using iterators so there's no performance drop.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
This commit is contained in:
Tobias Doerffel
2009-06-15 15:04:55 +02:00
parent 08ea133aa2
commit 2cc49b8010
5 changed files with 27 additions and 27 deletions

View File

@@ -1,7 +1,7 @@
/*
* mixer.h - audio-device-independent mixer for LMMS
*
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -227,7 +227,7 @@ public:
void removePlayHandle( playHandle * _ph );
inline playHandleVector & playHandles( void )
inline PlayHandleList & playHandles( void )
{
return m_playHandles;
}
@@ -436,8 +436,8 @@ private:
QWaitCondition m_queueReadyWaitCond;
playHandleVector m_playHandles;
constPlayHandleVector m_playHandlesToRemove;
PlayHandleList m_playHandles;
ConstPlayHandleList m_playHandlesToRemove;
struct qualitySettings m_qualitySettings;
float m_masterGain;

View File

@@ -1,8 +1,8 @@
/*
* play_handle.h - base-class playHandle - core of rendering engine
*
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
@@ -22,7 +22,6 @@
*
*/
#ifndef _PLAY_HANDLE_H
#define _PLAY_HANDLE_H
@@ -98,8 +97,8 @@ private:
} ;
typedef QVector<playHandle *> playHandleVector;
typedef QVector<const playHandle *> constPlayHandleVector;
typedef QList<playHandle *> PlayHandleList;
typedef QList<const playHandle *> ConstPlayHandleList;
#endif