Merge branch 'master' into calf-updates

This commit is contained in:
Tobias Doerffel
2010-01-04 00:42:01 +01:00
77 changed files with 166 additions and 63 deletions

View File

@@ -1,4 +1,4 @@
MINGW=/opt/mingw32
export PATH=$PATH:$MINGW/bin
cmake .. -DCMAKE_TOOLCHAIN_FILE=cmake/modules/Win32Toolchain.cmake
cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/modules/Win32Toolchain.cmake

View File

@@ -36,6 +36,9 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
SET(PKG_CONFIG_EXECUTABLE ${MINGW_PREFIX}/bin/pkg-config)
SET(CMAKE_C_FLAGS "-march=i686 -mtune=generic")
SET(CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS})
INCLUDE_DIRECTORIES(${MINGW_PREFIX}/include)
LINK_DIRECTORIES(${MINGW_PREFIX}/lib ${MINGW_PREFIX}/bin)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -225,9 +225,6 @@ protected:
float fittedValue( float _value ) const;
float m_minValue;
float m_maxValue;
float m_value;
private:
void linkModel( AutomatableModel * _model );
@@ -235,7 +232,10 @@ private:
DataType m_dataType;
float m_value;
float m_initValue;
float m_minValue;
float m_maxValue;
float m_step;
float m_range;

View File

@@ -41,64 +41,137 @@ class notePlayHandle;
class track;
/*! \brief Provides a standard interface for all instrument plugins.
*
* All instrument plugins have to derive from this class and implement the
* according virtual methods (see below). An instrument is instantiated by an
* InstrumentTrack.
*
* Instrument plugins can operate in two modes: process audio per note or
* process audio per Mixer period (one continuous audio stream).
* For the latter one, the instrument has to create an InstrumentPlayHandle
* for itself and re-implement #play( sampleFrame * ). When processing audio
* per note, overload the #playNote( notePlayHandle *, sampleFrame * ) and
* #deleteNotePluginData( notePlayHandle * ).
*/
class EXPORT Instrument : public Plugin
{
public:
Instrument( InstrumentTrack * _instrument_track,
const Descriptor * _descriptor );
/*! \brief Constructs an Instrument object.
*
* The constructor for Instrument objects.
* \param instrumentTrack The InstrumentTrack this Instrument belongs to.
* \param descriptor A Plugin::Descriptor holding information about the
* instrument plugin.
*/
Instrument( InstrumentTrack * instrumentTrack,
const Descriptor * descriptor );
virtual ~Instrument();
// --------------------------------------------------------------------
// functions that can/should be re-implemented:
// --------------------------------------------------------------------
/*! \brief Generates audio data for the next mixer period.
*
* If the instrument only generates one continuous audio stream (i.e. is
* not capable of generating individual audio streams for each active
* note), it has to overload this method, generate the audio data (should
* use working buffer to improve cache hit rate and eliminate memory
* de-/allocations) and finally call InstrumentTrack::processAudioBuffer()
* and pass NULL for the last parameter.
*
* \param workingBuf A buffer the instrument should operate on (data in it
* is not used after this function returns).
*/
virtual void play( sampleFrame * workingBuffer );
// if the plugin doesn't play each note, it can create an instrument-
// play-handle and re-implement this method, so that it mixes its
// output buffer only once per mixer-period
virtual void play( sampleFrame * _working_buffer );
// to be implemented by actual plugin
virtual void playNote( notePlayHandle * /* _note_to_play */,
sampleFrame * /* _working_buf */ )
/*! \brief Generates audio data for the given NotePlayHandle.
*
* When generating audio data per-note (recommended), the instrument has
* to do this in an overloaded version of this method. It can allocate
* note-specific data objects (sound generators, generator settings etc.)
* in the given NotePlayHandle if NotePlayHandle::totalFramesPlayed()==0.
* Store this data in NotePlayHandle::m_pluginData. See the
* deleteNotePluginData() method below for information how to free the
* allocated data.
* Like play(), call Instrument::processAudioBuffer() after sound data
* has been generated and pass the NotePlayHandle as last parameter.
*
* \param noteToPlay A NotePlayHandle handle for the note to play
* \param workingBuf A buffer the instrument should operate on (data in it
* is not used after this function returns).
*/
virtual void playNote( notePlayHandle * noteToPlay,
sampleFrame * workingBuf )
{
Q_UNUSED(noteToPlay)
Q_UNUSED(workingBuf)
}
// needed for deleting plugin-specific-data of a note - plugin has to
// cast void-ptr so that the plugin-data is deleted properly
// (call of dtor if it's a class etc.)
virtual void deleteNotePluginData( notePlayHandle * _note_to_play );
// Get number of sample-frames that should be used when playing beat
// (note with unspecified length)
// Per default this function returns 0. In this case, channel is using
// the length of the longest envelope (if one active).
virtual f_cnt_t beatLen( notePlayHandle * _n ) const;
/*! \brief Deletes data allocated for playing a certain note.
*
* In Instrument::playNote() an instrument usually allocates data for each
* note to store current state and or generator objects. After a note has
* finished playing, this method is called to free the data that was
* allocated for playing this note. Plugin has to cast
* NotePlayHandle::m_pluginData to according type and delete it.
*/
virtual void deleteNotePluginData( notePlayHandle * noteToPlay );
/*! \brief Returns number of frames for notes with unspecified length.
*
* When playing a note with unspecified length (e.g. a step in the
* BB-Editor), the sequencer core somehow has to determine for how long
* to play this note. Plugins can overload this method in order to specify
* the length of such notes (in frames). A sampler for example would return
* the length of the loaded sample at the according pitch.
* Per default this method returns 0 which means the InstrumentTrack will
* look for the longest active envelope and use that value. Otherwise the
* note will not be played.
*
* \param notePlayHandle A NotePlayHandle describing the concerned note.
*/
virtual f_cnt_t beatLen( notePlayHandle * n ) const;
// some instruments need a certain number of release-frames even
// if no envelope is active - such instruments can re-implement this
// method for returning how many frames they at least like to have for
// release
/*! \brief Returns number of desired release frames for this instrument.
*
* Some instruments need a certain number of release frames even
* if no envelope is active - such instruments can re-implement this
* method for returning how many frames they at least like to have for
* release.
*/
virtual f_cnt_t desiredReleaseFrames() const
{
return 0;
}
// return false if instrument is not bendable
/*! \brief Returns whether instrument is bendable.
*
* This is particularly important for instruments that do not supporting
* pitch bending. If the overloaded function returns false, the pitch bend
* knob will be hidden in InstrumentTrackWindow.
*/
inline virtual bool isBendable() const
{
return true;
}
// return true if instruments reacts to MIDI events passed to
// handleMidiEvent() rather than playNote() & Co
/*! \brief Returns true if instrument if instrument is MIDI based.
*
* Instruments should return true here if they react to MIDI events passed
* to handleMidiEvent() rather than playNote() & Co.
*/
inline virtual bool isMidiBased() const
{
return false;
}
// sub-classes can re-implement this for receiving all incoming
// MIDI-events
/*! \brief Allows to handle given MidiEvent.
*
* Subclasses can re-implement this for receiving all incoming MIDI events.
*
* \param midiEvent The MIDI event just received
* \param midiTime An optional offset for the MIDI event within current
* mixer period (e.g. NoteOn at frame X).
*/
inline virtual bool handleMidiEvent( const midiEvent &, const midiTime & )
{
return false;
@@ -106,17 +179,25 @@ public:
virtual QString fullDisplayName() const;
// --------------------------------------------------------------------
// provided functions:
// --------------------------------------------------------------------
// instantiate instrument-plugin with given name or return NULL
// on failure
static Instrument * instantiate( const QString & _plugin_name,
InstrumentTrack * _instrument_track );
/*! \brief Instantiates instrument plugin with given name.
*
* Tries to instantiate instrument plugin with given name from available
* plugin files.
*
* \param pluginName The internal identifier for the plugin
* \param instrumentTrack The InstrumentTrack the new instrument should
* belong to.
*
* \return Pointer to instantiated instrument plugin or NULL on failure.
*/
static Instrument * instantiate( const QString & pluginName,
InstrumentTrack * instrumentTrack );
/*! \brief Returns whether this instance belongs to given track. */
virtual bool isFromTrack( const track * _track ) const;
/*! \brief Returns whether the InstrumentTrack this instrument is attached
* to is muted. */
bool isMuted() const;
@@ -126,10 +207,14 @@ protected:
return m_instrumentTrack;
}
// instruments may use this to apply a soft fade out at the end of
// notes - method does this only if really less or equal
// desiredReleaseFrames() frames are left
void applyRelease( sampleFrame * buf, const notePlayHandle * _n );
/*! \brief Internal helper method to apply a release on given buffer.
*
* Instrument plugins may use this to apply a soft fade-out at the end of
* a note. Please note that this is only done if the number of frames
* returned by NotePlayHandle::framesLeft() is equal or below the number
* of frames returned by Instrument::desiredReleaseFrames().
*/
void applyRelease( sampleFrame * buf, const notePlayHandle * n );
private:

View File

@@ -2,8 +2,8 @@
* base64.h - namespace base64 with methods for encoding/decoding binary data
* to/from base64
*
* Copyright (c) 2006-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* Copyright (c) 2006-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
@@ -23,7 +23,6 @@
*
*/
#ifndef _BASE64_H
#define _BASE64_H
@@ -40,11 +39,12 @@ namespace base64
_dst = QByteArray( _data, _size ).toBase64();
}
inline void decode( const QString & _b64, char * * _data, int * _size )
template<class T>
inline void decode( const QString & _b64, T * * _data, int * _size )
{
QByteArray data = QByteArray::fromBase64( _b64.toAscii() );
QByteArray data = QByteArray::fromBase64( _b64.toUtf8() );
*_size = data.size();
*_data = new char[*_size];
*_data = new T[*_size / sizeof(T)];
memcpy( *_data, data.constData(), *_size );
}
// deprecated!!

View File

@@ -2,8 +2,8 @@
* track_container.h - base-class for all track-containers like Song-Editor,
* BB-Editor...
*
* 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
@@ -23,11 +23,10 @@
*
*/
#ifndef _TRACK_CONTAINER_H
#define _TRACK_CONTAINER_H
#include <QReadWriteLock>
#include <QtCore/QReadWriteLock>
#include "track.h"
#include "JournallingObject.h"

View File

@@ -36,6 +36,12 @@
#include "note_play_handle.h"
#include "led_checkbox.h"
// As of Stk 4.4 all classes and types have been moved to the namespace "stk".
// However in older versions this namespace does not exist, therefore declare it
// so this plugin builds with all versions of Stk.
namespace stk { } ;
using namespace stk;
class malletsSynth
{

View File

@@ -360,6 +360,11 @@ void VestigeInstrumentView::openPlugin()
engine::getMixer()->lock();
m_vi->loadFile( ofd.selectedFiles()[0] );
engine::getMixer()->unlock();
if( m_vi->m_plugin && m_vi->m_plugin->pluginWidget() )
{
m_vi->m_plugin->pluginWidget()->setWindowIcon(
PLUGIN_NAME::getIconPixmap( "logo" ) );
}
}
}

View File

@@ -241,7 +241,7 @@ void vibed::loadSettings( const QDomElement & _this )
float * shp = 0;
base64::decode( _this.attribute( "graph" +
QString::number( i ) ),
(char * *) &shp,
&shp,
&size );
// TODO: check whether size == 128 * sizeof( float ),
// otherwise me might and up in a segfault

View File

@@ -813,7 +813,7 @@ void RemoteVstPlugin::saveChunkToFile( const std::string & _file )
void RemoteVstPlugin::loadChunkFromFile( const std::string & _file, int _len )
{
char buf[_len];
char * buf = NULL;
void * chunk = NULL;
// various plugins need this in order to not crash when setting
@@ -823,7 +823,8 @@ void RemoteVstPlugin::loadChunkFromFile( const std::string & _file, int _len )
// allocated buffer big enough?
if( _len > actualLen )
{
// no, manually try our local buffer
// no, then manually allocate a buffer
buf = new char[_len];
chunk = buf;
}
@@ -831,6 +832,8 @@ void RemoteVstPlugin::loadChunkFromFile( const std::string & _file, int _len )
read( fd, chunk, _len );
close( fd );
pluginDispatch( 24, 0, _len, chunk );
delete[] buf;
}

View File

@@ -44,11 +44,11 @@ AutomatableModel::AutomatableModel( DataType _type,
const QString & _display_name,
bool _default_constructed ) :
Model( _parent, _display_name, _default_constructed ),
m_minValue( _min ),
m_maxValue( _max ),
m_dataType( _type ),
m_value( _val ),
m_initValue( _val ),
m_minValue( _min ),
m_maxValue( _max ),
m_step( _step ),
m_range( _max - _min ),
m_journalEntryReady( false ),

View File

@@ -823,6 +823,8 @@ void MainWindow::resetWindowTitle()
bool MainWindow::mayChangeProject()
{
engine::getSong()->stop();
if( !engine::getSong()->isModified() )
{
return true;