Merge branch 'master' into fx-mixer-rework

This commit is contained in:
Tobias Doerffel
2009-10-26 00:24:45 +01:00
50 changed files with 36369 additions and 69846 deletions

View File

@@ -22,11 +22,11 @@
*
*/
#include <QtCore/QDebug>
#include "Cpu.h"
#include <cstdlib>
#include <cstdio>
#include <memory.h>
@@ -463,7 +463,7 @@ void init()
#endif
if( features & SSE )
{
fprintf( stderr, "Using SSE optimized routines\n" );
qDebug( "Using SSE optimized routines" );
memCpy = memCpySSE;
memClear = memClearSSE;
bufApplyGain = bufApplyGainSSE;
@@ -477,7 +477,7 @@ void init()
}
if( features & SSE2 )
{
fprintf( stderr, "Using SSE2 optimized routines\n" );
qDebug( "Using SSE2 optimized routines" );
memCpy = memCpySSE2;
memClear = memClearSSE2;
convertToS16 = convertToS16SSE2;

View File

@@ -0,0 +1,120 @@
/*
* AlsaDeviceListModel - allows quick access to a list of alsa devices
*
* Copyright (c) 2009 Paul Giblock <pgib/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
* 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.
*
*/
#include <QtCore/QObject>
#include "AlsaDeviceListModel.h"
#ifdef LMMS_HAVE_ALSA
AlsaDeviceListModel::AlsaDeviceListModel(
snd_rawmidi_stream_t _stream,
QObject * _parent ) :
QAbstractListModel( _parent )
{
init( "rawmidi", SND_RAWMIDI_STREAM_INPUT ?
"Input" :
"Output" );
}
AlsaDeviceListModel::AlsaDeviceListModel(
snd_pcm_stream_t _stream,
QObject * _parent ) :
QAbstractListModel( _parent )
{
init( "pcm", SND_PCM_STREAM_CAPTURE ?
"Input" :
"Output" );
}
AlsaDeviceListModel::AlsaDeviceListModel(
QObject * _parent ) :
QAbstractListModel( _parent )
{
init( "seq", NULL);
}
void AlsaDeviceListModel::init(
const char * _iface,
const char * _filter)
{
void **hints, **n;
char *name, *descr, *io;
if (snd_device_name_hint(-1, _iface, &hints) < 0)
return;
n = hints;
while (*n != NULL) {
name = snd_device_name_get_hint(*n, "NAME");
descr = snd_device_name_get_hint(*n, "DESC");
io = snd_device_name_get_hint(*n, "IOID");
// Filter out non-null or filtered items
if (io == NULL || _filter == NULL || strcmp(io, _filter) == 0)
m_devices.append(StringPair(name, descr));
if (name != NULL)
free(name);
if (descr != NULL)
free(descr);
if (io != NULL)
free(io);
n++;
}
snd_device_name_free_hint(hints);
}
int AlsaDeviceListModel::rowCount(
const QModelIndex & parent ) const
{
return m_devices.count();
}
QVariant AlsaDeviceListModel::data(
const QModelIndex & index,
int role ) const
{
switch( role )
{
case Qt::DisplayRole:
return m_devices.at( index.row() ).first;
case Qt::ToolTipRole:
case Qt::StatusTipRole:
return m_devices.at( index.row() ).second;
default:
return QVariant();
};
}
#endif // LMMS_HAVE_ALSA

View File

@@ -22,13 +22,14 @@
*
*/
#include <QtGui/QLineEdit>
#include <QtGui/QComboBox>
#include <QtGui/QLabel>
#include "AudioAlsa.h"
#ifdef LMMS_HAVE_ALSA
#include "AlsaDeviceListModel.h"
#include "endian_handling.h"
#include "config_mgr.h"
#include "engine.h"
@@ -491,16 +492,21 @@ int AudioAlsa::setSWParams()
AudioAlsa::setupWidget::setupWidget( QWidget * _parent ) :
AudioDevice::setupWidget( AudioAlsa::name(), _parent )
{
m_device = new QLineEdit( AudioAlsa::probeDevice(), this );
m_device->setGeometry( 10, 20, 160, 20 );
m_device = new QComboBox( this );
m_device->setGeometry( 10, 20, 180, 20 );
m_device->setModel( new AlsaDeviceListModel(
SND_PCM_STREAM_PLAYBACK, this ) );
m_device->setEditable( true );
m_device->setInsertPolicy( QComboBox::NoInsert );
m_device->setEditText( AudioAlsa::probeDevice() );
QLabel * dev_lbl = new QLabel( tr( "DEVICE" ), this );
dev_lbl->setFont( pointSize<6>( dev_lbl->font() ) );
dev_lbl->setGeometry( 10, 40, 160, 10 );
dev_lbl->setGeometry( 10, 40, 180, 10 );
lcdSpinBoxModel * m = new lcdSpinBoxModel( /* this */ );
m->setRange( DEFAULT_CHANNELS, SURROUND_CHANNELS );
@@ -511,7 +517,7 @@ AudioAlsa::setupWidget::setupWidget( QWidget * _parent ) :
m_channels = new lcdSpinBox( 1, this );
m_channels->setModel( m );
m_channels->setLabel( tr( "CHANNELS" ) );
m_channels->move( 180, 20 );
m_channels->move( 200, 20 );
}
@@ -529,7 +535,7 @@ AudioAlsa::setupWidget::~setupWidget()
void AudioAlsa::setupWidget::saveSettings()
{
configManager::inst()->setValue( "audioalsa", "device",
m_device->text() );
m_device->currentText() );
configManager::inst()->setValue( "audioalsa", "channels",
QString::number( m_channels->value<int>() ) );
}

View File

@@ -27,6 +27,8 @@
#ifdef LMMS_HAVE_OSS
#include <QtCore/QFileInfo>
#include <QtGui/QCompleter>
#include <QtGui/QDirModel>
#include <QtGui/QLabel>
#include <QtGui/QLineEdit>
@@ -335,6 +337,13 @@ AudioOss::setupWidget::setupWidget( QWidget * _parent ) :
m_device = new QLineEdit( probeDevice(), this );
m_device->setGeometry( 10, 20, 160, 20 );
QDirModel * model = new QDirModel( QStringList(),
QDir::AllDirs | QDir::System,
QDir::Name | QDir::DirsFirst,
this );
m_device->setCompleter( new QCompleter( model, this ) );
QLabel * dev_lbl = new QLabel( tr( "DEVICE" ), this );
dev_lbl->setFont( pointSize<6>( dev_lbl->font() ) );
dev_lbl->setGeometry( 10, 40, 160, 10 );

View File

@@ -23,8 +23,9 @@
*/
#include <QtGui/QLabel>
#include <QtGui/QLineEdit>
#include <QtGui/QComboBox>
#include "AlsaDeviceListModel.h"
#include "MidiAlsaRaw.h"
#include "config_mgr.h"
#include "gui_templates.h"
@@ -179,8 +180,14 @@ void MidiAlsaRaw::run()
MidiAlsaRaw::setupWidget::setupWidget( QWidget * _parent ) :
MidiClientRaw::setupWidget( MidiAlsaRaw::name(), _parent )
{
m_device = new QLineEdit( MidiAlsaRaw::probeDevice(), this );
m_device->setGeometry( 10, 20, 160, 20 );
m_device = new QComboBox( this );
m_device->setGeometry( 10, 20, 180, 20 );
m_device->setModel( new AlsaDeviceListModel(
SND_RAWMIDI_STREAM_INPUT,
this ) );
m_device->setEditable( true );
m_device->setInsertPolicy( QComboBox::NoInsert );
m_device->setEditText( MidiAlsaRaw::probeDevice() );
QLabel * dev_lbl = new QLabel( tr( "DEVICE" ), this );
dev_lbl->setFont( pointSize<6>( dev_lbl->font() ) );
@@ -200,7 +207,7 @@ MidiAlsaRaw::setupWidget::~setupWidget()
void MidiAlsaRaw::setupWidget::saveSettings()
{
configManager::inst()->setValue( "MidiAlsaRaw", "Device",
m_device->text() );
m_device->currentText() );
}

View File

@@ -669,7 +669,7 @@ MidiAlsaSeq::setupWidget::setupWidget( QWidget * _parent ) :
MidiClient::setupWidget( MidiAlsaSeq::name(), _parent )
{
m_device = new QLineEdit( MidiAlsaSeq::probeDevice(), this );
m_device->setGeometry( 10, 20, 160, 20 );
m_device->setGeometry( 10, 20, 180, 20 );
QLabel * dev_lbl = new QLabel( tr( "DEVICE" ), this );
dev_lbl->setFont( pointSize<6>( dev_lbl->font() ) );

View File

@@ -28,6 +28,8 @@
#ifdef LMMS_HAVE_OSS
#include <QtGui/QCompleter>
#include <QtGui/QDirModel>
#include <QtGui/QLabel>
#include <QtGui/QLineEdit>
@@ -118,11 +120,17 @@ MidiOss::setupWidget::setupWidget( QWidget * _parent ) :
MidiClientRaw::setupWidget( MidiOss::name(), _parent )
{
m_device = new QLineEdit( MidiOss::probeDevice(), this );
m_device->setGeometry( 10, 20, 160, 20 );
m_device->setGeometry( 10, 20, 180, 20 );
QDirModel * model = new QDirModel( QStringList(),
QDir::AllDirs | QDir::System,
QDir::Name | QDir::DirsFirst,
this );
m_device->setCompleter( new QCompleter( model, this ) );
QLabel * dev_lbl = new QLabel( tr( "DEVICE" ), this );
dev_lbl->setFont( pointSize<6>( dev_lbl->font() ) );
dev_lbl->setGeometry( 10, 40, 160, 10 );
dev_lbl->setGeometry( 10, 40, 180, 10 );
}