introduced engine-technology
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@81 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
26
ChangeLog
26
ChangeLog
@@ -1,3 +1,18 @@
|
||||
2006-02-09 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* plugins/triple_oscillator/triple_oscillator.cpp:
|
||||
per default set volume of each osc to 33%
|
||||
|
||||
* allmost all files:
|
||||
use engine-technology
|
||||
|
||||
* include/engine.h:
|
||||
* src/core/engine.cpp:
|
||||
added engine- and engineObject-class providing new "engine-technology"
|
||||
which makes singleton-classes obsoletes and offers a lot of new
|
||||
possibilities like GUI-data-separation and having several projects
|
||||
open at the same time
|
||||
|
||||
2006-02-06 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* include/mixer.h:
|
||||
@@ -9,15 +24,14 @@
|
||||
|
||||
2006-02-06 Andreas Brandmaier <andy/at/brandmaier.de>
|
||||
|
||||
* plugins/bitinvader/bitinvader.cpp
|
||||
* plugins/bitinvader/bitinvader.h
|
||||
* plugins/bitinvader/graph.cpp
|
||||
* plugins/bitinvader/graph.h
|
||||
* plugins/bitinvader/bitinvader.cpp:
|
||||
* plugins/bitinvader/bitinvader.h:
|
||||
* plugins/bitinvader/graph.cpp:
|
||||
* plugins/bitinvader/graph.h:
|
||||
- code cleanup
|
||||
- added drag&drop support to wavegraph
|
||||
- added new BitInvader presets and improved old ones
|
||||
|
||||
|
||||
|
||||
2006-02-05 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* include/basic_filters.h:
|
||||
|
||||
@@ -63,7 +63,7 @@ lmms_MOC = \
|
||||
./knob.moc \
|
||||
./lcd_spinbox.moc \
|
||||
./led_checkbox.moc \
|
||||
./lmms_main_win.moc \
|
||||
./main_window.moc \
|
||||
./mixer.moc \
|
||||
./name_label.moc \
|
||||
./nstate_button.moc \
|
||||
@@ -121,12 +121,13 @@ lmms_SOURCES = \
|
||||
$(srcdir)/src/core/arp_and_chords_tab_widget.cpp \
|
||||
$(srcdir)/src/core/bb_editor.cpp \
|
||||
$(srcdir)/src/core/config_mgr.cpp \
|
||||
$(srcdir)/src/core/engine.cpp \
|
||||
$(srcdir)/src/core/envelope_and_lfo_widget.cpp \
|
||||
$(srcdir)/src/core/envelope_tab_widget.cpp \
|
||||
$(srcdir)/src/core/export_project_dialog.cpp \
|
||||
$(srcdir)/src/core/file_browser.cpp \
|
||||
$(srcdir)/src/core/instrument.cpp \
|
||||
$(srcdir)/src/core/lmms_main_win.cpp \
|
||||
$(srcdir)/src/core/main_window.cpp \
|
||||
$(srcdir)/src/core/main.cpp \
|
||||
$(srcdir)/src/core/midi_tab_widget.cpp \
|
||||
$(srcdir)/src/core/mixer.cpp \
|
||||
@@ -189,7 +190,7 @@ lmms_SOURCES = \
|
||||
$(srcdir)/src/widgets/visualization_widget.cpp \
|
||||
$(srcdir)/include/pch.h \
|
||||
$(srcdir)/include/debug.h \
|
||||
$(srcdir)/include/lmms_main_win.h \
|
||||
$(srcdir)/include/main_window.h \
|
||||
$(srcdir)/include/audio_alsa.h \
|
||||
$(srcdir)/include/audio_device.h \
|
||||
$(srcdir)/include/audio_dummy.h \
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ(2.50)
|
||||
AC_INIT(lmms, 0.1.4-cvs20060206, tobydox/at/users/dot/sourceforge/dot/net)
|
||||
AM_INIT_AUTOMAKE(lmms, 0.1.4-cvs20060206)
|
||||
AC_INIT(lmms, 0.1.4-cvs20060209, tobydox/at/users/dot/sourceforge/dot/net)
|
||||
AM_INIT_AUTOMAKE(lmms, 0.1.4-cvs20060209)
|
||||
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
|
||||
#include "settings.h"
|
||||
#include "types.h"
|
||||
#include "engine.h"
|
||||
|
||||
|
||||
class QPixmap;
|
||||
@@ -62,7 +63,8 @@ class tempoSyncKnob;
|
||||
const int MAX_CHORD_POLYPHONY = 10;
|
||||
|
||||
|
||||
class arpAndChordsTabWidget : public QWidget, public settings
|
||||
class arpAndChordsTabWidget : public QWidget, public settings,
|
||||
public engineObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
@@ -51,8 +51,9 @@ class QLineEdit;
|
||||
class audioALSA : public audioDevice, public QThread
|
||||
{
|
||||
public:
|
||||
audioALSA( const sample_rate_t _sample_rate, bool & _success_ful );
|
||||
~audioALSA();
|
||||
audioALSA( const sample_rate_t _sample_rate, bool & _success_ful,
|
||||
mixer * _mixer );
|
||||
virtual ~audioALSA();
|
||||
|
||||
inline static QString name( void )
|
||||
{
|
||||
|
||||
@@ -64,7 +64,7 @@ class audioDevice
|
||||
{
|
||||
public:
|
||||
audioDevice( const sample_rate_t _sample_rate,
|
||||
const ch_cnt_t _channels );
|
||||
const ch_cnt_t _channels, mixer * _mixer );
|
||||
virtual ~audioDevice();
|
||||
|
||||
inline void lock( void )
|
||||
@@ -163,10 +163,17 @@ protected:
|
||||
m_sampleRate = _new_sr;
|
||||
}
|
||||
|
||||
mixer * getMixer( void )
|
||||
{
|
||||
return( m_mixer );
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
sample_rate_t m_sampleRate;
|
||||
ch_cnt_t m_channels;
|
||||
mixer * m_mixer;
|
||||
|
||||
QMutex m_devMutex;
|
||||
|
||||
#ifdef HAVE_SAMPLERATE_H
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* audio_dummy.h - dummy-audio-device
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -33,8 +33,9 @@
|
||||
class audioDummy : public audioDevice, public QThread
|
||||
{
|
||||
public:
|
||||
audioDummy( Uint32 _sample_rate, bool & _success_ful ) :
|
||||
audioDevice( _sample_rate, DEFAULT_CHANNELS ),
|
||||
audioDummy( const sample_rate_t _sample_rate, bool & _success_ful,
|
||||
mixer * _mixer ) :
|
||||
audioDevice( _sample_rate, DEFAULT_CHANNELS, _mixer ),
|
||||
m_quit( FALSE )
|
||||
{
|
||||
_success_ful = TRUE;
|
||||
@@ -94,9 +95,8 @@ private:
|
||||
timer.reset();
|
||||
processNextBuffer();
|
||||
const Sint32 microseconds = static_cast<Sint32>(
|
||||
mixer::inst()->framesPerAudioBuffer() *
|
||||
1000000.0f /
|
||||
mixer::inst()->sampleRate() -
|
||||
getMixer()->framesPerAudioBuffer() *
|
||||
1000000.0f / getMixer()->sampleRate() -
|
||||
timer.elapsed() );
|
||||
if( microseconds > 0 )
|
||||
{
|
||||
|
||||
@@ -52,7 +52,8 @@ public:
|
||||
const bool _use_vbr,
|
||||
const bitrate_t _nom_bitrate,
|
||||
const bitrate_t _min_bitrate,
|
||||
const bitrate_t _max_bitrate );
|
||||
const bitrate_t _max_bitrate,
|
||||
mixer * _mixer );
|
||||
virtual ~audioFileDevice();
|
||||
|
||||
|
||||
|
||||
@@ -49,7 +49,8 @@ public:
|
||||
const bool _use_vbr,
|
||||
const bitrate_t _nom_bitrate,
|
||||
const bitrate_t _min_bitrate,
|
||||
const bitrate_t _max_bitrate );
|
||||
const bitrate_t _max_bitrate,
|
||||
mixer * _mixer );
|
||||
virtual ~audioFileOgg();
|
||||
|
||||
static audioFileDevice * getInst( const sample_rate_t _sample_rate,
|
||||
@@ -59,11 +60,13 @@ public:
|
||||
const bool _use_vbr,
|
||||
const bitrate_t _nom_bitrate,
|
||||
const bitrate_t _min_bitrate,
|
||||
const bitrate_t _max_bitrate )
|
||||
const bitrate_t _max_bitrate,
|
||||
mixer * _mixer )
|
||||
{
|
||||
return( new audioFileOgg( _sample_rate, _channels, _success_ful,
|
||||
_file, _use_vbr, _nom_bitrate,
|
||||
_min_bitrate, _max_bitrate ) );
|
||||
_min_bitrate, _max_bitrate,
|
||||
_mixer ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -42,7 +42,8 @@ public:
|
||||
const bool _use_vbr,
|
||||
const bitrate_t _nom_bitrate,
|
||||
const bitrate_t _min_bitrate,
|
||||
const bitrate_t _max_bitrate );
|
||||
const bitrate_t _max_bitrate,
|
||||
mixer * _mixer );
|
||||
virtual ~audioFileWave();
|
||||
|
||||
static audioFileDevice * getInst( const sample_rate_t _sample_rate,
|
||||
@@ -52,12 +53,14 @@ public:
|
||||
const bool _use_vbr,
|
||||
const bitrate_t _nom_bitrate,
|
||||
const bitrate_t _min_bitrate,
|
||||
const bitrate_t _max_bitrate )
|
||||
const bitrate_t _max_bitrate,
|
||||
mixer * _mixer )
|
||||
{
|
||||
return( new audioFileWave( _sample_rate, _channels,
|
||||
_success_ful, _file, _use_vbr,
|
||||
_nom_bitrate, _min_bitrate,
|
||||
_max_bitrate ) );
|
||||
_max_bitrate,
|
||||
_mixer ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* audio_jack.h - support for JACK-transport
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -67,8 +67,9 @@ class lcdSpinBox;
|
||||
class audioJACK : public audioDevice
|
||||
{
|
||||
public:
|
||||
audioJACK( Uint32 _sample_rate, bool & _success_ful );
|
||||
~audioJACK();
|
||||
audioJACK( const sample_rate_t _sample_rate, bool & _success_ful,
|
||||
mixer * _mixer );
|
||||
virtual ~audioJACK();
|
||||
|
||||
inline static QString name( void )
|
||||
{
|
||||
@@ -113,8 +114,8 @@ private:
|
||||
surroundSampleFrame * m_outBuf;
|
||||
|
||||
|
||||
Uint32 m_framesDoneInCurBuf;
|
||||
Uint32 m_framesToDoInCurBuf;
|
||||
f_cnt_t m_framesDoneInCurBuf;
|
||||
f_cnt_t m_framesToDoInCurBuf;
|
||||
|
||||
|
||||
struct stereoPort
|
||||
|
||||
@@ -47,7 +47,8 @@ class QLineEdit;
|
||||
class audioOSS : public audioDevice, public QThread
|
||||
{
|
||||
public:
|
||||
audioOSS( const sample_rate_t _sample_rate, bool & _success_ful );
|
||||
audioOSS( const sample_rate_t _sample_rate, bool & _success_ful,
|
||||
mixer * _mixer );
|
||||
virtual ~audioOSS();
|
||||
|
||||
inline static QString name( void )
|
||||
|
||||
@@ -43,10 +43,10 @@
|
||||
#include "effect_board.h"
|
||||
|
||||
|
||||
class audioPort
|
||||
class audioPort : public engineObject
|
||||
{
|
||||
public:
|
||||
audioPort( const QString & _name );
|
||||
audioPort( const QString & _name, engine * _engine );
|
||||
~audioPort();
|
||||
|
||||
inline surroundSampleFrame * firstBuffer( void )
|
||||
|
||||
@@ -54,11 +54,12 @@ class audioSampleRecorder : public audioDevice
|
||||
{
|
||||
public:
|
||||
audioSampleRecorder( const sample_rate_t _sample_rate,
|
||||
const ch_cnt_t _channels, bool & _success_ful );
|
||||
const ch_cnt_t _channels, bool & _success_ful,
|
||||
mixer * _mixer );
|
||||
virtual ~audioSampleRecorder();
|
||||
|
||||
f_cnt_t framesRecorded( void ) const;
|
||||
void FASTCALL createSampleBuffer( sampleBuffer * * _sample_buf ) const;
|
||||
void FASTCALL createSampleBuffer( sampleBuffer * * _sample_buf );
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@@ -51,7 +51,8 @@ class QLineEdit;
|
||||
class audioSDL : public audioDevice
|
||||
{
|
||||
public:
|
||||
audioSDL( const sample_rate_t _sample_rate, bool & _success_ful );
|
||||
audioSDL( const sample_rate_t _sample_rate, bool & _success_ful,
|
||||
mixer * _mixer );
|
||||
virtual ~audioSDL();
|
||||
|
||||
inline static QString name( void )
|
||||
|
||||
@@ -27,16 +27,12 @@
|
||||
#define _BB_EDITOR_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
|
||||
#include "track_container.h"
|
||||
#include "lmms_main_win.h"
|
||||
|
||||
|
||||
class QPixmap;
|
||||
|
||||
class comboBox;
|
||||
class songEditor;
|
||||
class toolButton;
|
||||
|
||||
|
||||
@@ -44,17 +40,9 @@ class bbEditor : public trackContainer
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
static inline bbEditor * inst( void )
|
||||
{
|
||||
if( s_instanceOfMe == NULL )
|
||||
{
|
||||
s_instanceOfMe = new bbEditor();
|
||||
}
|
||||
return( s_instanceOfMe );
|
||||
}
|
||||
|
||||
virtual bool FASTCALL play( midiTime _start, Uint32 _start_frame,
|
||||
Uint32 _frames, Uint32 _frame_base,
|
||||
virtual bool FASTCALL play( midiTime _start, const f_cnt_t _start_frame,
|
||||
const f_cnt_t _frames,
|
||||
const f_cnt_t _frame_base,
|
||||
Sint16 _tco_num = -1 );
|
||||
|
||||
virtual void FASTCALL saveSettings( QDomDocument & _doc,
|
||||
@@ -73,20 +61,22 @@ public:
|
||||
}
|
||||
|
||||
csize currentBB( void ) const;
|
||||
tact FASTCALL lengthOfBB( csize _bb );
|
||||
tact FASTCALL lengthOfBB( const csize _bb );
|
||||
inline tact lengthOfCurrentBB( void )
|
||||
{
|
||||
return( lengthOfBB( currentBB() ) );
|
||||
}
|
||||
void FASTCALL removeBB( csize _bb );
|
||||
void FASTCALL removeBB( const csize _bb );
|
||||
csize numOfBBs( void ) const;
|
||||
|
||||
void FASTCALL swapBB( csize _bb1, csize _bb2 );
|
||||
void FASTCALL swapBB( const csize _bb1, const csize _bb2 );
|
||||
|
||||
void updateBBTrack( trackContentObject * _tco );
|
||||
|
||||
|
||||
public slots:
|
||||
void play( void );
|
||||
void stop( void );
|
||||
void updateComboBox( void );
|
||||
void setCurrentBB( int _bb );
|
||||
|
||||
@@ -99,21 +89,14 @@ protected:
|
||||
virtual QRect scrollAreaRect( void ) const;
|
||||
|
||||
|
||||
protected slots:
|
||||
void play( void );
|
||||
void stop( void );
|
||||
|
||||
|
||||
private:
|
||||
bbEditor();
|
||||
bbEditor( engine * _engine );
|
||||
//bbEditor( const bbEditor & );
|
||||
~bbEditor();
|
||||
virtual ~bbEditor();
|
||||
|
||||
void FASTCALL createTCOsForBB( csize _bb );
|
||||
void FASTCALL createTCOsForBB( const csize _bb );
|
||||
|
||||
|
||||
static bbEditor * s_instanceOfMe;
|
||||
|
||||
QWidget * m_toolBar;
|
||||
|
||||
toolButton * m_playButton;
|
||||
@@ -122,8 +105,7 @@ private:
|
||||
comboBox * m_bbComboBox;
|
||||
|
||||
|
||||
friend class songEditor;
|
||||
friend lmmsMainWin::~lmmsMainWin();
|
||||
friend class engine;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -100,8 +100,9 @@ public:
|
||||
|
||||
virtual trackTypes type( void ) const;
|
||||
virtual bool FASTCALL play( const midiTime & _start,
|
||||
Uint32 _start_frame, Uint32 _frames,
|
||||
Uint32 _frame_base,
|
||||
const f_cnt_t _start_frame,
|
||||
const fpab_t _frames,
|
||||
const f_cnt_t _frame_base,
|
||||
Sint16 _tco_num = -1 );
|
||||
virtual trackContentObject * FASTCALL createTCO( const midiTime &
|
||||
_pos );
|
||||
@@ -111,7 +112,7 @@ public:
|
||||
virtual void FASTCALL loadTrackSpecificSettings( const QDomElement &
|
||||
_this );
|
||||
|
||||
static bbTrack * FASTCALL findBBTrack( csize _bb_num );
|
||||
static bbTrack * FASTCALL findBBTrack( csize _bb_num, engine * _engine );
|
||||
static csize FASTCALL numOfBBTrack( track * _track );
|
||||
static void FASTCALL swapBBTracks( track * _track1, track * _track2 );
|
||||
|
||||
|
||||
@@ -38,10 +38,10 @@
|
||||
|
||||
namespace bufferAllocator
|
||||
{
|
||||
void * FASTCALL allocBytes( Uint32 _bytes );
|
||||
void * FASTCALL allocBytes( const Uint32 _bytes );
|
||||
|
||||
template<class T>
|
||||
inline T * FASTCALL alloc( Uint32 _n )
|
||||
inline T * FASTCALL alloc( const Uint32 _n )
|
||||
{
|
||||
return( (T *) allocBytes( sizeof( T ) * _n ) );
|
||||
}
|
||||
@@ -50,10 +50,10 @@ namespace bufferAllocator
|
||||
void FASTCALL free( void * _buf );
|
||||
|
||||
// try to cleanup _level unused buffers
|
||||
void FASTCALL cleanUp( Uint16 _level );
|
||||
void FASTCALL cleanUp( const Uint16 _level );
|
||||
|
||||
// disable autocleanup-mechanisms
|
||||
void FASTCALL disableAutoCleanup( bool _disabled );
|
||||
void FASTCALL disableAutoCleanup( const bool _disabled );
|
||||
|
||||
|
||||
// simple class for automatically freeing buffer in complex functions
|
||||
|
||||
@@ -51,9 +51,6 @@
|
||||
#endif
|
||||
|
||||
|
||||
#include "lmms_main_win.h"
|
||||
|
||||
|
||||
class QLineEdit;
|
||||
class QLabel;
|
||||
class QRadioButton;
|
||||
@@ -61,6 +58,8 @@ class QHBoxLayout;
|
||||
class QVBoxLayout;
|
||||
class QFrame;
|
||||
|
||||
class engine;
|
||||
|
||||
|
||||
const QString PROJECTS_PATH = "projects/";
|
||||
const QString PRESETS_PATH = "presets/";
|
||||
@@ -207,8 +206,7 @@ private:
|
||||
QVBoxLayout * m_contentLayout;
|
||||
|
||||
|
||||
// lmmsMainWin-dtor is allowed to destroy us...
|
||||
friend lmmsMainWin::~lmmsMainWin();
|
||||
friend class engine;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* cpuload_widget.h - widget for displaying CPU-load (partly based on
|
||||
* Hydrogen's CPU-load-widget)
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -44,18 +44,19 @@
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
#include "engine.h"
|
||||
|
||||
|
||||
class cpuloadWidget : public QWidget
|
||||
class cpuloadWidget : public QWidget, public engineObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
cpuloadWidget( QWidget * _parent );
|
||||
~cpuloadWidget();
|
||||
cpuloadWidget( QWidget * _parent, engine * _engine );
|
||||
virtual ~cpuloadWidget();
|
||||
|
||||
|
||||
protected:
|
||||
void paintEvent( QPaintEvent * _ev );
|
||||
virtual void paintEvent( QPaintEvent * _ev );
|
||||
|
||||
|
||||
protected slots:
|
||||
|
||||
@@ -33,8 +33,8 @@
|
||||
class dummyPlugin : public plugin
|
||||
{
|
||||
public:
|
||||
inline dummyPlugin( void ) :
|
||||
plugin( NULL )
|
||||
inline dummyPlugin( engine * _engine = NULL ) :
|
||||
plugin( NULL, _engine )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -26,17 +26,21 @@
|
||||
#ifndef _ENGINE_H
|
||||
#define _ENGINE_H
|
||||
|
||||
class mixer;
|
||||
class lmmsMainWin;
|
||||
class songEditor;
|
||||
#include "qt3support.h"
|
||||
|
||||
|
||||
class bbEditor;
|
||||
class mainWindow;
|
||||
class mixer;
|
||||
class pianoRoll;
|
||||
class projectNotes;
|
||||
class songEditor;
|
||||
|
||||
|
||||
class engine
|
||||
{
|
||||
public:
|
||||
engine( bool _has_gui = TRUE );
|
||||
engine( const bool _has_gui = TRUE );
|
||||
engine( const engine & _engine );
|
||||
~engine();
|
||||
|
||||
@@ -55,7 +59,12 @@ public:
|
||||
return( m_mixer );
|
||||
}
|
||||
|
||||
inline lmmsMainWin * getMainWindow( void )
|
||||
inline const mixer * getMixer( void ) const
|
||||
{
|
||||
return( m_mixer );
|
||||
}
|
||||
|
||||
inline mainWindow * getMainWindow( void )
|
||||
{
|
||||
return( m_mainWindow );
|
||||
}
|
||||
@@ -65,6 +74,11 @@ public:
|
||||
return( m_songEditor );
|
||||
}
|
||||
|
||||
inline const songEditor * getSongEditor( void ) const
|
||||
{
|
||||
return( m_songEditor );
|
||||
}
|
||||
|
||||
inline bbEditor * getBBEditor( void )
|
||||
{
|
||||
return( m_bbEditor );
|
||||
@@ -75,15 +89,21 @@ public:
|
||||
return( m_pianoRoll );
|
||||
}
|
||||
|
||||
inline projectNotes * getProjectNotes( void )
|
||||
{
|
||||
return( m_projectNotes );
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
bool m_hasGUI;
|
||||
|
||||
mixer * m_mixer;
|
||||
lmmsMainWin * m_mainWindow;
|
||||
mainWindow * m_mainWindow;
|
||||
songEditor * m_songEditor;
|
||||
bbEditor * m_bbEditor;
|
||||
pianoRoll * m_pianoRoll;
|
||||
projectNotes * m_projectNotes;
|
||||
|
||||
} ;
|
||||
|
||||
@@ -100,6 +120,11 @@ public:
|
||||
return( m_engine );
|
||||
}
|
||||
|
||||
inline const engine * eng( void ) const
|
||||
{
|
||||
return( m_engine );
|
||||
}
|
||||
|
||||
inline bool hasGUI( void ) const
|
||||
{
|
||||
return( m_engine->hasGUI() );
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* is used by envelope/lfo/filter-tab of
|
||||
* channel-window
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -37,10 +37,14 @@
|
||||
#ifdef QT4
|
||||
|
||||
#include <QWidget>
|
||||
#include <QMap>
|
||||
#include <QVector>
|
||||
|
||||
#else
|
||||
|
||||
#include <qwidget.h>
|
||||
#include <qmap.h>
|
||||
#include <qvaluevector.h>
|
||||
|
||||
#endif
|
||||
|
||||
@@ -63,22 +67,26 @@ class tempoSyncKnob;
|
||||
|
||||
|
||||
class envelopeAndLFOWidget : public QWidget, public settings,
|
||||
public specialBgHandlingWidget
|
||||
public specialBgHandlingWidget,
|
||||
public engineObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
envelopeAndLFOWidget( float _value_for_zero_amount, QWidget * _parent );
|
||||
~envelopeAndLFOWidget();
|
||||
envelopeAndLFOWidget( float _value_for_zero_amount, QWidget * _parent,
|
||||
engine * _engine );
|
||||
virtual ~envelopeAndLFOWidget();
|
||||
|
||||
static inline float expKnobVal( float val )
|
||||
{
|
||||
return( ( ( val < 0 ) ? -1 : 1 ) * val*val );
|
||||
}
|
||||
static void triggerLFO( void );
|
||||
static void resetLFO( void );
|
||||
|
||||
float FASTCALL level( Uint32 _frame, Uint32 _release_begin,
|
||||
Uint32 _frame_offset ) const;
|
||||
static void triggerLFO( engine * _engine );
|
||||
static void resetLFO( engine * _engine );
|
||||
|
||||
float FASTCALL level( f_cnt_t _frame,
|
||||
const f_cnt_t _release_begin,
|
||||
const f_cnt_t _frame_offset ) const;
|
||||
|
||||
inline bool used( void ) const
|
||||
{
|
||||
@@ -105,7 +113,8 @@ protected:
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
|
||||
float FASTCALL lfoLevel( Uint32 _frame, Uint32 _frame_offset ) const;
|
||||
float FASTCALL lfoLevel( f_cnt_t _frame,
|
||||
const f_cnt_t _frame_offset ) const;
|
||||
|
||||
|
||||
protected slots:
|
||||
@@ -122,10 +131,11 @@ private:
|
||||
static QPixmap * s_envGraph;
|
||||
static QPixmap * s_lfoGraph;
|
||||
|
||||
static Uint32 s_lfoFrame;
|
||||
static QMap<engine *, vvector<envelopeAndLFOWidget *> > s_EaLWidgets;
|
||||
|
||||
bool m_used;
|
||||
|
||||
|
||||
// envelope-stuff
|
||||
knob * m_predelayKnob;
|
||||
knob * m_attackKnob;
|
||||
@@ -139,10 +149,10 @@ private:
|
||||
float m_amount;
|
||||
float m_valueForZeroAmount;
|
||||
float m_amountAdd;
|
||||
Uint32 m_pahdFrames;
|
||||
Uint32 m_rFrames;
|
||||
float * m_pahdEnv;
|
||||
float * m_rEnv;
|
||||
f_cnt_t m_pahdFrames;
|
||||
f_cnt_t m_rFrames;
|
||||
sample_t * m_pahdEnv;
|
||||
sample_t * m_rEnv;
|
||||
|
||||
// LFO-stuff
|
||||
knob * m_lfoPredelayKnob;
|
||||
@@ -158,12 +168,13 @@ private:
|
||||
ledCheckBox * m_x100Cb;
|
||||
ledCheckBox * m_controlEnvAmountCb;
|
||||
|
||||
Uint32 m_lfoPredelayFrames;
|
||||
Uint32 m_lfoAttackFrames;
|
||||
Uint32 m_lfoOscillationFrames;
|
||||
f_cnt_t m_lfoPredelayFrames;
|
||||
f_cnt_t m_lfoAttackFrames;
|
||||
f_cnt_t m_lfoOscillationFrames;
|
||||
f_cnt_t m_lfoFrame;
|
||||
float m_lfoAmount;
|
||||
bool m_lfoAmountIsZero;
|
||||
float * m_lfoShapeData;
|
||||
sample_t * m_lfoShapeData;
|
||||
sampleBuffer m_userWave;
|
||||
|
||||
enum lfoShapes
|
||||
|
||||
@@ -57,14 +57,16 @@ class pixmapButton;
|
||||
class tabWidget;
|
||||
|
||||
|
||||
class envelopeTabWidget : public QWidget, public settings
|
||||
class envelopeTabWidget : public QWidget, public settings,
|
||||
public engineObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
envelopeTabWidget( channelTrack * _channel_track );
|
||||
virtual ~envelopeTabWidget();
|
||||
|
||||
void FASTCALL processAudioBuffer( sampleFrame * _ab, Uint32 _frames,
|
||||
void FASTCALL processAudioBuffer( sampleFrame * _ab,
|
||||
const fpab_t _frames,
|
||||
notePlayHandle * _n );
|
||||
|
||||
enum targets
|
||||
@@ -77,10 +79,10 @@ public:
|
||||
TARGET_COUNT
|
||||
} ;
|
||||
|
||||
Uint32 envFrames( void );
|
||||
Uint32 releaseFrames( void );
|
||||
f_cnt_t envFrames( void );
|
||||
f_cnt_t releaseFrames( void );
|
||||
|
||||
float FASTCALL volumeLevel( notePlayHandle * _n, Uint32 _frame );
|
||||
float FASTCALL volumeLevel( notePlayHandle * _n, const f_cnt_t _frame );
|
||||
|
||||
|
||||
virtual void FASTCALL saveSettings( QDomDocument & _doc,
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
|
||||
class audioFileDevice;
|
||||
class mixer;
|
||||
|
||||
|
||||
typedef audioFileDevice * ( * getDeviceInst)( const sample_rate_t _sample_rate,
|
||||
@@ -38,7 +39,8 @@ typedef audioFileDevice * ( * getDeviceInst)( const sample_rate_t _sample_rate,
|
||||
const bool _use_vbr,
|
||||
const bitrate_t _nom_bitrate,
|
||||
const bitrate_t _min_bitrate,
|
||||
const bitrate_t _max_bitrate );
|
||||
const bitrate_t _max_bitrate,
|
||||
mixer * _mixer );
|
||||
|
||||
|
||||
enum fileTypes
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#endif
|
||||
|
||||
#include "export.h"
|
||||
#include "engine.h"
|
||||
|
||||
|
||||
class QLabel;
|
||||
@@ -55,12 +56,13 @@ class ledCheckBox;
|
||||
class pixmapButton;
|
||||
|
||||
|
||||
class exportProjectDialog : public QDialog
|
||||
class exportProjectDialog : public QDialog, public engineObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
exportProjectDialog( const QString & _file_name, QWidget * _parent );
|
||||
~exportProjectDialog();
|
||||
exportProjectDialog( const QString & _file_name, QWidget * _parent,
|
||||
engine * _engine );
|
||||
virtual ~exportProjectDialog();
|
||||
|
||||
|
||||
public slots:
|
||||
@@ -68,8 +70,8 @@ public slots:
|
||||
|
||||
|
||||
protected:
|
||||
void keyPressEvent( QKeyEvent * _ke );
|
||||
void closeEvent( QCloseEvent * _ce );
|
||||
virtual void keyPressEvent( QKeyEvent * _ke );
|
||||
virtual void closeEvent( QCloseEvent * _ce );
|
||||
|
||||
|
||||
private slots:
|
||||
@@ -85,6 +87,7 @@ private:
|
||||
_ext );
|
||||
static Sint16 s_availableBitrates[];
|
||||
|
||||
|
||||
QString m_fileName;
|
||||
QLabel * m_typeLbl;
|
||||
comboBox * m_typeCombo;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* fade_button.h - declaration of class fadeButton
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* file_browser.h - include file for fileBrowser
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
|
||||
#include "side_bar_widget.h"
|
||||
|
||||
#include "engine.h"
|
||||
|
||||
|
||||
class fileItem;
|
||||
@@ -57,13 +57,13 @@ class trackContainer;
|
||||
|
||||
|
||||
|
||||
class fileBrowser : public sideBarWidget
|
||||
class fileBrowser : public sideBarWidget, public engineObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
fileBrowser( const QString & _path, const QString & _filter,
|
||||
const QString & _title, const QPixmap & _pm,
|
||||
QWidget * _parent );
|
||||
QWidget * _parent, engine * _engine );
|
||||
virtual ~fileBrowser();
|
||||
|
||||
|
||||
@@ -100,12 +100,12 @@ private:
|
||||
|
||||
|
||||
|
||||
class listView : public Q3ListView
|
||||
class listView : public Q3ListView, public engineObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
listView( QWidget * _parent );
|
||||
~listView();
|
||||
listView( QWidget * _parent, engine * _engine );
|
||||
virtual ~listView();
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
@@ -82,7 +82,7 @@ public:
|
||||
// (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 Uint32 FASTCALL beatLen( notePlayHandle * _n ) const;
|
||||
virtual f_cnt_t FASTCALL beatLen( notePlayHandle * _n ) const;
|
||||
|
||||
|
||||
// instrument-play-handles use this for checking whether they can mark
|
||||
@@ -110,7 +110,7 @@ protected:
|
||||
inline void invalidate( void )
|
||||
{
|
||||
m_valid = FALSE;
|
||||
mixer::inst()->checkValidityOfPlayHandles();
|
||||
eng()->getMixer()->checkValidityOfPlayHandles();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* instrument_play_handle.h - play-handle for playing an instrument
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -33,8 +33,8 @@
|
||||
class instrumentPlayHandle : public playHandle
|
||||
{
|
||||
public:
|
||||
inline instrumentPlayHandle( instrument * _instrument ) :
|
||||
playHandle( INSTRUMENT_PLAY_HANDLE ),
|
||||
inline instrumentPlayHandle( instrument * _instrument ) FASTCALL :
|
||||
playHandle( INSTRUMENT_PLAY_HANDLE, _instrument->eng() ),
|
||||
m_instrument( _instrument )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This file is based on the knob-widget of the Qwt Widget Library by
|
||||
* Josef Wilgen
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -44,6 +44,9 @@
|
||||
#endif
|
||||
|
||||
|
||||
#include "engine.h"
|
||||
|
||||
|
||||
class QPixmap;
|
||||
class textFloat;
|
||||
|
||||
@@ -55,11 +58,12 @@ enum knobTypes
|
||||
|
||||
|
||||
|
||||
class knob : public QWidget
|
||||
class knob : public QWidget, public engineObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
knob( int _knob_num, QWidget * _parent, const QString & _name );
|
||||
knob( int _knob_num, QWidget * _parent, const QString & _name,
|
||||
engine * _engine );
|
||||
virtual ~knob();
|
||||
|
||||
|
||||
|
||||
165
include/main_window.h
Normal file
165
include/main_window.h
Normal file
@@ -0,0 +1,165 @@
|
||||
/*
|
||||
* main_window.h - declaration of class mainWindow, the main window of LMMS
|
||||
*
|
||||
* Copyright (c) 2004-2006 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.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _MAIN_WINDOW_H
|
||||
#define _MAIN_WINDOW_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QWorkspace>
|
||||
#include <QWhatsThis>
|
||||
|
||||
#else
|
||||
|
||||
#include <qmainwindow.h>
|
||||
#include <qworkspace.h>
|
||||
#include <qwhatsthis.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
|
||||
#include "types.h"
|
||||
#include "engine.h"
|
||||
|
||||
|
||||
class QGridLayout;
|
||||
class QSplashScreen;
|
||||
|
||||
class configManager;
|
||||
class toolButton;
|
||||
|
||||
|
||||
|
||||
class mainWindow : public QMainWindow, public engineObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
inline QWorkspace * workspace( void )
|
||||
{
|
||||
return( m_workspace );
|
||||
}
|
||||
|
||||
inline QWidget * toolBar( void )
|
||||
{
|
||||
return( m_toolBar );
|
||||
}
|
||||
|
||||
int addWidgetToToolBar( QWidget * _w, int _row = -1, int _col = -1 );
|
||||
void addSpacingToToolBar( int _size );
|
||||
|
||||
void FASTCALL resetWindowTitle( const QString & _add = "" );
|
||||
|
||||
void clearKeyModifiers( void );
|
||||
|
||||
inline bool isCtrlPressed( void )
|
||||
{
|
||||
return( m_keyMods.m_ctrl );
|
||||
}
|
||||
|
||||
inline bool isShiftPressed( void )
|
||||
{
|
||||
return( m_keyMods.m_shift );
|
||||
}
|
||||
|
||||
inline bool isAltPressed( void )
|
||||
{
|
||||
return( m_keyMods.m_alt );
|
||||
}
|
||||
|
||||
static QSplashScreen * s_splashScreen;
|
||||
|
||||
|
||||
public slots:
|
||||
inline void emptySlot( void )
|
||||
{
|
||||
}
|
||||
inline void enterWhatsThisMode( void )
|
||||
{
|
||||
QWhatsThis::enterWhatsThisMode();
|
||||
}
|
||||
void createNewProject( void );
|
||||
void createNewProjectFromTemplate( int _idx );
|
||||
void openProject( void );
|
||||
bool saveProject( void );
|
||||
bool saveProjectAs( void );
|
||||
void showSettingsDialog( void );
|
||||
void aboutLMMS( void );
|
||||
void help( void );
|
||||
void toggleBBEditorWin( void );
|
||||
void toggleSongEditorWin( void );
|
||||
void toggleProjectNotesWin( void );
|
||||
void togglePianoRollWin( void );
|
||||
|
||||
|
||||
protected:
|
||||
virtual void closeEvent( QCloseEvent * _ce );
|
||||
virtual void focusOutEvent( QFocusEvent * _fe );
|
||||
virtual void keyPressEvent( QKeyEvent * _ke );
|
||||
virtual void keyReleaseEvent( QKeyEvent * _ke );
|
||||
|
||||
|
||||
private:
|
||||
mainWindow( engine * _engine );
|
||||
mainWindow( const mainWindow & );
|
||||
virtual ~mainWindow();
|
||||
|
||||
void finalize( void );
|
||||
|
||||
|
||||
QWorkspace * m_workspace;
|
||||
|
||||
QWidget * m_toolBar;
|
||||
QGridLayout * m_toolBarLayout;
|
||||
|
||||
QMenu * m_templatesMenu;
|
||||
|
||||
struct keyModifiers
|
||||
{
|
||||
keyModifiers() :
|
||||
m_ctrl( FALSE ),
|
||||
m_shift( FALSE ),
|
||||
m_alt( FALSE )
|
||||
{
|
||||
}
|
||||
bool m_ctrl;
|
||||
bool m_shift;
|
||||
bool m_alt;
|
||||
} m_keyMods;
|
||||
|
||||
|
||||
friend class engine;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* micro_timer.h - simple high-precision timer
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* midi_alsa_raw.h - midi-client for RawMIDI via ALSA
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -61,8 +61,8 @@ class QLineEdit;
|
||||
class midiALSARaw : public midiClientRaw, public QThread
|
||||
{
|
||||
public:
|
||||
midiALSARaw( void );
|
||||
~midiALSARaw();
|
||||
midiALSARaw( engine * _engine );
|
||||
virtual ~midiALSARaw();
|
||||
|
||||
static QString probeDevice( void );
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* midi_alsa_seq.h - ALSA-sequencer-client
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -71,8 +71,8 @@ class midiALSASeq :
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
midiALSASeq( void );
|
||||
~midiALSASeq();
|
||||
midiALSASeq( engine * _engine );
|
||||
virtual ~midiALSASeq();
|
||||
|
||||
static QString probeDevice( void );
|
||||
|
||||
@@ -143,7 +143,7 @@ public:
|
||||
|
||||
|
||||
private slots:
|
||||
void changeQueueTempo( int _bpm );
|
||||
void changeQueueTempo( bpm_t _bpm );
|
||||
void updatePortList( void );
|
||||
|
||||
|
||||
|
||||
@@ -44,16 +44,17 @@
|
||||
#include "midi.h"
|
||||
#include "midi_event_processor.h"
|
||||
#include "tab_widget.h"
|
||||
#include "engine.h"
|
||||
|
||||
|
||||
class midiPort;
|
||||
|
||||
|
||||
// base-class for all MIDI-clients
|
||||
class midiClient
|
||||
class midiClient : public engineObject
|
||||
{
|
||||
public:
|
||||
midiClient( void );
|
||||
midiClient( engine * _engine );
|
||||
virtual ~midiClient();
|
||||
|
||||
// to be implemented by sub-classes
|
||||
@@ -143,7 +144,7 @@ const Uint8 RAW_MIDI_PARSE_BUF_SIZE = 16;
|
||||
class midiClientRaw : public midiClient
|
||||
{
|
||||
public:
|
||||
midiClientRaw( void );
|
||||
midiClientRaw( engine * _engine );
|
||||
virtual ~midiClientRaw();
|
||||
|
||||
// we are raw-clients for sure!
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* midi_dummy.h - dummy MIDI-driver
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -35,11 +35,11 @@
|
||||
class midiDummy : public midiClientRaw
|
||||
{
|
||||
public:
|
||||
midiDummy() :
|
||||
midiClientRaw()
|
||||
midiDummy( engine * _engine ) :
|
||||
midiClientRaw( _engine )
|
||||
{
|
||||
}
|
||||
~midiDummy()
|
||||
virtual ~midiDummy()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* midi_oss.h - OSS-raw-midi-client
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -43,8 +43,8 @@ class QLineEdit;
|
||||
class midiOSS : public midiClientRaw, public QThread
|
||||
{
|
||||
public:
|
||||
midiOSS( void );
|
||||
~midiOSS();
|
||||
midiOSS( engine * _engine );
|
||||
virtual ~midiOSS();
|
||||
|
||||
static QString probeDevice( void );
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* midi_port.h - abstraction of MIDI-ports which are part of LMMS's MIDI-
|
||||
* sequencing system
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#endif
|
||||
|
||||
#include "settings.h"
|
||||
#include "engine.h"
|
||||
|
||||
|
||||
class QMenu;
|
||||
@@ -57,12 +58,12 @@ class lcdSpinBox;
|
||||
class midiPort;
|
||||
|
||||
|
||||
class midiTabWidget : public QWidget, public settings
|
||||
class midiTabWidget : public QWidget, public settings, public engineObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
midiTabWidget( channelTrack * _channel_track, midiPort * _port );
|
||||
~midiTabWidget();
|
||||
virtual ~midiTabWidget();
|
||||
|
||||
|
||||
virtual void FASTCALL saveSettings( QDomDocument & _doc,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* midi_time.h - declaration of class midiTime which provides data-type for
|
||||
* position- and length-variables
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -98,11 +98,11 @@ public:
|
||||
}
|
||||
|
||||
// calculate number of frame that are needed this time
|
||||
inline Uint32 frames( const float _frames_per_tact ) const
|
||||
inline f_cnt_t frames( const float _frames_per_tact ) const
|
||||
{
|
||||
if( m_tact >= 0 )
|
||||
{
|
||||
return( static_cast<Uint32>( m_tact *
|
||||
return( static_cast<f_cnt_t>( m_tact *
|
||||
_frames_per_tact +
|
||||
m_tact64th *
|
||||
_frames_per_tact /
|
||||
@@ -111,7 +111,7 @@ public:
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
static inline midiTime fromFrames( Uint32 _frames,
|
||||
static inline midiTime fromFrames( const f_cnt_t _frames,
|
||||
const float _frames_per_tact )
|
||||
{
|
||||
return( midiTime( static_cast<Sint32>( _frames * 64.0f /
|
||||
|
||||
@@ -52,12 +52,11 @@
|
||||
#include "note.h"
|
||||
#include "play_handle.h"
|
||||
#include "effect_board.h"
|
||||
#include "engine.h"
|
||||
|
||||
|
||||
class audioDevice;
|
||||
class midiClient;
|
||||
class lmmsMainWin;
|
||||
class plugin;
|
||||
class audioPort;
|
||||
|
||||
|
||||
@@ -107,47 +106,14 @@ const octaves BASE_OCTAVE = OCTAVE_4;
|
||||
|
||||
|
||||
|
||||
class mixer : public QObject
|
||||
class mixer : public QObject, public engineObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
static inline mixer * inst( void )
|
||||
{
|
||||
if( s_instanceOfMe == NULL )
|
||||
{
|
||||
s_instanceOfMe = new mixer();
|
||||
}
|
||||
return( s_instanceOfMe );
|
||||
}
|
||||
void initDevices( void );
|
||||
void FASTCALL clear( const bool _everything = FALSE );
|
||||
|
||||
|
||||
void FASTCALL bufferToPort( const sampleFrame * _buf,
|
||||
const fpab_t _frames,
|
||||
const fpab_t _framesAhead,
|
||||
const volumeVector & _volumeVector,
|
||||
audioPort * _port );
|
||||
|
||||
inline fpab_t framesPerAudioBuffer( void ) const
|
||||
{
|
||||
return( m_framesPerAudioBuffer );
|
||||
}
|
||||
|
||||
inline Uint8 cpuLoad( void ) const
|
||||
{
|
||||
return( m_cpuLoad );
|
||||
}
|
||||
|
||||
inline bool highQuality( void ) const
|
||||
{
|
||||
return( m_qualityLevel > DEFAULT_QUALITY_LEVEL );
|
||||
}
|
||||
|
||||
|
||||
inline const surroundSampleFrame * currentAudioBuffer( void ) const
|
||||
{
|
||||
return( m_curBuf );
|
||||
}
|
||||
|
||||
// audio-device-stuff
|
||||
inline const QString & audioDevName( void ) const
|
||||
{
|
||||
@@ -181,6 +147,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// MIDI-client-stuff
|
||||
inline const QString & midiClientName( void ) const
|
||||
{
|
||||
@@ -193,6 +160,7 @@ public:
|
||||
}
|
||||
|
||||
|
||||
// play-handle stuff
|
||||
inline void addPlayHandle( playHandle * _ph )
|
||||
{
|
||||
if( criticalXRuns() == FALSE )
|
||||
@@ -217,9 +185,36 @@ public:
|
||||
|
||||
void checkValidityOfPlayHandles( void );
|
||||
|
||||
inline bool haveNoRunningNotes( void ) const
|
||||
{
|
||||
return( m_playHandles.size() == 0 );
|
||||
}
|
||||
|
||||
|
||||
inline sample_rate_t sampleRate( void )
|
||||
// methods providing information for other classes
|
||||
inline fpab_t framesPerAudioBuffer( void ) const
|
||||
{
|
||||
return( m_framesPerAudioBuffer );
|
||||
}
|
||||
|
||||
inline const surroundSampleFrame * currentAudioBuffer( void ) const
|
||||
{
|
||||
return( m_curBuf );
|
||||
}
|
||||
|
||||
|
||||
inline Uint8 cpuLoad( void ) const
|
||||
{
|
||||
return( m_cpuLoad );
|
||||
}
|
||||
|
||||
inline bool highQuality( void ) const
|
||||
{
|
||||
return( m_qualityLevel > DEFAULT_QUALITY_LEVEL );
|
||||
}
|
||||
|
||||
|
||||
inline sample_rate_t sampleRate( void ) const
|
||||
{
|
||||
return( SAMPLE_RATES[m_qualityLevel] );
|
||||
}
|
||||
@@ -250,6 +245,7 @@ public:
|
||||
}
|
||||
|
||||
|
||||
// methods for controlling mixer-state
|
||||
void pause( void )
|
||||
{
|
||||
if( m_mixMutexLockLevel == 0 )
|
||||
@@ -269,8 +265,12 @@ public:
|
||||
}
|
||||
|
||||
|
||||
void FASTCALL clear( const bool _everything = FALSE );
|
||||
|
||||
// audio-buffer-mgm
|
||||
void FASTCALL bufferToPort( const sampleFrame * _buf,
|
||||
const fpab_t _frames,
|
||||
const fpab_t _framesAhead,
|
||||
const volumeVector & _volumeVector,
|
||||
audioPort * _port );
|
||||
|
||||
void FASTCALL clearAudioBuffer( sampleFrame * _ab,
|
||||
const f_cnt_t _frames );
|
||||
@@ -279,11 +279,6 @@ public:
|
||||
const f_cnt_t _frames );
|
||||
#endif
|
||||
|
||||
inline bool haveNoRunningNotes( void ) const
|
||||
{
|
||||
return( m_playHandles.size() == 0 );
|
||||
}
|
||||
|
||||
bool criticalXRuns( void ) const;
|
||||
|
||||
const surroundSampleFrame * renderNextBuffer( void );
|
||||
@@ -300,17 +295,16 @@ signals:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
static mixer * s_instanceOfMe;
|
||||
|
||||
mixer();
|
||||
mixer( engine * _engine );
|
||||
~mixer();
|
||||
|
||||
void startProcessing( void );
|
||||
void stopProcessing( void );
|
||||
|
||||
|
||||
// we don't allow to create mixer by using copy-ctor
|
||||
mixer( const mixer & )
|
||||
mixer( const mixer & ) :
|
||||
engineObject( NULL )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -353,7 +347,7 @@ private:
|
||||
Uint8 m_mixMutexLockLevel;
|
||||
|
||||
|
||||
friend class lmmsMainWin;
|
||||
friend class engine;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -41,13 +41,16 @@
|
||||
|
||||
#endif
|
||||
|
||||
#include "engine.h"
|
||||
|
||||
class nameLabel : public QLabel
|
||||
|
||||
class nameLabel : public QLabel, public engineObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
nameLabel( const QString & _initial_name, QWidget * _parent );
|
||||
~nameLabel();
|
||||
nameLabel( const QString & _initial_name, QWidget * _parent,
|
||||
engine * _engine );
|
||||
virtual ~nameLabel();
|
||||
|
||||
const QPixmap & pixmap( void ) const
|
||||
{
|
||||
|
||||
@@ -27,8 +27,6 @@
|
||||
#ifndef _NOTE_PLAY_HANDLE_H
|
||||
#define _NOTE_PLAY_HANDLE_H
|
||||
|
||||
#include <qpair.h>
|
||||
|
||||
#include "play_handle.h"
|
||||
#include "basic_filters.h"
|
||||
#include "note.h"
|
||||
@@ -47,10 +45,10 @@ public:
|
||||
void * m_pluginData;
|
||||
basicFilters<> * m_filter;
|
||||
|
||||
notePlayHandle( channelTrack * _chnl_trk, const Uint32 _frames_ahead,
|
||||
const Uint32 _frames, note * _n,
|
||||
notePlayHandle( channelTrack * _chnl_trk, const f_cnt_t _frames_ahead,
|
||||
const f_cnt_t _frames, note * _n,
|
||||
const bool _arp_note = FALSE ) FASTCALL;
|
||||
~notePlayHandle();
|
||||
virtual ~notePlayHandle();
|
||||
|
||||
|
||||
virtual void play( void );
|
||||
@@ -65,34 +63,34 @@ public:
|
||||
virtual void checkValidity( void );
|
||||
|
||||
|
||||
void FASTCALL noteOff( Uint32 _s = 0 );
|
||||
void FASTCALL noteOff( const f_cnt_t _s = 0 );
|
||||
|
||||
inline Uint32 framesBeforeRelease( void ) const
|
||||
inline f_cnt_t framesBeforeRelease( void ) const
|
||||
{
|
||||
return( m_framesBeforeRelease );
|
||||
}
|
||||
|
||||
inline Uint32 releaseFramesDone( void ) const
|
||||
inline f_cnt_t releaseFramesDone( void ) const
|
||||
{
|
||||
return( m_releaseFramesDone );
|
||||
}
|
||||
|
||||
Uint32 actualReleaseFramesToDo( void ) const;
|
||||
f_cnt_t actualReleaseFramesToDo( void ) const;
|
||||
|
||||
// returns how many samples this note is aligned ahead, i.e.
|
||||
// at which position it is inserted in the according buffer
|
||||
inline Uint32 framesAhead( void ) const
|
||||
inline f_cnt_t framesAhead( void ) const
|
||||
{
|
||||
return ( m_framesAhead );
|
||||
}
|
||||
|
||||
// returns total numbers of frames to play
|
||||
inline Uint32 frames( void ) const
|
||||
inline f_cnt_t frames( void ) const
|
||||
{
|
||||
return( m_frames );
|
||||
}
|
||||
|
||||
void setFrames( Uint32 _frames );
|
||||
void setFrames( const f_cnt_t _frames );
|
||||
|
||||
// returns whether note was released
|
||||
inline bool released( void ) const
|
||||
@@ -101,13 +99,13 @@ public:
|
||||
}
|
||||
|
||||
// returns total numbers of played frames
|
||||
inline Uint32 totalFramesPlayed( void ) const
|
||||
inline f_cnt_t totalFramesPlayed( void ) const
|
||||
{
|
||||
return( m_totalFramesPlayed );
|
||||
}
|
||||
|
||||
// returns volume-level at frame _frame (envelope/LFO)
|
||||
float FASTCALL volumeLevel( Uint32 _frame );
|
||||
float FASTCALL volumeLevel( const f_cnt_t _frame );
|
||||
|
||||
// adds note-play-handle _n as subnote
|
||||
inline void addSubNote( notePlayHandle * _n )
|
||||
@@ -139,7 +137,7 @@ public:
|
||||
return( m_arpNote );
|
||||
}
|
||||
|
||||
inline void setArpNote( bool _on )
|
||||
inline void setArpNote( const bool _on )
|
||||
{
|
||||
m_arpNote = _on;
|
||||
}
|
||||
@@ -172,17 +170,17 @@ public:
|
||||
private:
|
||||
channelTrack * m_channelTrack; // needed for calling
|
||||
// channelTrack::playNote
|
||||
Uint32 m_frames; // total frames to play
|
||||
Uint32 m_framesAhead; // numbers of frames ahead in buffer
|
||||
f_cnt_t m_frames; // total frames to play
|
||||
f_cnt_t m_framesAhead; // numbers of frames ahead in buffer
|
||||
// to mix in
|
||||
Uint32 m_totalFramesPlayed; // total frame-counter - used for
|
||||
f_cnt_t m_totalFramesPlayed; // total frame-counter - used for
|
||||
// figuring out whether a whole note
|
||||
// has been played
|
||||
Uint32 m_framesBeforeRelease; // number of frames after which note
|
||||
f_cnt_t m_framesBeforeRelease; // number of frames after which note
|
||||
// is released
|
||||
Uint32 m_releaseFramesToDo; // total numbers of frames to be
|
||||
f_cnt_t m_releaseFramesToDo; // total numbers of frames to be
|
||||
// played after release
|
||||
Uint32 m_releaseFramesDone; // number of frames done after
|
||||
f_cnt_t m_releaseFramesDone; // number of frames done after
|
||||
// release of note
|
||||
notePlayHandleVector m_subNotes;// used for chords and arpeggios
|
||||
bool m_released; // indicates whether note is released
|
||||
|
||||
@@ -71,7 +71,8 @@ public:
|
||||
|
||||
oscillator( const modulationAlgos _modulation_algo, const float _freq,
|
||||
const Sint16 _phase_offset, const float _volume_factor,
|
||||
oscillator * _m_subOsc ) FASTCALL;
|
||||
const sample_rate_t _sample_rate,
|
||||
oscillator * _m_subOsc ) FASTCALL;
|
||||
virtual ~oscillator()
|
||||
{
|
||||
delete m_subOsc;
|
||||
@@ -112,6 +113,7 @@ public:
|
||||
const float _freq,
|
||||
const Sint16 _phase_offset,
|
||||
const float _volume_factor,
|
||||
const sample_rate_t _sample_rate,
|
||||
oscillator * _m_subOsc = NULL );
|
||||
inline bool syncOk( void )
|
||||
{
|
||||
@@ -212,6 +214,7 @@ protected:
|
||||
float m_freq;
|
||||
float m_volumeFactor;
|
||||
Sint16 m_phaseOffset;
|
||||
const sample_rate_t m_sampleRate;
|
||||
oscillator * m_subOsc;
|
||||
f_cnt_t m_sample;
|
||||
float m_oscCoeff;
|
||||
|
||||
@@ -78,8 +78,8 @@ public:
|
||||
BEAT_PATTERN, MELODY_PATTERN/*, AUTOMATION_PATTERN*/
|
||||
} ;
|
||||
|
||||
pattern( channelTrack * _channel_track ) FASTCALL;
|
||||
pattern( const pattern & _pat_to_copy ) FASTCALL;
|
||||
pattern( channelTrack * _channel_track );
|
||||
pattern( const pattern & _pat_to_copy );
|
||||
virtual ~pattern();
|
||||
|
||||
void init( void );
|
||||
@@ -139,8 +139,9 @@ public:
|
||||
|
||||
// if channel-track recognizes that this pattern is frozen, it calls
|
||||
// this instead of playing all the notes
|
||||
void FASTCALL playFrozenData( sampleFrame * _ab, Uint32 _start_frame,
|
||||
Uint32 _frames );
|
||||
void FASTCALL playFrozenData( sampleFrame * _ab,
|
||||
const f_cnt_t _start_frame,
|
||||
const fpab_t _frames );
|
||||
|
||||
// settings-management
|
||||
virtual void FASTCALL saveSettings( QDomDocument & _doc,
|
||||
@@ -269,7 +270,7 @@ signals:
|
||||
|
||||
|
||||
|
||||
class patternFreezeThread : public QThread
|
||||
class patternFreezeThread : public QThread, public engineObject
|
||||
{
|
||||
public:
|
||||
patternFreezeThread( pattern * _pattern );
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
|
||||
#include "types.h"
|
||||
#include "note.h"
|
||||
#include "engine.h"
|
||||
|
||||
|
||||
class QPainter;
|
||||
@@ -52,26 +53,16 @@ class QPixmap;
|
||||
class QScrollBar;
|
||||
|
||||
class comboBox;
|
||||
class lmmsMainWin;
|
||||
class notePlayHandle;
|
||||
class pattern;
|
||||
class timeLine;
|
||||
class toolButton;
|
||||
|
||||
|
||||
class pianoRoll : public QWidget
|
||||
class pianoRoll : public QWidget, public engineObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
static inline pianoRoll * inst( void )
|
||||
{
|
||||
if( s_instanceOfMe == NULL )
|
||||
{
|
||||
s_instanceOfMe = new pianoRoll();
|
||||
}
|
||||
return( s_instanceOfMe );
|
||||
}
|
||||
|
||||
void FASTCALL setCurrentPattern( pattern * _new_pattern );
|
||||
|
||||
inline bool isRecording( void ) const
|
||||
@@ -170,14 +161,11 @@ private:
|
||||
} ;
|
||||
|
||||
|
||||
pianoRoll( void );
|
||||
pianoRoll( engine * _engine );
|
||||
pianoRoll( const pianoRoll & );
|
||||
~pianoRoll();
|
||||
virtual ~pianoRoll();
|
||||
|
||||
|
||||
|
||||
static pianoRoll * s_instanceOfMe;
|
||||
|
||||
static QPixmap * s_whiteKeyBigPm;
|
||||
static QPixmap * s_whiteKeySmallPm;
|
||||
static QPixmap * s_blackKeyPm;
|
||||
@@ -251,7 +239,7 @@ private:
|
||||
|
||||
|
||||
|
||||
friend class lmmsMainWin;
|
||||
friend class engine;
|
||||
|
||||
|
||||
signals:
|
||||
|
||||
@@ -44,7 +44,10 @@
|
||||
#endif
|
||||
|
||||
|
||||
class playHandle
|
||||
#include "engine.h"
|
||||
|
||||
|
||||
class playHandle : public engineObject
|
||||
{
|
||||
public:
|
||||
enum types
|
||||
@@ -53,7 +56,8 @@ public:
|
||||
PRESET_PREVIEW_PLAY_HANDLE
|
||||
} ;
|
||||
|
||||
inline playHandle( types _type ) :
|
||||
inline playHandle( const types _type, engine * _engine ) FASTCALL :
|
||||
engineObject( _engine ),
|
||||
m_type( _type )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
#include "types.h"
|
||||
#include "settings.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
|
||||
|
||||
#define STRINGIFY_PLUGIN_NAME(s) STR(s)
|
||||
@@ -58,7 +59,7 @@
|
||||
class QPixmap;
|
||||
|
||||
|
||||
class plugin : public settings
|
||||
class plugin : public settings, public engineObject
|
||||
{
|
||||
public:
|
||||
enum pluginTypes
|
||||
@@ -85,7 +86,7 @@ public:
|
||||
} ;
|
||||
|
||||
// contructor of a plugin
|
||||
plugin( const descriptor * _descriptor );
|
||||
plugin( const descriptor * _descriptor, engine * _engine );
|
||||
virtual ~plugin();
|
||||
|
||||
// returns public-name out of descriptor
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* plugin_browser.h - include file for pluginBrowser
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -53,11 +53,11 @@
|
||||
class trackContainer;
|
||||
|
||||
|
||||
class pluginBrowser : public sideBarWidget
|
||||
class pluginBrowser : public sideBarWidget, public engineObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
pluginBrowser( QWidget * _parent );
|
||||
pluginBrowser( QWidget * _parent, engine * _engine );
|
||||
virtual ~pluginBrowser();
|
||||
|
||||
|
||||
@@ -71,10 +71,11 @@ private:
|
||||
|
||||
|
||||
|
||||
class pluginDescWidget : public QWidget
|
||||
class pluginDescWidget : public QWidget, public engineObject
|
||||
{
|
||||
public:
|
||||
pluginDescWidget( const plugin::descriptor & _pd, QWidget * _parent );
|
||||
pluginDescWidget( const plugin::descriptor & _pd, QWidget * _parent,
|
||||
engine * _engine );
|
||||
virtual ~pluginDescWidget();
|
||||
|
||||
|
||||
|
||||
@@ -27,31 +27,49 @@
|
||||
#ifndef _PRESET_PREVIEW_PLAY_HANDLE_H
|
||||
#define _PRESET_PREVIEW_PLAY_HANDLE_H
|
||||
|
||||
#include "note_play_handle.h"
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QMutex>
|
||||
#include <QMap>
|
||||
|
||||
#else
|
||||
|
||||
#include <qmutex.h>
|
||||
#include <qmap.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "note_play_handle.h"
|
||||
|
||||
|
||||
class previewTrackContainer;
|
||||
class channelTrack;
|
||||
class QMutex;
|
||||
|
||||
|
||||
class presetPreviewPlayHandle : public playHandle
|
||||
{
|
||||
public:
|
||||
presetPreviewPlayHandle( const QString & _preset_file );
|
||||
presetPreviewPlayHandle( const QString & _preset_file,
|
||||
engine * _engine ) FASTCALL;
|
||||
virtual ~presetPreviewPlayHandle();
|
||||
|
||||
virtual void play( void );
|
||||
virtual bool done( void ) const;
|
||||
|
||||
static void cleanUp( void );
|
||||
static void cleanUp( engine * _engine );
|
||||
static constNotePlayHandleVector nphsOfChannelTrack(
|
||||
const channelTrack * _ct );
|
||||
|
||||
private:
|
||||
static channelTrack * s_globalChannelTrack;
|
||||
static notePlayHandle * s_globalPreviewNote;
|
||||
static QMutex s_globalDataMutex;
|
||||
inline previewTrackContainer * previewTC( void )
|
||||
{
|
||||
return( s_previewTCs[eng()] );
|
||||
}
|
||||
|
||||
static QMap<const engine *, previewTrackContainer *> s_previewTCs;
|
||||
|
||||
notePlayHandle * m_previewNote;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* project_notes.h - header for project-notes-editor
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -39,6 +39,7 @@
|
||||
#endif
|
||||
|
||||
#include "settings.h"
|
||||
#include "engine.h"
|
||||
|
||||
|
||||
class QAction;
|
||||
@@ -46,11 +47,13 @@ class QComboBox;
|
||||
class QTextEdit;
|
||||
|
||||
|
||||
class projectNotes : public QMainWindow, public settings
|
||||
class projectNotes : public QMainWindow, public settings, public engineObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
projectNotes();
|
||||
projectNotes( engine * _engine );
|
||||
virtual ~projectNotes();
|
||||
|
||||
void clear( void );
|
||||
|
||||
virtual void FASTCALL saveSettings( QDomDocument & _doc,
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
class QPainter;
|
||||
|
||||
|
||||
class sampleBuffer : public QObject
|
||||
class sampleBuffer : public QObject, public engineObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -69,16 +69,16 @@ public:
|
||||
|
||||
// constructor which either loads sample _audio_file or decodes
|
||||
// base64-data out of string
|
||||
sampleBuffer( const QString & _audio_file = "",
|
||||
sampleBuffer( engine * _engine, const QString & _audio_file = "",
|
||||
bool _is_base64_data = FALSE );
|
||||
sampleBuffer( const sampleFrame * _data, const f_cnt_t _frames );
|
||||
sampleBuffer( const f_cnt_t _frames );
|
||||
sampleBuffer( const sampleFrame * _data, const f_cnt_t _frames,
|
||||
engine * _engine );
|
||||
sampleBuffer( const f_cnt_t _frames, engine * _engine );
|
||||
|
||||
~sampleBuffer();
|
||||
virtual ~sampleBuffer();
|
||||
|
||||
bool FASTCALL play( sampleFrame * _ab, const f_cnt_t _start_frame,
|
||||
const fpab_t _frames =
|
||||
mixer::inst()->framesPerAudioBuffer(),
|
||||
const fpab_t _frames,
|
||||
const float _freq = BASE_FREQ,
|
||||
const bool _looped = FALSE,
|
||||
void * * _resampling_data = NULL );
|
||||
@@ -131,15 +131,16 @@ public:
|
||||
static sampleBuffer * FASTCALL resample( sampleFrame * _data,
|
||||
const f_cnt_t _frames,
|
||||
const sample_rate_t _src_sr,
|
||||
const sample_rate_t _dst_sr );
|
||||
const sample_rate_t _dst_sr,
|
||||
engine * _engine );
|
||||
|
||||
static inline sampleBuffer * FASTCALL resample(
|
||||
const sampleBuffer * _buf,
|
||||
sampleBuffer * _buf,
|
||||
const sample_rate_t _src_sr,
|
||||
const sample_rate_t _dst_sr )
|
||||
{
|
||||
return( resample( _buf->m_data, _buf->m_frames, _src_sr,
|
||||
_dst_sr ) );
|
||||
_dst_sr, _buf->eng() ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* sample_play_handle.h - play-handle for playing a sample
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -37,15 +37,16 @@ class audioPort;
|
||||
class samplePlayHandle : public playHandle
|
||||
{
|
||||
public:
|
||||
samplePlayHandle( const QString & _sample_file );
|
||||
samplePlayHandle( sampleBuffer * _sample_buffer );
|
||||
samplePlayHandle( const QString & _sample_file, engine * _engine )
|
||||
FASTCALL;
|
||||
samplePlayHandle( sampleBuffer * _sample_buffer ) FASTCALL;
|
||||
virtual ~samplePlayHandle();
|
||||
|
||||
virtual void play( void );
|
||||
virtual bool done( void ) const;
|
||||
|
||||
Uint32 totalFrames( void ) const;
|
||||
inline Uint32 framesDone( void ) const
|
||||
f_cnt_t totalFrames( void ) const;
|
||||
inline f_cnt_t framesDone( void ) const
|
||||
{
|
||||
return( m_frame );
|
||||
}
|
||||
@@ -60,7 +61,7 @@ private:
|
||||
const bool m_ownSampleBuffer;
|
||||
bool m_doneMayReturnTrue;
|
||||
|
||||
Uint32 m_frame;
|
||||
f_cnt_t m_frame;
|
||||
|
||||
audioPort * m_audioPort;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* sample_track.h - class sampleTrack, a track which provides arrangement of
|
||||
* samples
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -58,8 +58,8 @@ public:
|
||||
virtual ~sampleTCO();
|
||||
|
||||
virtual void FASTCALL changeLength( const midiTime & _length );
|
||||
void FASTCALL play( sampleFrame * _ab, Uint32 _start_frame,
|
||||
Uint32 _frames );
|
||||
void FASTCALL play( sampleFrame * _ab, f_cnt_t _start_frame,
|
||||
const fpab_t _frames );
|
||||
const QString & sampleFile( void ) const;
|
||||
|
||||
virtual void FASTCALL saveSettings( QDomDocument & _doc,
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
|
||||
public slots:
|
||||
void setSampleFile( const QString & _sf );
|
||||
void updateLength( int = 0 );
|
||||
void updateLength( bpm_t = 0 );
|
||||
|
||||
|
||||
protected:
|
||||
@@ -127,8 +127,9 @@ public:
|
||||
|
||||
virtual trackTypes type( void ) const;
|
||||
virtual bool FASTCALL play( const midiTime & _start,
|
||||
Uint32 _start_frame, Uint32 _frames,
|
||||
Uint32 _frame_base,
|
||||
const f_cnt_t _start_frame,
|
||||
const fpab_t _frames,
|
||||
const f_cnt_t _frame_base,
|
||||
Sint16 _tco_num = -1 );
|
||||
virtual trackContentObject * FASTCALL createTCO( const midiTime &
|
||||
_pos );
|
||||
|
||||
@@ -53,7 +53,7 @@ class QSlider;
|
||||
class tabBar;
|
||||
|
||||
|
||||
class setupDialog : public QDialog
|
||||
class setupDialog : public QDialog, public engineObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -63,7 +63,8 @@ public:
|
||||
AUDIO_SETTINGS, MIDI_SETTINGS
|
||||
} ;
|
||||
|
||||
setupDialog( configTabs _tab_to_open = GENERAL_SETTINGS );
|
||||
setupDialog( engine * _engine,
|
||||
configTabs _tab_to_open = GENERAL_SETTINGS );
|
||||
virtual ~setupDialog();
|
||||
|
||||
|
||||
|
||||
@@ -38,16 +38,14 @@ class QSlider;
|
||||
|
||||
class comboBox;
|
||||
class lcdSpinBox;
|
||||
class lmmsMainWin;
|
||||
class pattern;
|
||||
class projectNotes;
|
||||
class textFloat;
|
||||
class timeLine;
|
||||
|
||||
|
||||
const int MIN_BPM = 10;
|
||||
const int DEFAULT_BPM = 140;
|
||||
const int MAX_BPM = 999;
|
||||
const bpm_t MIN_BPM = 10;
|
||||
const bpm_t DEFAULT_BPM = 140;
|
||||
const bpm_t MAX_BPM = 999;
|
||||
const Uint16 MAX_SONG_LENGTH = 9999;
|
||||
|
||||
|
||||
@@ -75,11 +73,11 @@ public:
|
||||
m_currentFrame( 0 )
|
||||
{
|
||||
}
|
||||
inline void setCurrentFrame( Uint32 _f )
|
||||
inline void setCurrentFrame( const f_cnt_t _f )
|
||||
{
|
||||
m_currentFrame = _f;
|
||||
}
|
||||
inline Uint32 currentFrame( void ) const
|
||||
inline f_cnt_t currentFrame( void ) const
|
||||
{
|
||||
return( m_currentFrame );
|
||||
}
|
||||
@@ -87,20 +85,11 @@ public:
|
||||
bool m_timeLineUpdate;
|
||||
|
||||
private:
|
||||
Uint32 m_currentFrame;
|
||||
f_cnt_t m_currentFrame;
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
static inline songEditor * inst( void )
|
||||
{
|
||||
if( s_instanceOfMe == NULL )
|
||||
{
|
||||
s_instanceOfMe = new songEditor();
|
||||
}
|
||||
return( s_instanceOfMe );
|
||||
}
|
||||
|
||||
void processNextBuffer( void );
|
||||
|
||||
|
||||
@@ -140,7 +129,8 @@ public:
|
||||
tact lengthInTacts( void ) const;
|
||||
|
||||
|
||||
int getBPM( void );
|
||||
bpm_t getTempo( void );
|
||||
|
||||
|
||||
// every function that replaces current file (e.g. creates new file,
|
||||
// opens another file...) has to call this before and may only process
|
||||
@@ -175,11 +165,6 @@ public:
|
||||
|
||||
int masterPitch( void ) const;
|
||||
|
||||
projectNotes * getProjectNotesWindow( void )
|
||||
{
|
||||
return( m_projectNotes );
|
||||
}
|
||||
|
||||
|
||||
public slots:
|
||||
void play( void );
|
||||
@@ -195,8 +180,9 @@ public slots:
|
||||
|
||||
void startExport( void );
|
||||
void stopExport( void );
|
||||
// set BPM (beats per minute)
|
||||
void setBPM( int _new_bpm = DEFAULT_BPM );
|
||||
|
||||
// set tempo in BPM (beats per minute)
|
||||
void setTempo( int _new_bpm = DEFAULT_BPM );
|
||||
|
||||
inline void setModified( void )
|
||||
{
|
||||
@@ -244,7 +230,7 @@ protected slots:
|
||||
|
||||
|
||||
private:
|
||||
songEditor();
|
||||
songEditor( engine * _engine );
|
||||
songEditor( const songEditor & );
|
||||
virtual ~songEditor();
|
||||
|
||||
@@ -266,8 +252,6 @@ private:
|
||||
|
||||
|
||||
|
||||
static songEditor * s_instanceOfMe;
|
||||
|
||||
QScrollBar * m_leftRightScroll;
|
||||
|
||||
QWidget * m_toolBar;
|
||||
@@ -310,9 +294,6 @@ private:
|
||||
bool m_scrollBack;
|
||||
|
||||
|
||||
projectNotes * m_projectNotes;
|
||||
|
||||
|
||||
|
||||
enum ACTIONS
|
||||
{
|
||||
@@ -322,12 +303,11 @@ private:
|
||||
vvector<ACTIONS> m_actions;
|
||||
|
||||
|
||||
friend class lmmsMainWin;
|
||||
|
||||
friend class engine;
|
||||
|
||||
|
||||
signals:
|
||||
void bpmChanged( int _new_bpm );
|
||||
void tempoChanged( bpm_t _new_bpm );
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* string_pair_drag.h - class stringPairDrag which provides general support
|
||||
* for drag'n'drop of string-pairs
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -39,19 +39,23 @@
|
||||
#endif
|
||||
|
||||
|
||||
#include "engine.h"
|
||||
|
||||
|
||||
class QPixmap;
|
||||
|
||||
|
||||
class stringPairDrag : public
|
||||
#ifdef QT4
|
||||
QDrag
|
||||
QDrag,
|
||||
#else
|
||||
QStoredDrag
|
||||
QStoredDrag,
|
||||
#endif
|
||||
public engineObject
|
||||
{
|
||||
public:
|
||||
stringPairDrag( const QString & _key, const QString & _value,
|
||||
const QPixmap & _icon, QWidget * _w );
|
||||
const QPixmap & _icon, QWidget * _w, engine * _engine );
|
||||
~stringPairDrag();
|
||||
|
||||
static bool processDragEnterEvent( QDragEnterEvent * _dee,
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#endif
|
||||
|
||||
#include "knob.h"
|
||||
#include "types.h"
|
||||
|
||||
|
||||
class QAction;
|
||||
@@ -59,8 +60,8 @@ public:
|
||||
} ;
|
||||
|
||||
|
||||
tempoSyncKnob( int _knob_num, QWidget * _parent, const QString & _name,
|
||||
float _scale = 1.0f );
|
||||
tempoSyncKnob( int _knob_num, QWidget * _parent, const QString & _name,
|
||||
engine * _engine, float _scale = 1.0f );
|
||||
virtual ~tempoSyncKnob();
|
||||
|
||||
tempoSyncMode getSyncMode( void );
|
||||
@@ -95,7 +96,7 @@ protected:
|
||||
|
||||
|
||||
protected slots:
|
||||
void calculateTempoSyncTime( int _bpm );
|
||||
void calculateTempoSyncTime( bpm_t _bpm );
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* timeline.h - class timeLine, representing a time-line with position marker
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -47,7 +47,7 @@ class nStateButton;
|
||||
class textFloat;
|
||||
|
||||
|
||||
class timeLine : public QWidget
|
||||
class timeLine : public QWidget, public engineObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
|
||||
|
||||
timeLine( int _xoff, int _yoff, float _ppt, songEditor::playPos & _pos,
|
||||
const midiTime & _begin, QWidget * _parent );
|
||||
const midiTime & _begin, QWidget * _parent, engine * _engine );
|
||||
virtual ~timeLine();
|
||||
|
||||
inline songEditor::playPos & pos( void )
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* track.h - declaration of classes concerning tracks -> neccessary for all
|
||||
* track-like objects (beat/bassline, sample-track...)
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -56,6 +56,7 @@
|
||||
#include "midi_time.h"
|
||||
#include "settings.h"
|
||||
#include "rubberband.h"
|
||||
#include "engine.h"
|
||||
|
||||
|
||||
class QMenu;
|
||||
@@ -77,7 +78,8 @@ const Uint16 TRACK_OP_WIDTH = 70;
|
||||
const Uint16 TCO_BORDER_WIDTH = 1;
|
||||
|
||||
|
||||
class trackContentObject : public selectableObject, public settings
|
||||
class trackContentObject : public selectableObject, public settings,
|
||||
public engineObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -345,7 +347,7 @@ private:
|
||||
|
||||
|
||||
// base-class for all tracks
|
||||
class track : public settings
|
||||
class track : public settings, public engineObject
|
||||
{
|
||||
public:
|
||||
enum trackTypes
|
||||
@@ -361,6 +363,7 @@ public:
|
||||
|
||||
track( trackContainer * _tc );
|
||||
virtual ~track();
|
||||
|
||||
static track * FASTCALL create( trackTypes _tt, trackContainer * _tc );
|
||||
static track * FASTCALL create( const QDomElement & _this,
|
||||
trackContainer * _tc );
|
||||
@@ -383,9 +386,9 @@ public:
|
||||
virtual trackTypes type( void ) const = 0;
|
||||
|
||||
virtual bool FASTCALL play( const midiTime & _start,
|
||||
Uint32 _start_frame,
|
||||
Uint32 _frames,
|
||||
Uint32 _frame_base,
|
||||
const f_cnt_t _start_frame,
|
||||
const fpab_t _frames,
|
||||
const f_cnt_t _frame_base,
|
||||
Sint16 _tco_num = -1 ) = 0;
|
||||
|
||||
|
||||
|
||||
@@ -47,19 +47,21 @@
|
||||
#include "track.h"
|
||||
#include "settings.h"
|
||||
#include "rubberband.h"
|
||||
#include "engine.h"
|
||||
|
||||
|
||||
|
||||
const Uint16 DEFAULT_PIXELS_PER_TACT = 16;
|
||||
|
||||
const Uint16 DEFAULT_SCROLLBAR_SIZE = 16;
|
||||
|
||||
|
||||
class trackContainer : public QMainWindow, public settings
|
||||
|
||||
class trackContainer : public QMainWindow, public settings, public engineObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
trackContainer( void );
|
||||
~trackContainer();
|
||||
trackContainer( engine * _engine );
|
||||
virtual ~trackContainer();
|
||||
|
||||
inline QWidget * containerWidget( void )
|
||||
{
|
||||
@@ -100,7 +102,9 @@ public:
|
||||
void FASTCALL removeTrack( track * _track );
|
||||
void FASTCALL moveTrackUp( track * _track );
|
||||
void FASTCALL moveTrackDown( track * _track );
|
||||
|
||||
void FASTCALL realignTracks( bool _complete_update = FALSE );
|
||||
void clearAllTracks( void );
|
||||
|
||||
const trackWidget * trackWidgetAt( const int _y ) const;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* visualization_widget.h - widget for visualization of sound-data
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -23,8 +23,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _OUTPUT_GRAPH_H
|
||||
#define _OUTPUT_GRAPH_H
|
||||
#ifndef _VISUALIZATION_WIDGET
|
||||
#define _VISUALIZATION_WIDGET
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
@@ -43,10 +43,11 @@
|
||||
|
||||
#include "mixer.h"
|
||||
|
||||
|
||||
class QTimer;
|
||||
|
||||
|
||||
class visualizationWidget : public QWidget
|
||||
class visualizationWidget : public QWidget, public engineObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -55,6 +56,7 @@ public:
|
||||
SIMPLE // add more here
|
||||
} ;
|
||||
visualizationWidget( const QPixmap & _bg, QWidget * _parent,
|
||||
engine * _engine,
|
||||
visualizationTypes _vtype = SIMPLE );
|
||||
virtual ~visualizationWidget();
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* audio_file_processor.cpp - instrument for using audio-files
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -41,6 +41,8 @@
|
||||
#include <qbitmap.h>
|
||||
#include <qdom.h>
|
||||
#include <qfileinfo.h>
|
||||
#include <qcursor.h>
|
||||
#include <qwhatsthis.h>
|
||||
|
||||
#endif
|
||||
|
||||
@@ -88,7 +90,7 @@ QPixmap * audioFileProcessor::s_artwork = NULL;
|
||||
audioFileProcessor::audioFileProcessor( channelTrack * _channel_track ) :
|
||||
instrument( _channel_track, &audiofileprocessor_plugin_descriptor ),
|
||||
specialBgHandlingWidget( PLUGIN_NAME::getIconPixmap( "artwork" ) ),
|
||||
m_sampleBuffer( "" ),
|
||||
m_sampleBuffer( eng(), "" ),
|
||||
m_drawMethod( sampleBuffer::LINE_CONNECT )
|
||||
{
|
||||
connect( &m_sampleBuffer, SIGNAL( sampleUpdated() ), this,
|
||||
@@ -166,7 +168,7 @@ audioFileProcessor::audioFileProcessor( channelTrack * _channel_track ) :
|
||||
"This is useful for things like string- and choir-"
|
||||
"samples." ) );
|
||||
|
||||
m_ampKnob = new knob( knobDark_28, this, tr( "Amplify" ) );
|
||||
m_ampKnob = new knob( knobDark_28, this, tr( "Amplify" ), eng() );
|
||||
m_ampKnob->setRange( 0, 500, 1.0f );
|
||||
m_ampKnob->move( 6, 114 );
|
||||
m_ampKnob->setValue( 100.0f, TRUE );
|
||||
@@ -184,7 +186,8 @@ audioFileProcessor::audioFileProcessor( channelTrack * _channel_track ) :
|
||||
"Otherwise it will be amplified up or down (your "
|
||||
"actual sample-file isn't touched!)" ) );
|
||||
|
||||
m_startKnob = new knob( knobDark_28, this, tr( "Start of sample" ) );
|
||||
m_startKnob = new knob( knobDark_28, this, tr( "Start of sample" ),
|
||||
eng() );
|
||||
m_startKnob->setRange( 0.0f, 1.0f, 0.00001f );
|
||||
m_startKnob->move( 46, 114 );
|
||||
m_startKnob->setValue( 0.0f, TRUE );
|
||||
@@ -203,7 +206,7 @@ audioFileProcessor::audioFileProcessor( channelTrack * _channel_track ) :
|
||||
"which AudioFileProcessor returns if a note is longer "
|
||||
"than the sample between start- and end-point." ) );
|
||||
|
||||
m_endKnob = new knob( knobDark_28, this, tr( "End of sample" ) );
|
||||
m_endKnob = new knob( knobDark_28, this, tr( "End of sample" ), eng() );
|
||||
m_endKnob->setRange( 0.0f, 1.0f, 0.00001f );
|
||||
m_endKnob->move( 84, 114 );
|
||||
m_endKnob->setValue( 1.0f, TRUE );
|
||||
@@ -365,7 +368,7 @@ Uint32 audioFileProcessor::getBeatLen( notePlayHandle * _n ) const
|
||||
const float freq_factor = BASE_FREQ /
|
||||
( getChannelTrack()->frequency( _n ) *
|
||||
DEFAULT_SAMPLE_RATE /
|
||||
mixer::inst()->sampleRate() );
|
||||
eng()->getMixer()->sampleRate() );
|
||||
|
||||
return( static_cast<Uint32>( floorf( ( m_sampleBuffer.endFrame() -
|
||||
m_sampleBuffer.startFrame() ) *
|
||||
@@ -398,12 +401,12 @@ void audioFileProcessor::setAudioFile( const QString & _audio_file )
|
||||
|
||||
void audioFileProcessor::playNote( notePlayHandle * _n )
|
||||
{
|
||||
const Uint32 frames = mixer::inst()->framesPerAudioBuffer();
|
||||
const Uint32 frames = eng()->getMixer()->framesPerAudioBuffer();
|
||||
sampleFrame * buf = bufferAllocator::alloc<sampleFrame>( frames );
|
||||
|
||||
// calculate frequency of note
|
||||
const float note_freq = getChannelTrack()->frequency( _n ) /
|
||||
( mixer::inst()->sampleRate() /
|
||||
( eng()->getMixer()->sampleRate() /
|
||||
DEFAULT_SAMPLE_RATE );
|
||||
if( m_sampleBuffer.play( buf, _n->totalFramesPlayed(),
|
||||
frames, note_freq,
|
||||
@@ -560,7 +563,7 @@ void audioFileProcessor::sampleUpdated( void )
|
||||
void audioFileProcessor::reverseBtnToggled( bool _on )
|
||||
{
|
||||
m_sampleBuffer.setReversed( _on );
|
||||
songEditor::inst()->setModified();
|
||||
eng()->getSongEditor()->setModified();
|
||||
}
|
||||
|
||||
|
||||
@@ -568,7 +571,7 @@ void audioFileProcessor::reverseBtnToggled( bool _on )
|
||||
|
||||
void audioFileProcessor::lineDrawBtnToggled( bool _on )
|
||||
{
|
||||
if( _on )
|
||||
if( _on == TRUE )
|
||||
{
|
||||
m_drawMethod = sampleBuffer::LINE_CONNECT;
|
||||
sampleUpdated();
|
||||
@@ -580,7 +583,7 @@ void audioFileProcessor::lineDrawBtnToggled( bool _on )
|
||||
|
||||
void audioFileProcessor::dotDrawBtnToggled( bool _on )
|
||||
{
|
||||
if( _on )
|
||||
if( _on == TRUE )
|
||||
{
|
||||
m_drawMethod = sampleBuffer::DOTS;
|
||||
sampleUpdated();
|
||||
@@ -592,7 +595,7 @@ void audioFileProcessor::dotDrawBtnToggled( bool _on )
|
||||
|
||||
void audioFileProcessor::ampKnobChanged( float _val )
|
||||
{
|
||||
m_sampleBuffer.setAmplification( _val/100.0f );
|
||||
m_sampleBuffer.setAmplification( _val / 100.0f );
|
||||
}
|
||||
|
||||
|
||||
@@ -628,7 +631,7 @@ void audioFileProcessor::startKnobChanged( float _new_value )
|
||||
}
|
||||
else
|
||||
{
|
||||
m_startKnob->setValue( m_endKnob->value() - 0.01 );
|
||||
m_startKnob->setValue( m_endKnob->value() - 0.01f );
|
||||
}
|
||||
update();
|
||||
}
|
||||
@@ -653,7 +656,7 @@ void audioFileProcessor::endKnobChanged( float _new_value )
|
||||
}
|
||||
else
|
||||
{
|
||||
m_endKnob->setValue( m_startKnob->value() + 0.01 );
|
||||
m_endKnob->setValue( m_startKnob->value() + 0.01f );
|
||||
}
|
||||
update();
|
||||
}
|
||||
@@ -667,7 +670,7 @@ void audioFileProcessor::openAudioFile( void )
|
||||
if( af != "" )
|
||||
{
|
||||
setAudioFile( af );
|
||||
songEditor::inst()->setModified();
|
||||
eng()->getSongEditor()->setModified();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ plugin::descriptor bitinvader_plugin_descriptor =
|
||||
QPixmap * bitInvader::s_artwork = NULL;
|
||||
|
||||
|
||||
bSynth::bSynth(float* shape, int length, float _pitch, bool _interpolation, float factor)
|
||||
bSynth::bSynth(float* shape, int length, float _pitch, bool _interpolation, float factor, const sample_rate_t _sample_rate )
|
||||
{
|
||||
|
||||
interpolation = _interpolation;
|
||||
@@ -110,8 +110,8 @@ bSynth::bSynth(float* shape, int length, float _pitch, bool _interpolation, floa
|
||||
sample_realindex = 0;
|
||||
|
||||
|
||||
sample_step = static_cast<float>( sample_length /
|
||||
((float)mixer::inst()->sampleRate() / _pitch) );
|
||||
sample_step = static_cast<float>( sample_length / ( _sample_rate /
|
||||
_pitch ) );
|
||||
|
||||
|
||||
}
|
||||
@@ -190,7 +190,8 @@ bitInvader::bitInvader( channelTrack * _channel_track ) :
|
||||
}
|
||||
|
||||
|
||||
m_sampleLengthKnob = new knob( knobDark_28, this, tr( "Samplelength" ) );
|
||||
m_sampleLengthKnob = new knob( knobDark_28, this, tr( "Samplelength" ),
|
||||
eng() );
|
||||
m_sampleLengthKnob->setRange( 8, 128, 1 );
|
||||
m_sampleLengthKnob->setValue( 128, TRUE );
|
||||
m_sampleLengthKnob->move( 10, 120 );
|
||||
@@ -213,7 +214,7 @@ bitInvader::bitInvader( channelTrack * _channel_track ) :
|
||||
this, SLOT ( normalizeToggle( bool ) ) );
|
||||
|
||||
|
||||
m_graph = new graph( "", this );
|
||||
m_graph = new graph( this, eng() );
|
||||
m_graph->move(53,118); // 55,120 - 2px border
|
||||
m_graph->setCursor( QCursor( Qt::CrossCursor ) );
|
||||
|
||||
@@ -436,7 +437,7 @@ void bitInvader::usrWaveClicked( void )
|
||||
}
|
||||
|
||||
// load user shape
|
||||
sampleBuffer buffer;
|
||||
sampleBuffer buffer( eng() );
|
||||
QString af = buffer.openAudioFile();
|
||||
if ( af != "" )
|
||||
{
|
||||
@@ -634,15 +635,14 @@ void bitInvader::interpolationToggle( bool value )
|
||||
{
|
||||
interpolation = value;
|
||||
|
||||
songEditor::inst()->setModified();
|
||||
|
||||
eng()->getSongEditor()->setModified();
|
||||
}
|
||||
|
||||
void bitInvader::normalizeToggle( bool value )
|
||||
{
|
||||
normalize = value;
|
||||
|
||||
songEditor::inst()->setModified();
|
||||
eng()->getSongEditor()->setModified();
|
||||
|
||||
}
|
||||
|
||||
@@ -674,8 +674,7 @@ void bitInvader::smoothClicked( void )
|
||||
update();
|
||||
m_graph->update();
|
||||
|
||||
songEditor::inst()->setModified();
|
||||
|
||||
eng()->getSongEditor()->setModified();
|
||||
|
||||
}
|
||||
|
||||
@@ -697,14 +696,15 @@ void bitInvader::playNote( notePlayHandle * _n )
|
||||
}
|
||||
|
||||
_n->m_pluginData = new bSynth( sample_shape, sample_length,freq
|
||||
, interpolation, factor );
|
||||
, interpolation, factor,
|
||||
eng()->getMixer()->sampleRate() );
|
||||
}
|
||||
|
||||
const Uint32 frames = mixer::inst()->framesPerAudioBuffer();
|
||||
const fpab_t frames = eng()->getMixer()->framesPerAudioBuffer();
|
||||
sampleFrame * buf = bufferAllocator::alloc<sampleFrame>( frames );
|
||||
|
||||
bSynth * ps = static_cast<bSynth *>( _n->m_pluginData );
|
||||
for( Uint32 frame = 0; frame < frames; ++frame )
|
||||
for( fpab_t frame = 0; frame < frames; ++frame )
|
||||
{
|
||||
const sample_t cur = ps->nextStringSample();
|
||||
for( Uint8 chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
@@ -772,7 +772,7 @@ void bitInvader::sampleSizeChanged( float _new_sample_length )
|
||||
m_graph->setSamplePointer( sample_shape, sample_length );
|
||||
|
||||
// set Song modified
|
||||
songEditor::inst()->setModified();
|
||||
eng()->getSongEditor()->setModified();
|
||||
|
||||
}
|
||||
|
||||
@@ -793,7 +793,7 @@ void bitInvader::sampleChanged()
|
||||
m_graph->update();
|
||||
}
|
||||
|
||||
songEditor::inst()->setModified();
|
||||
eng()->getSongEditor()->setModified();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ class pixmapButton;
|
||||
class bSynth
|
||||
{
|
||||
public:
|
||||
bSynth(float* sample, int length, float _pitch, bool _interpolation, float factor);
|
||||
bSynth(float* sample, int length, float _pitch, bool _interpolation, float factor, const sample_rate_t _sample_rate);
|
||||
virtual ~bSynth();
|
||||
|
||||
sample_t nextStringSample();
|
||||
|
||||
@@ -50,8 +50,9 @@ using namespace std;
|
||||
|
||||
|
||||
|
||||
graph::graph( const QString & _text, QWidget * _parent) :
|
||||
QWidget( _parent )
|
||||
graph::graph( QWidget * _parent, engine * _engine ) :
|
||||
QWidget( _parent ),
|
||||
engineObject( _engine )
|
||||
{
|
||||
|
||||
// m_background = 0; TODO
|
||||
@@ -86,7 +87,7 @@ void graph::setSamplePointer( float * _pointer, int _length )
|
||||
update();
|
||||
}
|
||||
|
||||
void graph::loadSampleFromFile( const QString filename )
|
||||
void graph::loadSampleFromFile( const QString & _filename )
|
||||
{
|
||||
// zero sample_shape
|
||||
for (int i = 0; i < sampleLength; i++)
|
||||
@@ -95,9 +96,8 @@ void graph::loadSampleFromFile( const QString filename )
|
||||
}
|
||||
|
||||
// load user shape
|
||||
sampleBuffer buffer;
|
||||
buffer.setAudioFile( filename );
|
||||
|
||||
sampleBuffer buffer( eng(), _filename );
|
||||
|
||||
// copy buffer data
|
||||
sampleLength = min( sampleLength, static_cast<int>(buffer.frames()) );
|
||||
for ( int i = 0; i < sampleLength; i++ )
|
||||
|
||||
@@ -39,22 +39,23 @@
|
||||
#include <qwidget.h>
|
||||
#include <qpixmap.h>
|
||||
#include <qcursor.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
//class QPixmap;
|
||||
#include "engine.h"
|
||||
|
||||
|
||||
class graph : public QWidget
|
||||
class graph : public QWidget, public engineObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
graph( const QString & _txt, QWidget * _parent );
|
||||
graph( QWidget * _parent, engine * _engine );
|
||||
virtual ~graph();
|
||||
|
||||
void setSamplePointer( float * pointer, int length );
|
||||
void setBackground ( const QPixmap & _pixmap );
|
||||
void graph::loadSampleFromFile( QString filename );
|
||||
void loadSampleFromFile( const QString & _filename );
|
||||
|
||||
signals:
|
||||
void sampleSizeChanged( float f );
|
||||
|
||||
@@ -72,13 +72,15 @@ plugin::descriptor pluckedstringsynth_plugin_descriptor =
|
||||
pluckedStringSynth::pluckedStringSynth( channelTrack * _channel_track ) :
|
||||
instrument( _channel_track, &pluckedstringsynth_plugin_descriptor )
|
||||
{
|
||||
m_pickKnob = new knob( knobDark_28, this, tr( "Pick position" ) );
|
||||
m_pickKnob = new knob( knobDark_28, this, tr( "Pick position" ),
|
||||
eng() );
|
||||
m_pickKnob->setRange( 0.0f, 0.5f, 0.005f );
|
||||
m_pickKnob->setValue( 0.0f, TRUE );
|
||||
m_pickKnob->move( 86, 134 );
|
||||
m_pickKnob->setHintText( tr( "Pick position:" ) + " ", "" );
|
||||
|
||||
m_pickupKnob = new knob( knobDark_28, this, tr( "Pickup position" ) );
|
||||
m_pickupKnob = new knob( knobDark_28, this, tr( "Pickup position" ),
|
||||
eng() );
|
||||
m_pickupKnob->setRange( 0.0f, 0.5f, 0.005f );
|
||||
m_pickupKnob->setValue( 0.05f, TRUE );
|
||||
m_pickupKnob->move( 138, 134 );
|
||||
@@ -139,10 +141,11 @@ void pluckedStringSynth::playNote( notePlayHandle * _n )
|
||||
{
|
||||
float freq = getChannelTrack()->frequency( _n );
|
||||
_n->m_pluginData = new pluckSynth( freq, m_pickKnob->value(),
|
||||
m_pickupKnob->value() );
|
||||
m_pickupKnob->value(),
|
||||
eng()->getMixer()->sampleRate() );
|
||||
}
|
||||
|
||||
const Uint32 frames = mixer::inst()->framesPerAudioBuffer();
|
||||
const Uint32 frames = eng()->getMixer()->framesPerAudioBuffer();
|
||||
sampleFrame * buf = bufferAllocator::alloc<sampleFrame>( frames );
|
||||
|
||||
pluckSynth * ps = static_cast<pluckSynth *>( _n->m_pluginData );
|
||||
@@ -208,11 +211,11 @@ void FASTCALL pluckSynth::freeDelayLine( delayLine * _dl )
|
||||
|
||||
|
||||
|
||||
pluckSynth::pluckSynth( float _pitch, float _pick, float _pickup )
|
||||
pluckSynth::pluckSynth( const float _pitch, const float _pick,
|
||||
const float _pickup, const sample_rate_t _sample_rate )
|
||||
{
|
||||
const float AMP = 1.5f;
|
||||
int rail_length = static_cast<int>( mixer::inst()->sampleRate() / 2 /
|
||||
_pitch ) + 1;
|
||||
int rail_length = static_cast<int>( _sample_rate / 2 / _pitch ) + 1;
|
||||
// Round pick position to nearest spatial sample.
|
||||
// A pick position at x = 0 is not allowed.
|
||||
int pick_sample = static_cast<int>( tMax<float>( rail_length * _pick,
|
||||
|
||||
@@ -38,7 +38,8 @@ class notePlayHandle;
|
||||
class pluckSynth
|
||||
{
|
||||
public:
|
||||
pluckSynth( float _pitch, float _pick, float _pickup );
|
||||
pluckSynth( const float _pitch, const float _pick, const float _pickup,
|
||||
const sample_rate_t _sample_rate );
|
||||
|
||||
inline ~pluckSynth( void )
|
||||
{
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include <qbitmap.h>
|
||||
#include <qpainter.h>
|
||||
#include <qdom.h>
|
||||
#include <qwhatsthis.h>
|
||||
|
||||
#define setChecked setOn
|
||||
|
||||
@@ -53,6 +54,7 @@
|
||||
#include "buffer_allocator.h"
|
||||
#include "debug.h"
|
||||
#include "tooltip.h"
|
||||
#include "sample_buffer.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
|
||||
@@ -81,6 +83,11 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) :
|
||||
m_modulationAlgo1( oscillator::MIX ),
|
||||
m_modulationAlgo2( oscillator::MIX )
|
||||
{
|
||||
for( int i = 0; i < NUM_OF_OSCILLATORS; ++i )
|
||||
{
|
||||
m_osc[i].m_sampleBuffer = new sampleBuffer( eng() );
|
||||
}
|
||||
|
||||
#ifdef QT4
|
||||
QPalette pal;
|
||||
pal.setBrush( backgroundRole(),
|
||||
@@ -258,10 +265,10 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) :
|
||||
|
||||
// setup volume-knob
|
||||
m_osc[i].volKnob = new knob( knobSmall_17, this, tr(
|
||||
"Osc %1 volume" ).arg( i+1 ) );
|
||||
"Osc %1 volume" ).arg( i+1 ), eng() );
|
||||
m_osc[i].volKnob->move( 6, 104+i*50 );
|
||||
m_osc[i].volKnob->setRange( MIN_VOLUME, MAX_VOLUME, 1.0f );
|
||||
m_osc[i].volKnob->setValue( DEFAULT_VOLUME, TRUE );
|
||||
m_osc[i].volKnob->setValue( DEFAULT_VOLUME / 3, TRUE );
|
||||
m_osc[i].volKnob->setHintText( tr( "Osc %1 volume:" ).arg(
|
||||
i+1 ) + " ", "%" );
|
||||
#ifdef QT4
|
||||
@@ -277,7 +284,7 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) :
|
||||
|
||||
// setup panning-knob
|
||||
m_osc[i].panKnob = new knob( knobSmall_17, this,
|
||||
tr( "Osc %1 panning" ).arg( i + 1 ) );
|
||||
tr( "Osc %1 panning" ).arg( i + 1 ), eng() );
|
||||
m_osc[i].panKnob->move( 33, 104+i*50 );
|
||||
m_osc[i].panKnob->setRange( PANNING_LEFT, PANNING_RIGHT, 1.0f );
|
||||
m_osc[i].panKnob->setValue( DEFAULT_PANNING, TRUE );
|
||||
@@ -295,7 +302,8 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) :
|
||||
|
||||
// setup coarse-knob
|
||||
m_osc[i].coarseKnob = new knob( knobSmall_17, this,
|
||||
tr("Osc %1 coarse detuning").arg( i + 1 ) );
|
||||
tr("Osc %1 coarse detuning").arg( i + 1 ),
|
||||
eng() );
|
||||
m_osc[i].coarseKnob->move( 66, 104 + i * 50 );
|
||||
m_osc[i].coarseKnob->setRange( -2 * NOTES_PER_OCTAVE,
|
||||
2 * NOTES_PER_OCTAVE, 1.0f );
|
||||
@@ -316,7 +324,8 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) :
|
||||
|
||||
// setup knob for left fine-detuning
|
||||
m_osc[i].fineLKnob = new knob( knobSmall_17, this,
|
||||
tr( "Osc %1 fine detuning left" ).arg( i+1 ) );
|
||||
tr( "Osc %1 fine detuning left" ).arg( i+1 ),
|
||||
eng() );
|
||||
m_osc[i].fineLKnob->move( 90, 104 + i * 50 );
|
||||
m_osc[i].fineLKnob->setRange( -100.0f, 100.0f, 1.0f );
|
||||
m_osc[i].fineLKnob->setValue( 0.0f, TRUE );
|
||||
@@ -338,7 +347,7 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) :
|
||||
// setup knob for right fine-detuning
|
||||
m_osc[i].fineRKnob = new knob( knobSmall_17, this,
|
||||
tr( "Osc %1 fine detuning right"
|
||||
).arg( i + 1 ) );
|
||||
).arg( i + 1 ), eng() );
|
||||
m_osc[i].fineRKnob->move( 110, 104 + i * 50 );
|
||||
m_osc[i].fineRKnob->setRange( -100.0f, 100.0f, 1.0f );
|
||||
m_osc[i].fineRKnob->setValue( 0.0f, TRUE );
|
||||
@@ -359,7 +368,8 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) :
|
||||
// setup phase-offset-knob
|
||||
m_osc[i].phaseOffsetKnob = new knob( knobSmall_17, this,
|
||||
tr( "Osc %1 phase-"
|
||||
"offset" ).arg( i+1 ) );
|
||||
"offset" ).arg( i+1 ),
|
||||
eng() );
|
||||
m_osc[i].phaseOffsetKnob->move( 142, 104 + i * 50 );
|
||||
m_osc[i].phaseOffsetKnob->setRange( 0.0f, 360.0f, 1.0f );
|
||||
m_osc[i].phaseOffsetKnob->setValue( 0.0f, TRUE );
|
||||
@@ -384,8 +394,8 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) :
|
||||
// setup stereo-phase-detuning-knob
|
||||
m_osc[i].stereoPhaseDetuningKnob = new knob( knobSmall_17, this,
|
||||
tr( "Osc %1 stereo phase-"
|
||||
"detuning" ).arg( i+1 )
|
||||
);
|
||||
"detuning" ).arg( i+1 ),
|
||||
eng() );
|
||||
m_osc[i].stereoPhaseDetuningKnob->move( 166, 104 + i * 50 );
|
||||
m_osc[i].stereoPhaseDetuningKnob->setRange( 0.0f, 360.0f,
|
||||
1.0f );
|
||||
@@ -601,6 +611,10 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) :
|
||||
|
||||
tripleOscillator::~tripleOscillator()
|
||||
{
|
||||
for( int i = 0; i < NUM_OF_OSCILLATORS; ++i )
|
||||
{
|
||||
delete m_osc[i].m_sampleBuffer;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -633,7 +647,7 @@ void tripleOscillator::saveSettings( QDomDocument & _doc,
|
||||
to_de.setAttribute( "wavetype" + is, QString::number(
|
||||
m_osc[i].waveShape ) );
|
||||
to_de.setAttribute( "userwavefile" + is,
|
||||
m_osc[i].m_sampleBuffer.audioFile() );
|
||||
m_osc[i].m_sampleBuffer->audioFile() );
|
||||
}
|
||||
|
||||
_parent.appendChild( to_de );
|
||||
@@ -669,7 +683,7 @@ void tripleOscillator::loadSettings( const QDomElement & _this )
|
||||
"phoffset" + is ).toFloat() );
|
||||
m_osc[i].stereoPhaseDetuningKnob->setValue( _this.attribute(
|
||||
"stphdetun" + is ).toFloat() );
|
||||
m_osc[i].m_sampleBuffer.setAudioFile( _this.attribute(
|
||||
m_osc[i].m_sampleBuffer->setAudioFile( _this.attribute(
|
||||
"userwavefile" + is ) );
|
||||
switch( _this.attribute( "wavetype" + is ).toInt() )
|
||||
{
|
||||
@@ -693,7 +707,7 @@ void tripleOscillator::loadSettings( const QDomElement & _this )
|
||||
break;
|
||||
case oscillator::USER_DEF_WAVE:
|
||||
toolTip::add( m_osc[i].usrWaveBtn,
|
||||
m_osc[i].m_sampleBuffer.audioFile() );
|
||||
m_osc[i].m_sampleBuffer->audioFile() );
|
||||
m_osc[i].usrWaveBtn->setChecked( TRUE );
|
||||
break;
|
||||
case oscillator::SIN_WAVE:
|
||||
@@ -762,14 +776,16 @@ void tripleOscillator::playNote( notePlayHandle * _n )
|
||||
static_cast<int>(
|
||||
m_osc[i].phaseOffsetKnob->value() +
|
||||
m_osc[i].stereoPhaseDetuningKnob->value() ),
|
||||
vol_fac_l );
|
||||
vol_fac_l,
|
||||
eng()->getMixer()->sampleRate() );
|
||||
oscs_r[i] = oscillator::createOsc(
|
||||
m_osc[i].waveShape,
|
||||
oscillator::MIX,
|
||||
freq*osc_detuning_r,
|
||||
static_cast<int>(
|
||||
m_osc[i].phaseOffsetKnob->value() ),
|
||||
vol_fac_r );
|
||||
vol_fac_r,
|
||||
eng()->getMixer()->sampleRate() );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -780,7 +796,9 @@ void tripleOscillator::playNote( notePlayHandle * _n )
|
||||
static_cast<int>(
|
||||
m_osc[i].phaseOffsetKnob->value() +
|
||||
m_osc[i].stereoPhaseDetuningKnob->value() ),
|
||||
vol_fac_l, oscs_l[i + 1] );
|
||||
vol_fac_l,
|
||||
eng()->getMixer()->sampleRate(),
|
||||
oscs_l[i + 1] );
|
||||
oscs_r[i] = oscillator::createOsc(
|
||||
m_osc[i].waveShape,
|
||||
getModulationAlgo( i + 1 ),
|
||||
@@ -788,17 +806,18 @@ void tripleOscillator::playNote( notePlayHandle * _n )
|
||||
static_cast<int>(
|
||||
m_osc[i].phaseOffsetKnob->value() ),
|
||||
vol_fac_r,
|
||||
eng()->getMixer()->sampleRate(),
|
||||
oscs_r[i + 1] );
|
||||
}
|
||||
|
||||
if( m_osc[i].waveShape == oscillator::USER_DEF_WAVE )
|
||||
{
|
||||
oscs_l[i]->setUserWave(
|
||||
m_osc[i].m_sampleBuffer.data(),
|
||||
m_osc[i].m_sampleBuffer.frames() );
|
||||
m_osc[i].m_sampleBuffer->data(),
|
||||
m_osc[i].m_sampleBuffer->frames() );
|
||||
oscs_r[i]->setUserWave(
|
||||
m_osc[i].m_sampleBuffer.data(),
|
||||
m_osc[i].m_sampleBuffer.frames() );
|
||||
m_osc[i].m_sampleBuffer->data(),
|
||||
m_osc[i].m_sampleBuffer->frames() );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -813,7 +832,7 @@ void tripleOscillator::playNote( notePlayHandle * _n )
|
||||
oscillator * osc_r = static_cast<oscPtr *>( _n->m_pluginData
|
||||
)->oscRight;
|
||||
|
||||
const Uint32 frames = mixer::inst()->framesPerAudioBuffer();
|
||||
const fpab_t frames = eng()->getMixer()->framesPerAudioBuffer();
|
||||
sampleFrame * buf = bufferAllocator::alloc<sampleFrame>( frames );
|
||||
|
||||
osc_l->update( buf, frames, 0 );
|
||||
@@ -857,7 +876,7 @@ void tripleOscillator::setModulationAlgo(
|
||||
m_modulationAlgo2 = _new_modulation_algo;
|
||||
}
|
||||
|
||||
songEditor::inst()->setModified();
|
||||
eng()->getSongEditor()->setModified();
|
||||
}
|
||||
|
||||
|
||||
@@ -881,7 +900,7 @@ oscillator::modulationAlgos tripleOscillator::getModulationAlgo( int _n )
|
||||
void tripleOscillator::doSinWaveBtn( oscillatorData * _osc )
|
||||
{
|
||||
_osc->waveShape = oscillator::SIN_WAVE;
|
||||
songEditor::inst()->setModified();
|
||||
eng()->getSongEditor()->setModified();
|
||||
}
|
||||
|
||||
|
||||
@@ -890,7 +909,7 @@ void tripleOscillator::doSinWaveBtn( oscillatorData * _osc )
|
||||
void tripleOscillator::doTriangleWaveBtn( oscillatorData * _osc )
|
||||
{
|
||||
_osc->waveShape = oscillator::TRIANGLE_WAVE;
|
||||
songEditor::inst()->setModified();
|
||||
eng()->getSongEditor()->setModified();
|
||||
}
|
||||
|
||||
|
||||
@@ -899,7 +918,7 @@ void tripleOscillator::doTriangleWaveBtn( oscillatorData * _osc )
|
||||
void tripleOscillator::doSawWaveBtn( oscillatorData * _osc )
|
||||
{
|
||||
_osc->waveShape = oscillator::SAW_WAVE;
|
||||
songEditor::inst()->setModified();
|
||||
eng()->getSongEditor()->setModified();
|
||||
}
|
||||
|
||||
|
||||
@@ -908,7 +927,7 @@ void tripleOscillator::doSawWaveBtn( oscillatorData * _osc )
|
||||
void tripleOscillator::doSqrWaveBtn( oscillatorData * _osc )
|
||||
{
|
||||
_osc->waveShape = oscillator::SQUARE_WAVE;
|
||||
songEditor::inst()->setModified();
|
||||
eng()->getSongEditor()->setModified();
|
||||
}
|
||||
|
||||
|
||||
@@ -917,7 +936,7 @@ void tripleOscillator::doSqrWaveBtn( oscillatorData * _osc )
|
||||
void tripleOscillator::doMoogSawWaveBtn( oscillatorData * _osc )
|
||||
{
|
||||
_osc->waveShape = oscillator::MOOG_SAW_WAVE;
|
||||
songEditor::inst()->setModified();
|
||||
eng()->getSongEditor()->setModified();
|
||||
}
|
||||
|
||||
|
||||
@@ -926,7 +945,7 @@ void tripleOscillator::doMoogSawWaveBtn( oscillatorData * _osc )
|
||||
void tripleOscillator::doExpWaveBtn( oscillatorData * _osc )
|
||||
{
|
||||
_osc->waveShape = oscillator::EXP_WAVE;
|
||||
songEditor::inst()->setModified();
|
||||
eng()->getSongEditor()->setModified();
|
||||
}
|
||||
|
||||
|
||||
@@ -935,7 +954,7 @@ void tripleOscillator::doExpWaveBtn( oscillatorData * _osc )
|
||||
void tripleOscillator::doWhiteNoiseWaveBtn( oscillatorData * _osc )
|
||||
{
|
||||
_osc->waveShape = oscillator::WHITE_NOISE_WAVE;
|
||||
songEditor::inst()->setModified();
|
||||
eng()->getSongEditor()->setModified();
|
||||
}
|
||||
|
||||
|
||||
@@ -944,7 +963,7 @@ void tripleOscillator::doWhiteNoiseWaveBtn( oscillatorData * _osc )
|
||||
void tripleOscillator::doUsrWaveBtn( oscillatorData * _osc )
|
||||
{
|
||||
_osc->waveShape = oscillator::USER_DEF_WAVE;
|
||||
songEditor::inst()->setModified();
|
||||
eng()->getSongEditor()->setModified();
|
||||
}
|
||||
|
||||
|
||||
@@ -992,15 +1011,15 @@ void tripleOscillator::osc01UserDefWaveCh( bool _on )
|
||||
|
||||
void tripleOscillator::osc01UserDefWaveDblClick( void )
|
||||
{
|
||||
QString af = m_osc[0].m_sampleBuffer.openAudioFile();
|
||||
QString af = m_osc[0].m_sampleBuffer->openAudioFile();
|
||||
if( af != "" )
|
||||
{
|
||||
m_osc[0].m_sampleBuffer.setAudioFile( af );
|
||||
m_osc[0].m_sampleBuffer->setAudioFile( af );
|
||||
/*#ifndef QT4
|
||||
toolTip::remove( m_osc[0].usrWaveBtn );
|
||||
#endif*/
|
||||
toolTip::add( m_osc[0].usrWaveBtn,
|
||||
m_osc[0].m_sampleBuffer.audioFile() );
|
||||
m_osc[0].m_sampleBuffer->audioFile() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1049,15 +1068,15 @@ void tripleOscillator::osc02UserDefWaveCh( bool _on )
|
||||
|
||||
void tripleOscillator::osc02UserDefWaveDblClick( void )
|
||||
{
|
||||
QString af = m_osc[1].m_sampleBuffer.openAudioFile();
|
||||
QString af = m_osc[1].m_sampleBuffer->openAudioFile();
|
||||
if( af != "" )
|
||||
{
|
||||
m_osc[1].m_sampleBuffer.setAudioFile( af );
|
||||
m_osc[1].m_sampleBuffer->setAudioFile( af );
|
||||
/*#ifndef QT4
|
||||
toolTip::remove( m_osc[1].usrWaveBtn );
|
||||
#endif*/
|
||||
toolTip::add( m_osc[1].usrWaveBtn,
|
||||
m_osc[1].m_sampleBuffer.audioFile() );
|
||||
m_osc[1].m_sampleBuffer->audioFile() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1105,15 +1124,15 @@ void tripleOscillator::osc03UserDefWaveCh( bool _on )
|
||||
|
||||
void tripleOscillator::osc03UserDefWaveDblClick( void )
|
||||
{
|
||||
QString af = m_osc[2].m_sampleBuffer.openAudioFile();
|
||||
QString af = m_osc[2].m_sampleBuffer->openAudioFile();
|
||||
if( af != "" )
|
||||
{
|
||||
m_osc[2].m_sampleBuffer.setAudioFile( af );
|
||||
m_osc[2].m_sampleBuffer->setAudioFile( af );
|
||||
/*#ifndef QT4
|
||||
toolTip::remove( m_osc[2].usrWaveBtn );
|
||||
#endif*/
|
||||
toolTip::add( m_osc[2].usrWaveBtn,
|
||||
m_osc[2].m_sampleBuffer.audioFile() );
|
||||
m_osc[2].m_sampleBuffer->audioFile() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,12 +29,12 @@
|
||||
|
||||
#include "instrument.h"
|
||||
#include "oscillator.h"
|
||||
#include "sample_buffer.h"
|
||||
|
||||
|
||||
class knob;
|
||||
class pixmapButton;
|
||||
class notePlayHandle;
|
||||
class sampleBuffer;
|
||||
|
||||
|
||||
const int NUM_OF_OSCILLATORS = 3;
|
||||
@@ -125,7 +125,7 @@ private:
|
||||
pixmapButton * expWaveBtn;
|
||||
pixmapButton * whiteNoiseWaveBtn;
|
||||
pixmapButton * usrWaveBtn;
|
||||
sampleBuffer m_sampleBuffer;
|
||||
sampleBuffer * m_sampleBuffer;
|
||||
} m_osc[NUM_OF_OSCILLATORS];
|
||||
|
||||
struct oscPtr
|
||||
|
||||
@@ -77,13 +77,14 @@
|
||||
|
||||
#include "templates.h"
|
||||
#include "config_mgr.h"
|
||||
#include "lmms_main_win.h"
|
||||
#include "main_window.h"
|
||||
#include "lvsl_client.h"
|
||||
|
||||
|
||||
|
||||
|
||||
remoteVSTPlugin::remoteVSTPlugin( const QString & _plugin ) :
|
||||
remoteVSTPlugin::remoteVSTPlugin( const QString & _plugin, engine * _engine ) :
|
||||
engineObject( _engine ),
|
||||
m_failed( TRUE ),
|
||||
m_plugin( _plugin ),
|
||||
m_pluginWidget( NULL ),
|
||||
@@ -241,7 +242,7 @@ void remoteVSTPlugin::showEditor( void )
|
||||
return;
|
||||
}
|
||||
|
||||
m_pluginWidget = new QWidget( lmmsMainWin::inst()->workspace() );
|
||||
m_pluginWidget = new QWidget( eng()->getMainWindow()->workspace() );
|
||||
m_pluginWidget->setFixedSize( m_pluginGeometry );
|
||||
m_pluginWidget->setWindowTitle( name() );
|
||||
m_pluginWidget->show();
|
||||
@@ -274,7 +275,7 @@ void remoteVSTPlugin::hideEditor( void )
|
||||
void remoteVSTPlugin::process( const sampleFrame * _in_buf,
|
||||
sampleFrame * _out_buf )
|
||||
{
|
||||
const fpab_t frames = mixer::inst()->framesPerAudioBuffer();
|
||||
const fpab_t frames = eng()->getMixer()->framesPerAudioBuffer();
|
||||
|
||||
if( m_shm == NULL )
|
||||
{
|
||||
@@ -286,7 +287,7 @@ void remoteVSTPlugin::process( const sampleFrame * _in_buf,
|
||||
{
|
||||
(void) processNextMessage();
|
||||
}
|
||||
mixer::inst()->clearAudioBuffer( _out_buf, frames );
|
||||
eng()->getMixer()->clearAudioBuffer( _out_buf, frames );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -323,7 +324,7 @@ void remoteVSTPlugin::process( const sampleFrame * _in_buf,
|
||||
if( outputs != DEFAULT_CHANNELS )
|
||||
{
|
||||
// clear buffer, if plugin didn't fill up both channels
|
||||
mixer::inst()->clearAudioBuffer( _out_buf, frames );
|
||||
eng()->getMixer()->clearAudioBuffer( _out_buf, frames );
|
||||
}
|
||||
|
||||
for( ch_cnt_t ch = 0; ch < outputs; ++ch )
|
||||
@@ -341,23 +342,23 @@ void remoteVSTPlugin::process( const sampleFrame * _in_buf,
|
||||
|
||||
|
||||
void remoteVSTPlugin::enqueueMidiEvent( const midiEvent & _event,
|
||||
const Uint32 _frames_ahead )
|
||||
const f_cnt_t _frames_ahead )
|
||||
{
|
||||
lock();
|
||||
writeValueS<Sint16>( VST_ENQUEUE_MIDI_EVENT );
|
||||
writeValueS<midiEvent>( _event );
|
||||
writeValueS<Uint32>( _frames_ahead );
|
||||
writeValueS<f_cnt_t>( _frames_ahead );
|
||||
unlock();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void remoteVSTPlugin::setBPM( Uint16 _bpm )
|
||||
void remoteVSTPlugin::setTempo( const bpm_t _bpm )
|
||||
{
|
||||
lock();
|
||||
writeValueS<Sint16>( VST_BPM );
|
||||
writeValueS<Uint16>( _bpm );
|
||||
writeValueS<bpm_t>( _bpm );
|
||||
unlock();
|
||||
}
|
||||
|
||||
@@ -465,14 +466,14 @@ Sint16 remoteVSTPlugin::processNextMessage( void )
|
||||
writeValueS<Sint16>( VST_SAMPLE_RATE );
|
||||
// handle is the same
|
||||
writeValueS<sample_rate_t>(
|
||||
mixer::inst()->sampleRate() );
|
||||
eng()->getMixer()->sampleRate() );
|
||||
break;
|
||||
|
||||
case VST_GET_BUFFER_SIZE:
|
||||
writeValueS<Sint16>( VST_BUFFER_SIZE );
|
||||
// handle is the same
|
||||
writeValueS<fpab_t>(
|
||||
mixer::inst()->framesPerAudioBuffer() );
|
||||
eng()->getMixer()->framesPerAudioBuffer() );
|
||||
break;
|
||||
|
||||
case VST_SHM_KEY_AND_SIZE:
|
||||
|
||||
@@ -44,13 +44,14 @@
|
||||
#include "mixer.h"
|
||||
#include "communication.h"
|
||||
#include "midi.h"
|
||||
#include "engine.h"
|
||||
|
||||
|
||||
|
||||
class remoteVSTPlugin
|
||||
class remoteVSTPlugin : public engineObject
|
||||
{
|
||||
public:
|
||||
remoteVSTPlugin( const QString & _plugin );
|
||||
remoteVSTPlugin( const QString & _plugin, engine * _engine );
|
||||
~remoteVSTPlugin();
|
||||
|
||||
void showEditor( void );
|
||||
@@ -80,7 +81,7 @@ public:
|
||||
sampleFrame * _out_buf );
|
||||
void FASTCALL enqueueMidiEvent( const midiEvent & _event,
|
||||
const Uint32 _frames_ahead );
|
||||
void FASTCALL setBPM( const Uint16 _bpm );
|
||||
void FASTCALL setTempo( const bpm_t _bpm );
|
||||
|
||||
const QMap<QString, QString> & parameterDump( void );
|
||||
void setParameterDump( const QMap<QString, QString> & _pdump );
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#include <qdir.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qcursor.h>
|
||||
#include <qwhatsthis.h>
|
||||
|
||||
#endif
|
||||
|
||||
@@ -52,13 +53,13 @@
|
||||
#include "note_play_handle.h"
|
||||
#include "buffer_allocator.h"
|
||||
#include "mixer.h"
|
||||
#include "song_editor.h"
|
||||
#include "instrument_play_handle.h"
|
||||
#include "pixmap_button.h"
|
||||
#include "tooltip.h"
|
||||
#include "spc_bg_hndl_widget.h"
|
||||
#include "vestige.h"
|
||||
#include "text_float.h"
|
||||
#include "song_editor.h"
|
||||
#include "lvsl_client.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
@@ -105,8 +106,8 @@ vestigeInstrument::vestigeInstrument( channelTrack * _channel_track ) :
|
||||
setErasePixmap( *s_artwork );
|
||||
#endif
|
||||
|
||||
connect( songEditor::inst(), SIGNAL( bpmChanged( int ) ),
|
||||
this, SLOT( changeBPM( int ) ) );
|
||||
connect( eng()->getSongEditor(), SIGNAL( tempoChanged( bpm_t ) ),
|
||||
this, SLOT( changeTempo( bpm_t ) ) );
|
||||
|
||||
m_openPluginButton = new pixmapButton( this );
|
||||
m_openPluginButton->setCheckable( FALSE );
|
||||
@@ -155,7 +156,7 @@ vestigeInstrument::vestigeInstrument( channelTrack * _channel_track ) :
|
||||
|
||||
// now we need a play-handle which cares for calling play()
|
||||
instrumentPlayHandle * iph = new instrumentPlayHandle( this );
|
||||
mixer::inst()->addPlayHandle( iph );
|
||||
eng()->getMixer()->addPlayHandle( iph );
|
||||
}
|
||||
|
||||
|
||||
@@ -270,7 +271,7 @@ void vestigeInstrument::setParameter( const QString & _param,
|
||||
PLUGIN_NAME::getIconPixmap( "logo", 24, 24 ),
|
||||
0 );
|
||||
m_pluginMutex.lock();
|
||||
m_plugin = new remoteVSTPlugin( m_pluginDLL );
|
||||
m_plugin = new remoteVSTPlugin( m_pluginDLL, eng() );
|
||||
if( m_plugin->failed() )
|
||||
{
|
||||
m_pluginMutex.unlock();
|
||||
@@ -300,7 +301,7 @@ void vestigeInstrument::setParameter( const QString & _param,
|
||||
return;
|
||||
}*/
|
||||
m_plugin->showEditor();
|
||||
m_plugin->setBPM( songEditor::inst()->getBPM() );
|
||||
m_plugin->setTempo( eng()->getSongEditor()->getTempo() );
|
||||
if( set_ch_name == TRUE )
|
||||
{
|
||||
getChannelTrack()->setName( m_plugin->name() );
|
||||
@@ -332,7 +333,7 @@ void vestigeInstrument::play( void )
|
||||
return;
|
||||
}
|
||||
|
||||
const Uint32 frames = mixer::inst()->framesPerAudioBuffer();
|
||||
const fpab_t frames = eng()->getMixer()->framesPerAudioBuffer();
|
||||
sampleFrame * buf = bufferAllocator::alloc<sampleFrame>( frames );
|
||||
|
||||
m_plugin->process( NULL, buf );
|
||||
@@ -476,12 +477,12 @@ void vestigeInstrument::noteOffAll( void )
|
||||
|
||||
|
||||
|
||||
void vestigeInstrument::changeBPM( int _new_val )
|
||||
void vestigeInstrument::changeTempo( bpm_t _new_tempo )
|
||||
{
|
||||
m_pluginMutex.lock();
|
||||
if( m_plugin != NULL )
|
||||
{
|
||||
m_plugin->setBPM( _new_val );
|
||||
m_plugin->setTempo( _new_tempo );
|
||||
}
|
||||
m_pluginMutex.unlock();
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ protected slots:
|
||||
void openPlugin( void );
|
||||
void toggleGUI( void );
|
||||
void noteOffAll( void );
|
||||
void changeBPM( int _new_val );
|
||||
void changeTempo( bpm_t _new_tempo );
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
@@ -54,10 +54,12 @@
|
||||
|
||||
|
||||
|
||||
audioALSA::audioALSA( const sample_rate_t _sample_rate, bool & _success_ful ) :
|
||||
audioALSA::audioALSA( const sample_rate_t _sample_rate, bool & _success_ful,
|
||||
mixer * _mixer ) :
|
||||
audioDevice( _sample_rate, tLimit<ch_cnt_t>(
|
||||
configManager::inst()->value( "audioalsa", "channels" ).toInt(),
|
||||
DEFAULT_CHANNELS, SURROUND_CHANNELS ) ),
|
||||
DEFAULT_CHANNELS, SURROUND_CHANNELS ),
|
||||
_mixer ),
|
||||
m_handle( NULL ),
|
||||
m_hwParams( NULL ),
|
||||
m_swParams( NULL ),
|
||||
@@ -213,9 +215,9 @@ void audioALSA::run( void )
|
||||
{
|
||||
surroundSampleFrame * temp =
|
||||
bufferAllocator::alloc<surroundSampleFrame>(
|
||||
mixer::inst()->framesPerAudioBuffer() );
|
||||
getMixer()->framesPerAudioBuffer() );
|
||||
int_sample_t * outbuf = bufferAllocator::alloc<int_sample_t>(
|
||||
mixer::inst()->framesPerAudioBuffer() *
|
||||
getMixer()->framesPerAudioBuffer() *
|
||||
channels() );
|
||||
m_quit = FALSE;
|
||||
|
||||
@@ -223,7 +225,7 @@ void audioALSA::run( void )
|
||||
{
|
||||
const f_cnt_t frames = getNextBuffer( temp );
|
||||
|
||||
convertToS16( temp, frames, mixer::inst()->masterGain(), outbuf,
|
||||
convertToS16( temp, frames, getMixer()->masterGain(), outbuf,
|
||||
m_littleEndian != isLittleEndian() );
|
||||
|
||||
f_cnt_t frame = 0;
|
||||
@@ -336,7 +338,7 @@ int audioALSA::setHWParams( const sample_rate_t _sample_rate,
|
||||
}
|
||||
}
|
||||
|
||||
m_periodSize = mixer::inst()->framesPerAudioBuffer();
|
||||
m_periodSize = getMixer()->framesPerAudioBuffer();
|
||||
m_bufferSize = m_periodSize * 8;
|
||||
dir = 0;
|
||||
err = snd_pcm_hw_params_set_period_size_near( m_handle, m_hwParams,
|
||||
|
||||
@@ -37,11 +37,12 @@
|
||||
|
||||
|
||||
audioDevice::audioDevice( const sample_rate_t _sample_rate,
|
||||
const ch_cnt_t _channels ) :
|
||||
const ch_cnt_t _channels, mixer * _mixer ) :
|
||||
m_sampleRate( _sample_rate ),
|
||||
m_channels( _channels ),
|
||||
m_mixer( _mixer ),
|
||||
m_buffer( bufferAllocator::alloc<surroundSampleFrame>(
|
||||
mixer::inst()->framesPerAudioBuffer() ) )
|
||||
getMixer()->framesPerAudioBuffer() ) )
|
||||
{
|
||||
#ifdef HAVE_SAMPLERATE_H
|
||||
int error;
|
||||
@@ -77,7 +78,7 @@ audioDevice::~audioDevice()
|
||||
void audioDevice::processNextBuffer( void )
|
||||
{
|
||||
const fpab_t frames = getNextBuffer( m_buffer );
|
||||
writeBuffer( m_buffer, frames, mixer::inst()->masterGain() );
|
||||
writeBuffer( m_buffer, frames, getMixer()->masterGain() );
|
||||
}
|
||||
|
||||
|
||||
@@ -85,18 +86,18 @@ void audioDevice::processNextBuffer( void )
|
||||
|
||||
fpab_t audioDevice::getNextBuffer( surroundSampleFrame * _ab )
|
||||
{
|
||||
fpab_t frames = mixer::inst()->framesPerAudioBuffer();
|
||||
const surroundSampleFrame * b = mixer::inst()->renderNextBuffer();
|
||||
fpab_t frames = getMixer()->framesPerAudioBuffer();
|
||||
const surroundSampleFrame * b = getMixer()->renderNextBuffer();
|
||||
|
||||
// make sure, no other thread is accessing device
|
||||
lock();
|
||||
|
||||
// now were safe to access the device
|
||||
if( mixer::inst()->sampleRate() != m_sampleRate )
|
||||
if( getMixer()->sampleRate() != m_sampleRate )
|
||||
{
|
||||
resample( b, frames, _ab, mixer::inst()->sampleRate(),
|
||||
resample( b, frames, _ab, getMixer()->sampleRate(),
|
||||
m_sampleRate );
|
||||
frames = frames * m_sampleRate / mixer::inst()->sampleRate();
|
||||
frames = frames * m_sampleRate / getMixer()->sampleRate();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -48,8 +48,9 @@ audioFileDevice::audioFileDevice( const sample_rate_t _sample_rate,
|
||||
const bool _use_vbr,
|
||||
const bitrate_t _nom_bitrate,
|
||||
const bitrate_t _min_bitrate,
|
||||
const bitrate_t _max_bitrate ) :
|
||||
audioDevice( _sample_rate, _channels),
|
||||
const bitrate_t _max_bitrate,
|
||||
mixer * _mixer ) :
|
||||
audioDevice( _sample_rate, _channels, _mixer ),
|
||||
m_outputFile( _file ),
|
||||
m_useVbr( _use_vbr ),
|
||||
m_nomBitrate( _nom_bitrate ),
|
||||
|
||||
@@ -46,9 +46,10 @@ audioFileOgg::audioFileOgg( const sample_rate_t _sample_rate,
|
||||
const bool _use_vbr,
|
||||
const bitrate_t _nom_bitrate,
|
||||
const bitrate_t _min_bitrate,
|
||||
const bitrate_t _max_bitrate ) :
|
||||
const bitrate_t _max_bitrate,
|
||||
mixer * _mixer ) :
|
||||
audioFileDevice( _sample_rate, _channels, _file, _use_vbr,
|
||||
_nom_bitrate, _min_bitrate, _max_bitrate )
|
||||
_nom_bitrate, _min_bitrate, _max_bitrate, _mixer )
|
||||
{
|
||||
_success_ful = startEncoding();
|
||||
}
|
||||
|
||||
@@ -38,9 +38,10 @@ audioFileWave::audioFileWave( const sample_rate_t _sample_rate,
|
||||
const bool _use_vbr,
|
||||
const bitrate_t _nom_bitrate,
|
||||
const bitrate_t _min_bitrate,
|
||||
const bitrate_t _max_bitrate ) :
|
||||
const bitrate_t _max_bitrate,
|
||||
mixer * _mixer ) :
|
||||
audioFileDevice( _sample_rate, _channels, _file, _use_vbr,
|
||||
_nom_bitrate, _min_bitrate, _max_bitrate )
|
||||
_nom_bitrate, _min_bitrate, _max_bitrate, _mixer )
|
||||
{
|
||||
_success_ful = startEncoding();
|
||||
}
|
||||
|
||||
@@ -56,15 +56,17 @@
|
||||
|
||||
|
||||
|
||||
audioJACK::audioJACK( Uint32 _sample_rate, bool & _success_ful ) :
|
||||
audioJACK::audioJACK( const sample_rate_t _sample_rate, bool & _success_ful,
|
||||
mixer * _mixer ) :
|
||||
audioDevice( _sample_rate, tLimit<int>( configManager::inst()->value(
|
||||
"audiojack", "channels" ).toInt(),
|
||||
DEFAULT_CHANNELS, SURROUND_CHANNELS ) ),
|
||||
DEFAULT_CHANNELS, SURROUND_CHANNELS ),
|
||||
_mixer ),
|
||||
m_client( NULL ),
|
||||
m_stopped( FALSE ),
|
||||
m_processCallbackMutex(),
|
||||
m_outBuf( bufferAllocator::alloc<surroundSampleFrame>(
|
||||
mixer::inst()->framesPerAudioBuffer() ) ),
|
||||
getMixer()->framesPerAudioBuffer() ) ),
|
||||
m_framesDoneInCurBuf( 0 ),
|
||||
m_framesToDoInCurBuf( 0 )
|
||||
{
|
||||
@@ -177,7 +179,7 @@ audioJACK::audioJACK( Uint32 _sample_rate, bool & _success_ful ) :
|
||||
|
||||
|
||||
// try to sync JACK's and LMMS's buffer-size
|
||||
jack_set_buffer_size( m_client, mixer::inst()->framesPerAudioBuffer() );
|
||||
jack_set_buffer_size( m_client, getMixer()->framesPerAudioBuffer() );
|
||||
|
||||
|
||||
|
||||
@@ -346,7 +348,7 @@ int audioJACK::processCallback( jack_nframes_t _nframes, void * _udata )
|
||||
}
|
||||
|
||||
/* const Uint32 frames = tMin<Uint32>( _nframes,
|
||||
mixer::inst()->framesPerAudioBuffer() );
|
||||
getMixer()->framesPerAudioBuffer() );
|
||||
for( jackPortMap::iterator it = _this->m_portMap.begin();
|
||||
it != _this->m_portMap.end(); ++it )
|
||||
{
|
||||
@@ -382,7 +384,7 @@ int audioJACK::processCallback( jack_nframes_t _nframes, void * _udata )
|
||||
{
|
||||
outbufs[chnl][done+frame] =
|
||||
_this->m_outBuf[_this->m_framesDoneInCurBuf+frame][chnl] *
|
||||
mixer::inst()->masterGain();
|
||||
_this->getMixer()->masterGain();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,10 +91,12 @@
|
||||
|
||||
|
||||
|
||||
audioOSS::audioOSS( const sample_rate_t _sample_rate, bool & _success_ful ) :
|
||||
audioOSS::audioOSS( const sample_rate_t _sample_rate, bool & _success_ful,
|
||||
mixer * _mixer ) :
|
||||
audioDevice( _sample_rate, tLimit<ch_cnt_t>(
|
||||
configManager::inst()->value( "audiooss", "channels" ).toInt(),
|
||||
DEFAULT_CHANNELS, SURROUND_CHANNELS ) ),
|
||||
DEFAULT_CHANNELS, SURROUND_CHANNELS ),
|
||||
_mixer ),
|
||||
m_convertEndian( FALSE ),
|
||||
m_quit( FALSE )
|
||||
{
|
||||
@@ -125,7 +127,7 @@ audioOSS::audioOSS( const sample_rate_t _sample_rate, bool & _success_ful ) :
|
||||
|
||||
int frag_spec;
|
||||
for( frag_spec = 0; static_cast<int>( 0x01 << frag_spec ) <
|
||||
mixer::inst()->framesPerAudioBuffer() * channels() *
|
||||
getMixer()->framesPerAudioBuffer() * channels() *
|
||||
BYTES_PER_INT_SAMPLE;
|
||||
++frag_spec )
|
||||
{
|
||||
@@ -316,9 +318,9 @@ void audioOSS::run( void )
|
||||
{
|
||||
surroundSampleFrame * temp =
|
||||
bufferAllocator::alloc<surroundSampleFrame>(
|
||||
mixer::inst()->framesPerAudioBuffer() );
|
||||
getMixer()->framesPerAudioBuffer() );
|
||||
int_sample_t * outbuf = bufferAllocator::alloc<int_sample_t>(
|
||||
mixer::inst()->framesPerAudioBuffer() *
|
||||
getMixer()->framesPerAudioBuffer() *
|
||||
channels() );
|
||||
m_quit = FALSE;
|
||||
|
||||
@@ -327,7 +329,7 @@ void audioOSS::run( void )
|
||||
const Uint32 frames = getNextBuffer( temp );
|
||||
|
||||
int bytes = convertToS16( temp, frames,
|
||||
mixer::inst()->masterGain(), outbuf,
|
||||
getMixer()->masterGain(), outbuf,
|
||||
m_convertEndian );
|
||||
write( m_audioFD, outbuf, bytes );
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* audio_port.cpp - base-class for objects providing sound at a port
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -28,21 +28,22 @@
|
||||
#include "buffer_allocator.h"
|
||||
|
||||
|
||||
audioPort::audioPort( const QString & _name ) :
|
||||
audioPort::audioPort( const QString & _name, engine * _engine ) :
|
||||
engineObject( _engine ),
|
||||
m_bufferUsage( NONE ),
|
||||
m_firstBuffer( bufferAllocator::alloc<surroundSampleFrame>(
|
||||
mixer::inst()->framesPerAudioBuffer() ) ),
|
||||
eng()->getMixer()->framesPerAudioBuffer() ) ),
|
||||
m_secondBuffer( bufferAllocator::alloc<surroundSampleFrame>(
|
||||
mixer::inst()->framesPerAudioBuffer() ) ),
|
||||
eng()->getMixer()->framesPerAudioBuffer() ) ),
|
||||
m_extOutputEnabled( FALSE ),
|
||||
m_nextFxChannel( -1 ),
|
||||
m_name( "unnamed port" )
|
||||
{
|
||||
mixer::inst()->clearAudioBuffer( m_firstBuffer,
|
||||
mixer::inst()->framesPerAudioBuffer() );
|
||||
mixer::inst()->clearAudioBuffer( m_secondBuffer,
|
||||
mixer::inst()->framesPerAudioBuffer() );
|
||||
mixer::inst()->addAudioPort( this );
|
||||
eng()->getMixer()->clearAudioBuffer( m_firstBuffer,
|
||||
eng()->getMixer()->framesPerAudioBuffer() );
|
||||
eng()->getMixer()->clearAudioBuffer( m_secondBuffer,
|
||||
eng()->getMixer()->framesPerAudioBuffer() );
|
||||
eng()->getMixer()->addAudioPort( this );
|
||||
setExtOutputEnabled( TRUE );
|
||||
}
|
||||
|
||||
@@ -51,10 +52,10 @@ audioPort::audioPort( const QString & _name ) :
|
||||
|
||||
audioPort::~audioPort()
|
||||
{
|
||||
mixer::inst()->removeAudioPort( this );
|
||||
eng()->getMixer()->removeAudioPort( this );
|
||||
if( m_extOutputEnabled == TRUE )
|
||||
{
|
||||
mixer::inst()->audioDev()->unregisterPort( this );
|
||||
eng()->getMixer()->audioDev()->unregisterPort( this );
|
||||
}
|
||||
bufferAllocator::free( m_firstBuffer );
|
||||
bufferAllocator::free( m_secondBuffer );
|
||||
@@ -65,8 +66,8 @@ audioPort::~audioPort()
|
||||
|
||||
void audioPort::nextPeriod( void )
|
||||
{
|
||||
mixer::inst()->clearAudioBuffer( m_firstBuffer,
|
||||
mixer::inst()->framesPerAudioBuffer() );
|
||||
eng()->getMixer()->clearAudioBuffer( m_firstBuffer,
|
||||
eng()->getMixer()->framesPerAudioBuffer() );
|
||||
qSwap( m_firstBuffer, m_secondBuffer );
|
||||
// this is how we decrease state of buffer-usage ;-)
|
||||
m_bufferUsage = ( m_bufferUsage != NONE ) ?
|
||||
@@ -83,11 +84,11 @@ void audioPort::setExtOutputEnabled( bool _enabled )
|
||||
m_extOutputEnabled = _enabled;
|
||||
if( m_extOutputEnabled )
|
||||
{
|
||||
mixer::inst()->audioDev()->registerPort( this );
|
||||
eng()->getMixer()->audioDev()->registerPort( this );
|
||||
}
|
||||
else
|
||||
{
|
||||
mixer::inst()->audioDev()->unregisterPort( this );
|
||||
eng()->getMixer()->audioDev()->unregisterPort( this );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -98,6 +99,6 @@ void audioPort::setExtOutputEnabled( bool _enabled )
|
||||
void audioPort::setName( const QString & _name )
|
||||
{
|
||||
m_name = _name;
|
||||
mixer::inst()->audioDev()->renamePort( this );
|
||||
eng()->getMixer()->audioDev()->renamePort( this );
|
||||
}
|
||||
|
||||
|
||||
@@ -35,8 +35,9 @@
|
||||
|
||||
audioSampleRecorder::audioSampleRecorder( const sample_rate_t _sample_rate,
|
||||
const ch_cnt_t _channels,
|
||||
bool & _success_ful ) :
|
||||
audioDevice( _sample_rate, _channels ),
|
||||
bool & _success_ful,
|
||||
mixer * _mixer ) :
|
||||
audioDevice( _sample_rate, _channels, _mixer ),
|
||||
m_buffers()
|
||||
{
|
||||
_success_ful = TRUE;
|
||||
@@ -57,9 +58,9 @@ audioSampleRecorder::~audioSampleRecorder()
|
||||
|
||||
|
||||
|
||||
Uint32 audioSampleRecorder::framesRecorded( void ) const
|
||||
f_cnt_t audioSampleRecorder::framesRecorded( void ) const
|
||||
{
|
||||
Uint32 frames = 0;
|
||||
f_cnt_t frames = 0;
|
||||
for( bufferList::const_iterator it = m_buffers.begin();
|
||||
it != m_buffers.end(); ++it )
|
||||
{
|
||||
@@ -72,9 +73,8 @@ Uint32 audioSampleRecorder::framesRecorded( void ) const
|
||||
|
||||
|
||||
void audioSampleRecorder::createSampleBuffer( sampleBuffer * * _sample_buf )
|
||||
const
|
||||
{
|
||||
f_cnt_t frames = framesRecorded();
|
||||
const f_cnt_t frames = framesRecorded();
|
||||
// create buffer to store all recorded buffers in
|
||||
sampleFrame * data = bufferAllocator::alloc<sampleFrame>( frames );
|
||||
// make sure buffer is cleaned up properly at the end...
|
||||
@@ -92,7 +92,7 @@ void audioSampleRecorder::createSampleBuffer( sampleBuffer * * _sample_buf )
|
||||
data += ( *it ).second;
|
||||
}
|
||||
// create according sample-buffer out of big buffer
|
||||
*_sample_buf = new sampleBuffer( ac.ptr(), frames );
|
||||
*_sample_buf = new sampleBuffer( ac.ptr(), frames, getMixer()->eng() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* audio_sdl.cpp - device-class that performs PCM-output via SDL
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -48,10 +48,11 @@
|
||||
|
||||
|
||||
|
||||
audioSDL::audioSDL( const sample_rate_t _sample_rate, bool & _success_ful ) :
|
||||
audioDevice( _sample_rate, DEFAULT_CHANNELS ),
|
||||
audioSDL::audioSDL( const sample_rate_t _sample_rate, bool & _success_ful,
|
||||
mixer * _mixer ) :
|
||||
audioDevice( _sample_rate, DEFAULT_CHANNELS, _mixer ),
|
||||
m_outBuf( bufferAllocator::alloc<surroundSampleFrame>(
|
||||
mixer::inst()->framesPerAudioBuffer() ) ),
|
||||
getMixer()->framesPerAudioBuffer() ) ),
|
||||
m_convertEndian( FALSE )
|
||||
{
|
||||
_success_ful = FALSE;
|
||||
@@ -81,7 +82,7 @@ audioSDL::audioSDL( const sample_rate_t _sample_rate, bool & _success_ful ) :
|
||||
// of system, so we don't have
|
||||
// to convert the buffers
|
||||
m_audioHandle.channels = channels();
|
||||
m_audioHandle.samples = mixer::inst()->framesPerAudioBuffer();
|
||||
m_audioHandle.samples = getMixer()->framesPerAudioBuffer();
|
||||
|
||||
m_audioHandle.callback = sdlAudioCallback;
|
||||
m_audioHandle.userdata = this;
|
||||
@@ -145,7 +146,7 @@ void audioSDL::sdlAudioCallback( void * _udata, Uint8 * _buf, int _len )
|
||||
const fpab_t frames = _this->getNextBuffer( _this->m_outBuf );
|
||||
|
||||
_this->convertToS16( _this->m_outBuf, frames,
|
||||
mixer::inst()->masterGain(),
|
||||
_this->getMixer()->masterGain(),
|
||||
(int_sample_t *)( _buf ),
|
||||
_this->m_convertEndian );
|
||||
}
|
||||
@@ -171,7 +172,6 @@ audioSDL::setupWidget::setupWidget( QWidget * _parent ) :
|
||||
|
||||
audioSDL::setupWidget::~setupWidget()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -200,6 +200,7 @@ const int ARP_GROUPBOX_HEIGHT = 240 - ARP_GROUPBOX_Y;
|
||||
arpAndChordsTabWidget::arpAndChordsTabWidget( channelTrack * _channel_track ) :
|
||||
QWidget( _channel_track->tabWidgetParent() ),
|
||||
settings(),
|
||||
engineObject( _channel_track->eng() ),
|
||||
m_arpDirection( UP )
|
||||
{
|
||||
m_chordsGroupBox = new groupBox( tr( "CHORDS" ), this );
|
||||
@@ -221,7 +222,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( channelTrack * _channel_track ) :
|
||||
}
|
||||
|
||||
m_chordRangeKnob = new knob( knobBright_26, m_chordsGroupBox,
|
||||
tr( "Chord range" ) );
|
||||
tr( "Chord range" ), eng() );
|
||||
m_chordRangeKnob->setLabel( tr( "RANGE" ) );
|
||||
m_chordRangeKnob->setRange( 1.0, 9.0, 1.0 );
|
||||
m_chordRangeKnob->setValue( 1.0, TRUE );
|
||||
@@ -273,7 +274,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( channelTrack * _channel_track ) :
|
||||
|
||||
|
||||
m_arpRangeKnob = new knob( knobBright_26, m_arpGroupBox,
|
||||
tr( "Arpeggio range" ) );
|
||||
tr( "Arpeggio range" ), eng() );
|
||||
m_arpRangeKnob->setLabel( tr( "RANGE" ) );
|
||||
m_arpRangeKnob->setRange( 1.0, 9.0, 1.0 );
|
||||
m_arpRangeKnob->setValue( 1.0, TRUE );
|
||||
@@ -290,7 +291,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( channelTrack * _channel_track ) :
|
||||
"amount of octaves." ) );
|
||||
|
||||
m_arpTimeKnob = new tempoSyncKnob( knobBright_26, m_arpGroupBox,
|
||||
tr( "Arpeggio time" ) );
|
||||
tr( "Arpeggio time" ), eng() );
|
||||
m_arpTimeKnob->setLabel( tr( "TIME" ) );
|
||||
m_arpTimeKnob->setRange( 10.0, 1000.0, 1.0 );
|
||||
m_arpTimeKnob->setValue( 100.0, TRUE );
|
||||
@@ -307,7 +308,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( channelTrack * _channel_track ) :
|
||||
"each arpeggio-tone should be played." ) );
|
||||
|
||||
m_arpGateKnob = new knob( knobBright_26, m_arpGroupBox,
|
||||
tr( "Arpeggio gate" ) );
|
||||
tr( "Arpeggio gate" ), eng() );
|
||||
m_arpGateKnob->setLabel( tr( "GATE" ) );
|
||||
m_arpGateKnob->setRange( 1.0, 200.0, 1.0 );
|
||||
m_arpGateKnob->setValue( 100.0, TRUE );
|
||||
@@ -511,9 +512,9 @@ void arpAndChordsTabWidget::processNote( notePlayHandle * _n )
|
||||
const int total_range = range * cnphv.size();
|
||||
|
||||
// number of frames that every note should be played
|
||||
const Uint32 arp_frames = (Uint32)( m_arpTimeKnob->value() / 1000.0f *
|
||||
mixer::inst()->sampleRate() );
|
||||
const Uint32 gated_frames = (Uint32)( m_arpGateKnob->value() *
|
||||
const f_cnt_t arp_frames = (f_cnt_t)( m_arpTimeKnob->value() / 1000.0f *
|
||||
eng()->getMixer()->sampleRate() );
|
||||
const f_cnt_t gated_frames = (f_cnt_t)( m_arpGateKnob->value() *
|
||||
arp_frames / 100.0f );
|
||||
|
||||
// used for calculating remaining frames for arp-note, we have to add
|
||||
@@ -524,15 +525,15 @@ void arpAndChordsTabWidget::processNote( notePlayHandle * _n )
|
||||
_n->totalFramesPlayed() )
|
||||
+ arp_frames - 1;
|
||||
// used for loop
|
||||
Uint32 frames_processed = 0;
|
||||
fpab_t frames_processed = 0;
|
||||
|
||||
while( frames_processed < mixer::inst()->framesPerAudioBuffer() )
|
||||
while( frames_processed < eng()->getMixer()->framesPerAudioBuffer() )
|
||||
{
|
||||
const Uint32 remaining_frames_for_cur_arp = arp_frames -
|
||||
const f_cnt_t remaining_frames_for_cur_arp = arp_frames -
|
||||
( cur_frame % arp_frames );
|
||||
// does current arp-note fill whole audio-buffer?
|
||||
if( remaining_frames_for_cur_arp >
|
||||
mixer::inst()->framesPerAudioBuffer() )
|
||||
eng()->getMixer()->framesPerAudioBuffer() )
|
||||
{
|
||||
// then we don't have to do something!
|
||||
break;
|
||||
@@ -721,7 +722,7 @@ void arpAndChordsTabWidget::arpUpToggled( bool _on )
|
||||
{
|
||||
m_arpDirection = UP;
|
||||
}
|
||||
songEditor::inst()->setModified();
|
||||
eng()->getSongEditor()->setModified();
|
||||
}
|
||||
|
||||
|
||||
@@ -733,7 +734,7 @@ void arpAndChordsTabWidget::arpDownToggled( bool _on )
|
||||
{
|
||||
m_arpDirection = DOWN;
|
||||
}
|
||||
songEditor::inst()->setModified();
|
||||
eng()->getSongEditor()->setModified();
|
||||
}
|
||||
|
||||
|
||||
@@ -745,7 +746,7 @@ void arpAndChordsTabWidget::arpUpAndDownToggled( bool _on )
|
||||
{
|
||||
m_arpDirection = UP_AND_DOWN;
|
||||
}
|
||||
songEditor::inst()->setModified();
|
||||
eng()->getSongEditor()->setModified();
|
||||
}
|
||||
|
||||
|
||||
@@ -757,7 +758,7 @@ void arpAndChordsTabWidget::arpRandomToggled( bool _on )
|
||||
{
|
||||
m_arpDirection = RANDOM;
|
||||
}
|
||||
songEditor::inst()->setModified();
|
||||
eng()->getSongEditor()->setModified();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
|
||||
#include <qpainter.h>
|
||||
#include <qlayout.h>
|
||||
#include <qwhatsthis.h>
|
||||
|
||||
#endif
|
||||
|
||||
@@ -51,19 +52,16 @@
|
||||
#include "debug.h"
|
||||
#include "tooltip.h"
|
||||
#include "combobox.h"
|
||||
|
||||
#include "main_window.h"
|
||||
|
||||
|
||||
const int BBE_PPT = 192;
|
||||
|
||||
|
||||
|
||||
bbEditor * bbEditor::s_instanceOfMe = NULL;
|
||||
|
||||
|
||||
|
||||
bbEditor::bbEditor() :
|
||||
trackContainer()
|
||||
bbEditor::bbEditor( engine * _engine ) :
|
||||
trackContainer( _engine )
|
||||
{
|
||||
// create toolbar
|
||||
m_toolBar = new QWidget( this );
|
||||
@@ -88,7 +86,7 @@ bbEditor::bbEditor() :
|
||||
setMinimumWidth( TRACK_OP_WIDTH + DEFAULT_SETTINGS_WIDGET_WIDTH +
|
||||
BBE_PPT + 2 * TCO_BORDER_WIDTH +
|
||||
DEFAULT_SCROLLBAR_SIZE );
|
||||
if( lmmsMainWin::inst()->workspace() != NULL )
|
||||
if( eng()->getMainWindow()->workspace() != NULL )
|
||||
{
|
||||
setGeometry( 10, 340, minimumWidth(), 300 );
|
||||
}
|
||||
@@ -178,9 +176,9 @@ void bbEditor::setCurrentBB( int _bb )
|
||||
|
||||
// now update all track-labels (the current one has to become white,
|
||||
// the others green)
|
||||
for( csize i = 0; i < bbEditor::inst()->numOfBBs(); ++i )
|
||||
for( csize i = 0; i < numOfBBs(); ++i )
|
||||
{
|
||||
bbTrack::findBBTrack( i )->trackLabel()->update();
|
||||
bbTrack::findBBTrack( i, eng() )->trackLabel()->update();
|
||||
}
|
||||
|
||||
emit positionChanged( m_currentPosition = midiTime(
|
||||
@@ -244,7 +242,7 @@ bool FASTCALL bbEditor::play( midiTime _start, Uint32 _start_frame,
|
||||
|
||||
csize bbEditor::numOfBBs( void ) const
|
||||
{
|
||||
return( songEditor::inst()->countTracks( track::BB_TRACK ) );
|
||||
return( eng()->getSongEditor()->countTracks( track::BB_TRACK ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -275,7 +273,7 @@ void bbEditor::removeBB( csize _bb )
|
||||
|
||||
void bbEditor::updateBBTrack( trackContentObject * _tco )
|
||||
{
|
||||
bbTrack * t = bbTrack::findBBTrack( _tco->startPosition() / 64 );
|
||||
bbTrack * t = bbTrack::findBBTrack( _tco->startPosition() / 64, eng() );
|
||||
if( t != NULL )
|
||||
{
|
||||
t->getTrackContentWidget()->updateTCOs();
|
||||
@@ -291,7 +289,7 @@ void bbEditor::updateComboBox( void )
|
||||
|
||||
for( csize i = 0; i < numOfBBs(); ++i )
|
||||
{
|
||||
bbTrack * bbt = bbTrack::findBBTrack( i );
|
||||
bbTrack * bbt = bbTrack::findBBTrack( i, eng() );
|
||||
m_bbComboBox->addItem( bbt->trackLabel()->text(),
|
||||
bbt->trackLabel()->pixmap() );
|
||||
}
|
||||
@@ -316,7 +314,7 @@ void bbEditor::keyPressEvent( QKeyEvent * _ke )
|
||||
{
|
||||
if ( _ke->key() == Qt::Key_Space )
|
||||
{
|
||||
if( songEditor::inst()->playing() )
|
||||
if( eng()->getSongEditor()->playing() )
|
||||
{
|
||||
stop();
|
||||
}
|
||||
@@ -374,31 +372,31 @@ QRect bbEditor::scrollAreaRect( void ) const
|
||||
|
||||
void bbEditor::play( void )
|
||||
{
|
||||
if( songEditor::inst()->playing() )
|
||||
if( eng()->getSongEditor()->playing() )
|
||||
{
|
||||
if( songEditor::inst()->playMode() != songEditor::PLAY_BB )
|
||||
if( eng()->getSongEditor()->playMode() != songEditor::PLAY_BB )
|
||||
{
|
||||
songEditor::inst()->stop();
|
||||
songEditor::inst()->playBB();
|
||||
eng()->getSongEditor()->stop();
|
||||
eng()->getSongEditor()->playBB();
|
||||
m_playButton->setIcon( embed::getIconPixmap(
|
||||
"pause" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
songEditor::inst()->pause();
|
||||
eng()->getSongEditor()->pause();
|
||||
m_playButton->setIcon( embed::getIconPixmap(
|
||||
"play" ) );
|
||||
}
|
||||
}
|
||||
else if( songEditor::inst()->paused() )
|
||||
else if( eng()->getSongEditor()->paused() )
|
||||
{
|
||||
songEditor::inst()->resumeFromPause();
|
||||
eng()->getSongEditor()->resumeFromPause();
|
||||
m_playButton->setIcon( embed::getIconPixmap( "pause" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_playButton->setIcon( embed::getIconPixmap( "pause" ) );
|
||||
songEditor::inst()->playBB();
|
||||
eng()->getSongEditor()->playBB();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -408,7 +406,7 @@ void bbEditor::play( void )
|
||||
|
||||
void bbEditor::stop( void )
|
||||
{
|
||||
songEditor::inst()->stop();
|
||||
eng()->getSongEditor()->stop();
|
||||
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
|
||||
m_playButton->update();
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* envelope_widget.cpp - widget which is m_used by envelope/lfo/filter-tab of
|
||||
* channel-window
|
||||
* envelope_and_lfo_widget.cpp - widget which is m_used by envelope/lfo/filter-
|
||||
* tab of channel-window
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -100,12 +100,15 @@ const int LFO_SHAPES_Y = LFO_GRAPH_Y + 50;
|
||||
|
||||
QPixmap * envelopeAndLFOWidget::s_envGraph = NULL;
|
||||
QPixmap * envelopeAndLFOWidget::s_lfoGraph = NULL;
|
||||
Uint32 envelopeAndLFOWidget::s_lfoFrame = 0;
|
||||
|
||||
QMap<engine *, vvector<envelopeAndLFOWidget *> >
|
||||
envelopeAndLFOWidget::s_EaLWidgets;
|
||||
|
||||
|
||||
|
||||
envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
|
||||
QWidget * _parent ) :
|
||||
QWidget * _parent,
|
||||
engine * _engine ) :
|
||||
QWidget( _parent ),
|
||||
settings(),
|
||||
#ifdef QT4
|
||||
@@ -113,12 +116,15 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
|
||||
#else
|
||||
specialBgHandlingWidget( paletteBackgroundColor() ),
|
||||
#endif
|
||||
engineObject( _engine ),
|
||||
m_used( FALSE ),
|
||||
m_valueForZeroAmount( _value_for_zero_amount ),
|
||||
m_pahdEnv( NULL ),
|
||||
m_rEnv( NULL ),
|
||||
m_lfoFrame( 0 ),
|
||||
m_lfoAmountIsZero( FALSE ),
|
||||
m_lfoShapeData( NULL ),
|
||||
m_userWave( eng() ),
|
||||
m_lfoShape( SIN ),
|
||||
m_busy( FALSE )
|
||||
{
|
||||
@@ -132,7 +138,11 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
|
||||
s_lfoGraph = new QPixmap( embed::getIconPixmap( "lfo_graph" ) );
|
||||
}
|
||||
|
||||
m_predelayKnob = new knob( knobBright_26, this, tr( "Predelay-time" ) );
|
||||
s_EaLWidgets[eng()].push_back( this );
|
||||
|
||||
|
||||
m_predelayKnob = new knob( knobBright_26, this, tr( "Predelay-time" ),
|
||||
eng() );
|
||||
m_predelayKnob->setLabel( tr( "DEL" ) );
|
||||
m_predelayKnob->setRange( 0.0, 1.0, 0.001 );
|
||||
m_predelayKnob->setValue( 0.0, TRUE );
|
||||
@@ -149,7 +159,8 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
|
||||
connect( m_predelayKnob, SIGNAL( valueChanged( float ) ), this,
|
||||
SLOT( updateAfterKnobChange( float ) ) );
|
||||
|
||||
m_attackKnob = new knob( knobBright_26, this, tr( "Attack-time" ) );
|
||||
m_attackKnob = new knob( knobBright_26, this, tr( "Attack-time" ),
|
||||
eng() );
|
||||
m_attackKnob->setLabel( tr( "ATT" ) );
|
||||
m_attackKnob->setRange( 0.0, 1.0, 0.001 );
|
||||
m_attackKnob->setValue( 0.0, TRUE );
|
||||
@@ -168,7 +179,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
|
||||
connect( m_attackKnob, SIGNAL( valueChanged( float ) ), this,
|
||||
SLOT( updateAfterKnobChange( float ) ) );
|
||||
|
||||
m_holdKnob = new knob( knobBright_26, this, tr( "Hold-time" ) );
|
||||
m_holdKnob = new knob( knobBright_26, this, tr( "Hold-time" ), eng() );
|
||||
m_holdKnob->setLabel( tr( "HOLD" ) );
|
||||
m_holdKnob->setRange( 0.0, 1.0, 0.001 );
|
||||
m_holdKnob->setValue( 0.5, TRUE );
|
||||
@@ -186,7 +197,8 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
|
||||
connect( m_holdKnob, SIGNAL( valueChanged( float ) ), this,
|
||||
SLOT( updateAfterKnobChange( float ) ) );
|
||||
|
||||
m_decayKnob = new knob( knobBright_26, this, tr( "Decay-time" ) );
|
||||
m_decayKnob = new knob( knobBright_26, this, tr( "Decay-time" ),
|
||||
eng() );
|
||||
m_decayKnob->setLabel( tr( "DEC" ) );
|
||||
m_decayKnob->setRange( 0.0, 1.0, 0.001 );
|
||||
m_decayKnob->setValue( 0.5, TRUE );
|
||||
@@ -205,7 +217,8 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
|
||||
connect( m_decayKnob, SIGNAL( valueChanged( float ) ), this,
|
||||
SLOT( updateAfterKnobChange( float ) ) );
|
||||
|
||||
m_sustainKnob = new knob( knobBright_26, this, tr( "Sustain-level" ) );
|
||||
m_sustainKnob = new knob( knobBright_26, this, tr( "Sustain-level" ),
|
||||
eng() );
|
||||
m_sustainKnob->setLabel( tr( "SUST" ) );
|
||||
m_sustainKnob->setRange( 0.0, 1.0, 0.001 );
|
||||
m_sustainKnob->setValue( 0.5, TRUE );
|
||||
@@ -223,7 +236,8 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
|
||||
connect( m_sustainKnob, SIGNAL( valueChanged( float ) ), this,
|
||||
SLOT( updateAfterKnobChange( float ) ) );
|
||||
|
||||
m_releaseKnob = new knob( knobBright_26, this, tr( "Release-time" ) );
|
||||
m_releaseKnob = new knob( knobBright_26, this, tr( "Release-time" ),
|
||||
eng() );
|
||||
m_releaseKnob->setLabel( tr( "REL" ) );
|
||||
m_releaseKnob->setRange( 0.0, 1.0, 0.001 );
|
||||
m_releaseKnob->setValue( 0.1, TRUE );
|
||||
@@ -243,7 +257,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
|
||||
SLOT( updateAfterKnobChange( float ) ) );
|
||||
|
||||
m_amountKnob = new knob( knobBright_26, this,
|
||||
tr( "Modulation amount" ) );
|
||||
tr( "Modulation amount" ), eng() );
|
||||
m_amountKnob->setLabel( tr( "AMT" ) );
|
||||
m_amountKnob->setRange( -1.0, 1.0, 0.005 );
|
||||
m_amountKnob->setValue( 0.0, TRUE );
|
||||
@@ -264,7 +278,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
|
||||
|
||||
|
||||
m_lfoPredelayKnob = new knob( knobBright_26, this,
|
||||
tr( "LFO-predelay-time" ) );
|
||||
tr( "LFO-predelay-time" ), eng() );
|
||||
m_lfoPredelayKnob->setLabel( tr( "DEL" ) );
|
||||
m_lfoPredelayKnob->setRange( 0.0, 1.0, 0.001 );
|
||||
m_lfoPredelayKnob->setValue( 0.0, TRUE );
|
||||
@@ -282,7 +296,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
|
||||
SLOT( updateAfterKnobChange( float ) ) );
|
||||
|
||||
m_lfoAttackKnob = new knob( knobBright_26, this,
|
||||
tr( "LFO-attack-time" ) );
|
||||
tr( "LFO-attack-time" ), eng() );
|
||||
m_lfoAttackKnob->setLabel( tr( "ATT" ) );
|
||||
m_lfoAttackKnob->setRange( 0.0, 1.0, 0.001 );
|
||||
m_lfoAttackKnob->setValue( 0.0, TRUE );
|
||||
@@ -300,7 +314,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
|
||||
SLOT( updateAfterKnobChange( float ) ) );
|
||||
|
||||
m_lfoSpeedKnob = new tempoSyncKnob( knobBright_26, this,
|
||||
tr( "LFO-speed" ), 20000.0 );
|
||||
tr( "LFO-speed" ), eng(), 20000.0 );
|
||||
m_lfoSpeedKnob->setLabel( tr( "SPD" ) );
|
||||
m_lfoSpeedKnob->setRange( 0.01, 1.0, 0.0001 );
|
||||
m_lfoSpeedKnob->setValue( 0.1, TRUE );
|
||||
@@ -318,7 +332,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
|
||||
SLOT( updateAfterKnobChange( float ) ) );
|
||||
|
||||
m_lfoAmountKnob = new knob( knobBright_26, this,
|
||||
tr( "LFO-modulation-amount" ) );
|
||||
tr( "LFO-modulation-amount" ), eng() );
|
||||
m_lfoAmountKnob->setLabel( tr( "AMT" ) );
|
||||
m_lfoAmountKnob->setRange( -1.0, 1.0, 0.005 );
|
||||
m_lfoAmountKnob->setValue( 0.0, TRUE );
|
||||
@@ -468,7 +482,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount,
|
||||
#endif
|
||||
setAcceptDrops( TRUE );
|
||||
|
||||
connect( mixer::inst(), SIGNAL( sampleRateChanged() ), this,
|
||||
connect( eng()->getMixer(), SIGNAL( sampleRateChanged() ), this,
|
||||
SLOT( updateSampleVars() ) );
|
||||
|
||||
updateSampleVars();
|
||||
@@ -482,29 +496,46 @@ envelopeAndLFOWidget::~envelopeAndLFOWidget()
|
||||
delete[] m_pahdEnv;
|
||||
delete[] m_rEnv;
|
||||
delete[] m_lfoShapeData;
|
||||
|
||||
vvector<envelopeAndLFOWidget *> & v = s_EaLWidgets[eng()];
|
||||
if( qFind( v.begin(), v.end(), this ) != v.end() )
|
||||
{
|
||||
v.erase( qFind( v.begin(), v.end(), this ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void envelopeAndLFOWidget::triggerLFO( void )
|
||||
void envelopeAndLFOWidget::triggerLFO( engine * _engine )
|
||||
{
|
||||
s_lfoFrame += mixer::inst()->framesPerAudioBuffer();
|
||||
vvector<envelopeAndLFOWidget *> & v = s_EaLWidgets[_engine];
|
||||
for( vvector<envelopeAndLFOWidget *>::iterator it = v.begin();
|
||||
it != v.end(); ++it )
|
||||
{
|
||||
( *it )->m_lfoFrame +=
|
||||
_engine->getMixer()->framesPerAudioBuffer();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void envelopeAndLFOWidget::resetLFO( void )
|
||||
void envelopeAndLFOWidget::resetLFO( engine * _engine )
|
||||
{
|
||||
s_lfoFrame = 0;
|
||||
vvector<envelopeAndLFOWidget *> & v = s_EaLWidgets[_engine];
|
||||
for( vvector<envelopeAndLFOWidget *>::iterator it = v.begin();
|
||||
it != v.end(); ++it )
|
||||
{
|
||||
( *it )->m_lfoFrame = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
inline float FASTCALL envelopeAndLFOWidget::lfoLevel( Uint32 _frame,
|
||||
Uint32 _frame_offset ) const
|
||||
inline float FASTCALL envelopeAndLFOWidget::lfoLevel( f_cnt_t _frame,
|
||||
const f_cnt_t _frame_offset ) const
|
||||
{
|
||||
if( m_lfoAmountIsZero == FALSE && _frame > m_lfoPredelayFrames )
|
||||
{
|
||||
@@ -514,10 +545,10 @@ inline float FASTCALL envelopeAndLFOWidget::lfoLevel( Uint32 _frame,
|
||||
_frame -= m_lfoPredelayFrames;
|
||||
if( _frame > m_lfoAttackFrames )
|
||||
{
|
||||
return( m_lfoShapeData[( s_lfoFrame + _frame_offset ) %
|
||||
return( m_lfoShapeData[( m_lfoFrame + _frame_offset ) %
|
||||
m_lfoOscillationFrames] );
|
||||
}
|
||||
return( m_lfoShapeData[( s_lfoFrame + _frame_offset ) %
|
||||
return( m_lfoShapeData[( m_lfoFrame + _frame_offset ) %
|
||||
m_lfoOscillationFrames] *
|
||||
_frame / m_lfoAttackFrames );
|
||||
}
|
||||
@@ -527,9 +558,9 @@ inline float FASTCALL envelopeAndLFOWidget::lfoLevel( Uint32 _frame,
|
||||
|
||||
|
||||
|
||||
float FASTCALL envelopeAndLFOWidget::level( Uint32 _frame,
|
||||
Uint32 _release_begin,
|
||||
Uint32 _frame_offset ) const
|
||||
float FASTCALL envelopeAndLFOWidget::level( f_cnt_t _frame,
|
||||
const f_cnt_t _release_begin,
|
||||
const f_cnt_t _frame_offset ) const
|
||||
{
|
||||
if( m_busy )
|
||||
{
|
||||
@@ -825,7 +856,7 @@ void envelopeAndLFOWidget::paintEvent( QPaintEvent * )
|
||||
int graph_y_base = LFO_GRAPH_Y + 3 + LFO_GRAPH_H / 2;
|
||||
|
||||
const float frames_for_graph = SECS_PER_LFO_OSCILLATION *
|
||||
mixer::inst()->sampleRate() / 10;
|
||||
eng()->getMixer()->sampleRate() / 10;
|
||||
|
||||
const float lfo_gray_amount = 1.0f - fabsf( m_lfoAmountKnob->value() );
|
||||
p.setPen( QPen( QColor( static_cast<int>( 96 * lfo_gray_amount ),
|
||||
@@ -851,7 +882,7 @@ void envelopeAndLFOWidget::paintEvent( QPaintEvent * )
|
||||
{
|
||||
float val = 0.0;
|
||||
float cur_sample = x * frames_for_graph / LFO_GRAPH_W;
|
||||
if( static_cast<Uint32>( cur_sample ) > m_lfoPredelayFrames )
|
||||
if( static_cast<f_cnt_t>( cur_sample ) > m_lfoPredelayFrames )
|
||||
{
|
||||
float phase = ( cur_sample -= m_lfoPredelayFrames ) /
|
||||
osc_frames;
|
||||
@@ -875,7 +906,8 @@ void envelopeAndLFOWidget::paintEvent( QPaintEvent * )
|
||||
m_userWave.data(),
|
||||
m_userWave.frames() );
|
||||
}
|
||||
if( (Uint32) cur_sample <= m_lfoAttackFrames )
|
||||
if( static_cast<f_cnt_t>( cur_sample ) <=
|
||||
m_lfoAttackFrames )
|
||||
{
|
||||
val *= cur_sample / m_lfoAttackFrames;
|
||||
}
|
||||
@@ -918,18 +950,21 @@ void envelopeAndLFOWidget::updateSampleVars( void )
|
||||
m_busy = TRUE;
|
||||
|
||||
const float frames_per_env_seg = SECS_PER_ENV_SEGMENT *
|
||||
mixer::inst()->sampleRate();
|
||||
Uint32 predelay_frames = static_cast<Uint32>(
|
||||
eng()->getMixer()->sampleRate();
|
||||
const f_cnt_t predelay_frames = static_cast<f_cnt_t>(
|
||||
frames_per_env_seg *
|
||||
expKnobVal( m_predelayKnob->value() ) );
|
||||
|
||||
Uint32 attack_frames = static_cast<Uint32>( frames_per_env_seg *
|
||||
const f_cnt_t attack_frames = static_cast<f_cnt_t>(
|
||||
frames_per_env_seg *
|
||||
expKnobVal( m_attackKnob->value() ) );
|
||||
|
||||
Uint32 hold_frames = static_cast<Uint32>( frames_per_env_seg *
|
||||
const f_cnt_t hold_frames = static_cast<f_cnt_t>(
|
||||
frames_per_env_seg *
|
||||
expKnobVal( m_holdKnob->value() ) );
|
||||
|
||||
Uint32 decay_frames = static_cast<Uint32>( frames_per_env_seg *
|
||||
const f_cnt_t decay_frames = static_cast<f_cnt_t>(
|
||||
frames_per_env_seg *
|
||||
expKnobVal( m_decayKnob->value() *
|
||||
m_sustainKnob->value() ) );
|
||||
|
||||
@@ -947,7 +982,7 @@ void envelopeAndLFOWidget::updateSampleVars( void )
|
||||
|
||||
m_pahdFrames = predelay_frames + attack_frames + hold_frames +
|
||||
decay_frames;
|
||||
m_rFrames = static_cast<Uint32>( frames_per_env_seg *
|
||||
m_rFrames = static_cast<f_cnt_t>( frames_per_env_seg *
|
||||
expKnobVal( m_releaseKnob->value() ) );
|
||||
|
||||
if( static_cast<int>( floorf( m_amount * 1000.0f ) ) == 0 )
|
||||
@@ -956,30 +991,30 @@ void envelopeAndLFOWidget::updateSampleVars( void )
|
||||
m_rFrames = 0;
|
||||
}
|
||||
|
||||
float * new_pahd_env = new float[m_pahdFrames];
|
||||
float * new_r_env = new float[m_rFrames];
|
||||
sample_t * new_pahd_env = new sample_t[m_pahdFrames];
|
||||
sample_t * new_r_env = new sample_t[m_rFrames];
|
||||
|
||||
for( Uint32 i = 0; i < predelay_frames; ++i )
|
||||
for( f_cnt_t i = 0; i < predelay_frames; ++i )
|
||||
{
|
||||
new_pahd_env[i] = m_amountAdd;
|
||||
}
|
||||
|
||||
Uint32 add = predelay_frames;
|
||||
f_cnt_t add = predelay_frames;
|
||||
|
||||
for( Uint32 i = 0; i < attack_frames; ++i )
|
||||
for( f_cnt_t i = 0; i < attack_frames; ++i )
|
||||
{
|
||||
new_pahd_env[add+i] = ( (float)i / attack_frames ) *
|
||||
m_amount + m_amountAdd;
|
||||
}
|
||||
|
||||
add += attack_frames;
|
||||
for( Uint32 i = 0; i < hold_frames; ++i )
|
||||
for( f_cnt_t i = 0; i < hold_frames; ++i )
|
||||
{
|
||||
new_pahd_env[add+i] = m_amount + m_amountAdd;
|
||||
}
|
||||
|
||||
add += hold_frames;
|
||||
for( Uint32 i = 0; i < decay_frames; ++i )
|
||||
for( f_cnt_t i = 0; i < decay_frames; ++i )
|
||||
{
|
||||
new_pahd_env[add+i] = ( m_sustainLevel + ( 1.0f -
|
||||
(float)i / decay_frames ) *
|
||||
@@ -993,7 +1028,7 @@ void envelopeAndLFOWidget::updateSampleVars( void )
|
||||
m_pahdEnv = new_pahd_env;
|
||||
m_rEnv = new_r_env;
|
||||
|
||||
for( Uint32 i = 0; i < m_rFrames; ++i )
|
||||
for( f_cnt_t i = 0; i < m_rFrames; ++i )
|
||||
{
|
||||
new_r_env[i] = ( (float)( m_rFrames - i ) / m_rFrames *
|
||||
m_sustainLevel ) * m_amount;
|
||||
@@ -1005,14 +1040,14 @@ void envelopeAndLFOWidget::updateSampleVars( void )
|
||||
|
||||
const float frames_per_lfo_oscillation =
|
||||
SECS_PER_LFO_OSCILLATION *
|
||||
mixer::inst()->sampleRate();
|
||||
m_lfoPredelayFrames = static_cast<Uint32>(
|
||||
eng()->getMixer()->sampleRate();
|
||||
m_lfoPredelayFrames = static_cast<f_cnt_t>(
|
||||
frames_per_lfo_oscillation *
|
||||
expKnobVal( m_lfoPredelayKnob->value() ) );
|
||||
m_lfoAttackFrames = static_cast<Uint32>(
|
||||
m_lfoAttackFrames = static_cast<f_cnt_t>(
|
||||
frames_per_lfo_oscillation *
|
||||
expKnobVal( m_lfoAttackKnob->value() ) );
|
||||
m_lfoOscillationFrames = static_cast<Uint32>(
|
||||
m_lfoOscillationFrames = static_cast<f_cnt_t>(
|
||||
frames_per_lfo_oscillation *
|
||||
m_lfoSpeedKnob->value() );
|
||||
if( m_x100Cb->isChecked() )
|
||||
@@ -1039,8 +1074,8 @@ void envelopeAndLFOWidget::updateSampleVars( void )
|
||||
if( m_lfoAmountIsZero == FALSE )
|
||||
{
|
||||
delete[] m_lfoShapeData;
|
||||
m_lfoShapeData = new float[m_lfoOscillationFrames];
|
||||
for( Uint32 frame = 0; frame < m_lfoOscillationFrames;
|
||||
m_lfoShapeData = new sample_t[m_lfoOscillationFrames];
|
||||
for( f_cnt_t frame = 0; frame < m_lfoOscillationFrames;
|
||||
++frame )
|
||||
{
|
||||
const float phase = frame / static_cast<float>(
|
||||
@@ -1088,7 +1123,7 @@ void envelopeAndLFOWidget::updateSampleVars( void )
|
||||
|
||||
void envelopeAndLFOWidget::x100Toggled( bool )
|
||||
{
|
||||
songEditor::inst()->setModified();
|
||||
eng()->getSongEditor()->setModified();
|
||||
updateSampleVars();
|
||||
}
|
||||
|
||||
@@ -1109,7 +1144,7 @@ void envelopeAndLFOWidget::lfoSinWaveCh( bool _on )
|
||||
{
|
||||
m_lfoShape = SIN;
|
||||
}
|
||||
songEditor::inst()->setModified();
|
||||
eng()->getSongEditor()->setModified();
|
||||
|
||||
update();
|
||||
}
|
||||
@@ -1123,7 +1158,7 @@ void envelopeAndLFOWidget::lfoTriangleWaveCh( bool _on )
|
||||
{
|
||||
m_lfoShape = TRIANGLE;
|
||||
}
|
||||
songEditor::inst()->setModified();
|
||||
eng()->getSongEditor()->setModified();
|
||||
|
||||
update();
|
||||
}
|
||||
@@ -1137,7 +1172,7 @@ void envelopeAndLFOWidget::lfoSawWaveCh( bool _on )
|
||||
{
|
||||
m_lfoShape = SAW;
|
||||
}
|
||||
songEditor::inst()->setModified();
|
||||
eng()->getSongEditor()->setModified();
|
||||
|
||||
update();
|
||||
}
|
||||
@@ -1151,7 +1186,7 @@ void envelopeAndLFOWidget::lfoSquareWaveCh( bool _on )
|
||||
{
|
||||
m_lfoShape = SQUARE;
|
||||
}
|
||||
songEditor::inst()->setModified();
|
||||
eng()->getSongEditor()->setModified();
|
||||
|
||||
update();
|
||||
}
|
||||
@@ -1172,7 +1207,7 @@ void envelopeAndLFOWidget::lfoUserWaveCh( bool _on )
|
||||
}
|
||||
m_lfoShape = USER;
|
||||
}
|
||||
songEditor::inst()->setModified();
|
||||
eng()->getSongEditor()->setModified();
|
||||
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -83,7 +83,8 @@ static const QString targetNames[envelopeTabWidget::TARGET_COUNT][2] =
|
||||
|
||||
envelopeTabWidget::envelopeTabWidget( channelTrack * _channel_track ) :
|
||||
QWidget( _channel_track->tabWidgetParent() ),
|
||||
settings()
|
||||
settings(),
|
||||
engineObject( _channel_track->eng() )
|
||||
{
|
||||
|
||||
m_targetsTabWidget = new tabWidget( tr( "TARGET" ), this );
|
||||
@@ -118,7 +119,9 @@ envelopeTabWidget::envelopeTabWidget( channelTrack * _channel_track ) :
|
||||
value_for_zero_amount = 1.0;
|
||||
}
|
||||
m_envLFOWidgets[i] = new envelopeAndLFOWidget(
|
||||
value_for_zero_amount, m_targetsTabWidget );
|
||||
value_for_zero_amount,
|
||||
m_targetsTabWidget,
|
||||
eng() );
|
||||
m_targetsTabWidget->addTab( m_envLFOWidgets[i],
|
||||
tr( targetNames[i][0]
|
||||
#ifdef QT4
|
||||
@@ -171,7 +174,7 @@ envelopeTabWidget::envelopeTabWidget( channelTrack * _channel_track ) :
|
||||
|
||||
|
||||
m_filterCutKnob = new knob( knobBright_26, m_filterGroupBox, tr(
|
||||
"cutoff-frequency" ) );
|
||||
"cutoff-frequency" ), eng() );
|
||||
m_filterCutKnob->setLabel( tr( "CUTOFF" ) );
|
||||
m_filterCutKnob->setRange( 0.0, 16000.0, 1.0 );
|
||||
m_filterCutKnob->move( 140, 18 );
|
||||
@@ -191,7 +194,7 @@ envelopeTabWidget::envelopeTabWidget( channelTrack * _channel_track ) :
|
||||
"frequencies below cutoff-frequency and so on..." ) );
|
||||
|
||||
m_filterResKnob = new knob( knobBright_26, m_filterGroupBox, tr(
|
||||
"Q/Resonance" ) );
|
||||
"Q/Resonance" ), eng() );
|
||||
m_filterResKnob->setLabel( tr( "Q/RESO" ) );
|
||||
m_filterResKnob->setRange( 0.01, 10.0, 0.01 );
|
||||
m_filterResKnob->move( 190, 18 );
|
||||
@@ -220,14 +223,14 @@ envelopeTabWidget::~envelopeTabWidget()
|
||||
|
||||
|
||||
float FASTCALL envelopeTabWidget::volumeLevel( notePlayHandle * _n,
|
||||
Uint32 _frame )
|
||||
const f_cnt_t _frame )
|
||||
{
|
||||
Uint32 release_begin = _frame - _n->releaseFramesDone() +
|
||||
f_cnt_t release_begin = _frame - _n->releaseFramesDone() +
|
||||
_n->framesBeforeRelease();
|
||||
|
||||
if( _n->released() == FALSE )
|
||||
{
|
||||
release_begin += mixer::inst()->framesPerAudioBuffer();
|
||||
release_begin += eng()->getMixer()->framesPerAudioBuffer();
|
||||
}
|
||||
|
||||
return( m_envLFOWidgets[VOLUME]->level( _frame, release_begin, 0 ) );
|
||||
@@ -236,16 +239,17 @@ float FASTCALL envelopeTabWidget::volumeLevel( notePlayHandle * _n,
|
||||
|
||||
|
||||
|
||||
void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab, Uint32 _frames,
|
||||
void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab,
|
||||
const fpab_t _frames,
|
||||
notePlayHandle * _n )
|
||||
{
|
||||
Uint32 total_frames = _n->totalFramesPlayed();
|
||||
Uint32 release_begin = total_frames - _n->releaseFramesDone() +
|
||||
f_cnt_t total_frames = _n->totalFramesPlayed();
|
||||
f_cnt_t release_begin = total_frames - _n->releaseFramesDone() +
|
||||
_n->framesBeforeRelease();
|
||||
|
||||
if( _n->released() == FALSE )
|
||||
{
|
||||
release_begin += mixer::inst()->framesPerAudioBuffer();
|
||||
release_begin += eng()->getMixer()->framesPerAudioBuffer();
|
||||
}
|
||||
|
||||
// because of optimizations, there's special code for several cases:
|
||||
@@ -265,7 +269,7 @@ void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab, Uint32 _frames,
|
||||
if( _n->m_filter == NULL )
|
||||
{
|
||||
_n->m_filter = new basicFilters<>(
|
||||
mixer::inst()->sampleRate() );
|
||||
eng()->getMixer()->sampleRate() );
|
||||
}
|
||||
|
||||
if( m_filterGroupBox->isActive() )
|
||||
@@ -281,7 +285,7 @@ void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab, Uint32 _frames,
|
||||
m_envLFOWidgets[CUT]->used() &&
|
||||
m_envLFOWidgets[RES]->used() )
|
||||
{
|
||||
for( Uint32 frame = 0; frame < _frames;
|
||||
for( fpab_t frame = 0; frame < _frames;
|
||||
++frame, ++total_frames )
|
||||
{
|
||||
float new_cut_val = m_envLFOWidgets[CUT]->level( total_frames, release_begin, frame );
|
||||
@@ -302,7 +306,7 @@ void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab, Uint32 _frames,
|
||||
float vol_level = m_envLFOWidgets[VOLUME]->level( total_frames, release_begin, frame );
|
||||
vol_level = vol_level*vol_level;
|
||||
|
||||
for( Uint8 chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
for( ch_cnt_t chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
{
|
||||
_ab[frame][chnl] = vol_level * _n->m_filter->update( _ab[frame][chnl], chnl );
|
||||
}
|
||||
@@ -310,7 +314,7 @@ void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab, Uint32 _frames,
|
||||
}
|
||||
else if( m_envLFOWidgets[VOLUME]->used() && m_envLFOWidgets[CUT]->used() )
|
||||
{
|
||||
for( Uint32 frame = 0; frame < _frames; ++frame, ++total_frames )
|
||||
for( fpab_t frame = 0; frame < _frames; ++frame, ++total_frames )
|
||||
{
|
||||
float new_cut_val = m_envLFOWidgets[CUT]->level( total_frames, release_begin, frame );
|
||||
new_cut_val = envelopeAndLFOWidget::expKnobVal( new_cut_val ) * CUT_FREQ_MULTIPLIER +
|
||||
@@ -325,7 +329,7 @@ void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab, Uint32 _frames,
|
||||
float vol_level = m_envLFOWidgets[VOLUME]->level( total_frames, release_begin, frame );
|
||||
vol_level = vol_level*vol_level;
|
||||
|
||||
for( Uint8 chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
for( ch_cnt_t chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
{
|
||||
_ab[frame][chnl] = vol_level * _n->m_filter->update( _ab[frame][chnl], chnl );
|
||||
}
|
||||
@@ -334,7 +338,7 @@ void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab, Uint32 _frames,
|
||||
else if( m_envLFOWidgets[VOLUME]->used() && m_envLFOWidgets[RES]->used() )
|
||||
{
|
||||
|
||||
for( Uint32 frame = 0; frame < _frames; ++frame, ++total_frames )
|
||||
for( fpab_t frame = 0; frame < _frames; ++frame, ++total_frames )
|
||||
{
|
||||
float new_res_val = m_filterResKnob->value() + RES_MULTIPLIER *
|
||||
m_envLFOWidgets[RES]->level( total_frames, release_begin, frame );
|
||||
@@ -348,7 +352,7 @@ void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab, Uint32 _frames,
|
||||
float vol_level = m_envLFOWidgets[VOLUME]->level( total_frames, release_begin, frame );
|
||||
vol_level = vol_level*vol_level;
|
||||
|
||||
for( Uint8 chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
for( ch_cnt_t chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
{
|
||||
_ab[frame][chnl] = vol_level * _n->m_filter->update( _ab[frame][chnl], chnl );
|
||||
}
|
||||
@@ -357,7 +361,7 @@ void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab, Uint32 _frames,
|
||||
}
|
||||
else if( m_envLFOWidgets[CUT]->used() )
|
||||
{
|
||||
for( Uint32 frame = 0; frame < _frames; ++frame, ++total_frames )
|
||||
for( fpab_t frame = 0; frame < _frames; ++frame, ++total_frames )
|
||||
{
|
||||
float new_cut_val = m_envLFOWidgets[CUT]->level( total_frames, release_begin, frame );
|
||||
new_cut_val = envelopeAndLFOWidget::expKnobVal( new_cut_val ) * CUT_FREQ_MULTIPLIER +
|
||||
@@ -369,7 +373,7 @@ void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab, Uint32 _frames,
|
||||
old_filter_cut = static_cast<int>( new_cut_val );
|
||||
}
|
||||
|
||||
for( Uint8 chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
for( ch_cnt_t chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
{
|
||||
_ab[frame][chnl] = _n->m_filter->update( _ab[frame][chnl], chnl );
|
||||
}
|
||||
@@ -377,7 +381,7 @@ void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab, Uint32 _frames,
|
||||
}
|
||||
else if( m_envLFOWidgets[RES]->used() )
|
||||
{
|
||||
for( Uint32 frame = 0; frame < _frames; ++frame, ++total_frames )
|
||||
for( fpab_t frame = 0; frame < _frames; ++frame, ++total_frames )
|
||||
{
|
||||
float new_res_val = m_filterResKnob->value() + RES_MULTIPLIER *
|
||||
m_envLFOWidgets[RES]->level( total_frames, release_begin, frame );
|
||||
@@ -388,7 +392,7 @@ void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab, Uint32 _frames,
|
||||
old_filter_res = static_cast<int>( new_res_val*RES_PRECISION );
|
||||
}
|
||||
|
||||
for( Uint8 chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
for( ch_cnt_t chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
{
|
||||
_ab[frame][chnl] = _n->m_filter->update( _ab[frame][chnl], chnl );
|
||||
}
|
||||
@@ -398,12 +402,12 @@ void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab, Uint32 _frames,
|
||||
{
|
||||
_n->m_filter->calcFilterCoeffs( filter, m_filterCutKnob->value(), m_filterResKnob->value() );
|
||||
|
||||
for( Uint32 frame = 0; frame < _frames; ++frame, ++total_frames )
|
||||
for( fpab_t frame = 0; frame < _frames; ++frame, ++total_frames )
|
||||
{
|
||||
float vol_level = m_envLFOWidgets[VOLUME]->level( total_frames, release_begin, frame );
|
||||
vol_level = vol_level*vol_level;
|
||||
|
||||
for( Uint8 chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
for( ch_cnt_t chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
{
|
||||
_ab[frame][chnl] = vol_level * _n->m_filter->update( _ab[frame][chnl], chnl );
|
||||
}
|
||||
@@ -413,9 +417,9 @@ void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab, Uint32 _frames,
|
||||
{
|
||||
_n->m_filter->calcFilterCoeffs( filter, m_filterCutKnob->value(), m_filterResKnob->value() );
|
||||
|
||||
for( Uint32 frame = 0; frame < _frames; ++frame, ++total_frames )
|
||||
for( fpab_t frame = 0; frame < _frames; ++frame, ++total_frames )
|
||||
{
|
||||
for( Uint8 chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
for( ch_cnt_t chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
{
|
||||
_ab[frame][chnl] = _n->m_filter->update( _ab[frame][chnl], chnl );
|
||||
}
|
||||
@@ -425,11 +429,11 @@ void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab, Uint32 _frames,
|
||||
else if( m_envLFOWidgets[VOLUME]->used() /*&& m_envLFOWidgets[PANNING]->used() == FALSE*/ )
|
||||
{
|
||||
// only use volume-envelope...
|
||||
for( Uint32 frame = 0; frame < _frames; ++frame, ++total_frames )
|
||||
for( fpab_t frame = 0; frame < _frames; ++frame, ++total_frames )
|
||||
{
|
||||
float vol_level = m_envLFOWidgets[VOLUME]->level( total_frames, release_begin, frame );
|
||||
vol_level = vol_level*vol_level;
|
||||
for( Uint8 chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
for( ch_cnt_t chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
{
|
||||
_ab[frame][chnl] = vol_level * _ab[frame][chnl];
|
||||
}
|
||||
@@ -438,11 +442,11 @@ void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab, Uint32 _frames,
|
||||
/* else if( m_envLFOWidgets[VOLUME]->used() == FALSE && m_envLFOWidgets[PANNING]->used() )
|
||||
{
|
||||
// only use panning-envelope...
|
||||
for( Uint32 frame = 0; frame < _frames; ++frame, ++total_frames )
|
||||
for( fpab_t frame = 0; frame < _frames; ++frame, ++total_frames )
|
||||
{
|
||||
float vol_level = m_envLFOWidgets[PANNING]->level( total_frames, release_begin, frame );
|
||||
vol_level = vol_level*vol_level;
|
||||
for( Uint8 chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
for( ch_cnt_t chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
{
|
||||
_ab[frame][chnl] = vol_level * _ab[frame][chnl];
|
||||
}
|
||||
@@ -453,9 +457,9 @@ void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab, Uint32 _frames,
|
||||
|
||||
|
||||
|
||||
Uint32 envelopeTabWidget::envFrames( void )
|
||||
f_cnt_t envelopeTabWidget::envFrames( void )
|
||||
{
|
||||
Uint32 ret_val = m_envLFOWidgets[VOLUME]->m_pahdFrames;
|
||||
f_cnt_t ret_val = m_envLFOWidgets[VOLUME]->m_pahdFrames;
|
||||
|
||||
for( int i = VOLUME+1; i < TARGET_COUNT; ++i )
|
||||
{
|
||||
@@ -471,9 +475,9 @@ Uint32 envelopeTabWidget::envFrames( void )
|
||||
|
||||
|
||||
|
||||
Uint32 envelopeTabWidget::releaseFrames( void )
|
||||
f_cnt_t envelopeTabWidget::releaseFrames( void )
|
||||
{
|
||||
Uint32 ret_val = m_envLFOWidgets[VOLUME]->m_rFrames;
|
||||
f_cnt_t ret_val = m_envLFOWidgets[VOLUME]->m_rFrames;
|
||||
for( int i = VOLUME+1; i < TARGET_COUNT; ++i )
|
||||
{
|
||||
if( m_envLFOWidgets[i]->used() &&
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
|
||||
#include "export_project_dialog.h"
|
||||
#include "song_editor.h"
|
||||
#include "lmms_main_win.h"
|
||||
#include "main_window.h"
|
||||
#include "combobox.h"
|
||||
#include "led_checkbox.h"
|
||||
#include "embed.h"
|
||||
@@ -127,8 +127,10 @@ Sint16 exportProjectDialog::s_availableBitrates[] =
|
||||
// TODO: rewrite that crap using layouts!!
|
||||
|
||||
exportProjectDialog::exportProjectDialog( const QString & _file_name,
|
||||
QWidget * _parent ) :
|
||||
QWidget * _parent,
|
||||
engine * _engine ) :
|
||||
QDialog( _parent ),
|
||||
engineObject( _engine ),
|
||||
m_fileName( _file_name ),
|
||||
m_hourglassLbl( NULL ),
|
||||
m_deleteFile( FALSE )
|
||||
@@ -156,7 +158,7 @@ exportProjectDialog::exportProjectDialog( const QString & _file_name,
|
||||
connect( m_typeCombo, SIGNAL( activated( const QString & ) ), this,
|
||||
SLOT( changedType( const QString & ) ) );
|
||||
|
||||
int idx = 0;
|
||||
Uint8 idx = 0;
|
||||
while( fileEncodeDevices[idx].m_fileType != NULL_FILE )
|
||||
{
|
||||
m_typeCombo->addItem(
|
||||
@@ -253,7 +255,7 @@ void exportProjectDialog::keyPressEvent( QKeyEvent * _ke )
|
||||
{
|
||||
if( _ke->key() == Qt::Key_Escape )
|
||||
{
|
||||
if( songEditor::inst()->exporting() == FALSE )
|
||||
if( eng()->getSongEditor()->exporting() == FALSE )
|
||||
{
|
||||
accept();
|
||||
}
|
||||
@@ -269,7 +271,7 @@ void exportProjectDialog::keyPressEvent( QKeyEvent * _ke )
|
||||
|
||||
void exportProjectDialog::closeEvent( QCloseEvent * _ce )
|
||||
{
|
||||
if( songEditor::inst()->exporting() == TRUE )
|
||||
if( eng()->getSongEditor()->exporting() == TRUE )
|
||||
{
|
||||
abortProjectExport();
|
||||
_ce->ignore();
|
||||
@@ -326,8 +328,8 @@ void exportProjectDialog::exportBtnClicked( void )
|
||||
m_vbrCb->isChecked(),
|
||||
m_kbpsCombo->currentText().toInt(),
|
||||
m_kbpsCombo->currentText().toInt() - 64,
|
||||
m_kbpsCombo->currentText().toInt() + 64
|
||||
);
|
||||
m_kbpsCombo->currentText().toInt() + 64,
|
||||
eng()->getMixer() );
|
||||
if( success_ful == FALSE )
|
||||
{
|
||||
QMessageBox::information( this,
|
||||
@@ -373,26 +375,26 @@ void exportProjectDialog::exportBtnClicked( void )
|
||||
|
||||
|
||||
|
||||
mixer::inst()->setAudioDevice( dev, m_hqmCb->isChecked() );
|
||||
songEditor::inst()->startExport();
|
||||
eng()->getMixer()->setAudioDevice( dev, m_hqmCb->isChecked() );
|
||||
eng()->getSongEditor()->startExport();
|
||||
|
||||
|
||||
songEditor::playPos & pp = songEditor::inst()->getPlayPos(
|
||||
songEditor::playPos & pp = eng()->getSongEditor()->getPlayPos(
|
||||
songEditor::PLAY_SONG );
|
||||
|
||||
while( songEditor::inst()->exportDone() == FALSE &&
|
||||
songEditor::inst()->exporting() == TRUE )
|
||||
while( eng()->getSongEditor()->exportDone() == FALSE &&
|
||||
eng()->getSongEditor()->exporting() == TRUE )
|
||||
{
|
||||
dev->processNextBuffer();
|
||||
int pval = pp * 100 /
|
||||
( ( songEditor::inst()->lengthInTacts() + 1 ) * 64 );
|
||||
( ( eng()->getSongEditor()->lengthInTacts() + 1 ) * 64 );
|
||||
#ifdef QT4
|
||||
m_exportProgressBar->setValue( pval );
|
||||
#else
|
||||
m_exportProgressBar->setProgress( pval );
|
||||
#endif
|
||||
// update lmms-main-win-caption
|
||||
lmmsMainWin::inst()->setWindowTitle( tr( "Rendering:" ) + " " +
|
||||
eng()->getMainWindow()->setWindowTitle( tr( "Rendering:" ) + " " +
|
||||
QString::number( pval ) + "%" );
|
||||
// process paint-events etc.
|
||||
qApp->processEvents();
|
||||
@@ -413,7 +415,7 @@ void exportProjectDialog::exportBtnClicked( void )
|
||||
void exportProjectDialog::cancelBtnClicked( void )
|
||||
{
|
||||
// is song-export-thread active?
|
||||
if( songEditor::inst()->exporting() == TRUE )
|
||||
if( eng()->getSongEditor()->exporting() == TRUE )
|
||||
{
|
||||
// then dispose abort of export
|
||||
abortProjectExport();
|
||||
@@ -438,7 +440,7 @@ void exportProjectDialog::abortProjectExport( void )
|
||||
|
||||
void exportProjectDialog::finishProjectExport( void )
|
||||
{
|
||||
mixer::inst()->restoreAudioDevice();
|
||||
eng()->getMixer()->restoreAudioDevice();
|
||||
|
||||
// if the user aborted export-process, the file has to be deleted
|
||||
if( m_deleteFile )
|
||||
@@ -447,9 +449,9 @@ void exportProjectDialog::finishProjectExport( void )
|
||||
}
|
||||
|
||||
// restore window-title
|
||||
lmmsMainWin::inst()->resetWindowTitle();
|
||||
eng()->getMainWindow()->resetWindowTitle();
|
||||
|
||||
songEditor::inst()->stopExport();
|
||||
eng()->getSongEditor()->stopExport();
|
||||
|
||||
// if we rendered file from command line, quit after export
|
||||
if( file_to_render != "" )
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* file_browser.cpp - implementation of the project-, preset- and
|
||||
* sample-file-browser
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -32,12 +32,15 @@
|
||||
#include <QKeyEvent>
|
||||
#include <QMenu>
|
||||
#include <Q3Header>
|
||||
#include <QCursor>
|
||||
|
||||
#else
|
||||
|
||||
#include <qpushbutton.h>
|
||||
#include <qpopupmenu.h>
|
||||
#include <qheader.h>
|
||||
#include <qcursor.h>
|
||||
#include <qworkspace.h>
|
||||
|
||||
#endif
|
||||
|
||||
@@ -55,19 +58,21 @@
|
||||
#include "instrument.h"
|
||||
#include "text_float.h"
|
||||
#include "string_pair_drag.h"
|
||||
#include "main_window.h"
|
||||
|
||||
|
||||
|
||||
fileBrowser::fileBrowser( const QString & _path, const QString & _filter,
|
||||
const QString & _title, const QPixmap & _pm,
|
||||
QWidget * _parent ) :
|
||||
QWidget * _parent, engine * _engine ) :
|
||||
sideBarWidget( _title, _pm, _parent ),
|
||||
engineObject( _engine ),
|
||||
m_contextMenuItem( NULL ),
|
||||
m_path( _path ),
|
||||
m_filter( _filter )
|
||||
{
|
||||
setWindowTitle( tr( "Browser" ) );
|
||||
m_l = new listView( contentParent() );
|
||||
m_l = new listView( contentParent(), eng() );
|
||||
addContentWidget( m_l );
|
||||
|
||||
#ifdef QT4
|
||||
@@ -190,10 +195,11 @@ void fileBrowser::contextMenuRequest( QListViewItem * i, const QPoint &, int )
|
||||
|
||||
void fileBrowser::sendToActiveChannel( void )
|
||||
{
|
||||
if( lmmsMainWin::inst()->workspace() != NULL )
|
||||
if( eng()->getMainWindow()->workspace() != NULL )
|
||||
{
|
||||
// get all windows opened in the workspace
|
||||
QWidgetList pl = lmmsMainWin::inst()->workspace()->windowList(
|
||||
QWidgetList pl =
|
||||
eng()->getMainWindow()->workspace()->windowList(
|
||||
#if QT_VERSION >= 0x030200
|
||||
QWorkspace::StackingOrder
|
||||
#endif
|
||||
@@ -290,7 +296,7 @@ void fileBrowser::openInNewChannel( trackContainer * _tc )
|
||||
|
||||
void fileBrowser::openInNewChannelSE( void )
|
||||
{
|
||||
openInNewChannel( songEditor::inst() );
|
||||
openInNewChannel( eng()->getSongEditor() );
|
||||
}
|
||||
|
||||
|
||||
@@ -298,7 +304,7 @@ void fileBrowser::openInNewChannelSE( void )
|
||||
|
||||
void fileBrowser::openInNewChannelBBE( void )
|
||||
{
|
||||
openInNewChannel( bbEditor::inst() );
|
||||
openInNewChannel( eng()->getBBEditor() );
|
||||
}
|
||||
|
||||
|
||||
@@ -308,8 +314,9 @@ void fileBrowser::openInNewChannelBBE( void )
|
||||
|
||||
|
||||
|
||||
listView::listView( QWidget * _parent ) :
|
||||
listView::listView( QWidget * _parent, engine * _engine ) :
|
||||
Q3ListView( _parent ),
|
||||
engineObject( _engine ),
|
||||
m_mousePressed( FALSE ),
|
||||
m_pressPos(),
|
||||
m_previewPlayHandle( NULL )
|
||||
@@ -344,9 +351,8 @@ void listView::contentsMouseDoubleClickEvent( QMouseEvent * _me )
|
||||
// samples are per default opened in bb-editor because
|
||||
// they're likely drum-samples etc.
|
||||
channelTrack * ct = dynamic_cast<channelTrack *>(
|
||||
track::create(
|
||||
track::CHANNEL_TRACK,
|
||||
bbEditor::inst() ) );
|
||||
track::create( track::CHANNEL_TRACK,
|
||||
eng()->getBBEditor() ) );
|
||||
#ifdef LMMS_DEBUG
|
||||
assert( ct != NULL );
|
||||
#endif
|
||||
@@ -364,7 +370,7 @@ void listView::contentsMouseDoubleClickEvent( QMouseEvent * _me )
|
||||
// presets are per default opened in bb-editor
|
||||
multimediaProject mmp( f->fullName() );
|
||||
track * t = track::create( track::CHANNEL_TRACK,
|
||||
bbEditor::inst() );
|
||||
eng()->getBBEditor() );
|
||||
channelTrack * ct = dynamic_cast<channelTrack *>( t );
|
||||
if( ct != NULL )
|
||||
{
|
||||
@@ -376,9 +382,9 @@ void listView::contentsMouseDoubleClickEvent( QMouseEvent * _me )
|
||||
}
|
||||
else if( f->type() == fileItem::PROJECT_FILE )
|
||||
{
|
||||
if( songEditor::inst()->mayChangeProject() == TRUE )
|
||||
if( eng()->getSongEditor()->mayChangeProject() == TRUE )
|
||||
{
|
||||
songEditor::inst()->loadProject(
|
||||
eng()->getSongEditor()->loadProject(
|
||||
f->fullName() );
|
||||
}
|
||||
}
|
||||
@@ -414,7 +420,7 @@ void listView::contentsMousePressEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( m_previewPlayHandle != NULL )
|
||||
{
|
||||
mixer::inst()->removePlayHandle( m_previewPlayHandle );
|
||||
eng()->getMixer()->removePlayHandle( m_previewPlayHandle );
|
||||
m_previewPlayHandle = NULL;
|
||||
}
|
||||
if( f->type() == fileItem::SAMPLE_FILE )
|
||||
@@ -431,7 +437,7 @@ void listView::contentsMousePressEvent( QMouseEvent * _me )
|
||||
qApp->processEvents();
|
||||
#endif
|
||||
samplePlayHandle * s = new samplePlayHandle(
|
||||
f->fullName() );
|
||||
f->fullName(), eng() );
|
||||
s->setDoneMayReturnTrue( FALSE );
|
||||
m_previewPlayHandle = s;
|
||||
delete tf;
|
||||
@@ -439,11 +445,11 @@ void listView::contentsMousePressEvent( QMouseEvent * _me )
|
||||
else if( f->type() == fileItem::PRESET_FILE )
|
||||
{
|
||||
m_previewPlayHandle = new presetPreviewPlayHandle(
|
||||
f->fullName() );
|
||||
f->fullName(), eng() );
|
||||
}
|
||||
if( m_previewPlayHandle != NULL )
|
||||
{
|
||||
mixer::inst()->addPlayHandle( m_previewPlayHandle );
|
||||
eng()->getMixer()->addPlayHandle( m_previewPlayHandle );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -469,7 +475,7 @@ void listView::contentsMouseMoveEvent( QMouseEvent * _me )
|
||||
f->fullName(),
|
||||
embed::getIconPixmap(
|
||||
"preset_file" ),
|
||||
this );
|
||||
this, eng() );
|
||||
break;
|
||||
|
||||
case fileItem::SAMPLE_FILE:
|
||||
@@ -477,7 +483,7 @@ void listView::contentsMouseMoveEvent( QMouseEvent * _me )
|
||||
f->fullName(),
|
||||
embed::getIconPixmap(
|
||||
"sound_file" ),
|
||||
this );
|
||||
this, eng() );
|
||||
break;
|
||||
|
||||
case fileItem::MIDI_FILE:
|
||||
@@ -485,7 +491,7 @@ void listView::contentsMouseMoveEvent( QMouseEvent * _me )
|
||||
f->fullName(),
|
||||
embed::getIconPixmap(
|
||||
"midi_file" ),
|
||||
this );
|
||||
this, eng() );
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -511,14 +517,14 @@ void listView::contentsMouseReleaseEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( s->totalFrames() - s->framesDone() <=
|
||||
static_cast<Uint32>(
|
||||
mixer::inst()->sampleRate() * 3 ) )
|
||||
eng()->getMixer()->sampleRate() * 3 ) )
|
||||
{
|
||||
s->setDoneMayReturnTrue( TRUE );
|
||||
m_previewPlayHandle = NULL;
|
||||
return;
|
||||
}
|
||||
}
|
||||
mixer::inst()->removePlayHandle( m_previewPlayHandle );
|
||||
eng()->getMixer()->removePlayHandle( m_previewPlayHandle );
|
||||
m_previewPlayHandle = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* instrument.cpp - base-class for all instrument-plugins (synths, samplers etc)
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -31,7 +31,7 @@
|
||||
instrument::instrument( channelTrack * _channel_track,
|
||||
const descriptor * _descriptor ) :
|
||||
QWidget( _channel_track->tabWidgetParent() ),
|
||||
plugin( _descriptor ),
|
||||
plugin( _descriptor, _channel_track->eng() ),
|
||||
m_channelTrack( _channel_track ),
|
||||
m_valid( TRUE )
|
||||
{
|
||||
@@ -73,7 +73,7 @@ void instrument::deleteNotePluginData( notePlayHandle * )
|
||||
|
||||
|
||||
|
||||
Uint32 instrument::beatLen( notePlayHandle * ) const
|
||||
f_cnt_t instrument::beatLen( notePlayHandle * ) const
|
||||
{
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
#include "lmms_main_win.h"
|
||||
#include "main_window.h"
|
||||
#include "embed.h"
|
||||
#include "config_mgr.h"
|
||||
#include "export_project_dialog.h"
|
||||
@@ -54,19 +54,20 @@
|
||||
#include "gui_templates.h"
|
||||
|
||||
|
||||
QString file_to_render;
|
||||
|
||||
|
||||
#if QT_VERSION >= 0x030100
|
||||
int splash_alignment_flags = Qt::AlignTop | Qt::AlignLeft;
|
||||
#endif
|
||||
|
||||
QString file_to_load;
|
||||
QString file_to_render;
|
||||
|
||||
|
||||
int main( int argc, char * * argv )
|
||||
{
|
||||
QApplication app( argc, argv );
|
||||
|
||||
QString extension = "wav";
|
||||
QString file_to_load;
|
||||
|
||||
for( int i = 1; i < app.argc(); ++i )
|
||||
{
|
||||
@@ -187,10 +188,10 @@ int main( int argc, char * * argv )
|
||||
#if QT_VERSION >= 0x030200
|
||||
// init splash screen
|
||||
QPixmap splash = embed::getIconPixmap( "splash" );
|
||||
lmmsMainWin::s_splashScreen = new QSplashScreen( splash );
|
||||
lmmsMainWin::s_splashScreen->show();
|
||||
mainWindow::s_splashScreen = new QSplashScreen( splash );
|
||||
mainWindow::s_splashScreen->show();
|
||||
|
||||
lmmsMainWin::s_splashScreen->showMessage( lmmsMainWin::tr(
|
||||
mainWindow::s_splashScreen->showMessage( mainWindow::tr(
|
||||
"Setting up main-"
|
||||
"window and "
|
||||
"workspace..." ),
|
||||
@@ -198,33 +199,45 @@ int main( int argc, char * * argv )
|
||||
Qt::white );
|
||||
#endif
|
||||
|
||||
engine * main_engine = new engine();
|
||||
|
||||
// we try to load given file
|
||||
if( file_to_load != "" )
|
||||
{
|
||||
main_engine->getSongEditor()->loadProject( file_to_load );
|
||||
}
|
||||
else
|
||||
{
|
||||
main_engine->getSongEditor()->createNewProject();
|
||||
}
|
||||
#ifndef QT4
|
||||
app.setMainWidget( lmmsMainWin::inst() );
|
||||
app.setMainWidget( main_engine->getMainWindow() );
|
||||
#endif
|
||||
// MDI-mode?
|
||||
if( lmmsMainWin::inst()->workspace() != NULL )
|
||||
if( main_engine->getMainWindow()->workspace() != NULL )
|
||||
{
|
||||
// then maximize
|
||||
lmmsMainWin::inst()->showMaximized();
|
||||
main_engine->getMainWindow()->showMaximized();
|
||||
}
|
||||
else
|
||||
{
|
||||
// otherwise arrange at top-left edge of screen
|
||||
lmmsMainWin::inst()->show();
|
||||
lmmsMainWin::inst()->move( 0, 0 );
|
||||
lmmsMainWin::inst()->resize( 200, 500 );
|
||||
main_engine->getMainWindow()->show();
|
||||
main_engine->getMainWindow()->move( 0, 0 );
|
||||
main_engine->getMainWindow()->resize( 200, 500 );
|
||||
}
|
||||
|
||||
|
||||
#if QT_VERSION >= 0x030200
|
||||
delete lmmsMainWin::s_splashScreen;
|
||||
lmmsMainWin::s_splashScreen = NULL;
|
||||
delete mainWindow::s_splashScreen;
|
||||
mainWindow::s_splashScreen = NULL;
|
||||
#endif
|
||||
if( file_to_render != "" )
|
||||
{
|
||||
exportProjectDialog * e = new exportProjectDialog(
|
||||
file_to_render,
|
||||
lmmsMainWin::inst() );
|
||||
file_to_render,
|
||||
main_engine->getMainWindow(),
|
||||
main_engine );
|
||||
e->show();
|
||||
e->exportBtnClicked();
|
||||
}
|
||||
|
||||
864
src/core/main_window.cpp
Normal file
864
src/core/main_window.cpp
Normal file
@@ -0,0 +1,864 @@
|
||||
/*
|
||||
* main_window.cpp - implementation of LMMS-main-window
|
||||
*
|
||||
* Copyright (c) 2004-2006 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 "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QApplication>
|
||||
#include <QFileDialog>
|
||||
#include <QCloseEvent>
|
||||
#include <QSplitter>
|
||||
#include <QSplashScreen>
|
||||
#include <QMessageBox>
|
||||
#include <QMenuBar>
|
||||
|
||||
#else
|
||||
|
||||
#include <qsplitter.h>
|
||||
#include <qapplication.h>
|
||||
#include <qdir.h>
|
||||
#include <qfiledialog.h>
|
||||
#include <qpopupmenu.h>
|
||||
#include <qmessagebox.h>
|
||||
#include <qmenubar.h>
|
||||
|
||||
#if QT_VERSION >= 0x030200
|
||||
#include <qsplashscreen.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
|
||||
#include "main_window.h"
|
||||
#include "bb_editor.h"
|
||||
#include "song_editor.h"
|
||||
#include "piano_roll.h"
|
||||
#include "embed.h"
|
||||
#include "about_dialog.h"
|
||||
#include "file_browser.h"
|
||||
#include "plugin_browser.h"
|
||||
#include "side_bar.h"
|
||||
#include "config_mgr.h"
|
||||
#include "mixer.h"
|
||||
#include "project_notes.h"
|
||||
#include "buffer_allocator.h"
|
||||
#include "setup_dialog.h"
|
||||
#include "audio_dummy.h"
|
||||
#include "tool_button.h"
|
||||
|
||||
|
||||
#if QT_VERSION >= 0x030100
|
||||
QSplashScreen * mainWindow::s_splashScreen = NULL;
|
||||
extern int splash_alignment_flags;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
mainWindow::mainWindow( engine * _engine ) :
|
||||
QMainWindow(
|
||||
#ifndef QT4
|
||||
0 , NULL, WDestructiveClose
|
||||
#endif
|
||||
),
|
||||
engineObject( _engine ),
|
||||
m_workspace( NULL ),
|
||||
m_templatesMenu( NULL )
|
||||
{
|
||||
#ifdef QT4
|
||||
setAttribute( Qt::WA_DeleteOnClose );
|
||||
#endif
|
||||
|
||||
bool no_mdi = configManager::inst()->value( "app", "gimplikewindows"
|
||||
).toInt();
|
||||
|
||||
QWidget * main_widget = new QWidget( this );
|
||||
QVBoxLayout * vbox = new QVBoxLayout( main_widget );
|
||||
vbox->setSpacing( 0 );
|
||||
vbox->setMargin( 0 );
|
||||
|
||||
|
||||
QWidget * w = new QWidget( main_widget );
|
||||
QHBoxLayout * hbox = new QHBoxLayout( w );
|
||||
hbox->setSpacing( 0 );
|
||||
hbox->setMargin( 0 );
|
||||
|
||||
sideBar * side_bar = new sideBar( sideBar::Vertical, w );
|
||||
side_bar->setStyle( sideBar::VSNET/*KDEV3ICON*/ );
|
||||
side_bar->setPosition( sideBar::Left );
|
||||
|
||||
QSplitter * splitter = new QSplitter( Qt::Horizontal, w );
|
||||
#if QT_VERSION >= 0x030200
|
||||
splitter->setChildrenCollapsible( FALSE );
|
||||
#endif
|
||||
|
||||
int id = 0;
|
||||
QString wdir = configManager::inst()->workingDir();
|
||||
side_bar->appendTab( new pluginBrowser( splitter, eng() ), ++id );
|
||||
side_bar->appendTab( new fileBrowser( wdir+"projects",
|
||||
"*.mmp *.xml *.mid",
|
||||
tr( "My projects" ),
|
||||
embed::getIconPixmap( "project_file" ),
|
||||
splitter, eng() ),
|
||||
++id );
|
||||
side_bar->appendTab( new fileBrowser( wdir+"samples", "*.wav *.ogg *.au"
|
||||
"*.voc *.aif *.aiff *.flac *.raw",
|
||||
tr( "My samples" ),
|
||||
embed::getIconPixmap( "sound_file" ),
|
||||
splitter, eng() ),
|
||||
++id );
|
||||
side_bar->appendTab( new fileBrowser( wdir+"presets", "*.cs.xml",
|
||||
tr( "My presets" ),
|
||||
embed::getIconPixmap( "preset_file" ),
|
||||
splitter, eng() ),
|
||||
++id );
|
||||
side_bar->appendTab( new fileBrowser( QDir::homePath(), "*",
|
||||
tr( "My home" ),
|
||||
embed::getIconPixmap( "home" ),
|
||||
splitter, eng() ),
|
||||
++id );
|
||||
side_bar->appendTab( new fileBrowser( QDir::rootPath(), "*",
|
||||
tr( "Root directory" ),
|
||||
embed::getIconPixmap( "root" ),
|
||||
splitter, eng() ),
|
||||
++id );
|
||||
|
||||
if( no_mdi == FALSE )
|
||||
{
|
||||
m_workspace = new QWorkspace( splitter );
|
||||
m_workspace->setScrollBarsEnabled( TRUE );
|
||||
|
||||
#ifdef QT4
|
||||
/* m_workspace->setBackground( embed::getIconPixmap(
|
||||
"background_artwork" ) );*/
|
||||
#else
|
||||
m_workspace->setPaletteBackgroundPixmap( embed::getIconPixmap(
|
||||
"background_artwork" ) );
|
||||
#endif
|
||||
}
|
||||
|
||||
hbox->addWidget( side_bar );
|
||||
hbox->addWidget( splitter );
|
||||
|
||||
|
||||
// create global-toolbar at the top of our window
|
||||
m_toolBar = new QWidget( main_widget );
|
||||
m_toolBar->setFixedHeight( 64 );
|
||||
m_toolBar->move( 0, 0 );
|
||||
#ifdef QT4
|
||||
QPalette pal;
|
||||
pal.setBrush( m_toolBar->backgroundRole(), QBrush(
|
||||
embed::getIconPixmap( "main_toolbar_bg" ) ) );
|
||||
m_toolBar->setPalette( pal );
|
||||
#else
|
||||
m_toolBar->setPaletteBackgroundPixmap(
|
||||
embed::getIconPixmap( "main_toolbar_bg" ) );
|
||||
#endif
|
||||
|
||||
// add layout for organizing quite complex toolbar-layouting
|
||||
m_toolBarLayout = new QGridLayout( m_toolBar/*, 2, 1*/ );
|
||||
m_toolBarLayout->setMargin( 0 );
|
||||
m_toolBarLayout->setSpacing( 0 );
|
||||
|
||||
vbox->addWidget( m_toolBar );
|
||||
vbox->addWidget( w );
|
||||
setCentralWidget( main_widget );
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
mainWindow::~mainWindow()
|
||||
{
|
||||
/* // first make sure, there're no mixing/audio-device-threads any more
|
||||
eng()->getMixer()->stopProcessing();
|
||||
|
||||
// destroy editors with all their children
|
||||
delete eng()->getSongEditor();
|
||||
delete eng()->getBBEditor();
|
||||
|
||||
|
||||
|
||||
// destroy mixer
|
||||
delete eng()->getMixer();
|
||||
|
||||
// destroy config-manager (which automatically saves config-file)
|
||||
*/
|
||||
delete eng();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void mainWindow::finalize( void )
|
||||
{
|
||||
#if QT_VERSION >= 0x030200
|
||||
if( qApp->argc() > 1 )
|
||||
{
|
||||
s_splashScreen->showMessage( tr( "Loading song..." ),
|
||||
splash_alignment_flags,
|
||||
Qt::white );
|
||||
}
|
||||
else
|
||||
{
|
||||
s_splashScreen->showMessage( tr( "Creating new song..." ),
|
||||
splash_alignment_flags,
|
||||
Qt::white );
|
||||
}
|
||||
#endif
|
||||
eng()->getSongEditor();
|
||||
|
||||
|
||||
#if QT_VERSION >= 0x030200
|
||||
s_splashScreen->showMessage( tr( "Creating GUI..." ),
|
||||
splash_alignment_flags,
|
||||
Qt::white );
|
||||
#endif
|
||||
resetWindowTitle( "" );
|
||||
setWindowIcon( embed::getIconPixmap( "icon" ) );
|
||||
|
||||
|
||||
// create tool-buttons
|
||||
toolButton * project_new = new toolButton(
|
||||
embed::getIconPixmap( "project_new" ),
|
||||
tr( "Create new project" ),
|
||||
this, SLOT( createNewProject() ),
|
||||
m_toolBar );
|
||||
|
||||
QDir d( configManager::inst()->projectsDir() + "templates" );
|
||||
QStringList templates = d.entryList(
|
||||
#ifdef QT4
|
||||
QStringList( "*.mpt" ),
|
||||
#else
|
||||
"*.mpt",
|
||||
#endif
|
||||
QDir::Files | QDir::Readable );
|
||||
if( !templates.isEmpty() )
|
||||
{
|
||||
m_templatesMenu = new QMenu( project_new );
|
||||
for( QStringList::iterator it = templates.begin();
|
||||
it != templates.end(); ++it )
|
||||
{
|
||||
m_templatesMenu->addAction(
|
||||
embed::getIconPixmap( "project_file" ),
|
||||
( *it ).left( ( *it ).length() - 4 ) );
|
||||
}
|
||||
connect( m_templatesMenu, SIGNAL( activated( int ) ),
|
||||
this, SLOT( createNewProjectFromTemplate( int ) ) );
|
||||
project_new->setMenu( m_templatesMenu );
|
||||
#ifdef QT4
|
||||
project_new->setPopupMode( toolButton::MenuButtonPopup );
|
||||
#else
|
||||
project_new->setPopupDelay( 0 );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
toolButton * project_open = new toolButton(
|
||||
embed::getIconPixmap( "project_open" ),
|
||||
tr( "Open existing project" ),
|
||||
this, SLOT( openProject() ),
|
||||
m_toolBar );
|
||||
|
||||
|
||||
toolButton * project_save = new toolButton(
|
||||
embed::getIconPixmap( "project_save" ),
|
||||
tr( "Save current project" ),
|
||||
this, SLOT( saveProject() ),
|
||||
m_toolBar );
|
||||
|
||||
|
||||
toolButton * project_export = new toolButton(
|
||||
embed::getIconPixmap( "project_export" ),
|
||||
tr( "Export current project" ),
|
||||
eng()->getSongEditor(),
|
||||
SLOT( exportProject() ),
|
||||
m_toolBar );
|
||||
|
||||
|
||||
m_toolBarLayout->setColumnMinimumWidth( 0, 5 );
|
||||
m_toolBarLayout->addWidget( project_new, 0, 1 );
|
||||
m_toolBarLayout->addWidget( project_open, 0, 2 );
|
||||
m_toolBarLayout->addWidget( project_save, 0, 3 );
|
||||
m_toolBarLayout->addWidget( project_export, 0, 4 );
|
||||
|
||||
|
||||
|
||||
// window-toolbar
|
||||
toolButton * bb_editor_window = new toolButton(
|
||||
embed::getIconPixmap( "bb_track" ),
|
||||
tr( "Show/hide Beat+Bassline Editor" ) +
|
||||
" (F6)",
|
||||
this, SLOT( toggleBBEditorWin() ),
|
||||
m_toolBar );
|
||||
bb_editor_window->setShortcut( Qt::Key_F6 );
|
||||
#ifdef QT4
|
||||
bb_editor_window->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( bb_editor_window,
|
||||
#endif
|
||||
tr( "By pressing this button, you can show or hide the "
|
||||
"Beat+Bassline Editor. The Beat+Bassline Editor is "
|
||||
"needed for setting beats, opening, adding and "
|
||||
"removing channels, cutting, copying and pasting "
|
||||
"beat- and bassline-patterns and other things like "
|
||||
"that." ) );
|
||||
|
||||
|
||||
toolButton * piano_roll_window = new toolButton(
|
||||
embed::getIconPixmap( "piano" ),
|
||||
tr( "Show/hide Piano-Roll" ) +
|
||||
" (F7)",
|
||||
this, SLOT( togglePianoRollWin() ),
|
||||
m_toolBar );
|
||||
piano_roll_window->setShortcut( Qt::Key_F7 );
|
||||
#ifdef QT4
|
||||
piano_roll_window->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( piano_roll_window,
|
||||
#endif
|
||||
tr( "By pressing this button, you can show or hide the "
|
||||
"Piano-Roll. With the help of the Piano-Roll "
|
||||
"you can edit melody-patterns in an easy way."
|
||||
) );
|
||||
|
||||
toolButton * song_editor_window = new toolButton(
|
||||
embed::getIconPixmap( "songeditor" ),
|
||||
tr( "Show/hide Song-Editor" ) + " (F8)",
|
||||
this, SLOT( toggleSongEditorWin() ),
|
||||
m_toolBar );
|
||||
song_editor_window->setShortcut( Qt::Key_F8 );
|
||||
#ifdef QT4
|
||||
song_editor_window->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( song_editor_window,
|
||||
#endif
|
||||
tr( "By pressing this button, you can show or hide the "
|
||||
"Song-Editor. With the help of the Song-Editor you can "
|
||||
"edit song-playlist and specify when which track "
|
||||
"should be played. "
|
||||
"You can also insert and move samples (e.g. "
|
||||
"rap-samples) directly into the playlist." ) );
|
||||
|
||||
|
||||
/* toolButton * effect_board_window = new toolButton(
|
||||
embed::getIconPixmap( "effect_board" ),
|
||||
tr( "Show/hide EffectBoard" ) + " (F9)",
|
||||
this, SLOT( emptySlot() ), m_toolBar );
|
||||
effect_board_window->setShortcut( Qt::Key_F9 );
|
||||
#ifdef QT4
|
||||
effect_board_window->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( effect_board_window,
|
||||
#endif
|
||||
tr( "By pressing this button, you can show or hide the "
|
||||
"EffectBoard. The EffectBoard is a very powerful tool "
|
||||
"for managing effects for your song. You can insert "
|
||||
"effects into different effect-channels." ) );*/
|
||||
|
||||
toolButton * project_notes_window = new toolButton(
|
||||
embed::getIconPixmap( "project_notes" ),
|
||||
tr( "Show/hide project notes" ) +
|
||||
" (F10)",
|
||||
this, SLOT( toggleProjectNotesWin() ),
|
||||
m_toolBar );
|
||||
project_notes_window->setShortcut( Qt::Key_F10 );
|
||||
#ifdef QT4
|
||||
project_notes_window->setWhatsThis(
|
||||
#else
|
||||
QWhatsThis::add( project_notes_window,
|
||||
#endif
|
||||
tr( "By pressing this button, you can show or hide the "
|
||||
"project notes window. In this window you can put "
|
||||
"down your project notes.") );
|
||||
|
||||
m_toolBarLayout->addWidget( bb_editor_window, 1, 1 );
|
||||
m_toolBarLayout->addWidget( piano_roll_window, 1, 2 );
|
||||
m_toolBarLayout->addWidget( song_editor_window, 1, 3 );
|
||||
//m_toolBarLayout->addWidget( effect_board_window, 1, 4 );
|
||||
m_toolBarLayout->addWidget( project_notes_window, 1, 5 );
|
||||
|
||||
m_toolBarLayout->setColumnStretch( 100, 1 );
|
||||
|
||||
|
||||
|
||||
// project-popup-menu
|
||||
QMenu * project_menu = new QMenu( this );
|
||||
#ifdef QT4
|
||||
menuBar()->addMenu( project_menu )->setText( tr( "&Project" ) );
|
||||
#else
|
||||
menuBar()->insertItem( tr( "&Project" ), project_menu );
|
||||
#endif
|
||||
project_menu->addAction( embed::getIconPixmap( "project_new" ),
|
||||
tr( "&New" ),
|
||||
this, SLOT( createNewProject() ),
|
||||
Qt::CTRL + Qt::Key_N );
|
||||
|
||||
project_menu->addAction( embed::getIconPixmap( "project_open" ),
|
||||
tr( "&Open..." ),
|
||||
this, SLOT( openProject() ),
|
||||
Qt::CTRL + Qt::Key_O );
|
||||
|
||||
project_menu->addAction( embed::getIconPixmap( "project_save" ),
|
||||
tr( "&Save" ),
|
||||
this, SLOT( saveProject() ),
|
||||
Qt::CTRL + Qt::Key_S );
|
||||
|
||||
project_menu->addAction( embed::getIconPixmap( "project_saveas" ),
|
||||
tr( "Save &As..." ),
|
||||
this, SLOT( saveProjectAs() ),
|
||||
Qt::CTRL + Qt::SHIFT + Qt::Key_S );
|
||||
#ifdef QT4
|
||||
project_menu->addSeparator();
|
||||
#else
|
||||
project_menu->insertSeparator();
|
||||
#endif
|
||||
project_menu->addAction( /*embed::getIconPixmap( "project_import" ),*/
|
||||
tr( "Import file" ),
|
||||
eng()->getSongEditor(),
|
||||
SLOT( importProject() ) );
|
||||
#ifdef QT4
|
||||
project_menu->addSeparator();
|
||||
#else
|
||||
project_menu->insertSeparator();
|
||||
#endif
|
||||
project_menu->addAction( embed::getIconPixmap( "project_export" ),
|
||||
tr( "E&xport" ),
|
||||
eng()->getSongEditor(),
|
||||
SLOT( exportProject() ),
|
||||
Qt::CTRL + Qt::Key_E );
|
||||
#ifdef QT4
|
||||
project_menu->addSeparator();
|
||||
#else
|
||||
project_menu->insertSeparator();
|
||||
#endif
|
||||
project_menu->addAction( embed::getIconPixmap( "exit" ), tr( "&Quit" ),
|
||||
qApp, SLOT( closeAllWindows() ),
|
||||
Qt::CTRL+Qt::Key_Q );
|
||||
|
||||
|
||||
QMenu * settings_menu = new QMenu( this );
|
||||
#ifdef QT4
|
||||
menuBar()->addMenu( settings_menu )->setText( tr( "&Settings" ) );
|
||||
#else
|
||||
menuBar()->insertItem( tr( "&Settings" ), settings_menu );
|
||||
#endif
|
||||
settings_menu->addAction( embed::getIconPixmap( "setup_general" ),
|
||||
tr( "Show settings dialog" ),
|
||||
this, SLOT( showSettingsDialog() ) );
|
||||
settings_menu->addAction( embed::getIconPixmap( "wizard" ),
|
||||
tr( "Show setup wizard" ),
|
||||
configManager::inst(), SLOT( exec() ) );
|
||||
|
||||
|
||||
// help-popup-menu
|
||||
QMenu * help_menu = new QMenu( this );
|
||||
#ifdef QT4
|
||||
menuBar()->addMenu( help_menu )->setText( tr( "&Help" ) );
|
||||
#else
|
||||
menuBar()->insertItem( tr( "&Help" ), help_menu );
|
||||
#endif
|
||||
help_menu->addAction( embed::getIconPixmap( "help" ), tr( "Help" ),
|
||||
this, SLOT( help() ) );
|
||||
help_menu->addAction( embed::getIconPixmap( "whatsthis" ),
|
||||
tr( "What's this?" ),
|
||||
this, SLOT( enterWhatsThisMode() ) );
|
||||
#ifdef QT4
|
||||
help_menu->addSeparator();
|
||||
#else
|
||||
help_menu->insertSeparator();
|
||||
#endif
|
||||
help_menu->addAction( embed::getIconPixmap( "icon" ), tr( "About" ),
|
||||
this, SLOT( aboutLMMS() ) );
|
||||
|
||||
// setup-dialog opened before?
|
||||
if( !configManager::inst()->value( "app", "configured" ).toInt() )
|
||||
{
|
||||
// no, so show it that user can setup everything
|
||||
setupDialog( eng() ).exec();
|
||||
configManager::inst()->setValue( "app", "configured", "1" );
|
||||
}
|
||||
// look whether mixer could use a audio-interface beside audioDummy
|
||||
else if( eng()->getMixer()->audioDevName() == audioDummy::name() )
|
||||
{
|
||||
// no, so we offer setup-dialog with audio-settings...
|
||||
setupDialog sd( eng(), setupDialog::AUDIO_SETTINGS );
|
||||
sd.exec();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int mainWindow::addWidgetToToolBar( QWidget * _w, int _row, int _col )
|
||||
{
|
||||
int col = ( _col == -1 ) ? m_toolBarLayout->columnCount() + 6 : _col;
|
||||
if( _w->height() > 32 || _row == -1 )
|
||||
{
|
||||
#ifdef QT4
|
||||
m_toolBarLayout->addWidget( _w, 0, col, 2, 1 );
|
||||
#else
|
||||
m_toolBarLayout->addMultiCellWidget( _w, 0, 1, col, col );
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
m_toolBarLayout->addWidget( _w, _row, col );
|
||||
}
|
||||
return( col );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void mainWindow::addSpacingToToolBar( int _size )
|
||||
{
|
||||
m_toolBarLayout->setColumnMinimumWidth( m_toolBarLayout->columnCount() +
|
||||
6, _size );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void mainWindow::resetWindowTitle( const QString & _add )
|
||||
{
|
||||
QString title = _add;
|
||||
if( _add == "" && eng()->getSongEditor()->projectFileName() != "" )
|
||||
{
|
||||
title = QFileInfo( eng()->getSongEditor()->projectFileName()
|
||||
#ifdef QT4
|
||||
).completeBaseName();
|
||||
#else
|
||||
).baseName( TRUE );
|
||||
#endif
|
||||
}
|
||||
if( title != "" )
|
||||
{
|
||||
title += " - ";
|
||||
}
|
||||
setWindowTitle( title + tr( "LMMS %1" ).arg( VERSION ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void mainWindow::clearKeyModifiers( void )
|
||||
{
|
||||
m_keyMods.m_ctrl = FALSE;
|
||||
m_keyMods.m_shift = FALSE;
|
||||
m_keyMods.m_alt = FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void mainWindow::createNewProject( void )
|
||||
{
|
||||
if( eng()->getSongEditor()->mayChangeProject() == TRUE )
|
||||
{
|
||||
eng()->getSongEditor()->createNewProject();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void mainWindow::createNewProjectFromTemplate( int _idx )
|
||||
{
|
||||
#ifdef QT4
|
||||
// TODO!!!
|
||||
#else
|
||||
if( m_templatesMenu != NULL &&
|
||||
eng()->getSongEditor()->mayChangeProject() == TRUE )
|
||||
{
|
||||
eng()->getSongEditor()->createNewProjectFromTemplate(
|
||||
configManager::inst()->projectsDir() + "templates/" +
|
||||
m_templatesMenu->text( _idx ) + ".mpt" );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void mainWindow::openProject( void )
|
||||
{
|
||||
if( eng()->getSongEditor()->mayChangeProject() == TRUE )
|
||||
{
|
||||
#ifdef QT4
|
||||
QFileDialog ofd( this, tr( "Open project" ), "",
|
||||
tr( "MultiMedia Project (*.mmp *.xml)" ) );
|
||||
#else
|
||||
QFileDialog ofd( QString::null,
|
||||
tr( "MultiMedia Project (*.mmp *.xml)" ),
|
||||
this, "", TRUE );
|
||||
ofd.setWindowTitle( tr( "Open project" ) );
|
||||
#endif
|
||||
ofd.setDirectory( configManager::inst()->projectsDir() );
|
||||
ofd.setFileMode( QFileDialog::ExistingFiles );
|
||||
if( ofd.exec () == QDialog::Accepted &&
|
||||
!ofd.selectedFiles().isEmpty() )
|
||||
{
|
||||
eng()->getSongEditor()->loadProject(
|
||||
ofd.selectedFiles()[0] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
bool mainWindow::saveProject( void )
|
||||
{
|
||||
if( eng()->getSongEditor()->projectFileName() == "" )
|
||||
{
|
||||
return( saveProjectAs() );
|
||||
}
|
||||
else
|
||||
{
|
||||
eng()->getSongEditor()->saveProject();
|
||||
}
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
bool mainWindow::saveProjectAs( void )
|
||||
{
|
||||
#ifdef QT4
|
||||
QFileDialog sfd( this, tr( "Save project" ), "",
|
||||
tr( "MultiMedia Project (*.mmp);;"
|
||||
"MultiMedia Project Template (*.mpt)" ) );
|
||||
#else
|
||||
QFileDialog sfd( QString::null,
|
||||
tr( "MultiMedia Project (*.mmp);;"
|
||||
"MultiMedia Project Template (*.mpt)" ),
|
||||
this, "", TRUE );
|
||||
sfd.setWindowTitle( tr( "Save project" ) );
|
||||
#endif
|
||||
sfd.setFileMode( QFileDialog::AnyFile );
|
||||
QString f = eng()->getSongEditor()->projectFileName();
|
||||
if( f != "" )
|
||||
{
|
||||
sfd.selectFile( QFileInfo( f ).fileName() );
|
||||
#ifdef QT4
|
||||
sfd.setDirectory( QFileInfo( f ).absolutePath() );
|
||||
#else
|
||||
sfd.setDirectory( QFileInfo( f ).dirPath( TRUE ) );
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
sfd.setDirectory( configManager::inst()->projectsDir() );
|
||||
}
|
||||
|
||||
if( sfd.exec () == QFileDialog::Accepted &&
|
||||
#ifdef QT4
|
||||
!sfd.selectedFiles().isEmpty() && sfd.selectedFiles()[0] != ""
|
||||
#else
|
||||
sfd.selectedFile() != ""
|
||||
#endif
|
||||
)
|
||||
{
|
||||
#ifdef QT4
|
||||
eng()->getSongEditor()->saveProjectAs( sfd.selectedFiles()[0] );
|
||||
#else
|
||||
eng()->getSongEditor()->saveProjectAs( sfd.selectedFile() );
|
||||
#endif
|
||||
return( TRUE );
|
||||
}
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void mainWindow::showSettingsDialog( void )
|
||||
{
|
||||
setupDialog( eng() ).exec();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void mainWindow::aboutLMMS( void )
|
||||
{
|
||||
aboutDialog().exec();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void mainWindow::help( void )
|
||||
{
|
||||
QMessageBox::information( this, tr( "Help not available" ),
|
||||
tr( "Currently there's no help "
|
||||
"available in LMMS.\n"
|
||||
"Please visit "
|
||||
"http://wiki.mindrules.net "
|
||||
"for documentation on LMMS." ),
|
||||
QMessageBox::Ok );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void mainWindow::toggleBBEditorWin( void )
|
||||
{
|
||||
if( eng()->getBBEditor()->isHidden() == TRUE ||
|
||||
( m_workspace != NULL &&
|
||||
m_workspace->activeWindow() != eng()->getBBEditor() ) )
|
||||
{
|
||||
eng()->getBBEditor()->show();
|
||||
eng()->getBBEditor()->setFocus();
|
||||
}
|
||||
else
|
||||
{
|
||||
eng()->getBBEditor()->hide();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void mainWindow::toggleSongEditorWin( void )
|
||||
{
|
||||
if( eng()->getSongEditor()->isHidden() == TRUE ||
|
||||
( m_workspace != NULL &&
|
||||
m_workspace->activeWindow() != eng()->getSongEditor() ) )
|
||||
{
|
||||
eng()->getSongEditor()->show();
|
||||
eng()->getSongEditor()->setFocus();
|
||||
}
|
||||
else
|
||||
{
|
||||
eng()->getSongEditor()->hide();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void mainWindow::toggleProjectNotesWin( void )
|
||||
{
|
||||
if( eng()->getProjectNotes()->isHidden() == TRUE ||
|
||||
( m_workspace != NULL && m_workspace->activeWindow() !=
|
||||
eng()->getProjectNotes() ) )
|
||||
{
|
||||
eng()->getProjectNotes()->show();
|
||||
eng()->getProjectNotes()->setFocus();
|
||||
}
|
||||
else
|
||||
{
|
||||
eng()->getProjectNotes()->hide();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void mainWindow::togglePianoRollWin( void )
|
||||
{
|
||||
if( eng()->getPianoRoll()->isHidden() == TRUE ||
|
||||
( m_workspace != NULL &&
|
||||
m_workspace->activeWindow() != eng()->getPianoRoll() ) )
|
||||
{
|
||||
eng()->getPianoRoll()->show();
|
||||
eng()->getPianoRoll()->setFocus();
|
||||
}
|
||||
else
|
||||
{
|
||||
eng()->getPianoRoll()->hide();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void mainWindow::closeEvent( QCloseEvent * _ce )
|
||||
{
|
||||
if( eng()->getSongEditor()->mayChangeProject() == TRUE )
|
||||
{
|
||||
_ce->accept();
|
||||
}
|
||||
else
|
||||
{
|
||||
_ce->ignore();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void mainWindow::focusOutEvent( QFocusEvent * _fe )
|
||||
{
|
||||
// when loosing focus we do not receive key-(release!)-events anymore,
|
||||
// so we might miss release-events of one the modifiers we're watching!
|
||||
clearKeyModifiers();
|
||||
QMainWindow::leaveEvent( _fe );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void mainWindow::keyPressEvent( QKeyEvent * _ke )
|
||||
{
|
||||
switch( _ke->key() )
|
||||
{
|
||||
case Qt::Key_Control: m_keyMods.m_ctrl = TRUE; break;
|
||||
case Qt::Key_Shift: m_keyMods.m_shift = TRUE; break;
|
||||
case Qt::Key_Alt: m_keyMods.m_alt = TRUE; break;
|
||||
default:
|
||||
QMainWindow::keyPressEvent( _ke );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void mainWindow::keyReleaseEvent( QKeyEvent * _ke )
|
||||
{
|
||||
switch( _ke->key() )
|
||||
{
|
||||
case Qt::Key_Control: m_keyMods.m_ctrl = FALSE; break;
|
||||
case Qt::Key_Shift: m_keyMods.m_shift = FALSE; break;
|
||||
case Qt::Key_Alt: m_keyMods.m_alt = FALSE; break;
|
||||
default:
|
||||
QMainWindow::keyReleaseEvent( _ke );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#include "main_window.moc"
|
||||
|
||||
@@ -62,6 +62,7 @@ midiTabWidget::midiTabWidget( channelTrack * _channel_track,
|
||||
midiPort * _port ) :
|
||||
QWidget( _channel_track->tabWidgetParent() ),
|
||||
settings(),
|
||||
engineObject( _channel_track->eng() ),
|
||||
m_channelTrack( _channel_track ),
|
||||
m_midiPort( _port ),
|
||||
m_readablePorts( NULL ),
|
||||
@@ -119,7 +120,7 @@ midiTabWidget::midiTabWidget( channelTrack * _channel_track,
|
||||
|
||||
// when using with non-raw-clients we can provide buttons showing
|
||||
// our port-menus when being clicked
|
||||
midiClient * mc = mixer::inst()->getMIDIClient();
|
||||
midiClient * mc = eng()->getMixer()->getMIDIClient();
|
||||
if( mc->isRaw() == FALSE )
|
||||
{
|
||||
m_readablePorts = new QMenu( m_setupTabWidget );
|
||||
@@ -345,7 +346,7 @@ void midiTabWidget::loadSettings( const QDomElement & _this )
|
||||
void midiTabWidget::inputChannelChanged( int _new_chnl )
|
||||
{
|
||||
m_midiPort->setInputChannel( _new_chnl - 1 );
|
||||
songEditor::inst()->setModified();
|
||||
eng()->getSongEditor()->setModified();
|
||||
}
|
||||
|
||||
|
||||
@@ -354,7 +355,7 @@ void midiTabWidget::inputChannelChanged( int _new_chnl )
|
||||
void midiTabWidget::outputChannelChanged( int _new_chnl )
|
||||
{
|
||||
m_midiPort->setOutputChannel( _new_chnl - 1 );
|
||||
songEditor::inst()->setModified();
|
||||
eng()->getSongEditor()->setModified();
|
||||
}
|
||||
|
||||
|
||||
@@ -418,7 +419,7 @@ void midiTabWidget::midiPortModeToggled( bool )
|
||||
}
|
||||
#endif
|
||||
}
|
||||
songEditor::inst()->setModified();
|
||||
eng()->getSongEditor()->setModified();
|
||||
}
|
||||
|
||||
|
||||
@@ -450,7 +451,7 @@ void midiTabWidget::readablePortsChanged( void )
|
||||
#endif
|
||||
|
||||
m_readablePorts->clear();
|
||||
const QStringList & rp = mixer::inst()->getMIDIClient()->
|
||||
const QStringList & rp = eng()->getMixer()->getMIDIClient()->
|
||||
readablePorts();
|
||||
// now insert new ports and restore selections
|
||||
for( QStringList::const_iterator it = rp.begin(); it != rp.end(); ++it )
|
||||
@@ -501,7 +502,7 @@ void midiTabWidget::writeablePortsChanged( void )
|
||||
#endif
|
||||
|
||||
m_writeablePorts->clear();
|
||||
const QStringList & wp = mixer::inst()->getMIDIClient()->
|
||||
const QStringList & wp = eng()->getMixer()->getMIDIClient()->
|
||||
writeablePorts();
|
||||
// now insert new ports and restore selections
|
||||
for( QStringList::const_iterator it = wp.begin(); it != wp.end(); ++it )
|
||||
@@ -536,7 +537,7 @@ void midiTabWidget::activatedReadablePort( QAction * _item )
|
||||
m_receiveCheckBox->setChecked( TRUE );
|
||||
}
|
||||
_item->setChecked( !_item->isChecked() );
|
||||
mixer::inst()->getMIDIClient()->subscribeReadablePort( m_midiPort,
|
||||
eng()->getMixer()->getMIDIClient()->subscribeReadablePort( m_midiPort,
|
||||
_item->text(), !_item->isChecked() );
|
||||
}
|
||||
|
||||
@@ -553,7 +554,7 @@ void midiTabWidget::activatedWriteablePort( QAction * _item )
|
||||
m_sendCheckBox->setChecked( TRUE );
|
||||
}
|
||||
_item->setChecked( !_item->isChecked() );
|
||||
mixer::inst()->getMIDIClient()->subscribeWriteablePort( m_midiPort,
|
||||
eng()->getMixer()->getMIDIClient()->subscribeWriteablePort( m_midiPort,
|
||||
_item->text(), !_item->isChecked() );
|
||||
}
|
||||
|
||||
@@ -575,7 +576,7 @@ void midiTabWidget::activatedReadablePort( int _id )
|
||||
}
|
||||
m_readablePorts->setItemChecked( _id,
|
||||
!m_readablePorts->isItemChecked( _id ) );
|
||||
mixer::inst()->getMIDIClient()->subscribeReadablePort(
|
||||
eng()->getMixer()->getMIDIClient()->subscribeReadablePort(
|
||||
m_midiPort, m_readablePorts->text( _id ),
|
||||
!m_readablePorts->isItemChecked( _id ) );
|
||||
}
|
||||
@@ -594,7 +595,7 @@ void midiTabWidget::activatedWriteablePort( int _id )
|
||||
}
|
||||
m_writeablePorts->setItemChecked( _id,
|
||||
!m_writeablePorts->isItemChecked( _id ) );
|
||||
mixer::inst()->getMIDIClient()->subscribeWriteablePort(
|
||||
eng()->getMixer()->getMIDIClient()->subscribeWriteablePort(
|
||||
m_midiPort, m_writeablePorts->text( _id ),
|
||||
!m_writeablePorts->isItemChecked( _id ) );
|
||||
}
|
||||
|
||||
@@ -57,11 +57,9 @@
|
||||
sample_rate_t SAMPLE_RATES[QUALITY_LEVELS] = { 44100, 88200 } ;
|
||||
|
||||
|
||||
mixer * mixer::s_instanceOfMe = NULL;
|
||||
|
||||
|
||||
mixer::mixer() :
|
||||
mixer::mixer( engine * _engine ) :
|
||||
QObject(),
|
||||
engineObject( _engine ),
|
||||
m_framesPerAudioBuffer( DEFAULT_BUFFER_SIZE ),
|
||||
m_curBuf( NULL ),
|
||||
m_nextBuf( NULL ),
|
||||
@@ -73,9 +71,6 @@ mixer::mixer() :
|
||||
m_mixMutex(),
|
||||
m_mixMutexLockLevel( 0 )
|
||||
{
|
||||
// small hack because code calling mixer::inst() is called out of ctor
|
||||
s_instanceOfMe = this;
|
||||
|
||||
if( configManager::inst()->value( "mixer", "framesperaudiobuffer"
|
||||
).toInt() >= 32 )
|
||||
{
|
||||
@@ -94,17 +89,10 @@ mixer::mixer() :
|
||||
m_nextBuf = bufferAllocator::alloc<surroundSampleFrame>(
|
||||
m_framesPerAudioBuffer );
|
||||
|
||||
|
||||
m_audioDev = tryAudioDevices();
|
||||
m_midiClient = tryMIDIClients();
|
||||
|
||||
|
||||
// now clear our two output-buffers before using them...
|
||||
clearAudioBuffer( m_curBuf, m_framesPerAudioBuffer );
|
||||
clearAudioBuffer( m_nextBuf, m_framesPerAudioBuffer );
|
||||
|
||||
m_audioDev->startProcessing();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -122,6 +110,23 @@ mixer::~mixer()
|
||||
|
||||
|
||||
|
||||
void mixer::initDevices( void )
|
||||
{
|
||||
m_audioDev = tryAudioDevices();
|
||||
m_midiClient = tryMIDIClients();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void mixer::startProcessing( void )
|
||||
{
|
||||
m_audioDev->startProcessing();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void mixer::stopProcessing( void )
|
||||
{
|
||||
m_audioDev->stopProcessing();
|
||||
@@ -133,7 +138,7 @@ void mixer::stopProcessing( void )
|
||||
bool mixer::criticalXRuns( void ) const
|
||||
{
|
||||
return( ( m_cpuLoad >= 98 &&
|
||||
songEditor::inst()->realTimeTask() == TRUE ) );
|
||||
eng()->getSongEditor()->realTimeTask() == TRUE ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -145,13 +150,14 @@ const surroundSampleFrame * mixer::renderNextBuffer( void )
|
||||
|
||||
static songEditor::playPos last_metro_pos = -1;
|
||||
|
||||
songEditor::playPos p = songEditor::inst()->getPlayPos(
|
||||
songEditor::playPos p = eng()->getSongEditor()->getPlayPos(
|
||||
songEditor::PLAY_PATTERN );
|
||||
if( songEditor::inst()->playMode() == songEditor::PLAY_PATTERN &&
|
||||
pianoRoll::inst()->isRecording() == TRUE &&
|
||||
if( eng()->getSongEditor()->playMode() == songEditor::PLAY_PATTERN &&
|
||||
eng()->getPianoRoll()->isRecording() == TRUE &&
|
||||
p != last_metro_pos && p.getTact64th() % 16 == 0 )
|
||||
{
|
||||
addPlayHandle( new samplePlayHandle( "misc/metronome01.ogg" ) );
|
||||
addPlayHandle( new samplePlayHandle( "misc/metronome01.ogg",
|
||||
eng() ) );
|
||||
last_metro_pos = p;
|
||||
}
|
||||
|
||||
@@ -208,7 +214,7 @@ const surroundSampleFrame * mixer::renderNextBuffer( void )
|
||||
}
|
||||
}
|
||||
|
||||
songEditor::inst()->processNextBuffer();
|
||||
eng()->getSongEditor()->processNextBuffer();
|
||||
|
||||
for( vvector<audioPort *>::iterator it = m_audioPorts.begin();
|
||||
it != m_audioPorts.end(); ++it )
|
||||
@@ -229,7 +235,7 @@ const surroundSampleFrame * mixer::renderNextBuffer( void )
|
||||
|
||||
|
||||
// and trigger LFOs
|
||||
envelopeAndLFOWidget::triggerLFO();
|
||||
envelopeAndLFOWidget::triggerLFO( eng() );
|
||||
|
||||
const float new_cpu_load = timer.elapsed() / 10000.0f * sampleRate() /
|
||||
m_framesPerAudioBuffer;
|
||||
@@ -427,7 +433,7 @@ audioDevice * mixer::tryAudioDevices( void )
|
||||
if( dev_name == audioALSA::name() || dev_name == "" )
|
||||
{
|
||||
dev = new audioALSA( SAMPLE_RATES[DEFAULT_QUALITY_LEVEL],
|
||||
success_ful );
|
||||
success_ful, this );
|
||||
if( success_ful )
|
||||
{
|
||||
m_audioDevName = audioALSA::name();
|
||||
@@ -442,7 +448,7 @@ audioDevice * mixer::tryAudioDevices( void )
|
||||
if( dev_name == audioOSS::name() || dev_name == "" )
|
||||
{
|
||||
dev = new audioOSS( SAMPLE_RATES[DEFAULT_QUALITY_LEVEL],
|
||||
success_ful );
|
||||
success_ful, this );
|
||||
if( success_ful )
|
||||
{
|
||||
m_audioDevName = audioOSS::name();
|
||||
@@ -457,7 +463,7 @@ audioDevice * mixer::tryAudioDevices( void )
|
||||
if( dev_name == audioJACK::name() || dev_name == "" )
|
||||
{
|
||||
dev = new audioJACK( SAMPLE_RATES[DEFAULT_QUALITY_LEVEL],
|
||||
success_ful );
|
||||
success_ful, this );
|
||||
if( success_ful )
|
||||
{
|
||||
m_audioDevName = audioJACK::name();
|
||||
@@ -472,7 +478,7 @@ audioDevice * mixer::tryAudioDevices( void )
|
||||
if( dev_name == audioSDL::name() || dev_name == "" )
|
||||
{
|
||||
dev = new audioSDL( SAMPLE_RATES[DEFAULT_QUALITY_LEVEL],
|
||||
success_ful );
|
||||
success_ful, this );
|
||||
if( success_ful )
|
||||
{
|
||||
m_audioDevName = audioSDL::name();
|
||||
@@ -483,7 +489,7 @@ audioDevice * mixer::tryAudioDevices( void )
|
||||
#endif
|
||||
|
||||
// add more device-classes here...
|
||||
//dev = new audioXXXX( SAMPLE_RATES[m_qualityLevel], success_ful );
|
||||
//dev = new audioXXXX( SAMPLE_RATES[m_qualityLevel], success_ful, this );
|
||||
//if( sucess_ful )
|
||||
//{
|
||||
// return( dev );
|
||||
@@ -496,7 +502,8 @@ audioDevice * mixer::tryAudioDevices( void )
|
||||
|
||||
m_audioDevName = audioDummy::name();
|
||||
|
||||
return( new audioDummy( SAMPLE_RATES[m_qualityLevel], success_ful ) );
|
||||
return( new audioDummy( SAMPLE_RATES[m_qualityLevel], success_ful,
|
||||
this ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -510,7 +517,7 @@ midiClient * mixer::tryMIDIClients( void )
|
||||
#ifdef ALSA_SUPPORT
|
||||
if( client_name == midiALSASeq::name() || client_name == "" )
|
||||
{
|
||||
midiALSASeq * malsas = new midiALSASeq();
|
||||
midiALSASeq * malsas = new midiALSASeq( eng() );
|
||||
if( malsas->isRunning() )
|
||||
{
|
||||
m_midiClientName = midiALSASeq::name();
|
||||
@@ -521,7 +528,7 @@ midiClient * mixer::tryMIDIClients( void )
|
||||
|
||||
if( client_name == midiALSARaw::name() || client_name == "" )
|
||||
{
|
||||
midiALSARaw * malsar = new midiALSARaw();
|
||||
midiALSARaw * malsar = new midiALSARaw( eng() );
|
||||
if( malsar->isRunning() )
|
||||
{
|
||||
m_midiClientName = midiALSARaw::name();
|
||||
@@ -534,7 +541,7 @@ midiClient * mixer::tryMIDIClients( void )
|
||||
#ifdef OSS_SUPPORT
|
||||
if( client_name == midiOSS::name() || client_name == "" )
|
||||
{
|
||||
midiOSS * moss = new midiOSS();
|
||||
midiOSS * moss = new midiOSS( eng() );
|
||||
if( moss->isRunning() )
|
||||
{
|
||||
m_midiClientName = midiOSS::name();
|
||||
@@ -549,7 +556,7 @@ midiClient * mixer::tryMIDIClients( void )
|
||||
|
||||
m_midiClientName = midiDummy::name();
|
||||
|
||||
return( new midiDummy() );
|
||||
return( new midiDummy( eng() ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -50,8 +50,10 @@
|
||||
|
||||
|
||||
|
||||
nameLabel::nameLabel( const QString & _initial_name, QWidget * _parent ) :
|
||||
nameLabel::nameLabel( const QString & _initial_name, QWidget * _parent,
|
||||
engine * _engine ) :
|
||||
QLabel( _initial_name, _parent ),
|
||||
engineObject( _engine ),
|
||||
m_pixmap(),
|
||||
m_pixmapFile( "" )
|
||||
{
|
||||
@@ -267,7 +269,8 @@ void nameLabel::paintEvent( QPaintEvent * )
|
||||
}
|
||||
|
||||
p.setPen( QColor( 0, 224, 0 ) );
|
||||
bbTrack * bbt = bbTrack::findBBTrack( bbEditor::inst()->currentBB() );
|
||||
bbTrack * bbt = bbTrack::findBBTrack(
|
||||
eng()->getBBEditor()->currentBB(), eng() );
|
||||
if( bbt != NULL && bbt->getTrackSettingsWidget() ==
|
||||
dynamic_cast<trackSettingsWidget *>( parentWidget() ) )
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* note.cpp - implementation of class note
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <qmap.h>
|
||||
|
||||
#include "note_play_handle.h"
|
||||
#include "channel_track.h"
|
||||
#include "envelope_tab_widget.h"
|
||||
@@ -38,11 +36,11 @@
|
||||
|
||||
|
||||
notePlayHandle::notePlayHandle( channelTrack * _chnl_trk,
|
||||
const Uint32 _frames_ahead,
|
||||
const Uint32 _frames,
|
||||
const f_cnt_t _frames_ahead,
|
||||
const f_cnt_t _frames,
|
||||
note * _n,
|
||||
const bool _arp_note ) :
|
||||
playHandle( NOTE_PLAY_HANDLE ),
|
||||
playHandle( NOTE_PLAY_HANDLE, _chnl_trk->eng() ),
|
||||
note( *_n ),
|
||||
m_pluginData( NULL ),
|
||||
m_filter( NULL ),
|
||||
@@ -72,8 +70,8 @@ notePlayHandle::notePlayHandle( channelTrack * _chnl_trk,
|
||||
(Uint16) ( ( getVolume() / 100.0f ) *
|
||||
( m_channelTrack->getVolume() / 100.0f ) *
|
||||
127 ), 0, 127 ) ),
|
||||
midiTime::fromFrames( m_framesAhead,
|
||||
songEditor::inst()->framesPerTact() ) );
|
||||
midiTime::fromFrames( m_framesAhead,
|
||||
eng()->getSongEditor()->framesPerTact() ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -112,8 +110,8 @@ void notePlayHandle::play( void )
|
||||
}
|
||||
|
||||
if( m_released == FALSE &&
|
||||
m_totalFramesPlayed + mixer::inst()->framesPerAudioBuffer() >=
|
||||
m_frames )
|
||||
m_totalFramesPlayed +
|
||||
eng()->getMixer()->framesPerAudioBuffer() >= m_frames )
|
||||
{
|
||||
noteOff( m_frames - m_totalFramesPlayed );
|
||||
}
|
||||
@@ -123,7 +121,7 @@ void notePlayHandle::play( void )
|
||||
|
||||
if( m_released == TRUE )
|
||||
{
|
||||
Uint32 todo = mixer::inst()->framesPerAudioBuffer();
|
||||
f_cnt_t todo = eng()->getMixer()->framesPerAudioBuffer();
|
||||
// if this note is base-note for arpeggio, always set
|
||||
// m_releaseFramesToDo to bigger value than m_releaseFramesDone
|
||||
// because we do not allow notePlayHandle::done() to be true
|
||||
@@ -132,7 +130,7 @@ void notePlayHandle::play( void )
|
||||
if( arpBaseNote() == TRUE )
|
||||
{
|
||||
m_releaseFramesToDo = m_releaseFramesDone + 2 *
|
||||
mixer::inst()->framesPerAudioBuffer();
|
||||
eng()->getMixer()->framesPerAudioBuffer();
|
||||
}
|
||||
// look whether we have frames left to be done before release
|
||||
if( m_framesBeforeRelease )
|
||||
@@ -140,7 +138,7 @@ void notePlayHandle::play( void )
|
||||
// yes, then look whether these samples can be played
|
||||
// within one audio-buffer
|
||||
if( m_framesBeforeRelease <=
|
||||
mixer::inst()->framesPerAudioBuffer() )
|
||||
eng()->getMixer()->framesPerAudioBuffer() )
|
||||
{
|
||||
// yes, then we did less releaseFramesDone
|
||||
todo -= m_framesBeforeRelease;
|
||||
@@ -153,7 +151,7 @@ void notePlayHandle::play( void )
|
||||
// release-phase yet)
|
||||
todo = 0;
|
||||
m_framesBeforeRelease -=
|
||||
mixer::inst()->framesPerAudioBuffer();
|
||||
eng()->getMixer()->framesPerAudioBuffer();
|
||||
}
|
||||
}
|
||||
// look whether we're in release-phase
|
||||
@@ -201,7 +199,7 @@ void notePlayHandle::play( void )
|
||||
}
|
||||
|
||||
// update internal data
|
||||
m_totalFramesPlayed += mixer::inst()->framesPerAudioBuffer();
|
||||
m_totalFramesPlayed += eng()->getMixer()->framesPerAudioBuffer();
|
||||
}
|
||||
|
||||
|
||||
@@ -233,7 +231,7 @@ void notePlayHandle::checkValidity( void )
|
||||
|
||||
|
||||
|
||||
void notePlayHandle::noteOff( Uint32 _s )
|
||||
void notePlayHandle::noteOff( const f_cnt_t _s )
|
||||
{
|
||||
// first note-off all sub-notes
|
||||
for( notePlayHandleVector::iterator it = m_subNotes.begin();
|
||||
@@ -260,7 +258,7 @@ void notePlayHandle::noteOff( Uint32 _s )
|
||||
key(), 0 ),
|
||||
midiTime::fromFrames(
|
||||
m_framesBeforeRelease,
|
||||
songEditor::inst()->framesPerTact() ) );
|
||||
eng()->getSongEditor()->framesPerTact() ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -273,7 +271,7 @@ void notePlayHandle::noteOff( Uint32 _s )
|
||||
|
||||
|
||||
|
||||
Uint32 notePlayHandle::actualReleaseFramesToDo( void ) const
|
||||
f_cnt_t notePlayHandle::actualReleaseFramesToDo( void ) const
|
||||
{
|
||||
return( ( m_channelTrack != NULL ) ?
|
||||
m_channelTrack->m_envWidget->releaseFrames() : 0 );
|
||||
@@ -282,7 +280,7 @@ Uint32 notePlayHandle::actualReleaseFramesToDo( void ) const
|
||||
|
||||
|
||||
|
||||
void notePlayHandle::setFrames( Uint32 _frames )
|
||||
void notePlayHandle::setFrames( const f_cnt_t _frames )
|
||||
{
|
||||
m_frames = _frames;
|
||||
if( m_frames == 0 && m_channelTrack != NULL )
|
||||
@@ -294,7 +292,7 @@ void notePlayHandle::setFrames( Uint32 _frames )
|
||||
|
||||
|
||||
|
||||
float notePlayHandle::volumeLevel( Uint32 _frame )
|
||||
float notePlayHandle::volumeLevel( const f_cnt_t _frame )
|
||||
{
|
||||
return( ( m_channelTrack != NULL ) ?
|
||||
m_channelTrack->m_envWidget->volumeLevel( this, _frame ) : 0 );
|
||||
@@ -319,7 +317,7 @@ void notePlayHandle::mute( void )
|
||||
|
||||
int notePlayHandle::index( void ) const
|
||||
{
|
||||
const playHandleVector & phv = mixer::inst()->playHandles();
|
||||
const playHandleVector & phv = eng()->getMixer()->playHandles();
|
||||
int idx = 0;
|
||||
for( constPlayHandleVector::const_iterator it = phv.begin();
|
||||
it != phv.end(); ++it )
|
||||
@@ -346,7 +344,7 @@ int notePlayHandle::index( void ) const
|
||||
constNotePlayHandleVector notePlayHandle::nphsOfChannelTrack(
|
||||
const channelTrack * _ct )
|
||||
{
|
||||
const playHandleVector & phv = mixer::inst()->playHandles();
|
||||
const playHandleVector & phv = _ct->eng()->getMixer()->playHandles();
|
||||
constNotePlayHandleVector cnphv;
|
||||
|
||||
for( constPlayHandleVector::const_iterator it = phv.begin();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user