new audio-mixing system and new VST-support-framework
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@25 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* audio_alsa.cpp - device-class that implements ALSA-PCM-output
|
||||
* audio_alsa.cpp - device-class which implements ALSA-PCM-output
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* audio_device.cpp - base-class for audio-devices used by LMMS-mixer
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
@@ -94,6 +95,29 @@ void audioDevice::writeBuffer( surroundSampleFrame * _ab, Uint32 _frames,
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void audioDevice::registerPort( audioPort * )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void audioDevice::unregisterPort( audioPort * _port )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void audioDevice::renamePort( audioPort *, const QString & )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef HAVE_SAMPLERATE_H
|
||||
const Uint8 LP_FILTER_TAPS = 24;
|
||||
const float LP_FILTER_COEFFS[LP_FILTER_TAPS] =
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
* audio_file_device.cpp - base-class for audio-device-classes which write
|
||||
* their output into a file
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
* This file is based on encode.c from vorbis-tools-source, for more information
|
||||
* see below.
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
* audio_file_wave.cpp - Audio-device which encodes wave-stream and writes it
|
||||
* into a WAVE-file. This is used for song-export.
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* audio_jack.cpp - support for JACK-transport
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
@@ -37,11 +38,13 @@
|
||||
|
||||
#include <QLineEdit>
|
||||
#include <QLabel>
|
||||
#include <QMessageBox>
|
||||
|
||||
#else
|
||||
|
||||
#include <qlineedit.h>
|
||||
#include <qlabel.h>
|
||||
#include <qmessagebox.h>
|
||||
|
||||
#endif
|
||||
|
||||
@@ -117,14 +120,15 @@ audioJACK::audioJACK( Uint32 _sample_rate, bool & _success_ful ) :
|
||||
// set process-callback
|
||||
jack_set_process_callback( m_client, processCallback, this );
|
||||
|
||||
m_jackBufSize = jack_get_buffer_size( m_client );
|
||||
|
||||
// we need to know about buffer-size changes to know how long to block
|
||||
// in writeToDev()-method
|
||||
jack_set_buffer_size_callback( m_client, bufSizeCallback, this );
|
||||
|
||||
// set shutdown-callback
|
||||
//jack_on_shutdown( m_client, shutdown, this );
|
||||
jack_on_shutdown( m_client, shutdownCallback, this );
|
||||
|
||||
m_jackBufSize = jack_get_buffer_size( m_client );
|
||||
|
||||
|
||||
if( jack_get_sample_rate( m_client ) != sampleRate() )
|
||||
@@ -161,6 +165,19 @@ audioJACK::audioJACK( Uint32 _sample_rate, bool & _success_ful ) :
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// make sure, JACK transport is rolling
|
||||
if( jack_transport_query( m_client, NULL ) != JackTransportRolling )
|
||||
{
|
||||
jack_transport_start( m_client );
|
||||
}
|
||||
|
||||
|
||||
// try to sync JACK's and LMMS's buffer-size
|
||||
jack_set_buffer_size( m_client, mixer::inst()->framesPerAudioBuffer() );
|
||||
|
||||
|
||||
|
||||
const char * * ports = jack_get_ports( m_client, NULL, NULL,
|
||||
JackPortIsPhysical |
|
||||
JackPortIsInput );
|
||||
@@ -186,6 +203,7 @@ audioJACK::audioJACK( Uint32 _sample_rate, bool & _success_ful ) :
|
||||
|
||||
free( ports );
|
||||
|
||||
|
||||
_success_ful = TRUE;
|
||||
}
|
||||
|
||||
@@ -194,8 +212,11 @@ audioJACK::audioJACK( Uint32 _sample_rate, bool & _success_ful ) :
|
||||
|
||||
audioJACK::~audioJACK()
|
||||
{
|
||||
jack_deactivate( m_client );
|
||||
jack_client_close( m_client );
|
||||
if( m_client != NULL )
|
||||
{
|
||||
jack_deactivate( m_client );
|
||||
jack_client_close( m_client );
|
||||
}
|
||||
|
||||
while( m_bufferSets.size() )
|
||||
{
|
||||
@@ -216,6 +237,11 @@ audioJACK::~audioJACK()
|
||||
void audioJACK::writeBufferToDev( surroundSampleFrame * _ab, Uint32 _frames,
|
||||
float _master_gain )
|
||||
{
|
||||
if( m_client == NULL )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_bufMutex.lock();
|
||||
|
||||
jack_transport_state_t ts = jack_transport_query( m_client, NULL );
|
||||
@@ -258,10 +284,33 @@ void audioJACK::writeBufferToDev( surroundSampleFrame * _ab, Uint32 _frames,
|
||||
|
||||
|
||||
|
||||
void audioJACK::registerPort( audioPort * )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void audioJACK::unregisterPort( audioPort * _port )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void audioJACK::renamePort( audioPort *, const QString & )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int audioJACK::processCallback( jack_nframes_t _nframes, void * _udata )
|
||||
{
|
||||
audioJACK * _this = static_cast<audioJACK *>( _udata );
|
||||
|
||||
/* printf( "%f\n", jack_cpu_load( _this->m_client ) );*/
|
||||
|
||||
#ifdef LMMS_DEBUG
|
||||
assert( _this != NULL );
|
||||
#endif
|
||||
@@ -272,7 +321,8 @@ int audioJACK::processCallback( jack_nframes_t _nframes, void * _udata )
|
||||
if( ts != JackTransportRolling )
|
||||
{
|
||||
// always decrease frame-sync-var as we would do it if running
|
||||
// in normal mode, so that the mixer-thread does up
|
||||
// in normal mode, so that the mixer-thread knows when to
|
||||
// proceed
|
||||
if( _nframes < _this->m_frameSync )
|
||||
{
|
||||
_this->m_frameSync -= _nframes;
|
||||
@@ -331,17 +381,20 @@ int audioJACK::processCallback( jack_nframes_t _nframes, void * _udata )
|
||||
_this->m_frameSync -= todo;
|
||||
}
|
||||
|
||||
// we have to clear the part of the buffers, we could not fill because
|
||||
// no usable data is left, otherwise there's baaaaaad noise... ;-)
|
||||
// we have to clear the part of the buffers, if we could not fill
|
||||
// because no usable data is left, otherwise there's baaaaaad
|
||||
// noise... ;-)
|
||||
if( done < _nframes )
|
||||
{
|
||||
for( Uint8 ch = 0; ch < _this->channels(); ++ch )
|
||||
{
|
||||
jack_default_audio_sample_t * b = outbufs[ch];
|
||||
for( Uint32 frame = done; frame < _nframes; ++frame )
|
||||
memset( b + done, 0,
|
||||
sizeof( *b ) * ( _nframes - done ) );
|
||||
/* for( Uint32 frame = done; frame < _nframes; ++frame )
|
||||
{
|
||||
b[frame] = 0.0f;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -368,6 +421,23 @@ int audioJACK::bufSizeCallback( jack_nframes_t _nframes, void * _udata )
|
||||
|
||||
|
||||
|
||||
void audioJACK::shutdownCallback( void * _udata )
|
||||
{
|
||||
audioJACK * _this = static_cast<audioJACK *>( _udata );
|
||||
_this->m_client = NULL;
|
||||
/* QMessageBox::information( 0, setupWidget::tr( "JACK-server down" ),
|
||||
setupWidget::tr( "You seem to have "
|
||||
"shutdown JACK-server, so "
|
||||
"LMMS is unable to proceed. "
|
||||
"You should save your project "
|
||||
"and restart LMMS!" ),
|
||||
QMessageBox::Ok );*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
audioJACK::setupWidget::setupWidget( QWidget * _parent ) :
|
||||
audioDevice::setupWidget( audioJACK::name(), _parent )
|
||||
{
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* audio_oss.cpp - device-class that implements OSS-PCM-output
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
100
src/audio/audio_port.cpp
Normal file
100
src/audio/audio_port.cpp
Normal file
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* audio_port.cpp - base-class for objects providing sound at a port
|
||||
*
|
||||
* Copyright (c) 2004-2005 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
|
||||
* 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., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "audio_port.h"
|
||||
#include "audio_device.h"
|
||||
#include "buffer_allocator.h"
|
||||
|
||||
|
||||
audioPort::audioPort( const QString & _name ) :
|
||||
m_bufferUsage( NONE ),
|
||||
m_firstBuffer( bufferAllocator::alloc<surroundSampleFrame>(
|
||||
mixer::inst()->framesPerAudioBuffer() ) ),
|
||||
m_secondBuffer( bufferAllocator::alloc<surroundSampleFrame>(
|
||||
mixer::inst()->framesPerAudioBuffer() ) ),
|
||||
m_extOutputEnabled( FALSE ),
|
||||
m_nextFxChannel( -1 )
|
||||
{
|
||||
mixer::inst()->clearAudioBuffer( m_firstBuffer,
|
||||
mixer::inst()->framesPerAudioBuffer() );
|
||||
mixer::inst()->clearAudioBuffer( m_secondBuffer,
|
||||
mixer::inst()->framesPerAudioBuffer() );
|
||||
mixer::inst()->addAudioPort( this );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
audioPort::~audioPort()
|
||||
{
|
||||
mixer::inst()->removeAudioPort( this );
|
||||
if( m_extOutputEnabled == TRUE )
|
||||
{
|
||||
mixer::inst()->audioDev()->unregisterPort( this );
|
||||
}
|
||||
bufferAllocator::free( m_firstBuffer );
|
||||
bufferAllocator::free( m_secondBuffer );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void audioPort::nextPeriod( void )
|
||||
{
|
||||
mixer::inst()->clearAudioBuffer( m_firstBuffer,
|
||||
mixer::inst()->framesPerAudioBuffer() );
|
||||
qSwap( m_firstBuffer, m_secondBuffer );
|
||||
// this is how we decrease state of buffer-usage ;-)
|
||||
m_bufferUsage = ( m_bufferUsage != NONE ) ?
|
||||
( ( m_bufferUsage == FIRST ) ? NONE : FIRST ) : NONE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void audioPort::setExtOutputEnabled( bool _enabled )
|
||||
{
|
||||
if( _enabled != m_extOutputEnabled )
|
||||
{
|
||||
m_extOutputEnabled = _enabled;
|
||||
if( m_extOutputEnabled )
|
||||
{
|
||||
mixer::inst()->audioDev()->registerPort( this );
|
||||
}
|
||||
else
|
||||
{
|
||||
mixer::inst()->audioDev()->unregisterPort( this );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void audioPort::setName( const QString & _name )
|
||||
{
|
||||
mixer::inst()->audioDev()->renamePort( this, _name );
|
||||
}
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
* surround-audio-buffers into RAM, maybe later
|
||||
* also harddisk
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* audio_sdl.cpp - device-class that performs PCM-output via SDL
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* about_dialog.cpp - implementation of about-dialog
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
* arp_and_chords_tab_widget.cpp - widget for use in arp/chord-tab of
|
||||
* channel-window
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* bb_editor.cpp - basic main-window for editing of beats and basslines
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* config_mgr.cpp - implementation of class configManager
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
* envelope_widget.cpp - widget which is m_used by envelope/lfo/filter-tab of
|
||||
* channel-window
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
* envelope_tab_widget.cpp - widget for use in envelope/lfo/filter-tab of
|
||||
* channel-window
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* export_project_dialog.cpp - implementation of dialog for exporting project
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* file_browser.cpp - implementation of the project-, preset- and sample-file-browser
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* instrument.cpp - base-class for all instrument-plugins (synths, samplers etc)
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* main.cpp - just main.cpp which is starting up app...
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
* midi_tab_widget.cpp - tab-widget in channel-track-window for setting up
|
||||
* MIDI-related stuff
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* mixer.cpp - audio-device-independent mixer for LMMS
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
@@ -30,6 +31,7 @@
|
||||
#include "buffer_allocator.h"
|
||||
#include "debug.h"
|
||||
#include "config_mgr.h"
|
||||
#include "audio_port.h"
|
||||
|
||||
#include "audio_device.h"
|
||||
#include "midi_client.h"
|
||||
@@ -59,13 +61,11 @@ mixer::mixer() :
|
||||
QObject(),
|
||||
#endif
|
||||
QThread(),
|
||||
m_silence(),
|
||||
/* m_silence(),
|
||||
#ifndef DISABLE_SURROUND
|
||||
m_surroundSilence(),
|
||||
#endif
|
||||
#endif*/
|
||||
m_framesPerAudioBuffer( DEFAULT_BUFFER_SIZE ),
|
||||
m_buffer1( NULL ),
|
||||
m_buffer2( NULL ),
|
||||
m_curBuf( NULL ),
|
||||
m_nextBuf( NULL ),
|
||||
m_discardCurBuf( FALSE ),
|
||||
@@ -91,26 +91,17 @@ mixer::mixer() :
|
||||
QString::number( m_framesPerAudioBuffer ) );
|
||||
}
|
||||
|
||||
m_buffer1 = bufferAllocator::alloc<surroundSampleFrame>(
|
||||
m_curBuf = bufferAllocator::alloc<surroundSampleFrame>(
|
||||
m_framesPerAudioBuffer );
|
||||
m_buffer2 = bufferAllocator::alloc<surroundSampleFrame>(
|
||||
m_nextBuf = bufferAllocator::alloc<surroundSampleFrame>(
|
||||
m_framesPerAudioBuffer );
|
||||
|
||||
m_curBuf = m_buffer1;
|
||||
m_nextBuf = m_buffer2;
|
||||
|
||||
|
||||
m_audioDev = tryAudioDevices();
|
||||
m_midiClient = tryMIDIClients();
|
||||
|
||||
|
||||
for( int i = 0; i < MAX_SAMPLE_PACKETS; ++i )
|
||||
{
|
||||
m_samplePackets[i].m_buffer = NULL;
|
||||
m_samplePackets[i].m_state = samplePacket::UNUSED;
|
||||
}
|
||||
|
||||
m_silence = bufferAllocator::alloc<sampleFrame>(
|
||||
/* m_silence = bufferAllocator::alloc<sampleFrame>(
|
||||
m_framesPerAudioBuffer );
|
||||
#ifndef DISABLE_SURROUND
|
||||
m_surroundSilence = bufferAllocator::alloc<surroundSampleFrame>(
|
||||
@@ -128,11 +119,11 @@ mixer::mixer() :
|
||||
m_surroundSilence[frame][chnl] = 0.0f;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}*/
|
||||
|
||||
// now clear our two output-buffers before using them...
|
||||
clearAudioBuffer( m_buffer1, m_framesPerAudioBuffer );
|
||||
clearAudioBuffer( m_buffer2, m_framesPerAudioBuffer );
|
||||
clearAudioBuffer( m_curBuf, m_framesPerAudioBuffer );
|
||||
clearAudioBuffer( m_nextBuf, m_framesPerAudioBuffer );
|
||||
|
||||
}
|
||||
|
||||
@@ -144,21 +135,14 @@ mixer::~mixer()
|
||||
delete m_audioDev;
|
||||
delete m_midiClient;
|
||||
|
||||
bufferAllocator::free( m_buffer1 );
|
||||
bufferAllocator::free( m_buffer2 );
|
||||
bufferAllocator::free( m_curBuf );
|
||||
bufferAllocator::free( m_nextBuf );
|
||||
|
||||
for( int i = 0; i < MAX_SAMPLE_PACKETS; ++i )
|
||||
{
|
||||
if( m_samplePackets[i].m_state != samplePacket::UNUSED )
|
||||
{
|
||||
bufferAllocator::free( m_samplePackets[i].m_buffer );
|
||||
}
|
||||
}
|
||||
|
||||
bufferAllocator::free( m_silence );
|
||||
/* bufferAllocator::free( m_silence );
|
||||
#ifndef DISABLE_SURROUND
|
||||
bufferAllocator::free( m_surroundSilence );
|
||||
#endif
|
||||
#endif*/
|
||||
}
|
||||
|
||||
|
||||
@@ -235,32 +219,15 @@ void mixer::run( void )
|
||||
|
||||
songEditor::inst()->processNextBuffer();
|
||||
|
||||
// check for samples-packets that have to be mixed in
|
||||
// the current audio-buffer
|
||||
for( int i = 0; i < MAX_SAMPLE_PACKETS; ++i )
|
||||
for( vvector<audioPort *>::iterator it = m_audioPorts.begin();
|
||||
it != m_audioPorts.end(); ++it )
|
||||
{
|
||||
if( m_samplePackets[i].m_state == samplePacket::READY )
|
||||
if( ( *it )->m_bufferUsage != audioPort::NONE )
|
||||
{
|
||||
if( m_samplePackets[i].m_framesAhead <=
|
||||
m_framesPerAudioBuffer )
|
||||
{
|
||||
// found one! mix it...
|
||||
mixSamplePacket( &m_samplePackets[i] );
|
||||
// now this audio-sample can be used
|
||||
// again
|
||||
bufferAllocator::free(
|
||||
m_samplePackets[i].m_buffer );
|
||||
m_samplePackets[i].m_state =
|
||||
samplePacket::UNUSED;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_samplePackets[i].m_framesAhead -=
|
||||
m_framesPerAudioBuffer;
|
||||
}
|
||||
|
||||
processBuffer( ( *it )->firstBuffer(),
|
||||
( *it )->nextFxChannel() );
|
||||
( *it )->nextPeriod();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if( !m_discardCurBuf )
|
||||
@@ -280,7 +247,7 @@ void mixer::run( void )
|
||||
}
|
||||
|
||||
emit nextAudioBuffer( m_curBuf, m_framesPerAudioBuffer );
|
||||
|
||||
usleep( 1 ); // give time to other threads/processes
|
||||
|
||||
m_safetySyncMutex.unlock();
|
||||
|
||||
@@ -318,7 +285,8 @@ void mixer::clear( void )
|
||||
|
||||
void FASTCALL mixer::clearAudioBuffer( sampleFrame * _ab, Uint32 _frames )
|
||||
{
|
||||
if( _frames == m_framesPerAudioBuffer )
|
||||
memset( _ab, 0, sizeof( *_ab ) * _frames );
|
||||
/* if( _frames == m_framesPerAudioBuffer )
|
||||
{
|
||||
memcpy( _ab, m_silence, m_framesPerAudioBuffer *
|
||||
BYTES_PER_FRAME );
|
||||
@@ -332,7 +300,7 @@ void FASTCALL mixer::clearAudioBuffer( sampleFrame * _ab, Uint32 _frames )
|
||||
_ab[frame][ch] = 0.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
@@ -341,7 +309,8 @@ void FASTCALL mixer::clearAudioBuffer( sampleFrame * _ab, Uint32 _frames )
|
||||
void FASTCALL mixer::clearAudioBuffer( surroundSampleFrame * _ab,
|
||||
Uint32 _frames )
|
||||
{
|
||||
if( _frames == m_framesPerAudioBuffer )
|
||||
memset( _ab, 0, sizeof( *_ab ) * _frames );
|
||||
/* if( _frames == m_framesPerAudioBuffer )
|
||||
{
|
||||
memcpy( _ab, m_surroundSilence, m_framesPerAudioBuffer *
|
||||
BYTES_PER_SURROUND_FRAME );
|
||||
@@ -355,59 +324,52 @@ void FASTCALL mixer::clearAudioBuffer( surroundSampleFrame * _ab,
|
||||
_ab[frame][ch] = 0.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
void FASTCALL mixer::addBuffer( sampleFrame * _buf, Uint32 _frames,
|
||||
void FASTCALL mixer::bufferToPort( sampleFrame * _buf, Uint32 _frames,
|
||||
Uint32 _frames_ahead,
|
||||
volumeVector & _volume_vector )
|
||||
volumeVector & _volume_vector,
|
||||
audioPort * _port )
|
||||
{
|
||||
#ifdef LMMS_DEBUG
|
||||
bool success = FALSE;
|
||||
#endif
|
||||
for ( Uint16 i = 0; i < MAX_SAMPLE_PACKETS; ++i )
|
||||
Uint32 start_frame = _frames_ahead % m_framesPerAudioBuffer;
|
||||
Uint32 end_frame = start_frame + _frames;
|
||||
Uint32 loop1_frame = tMin( end_frame, m_framesPerAudioBuffer );
|
||||
for( Uint32 frame = start_frame; frame < loop1_frame; ++frame )
|
||||
{
|
||||
if( m_samplePackets[i].m_state == samplePacket::UNUSED )
|
||||
for( Uint8 chnl = 0; chnl < SURROUND_CHANNELS; ++chnl )
|
||||
{
|
||||
m_samplePackets[i].m_state = samplePacket::FILLING;
|
||||
m_samplePackets[i].m_frames = _frames;//m_framesPerAudioBuffer;
|
||||
m_samplePackets[i].m_framesDone = 0;
|
||||
m_samplePackets[i].m_framesAhead = _frames_ahead;
|
||||
|
||||
m_samplePackets[i].m_buffer =
|
||||
bufferAllocator::alloc<surroundSampleFrame>(
|
||||
m_framesPerAudioBuffer );
|
||||
// now we have to make a surround-buffer out of a
|
||||
// stereo-buffer (could be done more easily if there
|
||||
// would be no volume-vector...)
|
||||
for( Uint32 frame = 0; frame < _frames/*m_framesPerAudioBuffer*/;
|
||||
++frame )
|
||||
{
|
||||
for( Uint8 chnl = 0; chnl < SURROUND_CHANNELS;
|
||||
++chnl )
|
||||
{
|
||||
m_samplePackets[i].m_buffer[frame][chnl] =
|
||||
_buf[frame][chnl%DEFAULT_CHANNELS] *
|
||||
_port->firstBuffer()[frame][chnl] +=
|
||||
_buf[frame - start_frame][chnl %
|
||||
DEFAULT_CHANNELS] *
|
||||
_volume_vector.vol[chnl];
|
||||
}
|
||||
}
|
||||
|
||||
m_samplePackets[i].m_state = samplePacket::READY;
|
||||
#ifdef LMMS_DEBUG
|
||||
success = TRUE;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
#ifdef LMMS_DEBUG
|
||||
if( success == FALSE )
|
||||
if( end_frame > m_framesPerAudioBuffer )
|
||||
{
|
||||
qWarning( "No sample-packets left in mixer::addBuffer(...)!\n" );
|
||||
Uint32 frames_done = m_framesPerAudioBuffer - start_frame;
|
||||
end_frame = tMin( end_frame -= m_framesPerAudioBuffer,
|
||||
m_framesPerAudioBuffer );
|
||||
for( Uint32 frame = 0; frame < end_frame; ++frame )
|
||||
{
|
||||
for( Uint8 chnl = 0; chnl < SURROUND_CHANNELS; ++chnl )
|
||||
{
|
||||
_port->secondBuffer()[frame][chnl] +=
|
||||
_buf[frames_done + frame][chnl %
|
||||
DEFAULT_CHANNELS] *
|
||||
_volume_vector.vol[chnl];
|
||||
}
|
||||
}
|
||||
_port->m_bufferUsage = audioPort::BOTH;
|
||||
}
|
||||
#endif
|
||||
else if( _port->m_bufferUsage == audioPort::NONE )
|
||||
{
|
||||
_port->m_bufferUsage = audioPort::FIRST;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -509,51 +471,6 @@ void mixer::checkValidityOfPlayHandles( void )
|
||||
|
||||
|
||||
|
||||
void FASTCALL mixer::mixSamplePacket( samplePacket * _sp )
|
||||
{
|
||||
Uint32 start_frame = _sp->m_framesAhead % m_framesPerAudioBuffer;
|
||||
Uint32 end_frame = start_frame + _sp->m_frames;//m_framesPerAudioBuffer;
|
||||
|
||||
if( end_frame <= m_framesPerAudioBuffer )
|
||||
{
|
||||
for( Uint32 frame = start_frame; frame < end_frame; ++frame )
|
||||
{
|
||||
for( Uint8 chnl = 0; chnl < SURROUND_CHANNELS; ++chnl )
|
||||
{
|
||||
m_curBuf[frame][chnl] +=
|
||||
_sp->m_buffer[frame-start_frame][chnl];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for( Uint32 frame = start_frame; frame <
|
||||
m_framesPerAudioBuffer; ++frame )
|
||||
{
|
||||
for( Uint8 chnl = 0; chnl < SURROUND_CHANNELS; ++chnl )
|
||||
{
|
||||
m_curBuf[frame][chnl] +=
|
||||
_sp->m_buffer[frame-start_frame][chnl];
|
||||
}
|
||||
}
|
||||
|
||||
Uint32 frames_done = m_framesPerAudioBuffer - start_frame;
|
||||
end_frame = tMin( end_frame -= m_framesPerAudioBuffer,
|
||||
m_framesPerAudioBuffer );
|
||||
|
||||
for( Uint32 frame = 0; frame < end_frame; ++frame )
|
||||
{
|
||||
for( Uint8 chnl = 0; chnl < SURROUND_CHANNELS; ++chnl )
|
||||
{
|
||||
m_nextBuf[frame][chnl] +=
|
||||
_sp->m_buffer[frames_done+frame][chnl];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
audioDevice * mixer::tryAudioDevices( void )
|
||||
{
|
||||
@@ -693,5 +610,19 @@ midiClient * mixer::tryMIDIClients( void )
|
||||
|
||||
|
||||
|
||||
|
||||
void mixer::processBuffer( surroundSampleFrame * _buf, fxChnl/* _fx_chnl */ )
|
||||
{
|
||||
// TODO: effect-implementation
|
||||
for( Uint32 frame = 0; frame < m_framesPerAudioBuffer; ++frame )
|
||||
{
|
||||
for( Uint8 chnl = 0; chnl < SURROUND_CHANNELS; ++chnl )
|
||||
{
|
||||
m_curBuf[frame][chnl] += _buf[frame][chnl];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#include "mixer.moc"
|
||||
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
* name_label.cpp - implementation of class nameLabel, a label which
|
||||
* is renamable by double-clicking it
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* note.cpp - implementation of class note
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
* note_play_handle.cpp - implementation of class notePlayHandle, part of
|
||||
* play-engine
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
* piano_roll.cpp - implementation of piano-roll which is used for actual
|
||||
* writing of melodies
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
* piano_widget.cpp - implementation of piano-widget used in channel-window
|
||||
* for testing channel
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* plugin.cpp - implemenation of plugin-class including plugin-loader
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
@@ -93,7 +94,7 @@ plugin * plugin::instantiate( const QString & _plugin_name, void * _data )
|
||||
#else
|
||||
ascii()
|
||||
#endif
|
||||
, RTLD_LAZY );
|
||||
, RTLD_NOW );
|
||||
if( handle == NULL )
|
||||
{
|
||||
QMessageBox::information( NULL,
|
||||
@@ -132,7 +133,7 @@ plugin * plugin::instantiate( const QString & _plugin_name, void * _data )
|
||||
void plugin::getDescriptorsOfAvailPlugins( vvector<descriptor> & _plugin_descs )
|
||||
{
|
||||
QDir directory( configManager::inst()->pluginDir() );
|
||||
const QFileInfoList * list = directory.entryInfoList( "*.so" );
|
||||
const QFileInfoList * list = directory.entryInfoList( "lib*.so" );
|
||||
if( list == NULL )
|
||||
{
|
||||
return;
|
||||
@@ -141,7 +142,7 @@ void plugin::getDescriptorsOfAvailPlugins( vvector<descriptor> & _plugin_descs )
|
||||
file != list->end(); ++file )
|
||||
{
|
||||
void * handle = dlopen( ( *file )->absFilePath().latin1(),
|
||||
RTLD_LAZY );
|
||||
RTLD_NOW );
|
||||
char * msg = dlerror();
|
||||
if( msg != NULL || handle == NULL )
|
||||
{
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* plugin_browser.cpp - implementation of the plugin-browser
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
* preset_preview_play_handle.cpp - implementation of class
|
||||
* presetPreviewPlayHandle
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* sample_play_handle.cpp - implementation of class samplePlayHandle
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
@@ -30,6 +31,8 @@
|
||||
#include "sample_play_handle.h"
|
||||
#include "sample_buffer.h"
|
||||
#include "buffer_allocator.h"
|
||||
#include "audio_port.h"
|
||||
|
||||
|
||||
|
||||
samplePlayHandle::samplePlayHandle( const QString & _sample_file ) :
|
||||
@@ -37,17 +40,21 @@ samplePlayHandle::samplePlayHandle( const QString & _sample_file ) :
|
||||
m_sampleBuffer( new sampleBuffer( _sample_file ) ),
|
||||
m_ownSampleBuffer( TRUE ),
|
||||
m_doneMayReturnTrue( TRUE ),
|
||||
m_frame( 0 )
|
||||
m_frame( 0 ),
|
||||
m_audioPort( new audioPort( "samplePlayHandle" ) )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
samplePlayHandle::samplePlayHandle( sampleBuffer * _sample_buffer ) :
|
||||
playHandle(),
|
||||
m_sampleBuffer( _sample_buffer ),
|
||||
m_ownSampleBuffer( FALSE ),
|
||||
m_doneMayReturnTrue( TRUE ),
|
||||
m_frame( 0 )
|
||||
m_frame( 0 ),
|
||||
m_audioPort( new audioPort( "samplePlayHandle" ) )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -59,6 +66,7 @@ samplePlayHandle::~samplePlayHandle()
|
||||
{
|
||||
delete m_sampleBuffer;
|
||||
}
|
||||
delete m_audioPort;
|
||||
}
|
||||
|
||||
|
||||
@@ -80,8 +88,8 @@ void samplePlayHandle::play( void )
|
||||
#endif
|
||||
} ;
|
||||
m_sampleBuffer->play( buf, m_frame );
|
||||
mixer::inst()->addBuffer( buf, mixer::inst()->framesPerAudioBuffer(),
|
||||
0, v );
|
||||
mixer::inst()->bufferToPort( buf, mixer::inst()->framesPerAudioBuffer(),
|
||||
0, v, m_audioPort );
|
||||
|
||||
bufferAllocator::free( buf );
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* setup_dialog.cpp - dialog for setting up LMMS
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* song_editor.cpp - basic window for editing song
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
* surround_area.cpp - a widget for setting position of a channel +
|
||||
* calculation of volume for each speaker
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
* playpos_marker.cpp - class timeLine, representing a time-line with
|
||||
* position marker
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
* track.cpp - implementation of classes concerning tracks -> neccessary for
|
||||
* all track-like objects (beat/bassline, sample-track...)
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
* track_container.cpp - implementation of base-class for all track-containers
|
||||
* like Song-Editor, BB-Editor...
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
* buffer_allocator.cpp - namespace bufferAllocator providing routines for own
|
||||
* optimized memory-management for audio-buffers
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* clipboard.cpp - the clipboard for patterns, notes etc.
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* embed.cpp - misc stuff for using embedded resources (linked into binary)
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
* ladspa_manager.cpp - a class to manage loading and instantiation
|
||||
* of ladspa plugins
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Danny McRae <khjklujn@netscape.net>
|
||||
* Copyright (c) 2005 Danny McRae <khjklujn@netscape.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
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* mmp.cpp - implementation of class multimediaProject
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* oscillator.cpp - implementation of powerful oscillator-class
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* sample_buffer.cpp - container-class sampleBuffer
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
@@ -261,20 +262,22 @@ m_data[frame][chnl] = buf[idx] * fac;
|
||||
else
|
||||
{
|
||||
m_data = new sampleFrame[1];
|
||||
for( Uint8 chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
memset( m_data, 0, sizeof( *m_data ) * 1 );
|
||||
/* for( Uint8 chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
{
|
||||
m_data[0][chnl] = 0.0f;
|
||||
}
|
||||
}*/
|
||||
m_frames = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_data = new sampleFrame[1];
|
||||
for( Uint8 chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
memset( m_data, 0, sizeof( *m_data ) * 1 );
|
||||
/* for( Uint8 chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
{
|
||||
m_data[0][chnl] = 0.0f;
|
||||
}
|
||||
}*/
|
||||
m_frames = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
* string_pair_drag.cpp - class stringPairDrag which provides general support
|
||||
* for drag'n'drop of string-pairs
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* midi_alsa_raw.cpp - midi-client for RawMIDI via ALSA
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* midi_alsa_seq.cpp - ALSA-sequencer-client
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* midi_client.cpp - base-class for MIDI-clients like ALSA-sequencer-client
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (_c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* This file partly contains code from Fluidsynth, Peter Hanappe
|
||||
*
|
||||
* 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
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* midi_mapper.cpp - MIDI-mapper for any midiDevice
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* midi_oss.cpp - OSS-raw-midi-client
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
* midi_port.cpp - abstraction of MIDI-ports which are part of LMMS's MIDI-
|
||||
* sequencing system
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (_c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* This file partly contains code from Fluidsynth, Peter Hanappe
|
||||
* Copyright (c) 2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* bb_track.cpp - implementation of class bbTrack
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* pattern.cpp - implementation of class pattern which holds notes
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
* sample_track.cpp - implementation of class sampleTrack, a track which
|
||||
* provides arrangement of samples
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
@@ -47,6 +48,7 @@
|
||||
#include "templates.h"
|
||||
#include "buffer_allocator.h"
|
||||
#include "tooltip.h"
|
||||
#include "audio_port.h"
|
||||
|
||||
|
||||
|
||||
@@ -283,8 +285,9 @@ void sampleTCOSettingsDialog::setSampleFile( const QString & _f )
|
||||
|
||||
|
||||
|
||||
sampleTrack::sampleTrack( trackContainer * _tc )
|
||||
: track( _tc )
|
||||
sampleTrack::sampleTrack( trackContainer * _tc ) :
|
||||
track( _tc ),
|
||||
m_audioPort( new audioPort( tr( "Sample track" ) ) )
|
||||
{
|
||||
getTrackWidget()->setFixedHeight( 32 );
|
||||
|
||||
@@ -303,6 +306,7 @@ sampleTrack::sampleTrack( trackContainer * _tc )
|
||||
|
||||
sampleTrack::~sampleTrack()
|
||||
{
|
||||
delete m_audioPort;
|
||||
}
|
||||
|
||||
|
||||
@@ -348,10 +352,11 @@ bool FASTCALL sampleTrack::play( const midiTime & _start, Uint32 _start_frame,
|
||||
static_cast<Uint32>( _start.getTact() *
|
||||
fpt ),
|
||||
_frames );
|
||||
mixer::inst()->addBuffer( buf, _frames, _frame_base +
|
||||
mixer::inst()->bufferToPort( buf, _frames, _frame_base +
|
||||
static_cast<Uint32>(
|
||||
st->startPosition().getTact64th() *
|
||||
fpt / 64.0f ), v );
|
||||
fpt / 64.0f ), v,
|
||||
m_audioPort );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* group_box.cpp - groupbox for LMMS
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
* This file is based on the knob-widget of the Qwt Widget Library from
|
||||
* Josef Wilgen
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* lcd_spinbox.cpp - class lcdSpinBox, an improved QLCDNumber
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* led_checkbox.cpp - class ledCheckBox, an improved QCheckBox
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* nstate_button.cpp - implementation of n-state-button
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
* pixmap_button.cpp - implementation of pixmap-button (often used as "themed"
|
||||
* checkboxes/radiobuttons etc)
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* project_notes.cpp - implementation of project-notes-editor
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
1359
src/widgets/qxembed.cpp
Normal file
1359
src/widgets/qxembed.cpp
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* rename_dialog.cpp - implementation of dialog for renaming something
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* side_bar_widget.cpp - implementation of base-widget for side-bar
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* tab_bar.cpp - implementation of tab-bar
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* tabwidget.cpp - tabwidget for LMMS
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
/*
|
||||
* tempo_sync_knob.h - adds bpm to ms conversion for knob class
|
||||
*
|
||||
* This file is derived from the knob-widget by Tobias Doerffel
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Danny McRae <khjklujn@yahoo.com>
|
||||
* Copyright (c) 2005 Danny McRae <khjklujn@yahoo.com>
|
||||
*
|
||||
* 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
|
||||
@@ -60,8 +59,8 @@
|
||||
|
||||
|
||||
|
||||
tempoSyncKnob::tempoSyncKnob( int _knob_num, QWidget * _parent, const QString & _name,
|
||||
float _scale ) :
|
||||
tempoSyncKnob::tempoSyncKnob( int _knob_num, QWidget * _parent,
|
||||
const QString & _name, float _scale ) :
|
||||
knob( _knob_num, _parent, _name ),
|
||||
m_tempoSyncMode( NO_SYNC ),
|
||||
m_scale( _scale ),
|
||||
@@ -115,9 +114,10 @@ void tempoSyncKnob::contextMenuEvent( QContextMenuEvent * )
|
||||
int menuId;
|
||||
menuId = syncMenu->addAction( embed::getIconPixmap( "note_none" ),
|
||||
tr( "No Sync" ),
|
||||
this, SLOT( setTempoSync( int ) ) );
|
||||
this, SLOT( setTempoSync( int ) ) );
|
||||
syncMenu->setItemParameter( menuId, ( int ) NO_SYNC );
|
||||
menuId = syncMenu->addAction( embed::getIconPixmap( "note_double_whole" ),
|
||||
menuId = syncMenu->addAction( embed::getIconPixmap(
|
||||
"note_double_whole" ),
|
||||
tr( "Eight beats" ),
|
||||
this, SLOT( setTempoSync( int ) ) );
|
||||
syncMenu->setItemParameter( menuId, ( int ) DOUBLE_WHOLE_NOTE );
|
||||
@@ -135,18 +135,20 @@ void tempoSyncKnob::contextMenuEvent( QContextMenuEvent * )
|
||||
syncMenu->setItemParameter( menuId, ( int ) QUARTER_NOTE );
|
||||
menuId = syncMenu->addAction( embed::getIconPixmap( "note_eighth" ),
|
||||
tr( "8th note" ),
|
||||
this, SLOT( setTempoSync( int ) ) );
|
||||
this, SLOT( setTempoSync( int ) ) );
|
||||
syncMenu->setItemParameter( menuId, ( int ) EIGHTH_NOTE );
|
||||
menuId = syncMenu->addAction( embed::getIconPixmap( "note_sixteenth" ),
|
||||
tr( "16th note" ),
|
||||
this, SLOT( setTempoSync( int ) ) );
|
||||
this, SLOT( setTempoSync( int ) ) );
|
||||
syncMenu->setItemParameter( menuId, ( int ) SIXTEENTH_NOTE );
|
||||
menuId = syncMenu->addAction( embed::getIconPixmap( "note_thirtysecond" ),
|
||||
menuId = syncMenu->addAction( embed::getIconPixmap(
|
||||
"note_thirtysecond" ),
|
||||
tr( "32nd note" ),
|
||||
this, SLOT( setTempoSync( int ) ) );
|
||||
this, SLOT( setTempoSync( int ) ) );
|
||||
syncMenu->setItemParameter( menuId, ( int ) THIRTYSECOND_NOTE );
|
||||
|
||||
contextMenu.addMenu( m_tempoSyncIcon, m_tempoSyncDescription, syncMenu );
|
||||
contextMenu.addMenu( m_tempoSyncIcon, m_tempoSyncDescription,
|
||||
syncMenu );
|
||||
contextMenu.addSeparator();
|
||||
|
||||
contextMenu.addAction( tr( "Connect to MIDI-device" ), this,
|
||||
@@ -201,42 +203,57 @@ void tempoSyncKnob::calculateTempoSyncTime( int _bpm )
|
||||
switch( m_tempoSyncMode )
|
||||
{
|
||||
case DOUBLE_WHOLE_NOTE:
|
||||
m_tempoSyncDescription = tr( "Synced to Eight Beats" );
|
||||
m_tempoSyncIcon = embed::getIconPixmap( "note_double_whole" );
|
||||
m_tempoSyncDescription = tr(
|
||||
"Synced to Eight Beats" );
|
||||
m_tempoSyncIcon = embed::getIconPixmap(
|
||||
"note_double_whole" );
|
||||
conversionFactor = 0.125;
|
||||
break;
|
||||
case WHOLE_NOTE:
|
||||
m_tempoSyncDescription = tr( "Synced to Whole Note" );
|
||||
m_tempoSyncIcon = embed::getIconPixmap( "note_whole" );
|
||||
m_tempoSyncDescription = tr(
|
||||
"Synced to Whole Note" );
|
||||
m_tempoSyncIcon = embed::getIconPixmap(
|
||||
"note_whole" );
|
||||
conversionFactor = 0.25;
|
||||
break;
|
||||
case HALF_NOTE:
|
||||
m_tempoSyncDescription = tr( "Synced to Half Note" );
|
||||
m_tempoSyncIcon = embed::getIconPixmap( "note_half" );
|
||||
m_tempoSyncDescription = tr(
|
||||
"Synced to Half Note" );
|
||||
m_tempoSyncIcon = embed::getIconPixmap(
|
||||
"note_half" );
|
||||
conversionFactor = 0.5;
|
||||
break;
|
||||
case QUARTER_NOTE:
|
||||
m_tempoSyncDescription = tr( "Synced to Quarter Note" );
|
||||
m_tempoSyncIcon = embed::getIconPixmap( "note_quarter" );
|
||||
m_tempoSyncDescription = tr(
|
||||
"Synced to Quarter Note" );
|
||||
m_tempoSyncIcon = embed::getIconPixmap(
|
||||
"note_quarter" );
|
||||
conversionFactor = 1.0;
|
||||
break;
|
||||
case EIGHTH_NOTE:
|
||||
m_tempoSyncDescription = tr( "Synced to 8th Note" );
|
||||
m_tempoSyncIcon = embed::getIconPixmap( "note_eighth" );
|
||||
m_tempoSyncDescription = tr(
|
||||
"Synced to 8th Note" );
|
||||
m_tempoSyncIcon = embed::getIconPixmap(
|
||||
"note_eighth" );
|
||||
conversionFactor = 2.0;
|
||||
break;
|
||||
case SIXTEENTH_NOTE:
|
||||
m_tempoSyncDescription = tr( "Synced to 16th Note" );
|
||||
m_tempoSyncIcon = embed::getIconPixmap( "note_sixteenth" );
|
||||
m_tempoSyncDescription = tr(
|
||||
"Synced to 16th Note" );
|
||||
m_tempoSyncIcon = embed::getIconPixmap(
|
||||
"note_sixteenth" );
|
||||
conversionFactor = 4.0;
|
||||
break;
|
||||
case THIRTYSECOND_NOTE:
|
||||
m_tempoSyncDescription = tr( "Synced to 32nd Note" );
|
||||
m_tempoSyncIcon = embed::getIconPixmap( "note_thirtysecond" );
|
||||
m_tempoSyncDescription = tr(
|
||||
"Synced to 32nd Note" );
|
||||
m_tempoSyncIcon = embed::getIconPixmap(
|
||||
"note_thirtysecond" );
|
||||
conversionFactor = 8.0;
|
||||
break;
|
||||
default:
|
||||
printf( "tempoSyncKnob::calculateTempoSyncTime: invalid tempoSyncMode" );
|
||||
printf( "tempoSyncKnob::calculateTempoSyncTime"
|
||||
": invalid tempoSyncMode" );
|
||||
break;
|
||||
}
|
||||
setValue( 60000.0 / ( _bpm * conversionFactor * m_scale ),
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* text_float.cpp - class textFloat, a floating text-label
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* tooltip.cpp - namespace toolTip, a tooltip-wrapper for LMMS
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* visualization_widget.cpp - widget for visualization of waves
|
||||
* visualization_widget.cpp - widget for visualization of sound-data
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
@@ -64,13 +65,14 @@ visualizationWidget::visualizationWidget( const QPixmap & _bg, QWidget * _p,
|
||||
const Uint32 frames = mixer::inst()->framesPerAudioBuffer();
|
||||
m_buffer = bufferAllocator::alloc<surroundSampleFrame>( frames );
|
||||
|
||||
for( Uint32 frame = 0; frame < frames; ++frame )
|
||||
mixer::inst()->clearAudioBuffer( m_buffer, frames );
|
||||
/* for( Uint32 frame = 0; frame < frames; ++frame )
|
||||
{
|
||||
for( Uint8 chnl = 0; chnl < SURROUND_CHANNELS; ++chnl )
|
||||
{
|
||||
m_buffer[frame][chnl] = 0.0f;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
setFixedSize( s_background.width(), s_background.height() );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user