This commit is contained in:
Raine M. Ekman
2014-03-19 23:21:23 +02:00
16 changed files with 182 additions and 145 deletions

View File

@@ -1,4 +1,4 @@
?package(lmms):needs="X11" section="Apps/Sound" \
title="LMMS" hints="Audio" command="/usr/bin/lmms" \
longtitle="Linux MultiMedia Studio" \
longtitle="LMMS" \
icon="/usr/share/pixmaps/lmms.png"

View File

@@ -1,5 +1,5 @@
[Desktop Entry]
Name=Linux MultiMedia Studio
Name=LMMS
GenericName=music production suite
GenericName[ca]=Programari de producció musical
GenericName[de]=Software zur Musik-Produktion

View File

@@ -1,8 +1,8 @@
/*
* main_window.h - declaration of class MainWindow, the main window of LMMS
* MainWindow.h - declaration of class MainWindow, the main window of LMMS
*
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* Copyright (c) 2004-2013 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
@@ -22,15 +22,13 @@
*
*/
#ifndef _MAIN_WINDOW_H
#define _MAIN_WINDOW_H
#ifndef MAIN_WINDOW_H
#define MAIN_WINDOW_H
#include <QtCore/QBasicTimer>
#include <QtCore/QTimer>
#include <QtCore/QList>
#include <QtGui/QMainWindow>
#include <QtGui/QWhatsThis>
class QAction;
class QDomElement;
@@ -46,14 +44,14 @@ class MainWindow : public QMainWindow
{
Q_OBJECT
public:
inline QMdiArea * workspace( void )
QMdiArea* workspace()
{
return( m_workspace );
return m_workspace;
}
inline QWidget * toolBar( void )
QWidget* toolBar()
{
return( m_toolBar );
return m_toolBar;
}
int addWidgetToToolBar( QWidget * _w, int _row = -1, int _col = -1 );
@@ -63,24 +61,24 @@ public:
// every function that replaces current file (e.g. creates new file,
// opens another file...) has to call this before and may only process
// if this function returns true
bool mayChangeProject( void );
bool mayChangeProject();
void clearKeyModifiers( void );
void clearKeyModifiers();
inline bool isCtrlPressed( void )
bool isCtrlPressed()
{
return( m_keyMods.m_ctrl );
return m_keyMods.m_ctrl;
}
inline bool isShiftPressed( void )
bool isShiftPressed()
{
return( m_keyMods.m_shift );
return m_keyMods.m_shift;
}
inline bool isAltPressed( void )
bool isAltPressed()
{
return( m_keyMods.m_alt );
return m_keyMods.m_alt;
}
static void saveWidgetState( QWidget * _w, QDomElement & _de );
@@ -88,34 +86,31 @@ public:
public slots:
void resetWindowTitle( void );
void resetWindowTitle();
inline void emptySlot( void )
{
}
inline void enterWhatsThisMode( void )
{
QWhatsThis::enterWhatsThisMode();
}
void createNewProject( void );
void emptySlot();
void enterWhatsThisMode();
void createNewProject();
void createNewProjectFromTemplate( QAction * _idx );
void openProject( void );
bool saveProject( void );
bool saveProjectAs( void );
bool saveProjectAsNewVersion( void );
void showSettingsDialog( void );
void aboutLMMS( void );
void help( void );
void toggleAutomationEditorWin( void );
void openProject();
bool saveProject();
bool saveProjectAs();
bool saveProjectAsNewVersion();
void showSettingsDialog();
void aboutLMMS();
void help();
void toggleAutomationEditorWin();
void toggleBBEditorWin( bool forceShow = false );
void toggleSongEditorWin( void );
void toggleProjectNotesWin( void );
void toggleFxMixerWin( void );
void togglePianoRollWin( void );
void toggleControllerRack( void );
void toggleSongEditorWin();
void toggleProjectNotesWin();
void toggleFxMixerWin();
void togglePianoRollWin();
void toggleControllerRack();
void undo( void );
void redo( void );
void updatePlayPauseIcons();
void undo();
void redo();
protected:
@@ -127,11 +122,11 @@ protected:
private:
MainWindow( void );
MainWindow();
MainWindow( const MainWindow & );
virtual ~MainWindow();
void finalize( void );
void finalize();
void toggleWindow( QWidget *window, bool forceShow = false );
@@ -169,17 +164,17 @@ private:
private slots:
void browseHelp( void );
void fillTemplatesMenu( void );
void browseHelp();
void fillTemplatesMenu();
void openRecentlyOpenedProject( QAction * _action );
void showTool( QAction * _idx );
void updateRecentlyOpenedProjectsMenu( void );
void updateRecentlyOpenedProjectsMenu();
void autoSave();
signals:
void periodicUpdate( void );
void periodicUpdate();
} ;

View File

@@ -147,8 +147,6 @@ public:
return s_controllerRackView;
}
static void updatePlayPauseIcons();
static float framesPerTick()
{
return s_framesPerTick;

View File

@@ -360,6 +360,7 @@ private:
signals:
void projectLoaded();
void playbackStateChanged();
void lengthChanged( int _tacts );
void tempoChanged( bpm_t _new_bpm );
void timeSignatureChanged( int _old_ticks_per_tact,

View File

@@ -55,6 +55,10 @@ DualFilterEffect::DualFilterEffect( Model* parent, const Descriptor::SubPluginFe
{
m_filter1 = new basicFilters<2>( engine::mixer()->processingSampleRate() );
m_filter2 = new basicFilters<2>( engine::mixer()->processingSampleRate() );
// ensure filters get updated
m_filter1changed = true;
m_filter2changed = true;
}
@@ -82,10 +86,23 @@ bool DualFilterEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames
m_filter1->setFilterType( m_dfControls.m_filter1Model.value() );
m_filter2->setFilterType( m_dfControls.m_filter2Model.value() );
const bool enabled1 = m_dfControls.m_enabled1Model.value();
const bool enabled2 = m_dfControls.m_enabled2Model.value();
if( m_dfControls.m_enabled1Model.value() ) m_filter1->calcFilterCoeffs( m_dfControls.m_cut1Model.value(), m_dfControls.m_res1Model.value() );
if( m_dfControls.m_enabled2Model.value() ) m_filter2->calcFilterCoeffs( m_dfControls.m_cut2Model.value(), m_dfControls.m_res2Model.value() );
// recalculate only when necessary
if( enabled1 && m_filter1changed )
{
m_filter1->calcFilterCoeffs( m_dfControls.m_cut1Model.value(), m_dfControls.m_res1Model.value() );
m_filter1changed = false;
}
if( enabled2 && m_filter2changed )
{
m_filter2->calcFilterCoeffs( m_dfControls.m_cut2Model.value(), m_dfControls.m_res2Model.value() );
m_filter2changed = false;
}
// buffer processing loop
for( fpp_t f = 0; f < frames; ++f )
{
@@ -98,7 +115,7 @@ bool DualFilterEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames
const float mix2 = ( ( m_dfControls.m_mixModel.value( f ) + 1.0f ) / 2.0f );
// update filter 1
if( m_dfControls.m_enabled1Model.value() )
if( enabled1 )
{
s1[0] = m_filter1->update( s1[0], 0 );
s1[1] = m_filter1->update( s1[1], 1 );
@@ -113,7 +130,7 @@ bool DualFilterEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames
}
// update filter 2
if( m_dfControls.m_enabled2Model.value() )
if( enabled2 )
{
s2[0] = m_filter2->update( s2[0], 0 );
s2[1] = m_filter2->update( s2[1], 1 );
@@ -140,6 +157,8 @@ bool DualFilterEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames
extern "C"
{

View File

@@ -43,11 +43,15 @@ public:
return &m_dfControls;
}
private:
DualFilterControls m_dfControls;
basicFilters<2> * m_filter1;
basicFilters<2> * m_filter2;
bool m_filter1changed;
bool m_filter2changed;
friend class DualFilterControls;

View File

@@ -51,19 +51,13 @@ DualFilterControls::DualFilterControls( DualFilterEffect* effect ) :
m_res2Model( 0.5, basicFilters<0>::minQ(), 10.0, 0.01, this, tr( "Q/Resonance 2" ) ),
m_gain2Model( 100.0f, 0.0f, 200.0f, 0.1f, this, tr( "Gain 2" ) )
{
connect( &m_enabled1Model, SIGNAL( dataChanged() ), this, SLOT( changeControl() ) );
connect( &m_filter1Model, SIGNAL( dataChanged() ), this, SLOT( changeControl() ) );
connect( &m_cut1Model, SIGNAL( dataChanged() ), this, SLOT( changeControl() ) );
connect( &m_res1Model, SIGNAL( dataChanged() ), this, SLOT( changeControl() ) );
connect( &m_gain1Model, SIGNAL( dataChanged() ), this, SLOT( changeControl() ) );
connect( &m_filter1Model, SIGNAL( dataChanged() ), this, SLOT( updateFilter1() ) );
connect( &m_cut1Model, SIGNAL( dataChanged() ), this, SLOT( updateFilter1() ) );
connect( &m_res1Model, SIGNAL( dataChanged() ), this, SLOT( updateFilter1() ) );
connect( &m_mixModel, SIGNAL( dataChanged() ), this, SLOT( changeControl() ) );
connect( &m_enabled2Model, SIGNAL( dataChanged() ), this, SLOT( changeControl() ) );
connect( &m_filter2Model, SIGNAL( dataChanged() ), this, SLOT( changeControl() ) );
connect( &m_cut2Model, SIGNAL( dataChanged() ), this, SLOT( changeControl() ) );
connect( &m_res2Model, SIGNAL( dataChanged() ), this, SLOT( changeControl() ) );
connect( &m_gain2Model, SIGNAL( dataChanged() ), this, SLOT( changeControl() ) );
connect( &m_filter2Model, SIGNAL( dataChanged() ), this, SLOT( updateFilter2() ) );
connect( &m_cut2Model, SIGNAL( dataChanged() ), this, SLOT( updateFilter2() ) );
connect( &m_res2Model, SIGNAL( dataChanged() ), this, SLOT( updateFilter2() ) );
m_filter1Model.addItem( tr( "LowPass" ), new PixmapLoader( "filter_lp" ) );
m_filter1Model.addItem( tr( "HiPass" ), new PixmapLoader( "filter_hp" ) );
@@ -102,19 +96,30 @@ DualFilterControls::DualFilterControls( DualFilterEffect* effect ) :
void DualFilterControls::changeControl()
void DualFilterControls::updateFilter1()
{
engine::getSong()->setModified();
m_effect->m_filter1changed = true;
}
void DualFilterControls::updateFilter2()
{
m_effect->m_filter2changed = true;
}
void DualFilterControls::updateFilters()
{
// swap filters to new ones
delete m_effect->m_filter1;
delete m_effect->m_filter2;
m_effect->m_filter1 = new basicFilters<2>( engine::mixer()->processingSampleRate() );
m_effect->m_filter2 = new basicFilters<2>( engine::mixer()->processingSampleRate() );
// flag filters as needing recalculation
updateFilter1();
updateFilter2();
}

View File

@@ -62,7 +62,8 @@ public:
private slots:
void changeControl();
void updateFilter1();
void updateFilter2();
void updateFilters();
private:

View File

@@ -607,7 +607,7 @@ void sf2Instrument::playNote( NotePlayHandle * _n, sampleFrame * )
}
#endif
const float currentVelocity = _n->volumeLevel( tfp ) * MidiMaxVelocity * DefaultVolume / MaxVolume;
const float currentVelocity = _n->volumeLevel( tfp ) * instrumentTrack()->midiPort()->baseVelocity();
if( pluginData->fluidVoice &&
pluginData->lastVelocity != currentVelocity )
{

View File

@@ -146,42 +146,6 @@ void engine::destroy()
void engine::updatePlayPauseIcons()
{
s_songEditor->setPauseIcon( false );
s_automationEditor->setPauseIcon( false );
s_bbEditor->setPauseIcon( false );
s_pianoRoll->setPauseIcon( false );
if( s_song->isPlaying() )
{
switch( s_song->playMode() )
{
case song::Mode_PlaySong:
s_songEditor->setPauseIcon( true );
break;
case song::Mode_PlayAutomationPattern:
s_automationEditor->setPauseIcon( true );
break;
case song::Mode_PlayBB:
s_bbEditor->setPauseIcon( true );
break;
case song::Mode_PlayPattern:
s_pianoRoll->setPauseIcon( true );
break;
default:
break;
}
}
}
void engine::updateFramesPerTick()
{
s_framesPerTick = s_mixer->processingSampleRate() * 60.0f * 4 /

View File

@@ -404,10 +404,7 @@ void song::playSong()
savePos();
if( QApplication::type() != QApplication::Tty )
{
engine::updatePlayPauseIcons();
}
emit playbackStateChanged();
}
@@ -447,7 +444,7 @@ void song::playTrack( track * _trackToPlay )
savePos();
engine::updatePlayPauseIcons();
emit playbackStateChanged();
}
@@ -468,7 +465,7 @@ void song::playBB()
savePos();
engine::updatePlayPauseIcons();
emit playbackStateChanged();
}
@@ -493,7 +490,7 @@ void song::playPattern( pattern * _patternToPlay, bool _loop )
savePos();
engine::updatePlayPauseIcons();
emit playbackStateChanged();
}
@@ -546,7 +543,7 @@ void song::togglePause()
m_vstSyncController.setPlaybackState( m_playing );
engine::updatePlayPauseIcons();
emit playbackStateChanged();
}
@@ -605,9 +602,7 @@ void song::stop()
m_playMode = Mode_None;
if(QApplication::type() != QApplication::Tty) {
engine::updatePlayPauseIcons();
}
emit playbackStateChanged();
}

View File

@@ -33,6 +33,7 @@
#include <QtGui/QMenuBar>
#include <QtGui/QMessageBox>
#include <QtGui/QSplitter>
#include <QtGui/QWhatsThis>
#include "lmmsversion.h"
#include "MainWindow.h"
@@ -67,7 +68,7 @@
MainWindow::MainWindow( void ) :
MainWindow::MainWindow() :
m_workspace( NULL ),
m_templatesMenu( NULL ),
m_recentlyOpenedProjectsMenu( NULL ),
@@ -189,6 +190,9 @@ MainWindow::MainWindow( void ) :
connect(&m_autoSaveTimer, SIGNAL(timeout()), this, SLOT(autoSave()));
m_autoSaveTimer.start(1000 * 60); // 1 minute
}
connect( engine::getSong(), SIGNAL( playbackStateChanged() ),
this, SLOT( updatePlayPauseIcons() ) );
}
@@ -211,7 +215,7 @@ MainWindow::~MainWindow()
void MainWindow::finalize( void )
void MainWindow::finalize()
{
resetWindowTitle();
setWindowIcon( embed::getIconPixmap( "icon" ) );
@@ -542,7 +546,7 @@ void MainWindow::addSpacingToToolBar( int _size )
void MainWindow::resetWindowTitle( void )
void MainWindow::resetWindowTitle()
{
QString title = "";
if( engine::getSong()->projectFileName() != "" )
@@ -564,7 +568,7 @@ void MainWindow::resetWindowTitle( void )
bool MainWindow::mayChangeProject( void )
bool MainWindow::mayChangeProject()
{
engine::getSong()->stop();
@@ -599,7 +603,7 @@ bool MainWindow::mayChangeProject( void )
void MainWindow::clearKeyModifiers( void )
void MainWindow::clearKeyModifiers()
{
m_keyMods.m_ctrl = FALSE;
m_keyMods.m_shift = FALSE;
@@ -658,8 +662,20 @@ void MainWindow::restoreWidgetState( QWidget * _w, const QDomElement & _de )
void MainWindow::emptySlot()
{
}
void MainWindow::createNewProject( void )
void MainWindow::enterWhatsThisMode()
{
QWhatsThis::enterWhatsThisMode();
}
void MainWindow::createNewProject()
{
if( mayChangeProject() )
{
@@ -708,7 +724,7 @@ void MainWindow::openProject()
void MainWindow::updateRecentlyOpenedProjectsMenu( void )
void MainWindow::updateRecentlyOpenedProjectsMenu()
{
m_recentlyOpenedProjectsMenu->clear();
QStringList rup = configManager::inst()->recentlyOpenedProjects();
@@ -734,7 +750,7 @@ void MainWindow::openRecentlyOpenedProject( QAction * _action )
bool MainWindow::saveProject( void )
bool MainWindow::saveProject()
{
if( engine::getSong()->projectFileName() == "" )
{
@@ -750,7 +766,7 @@ bool MainWindow::saveProject( void )
bool MainWindow::saveProjectAs( void )
bool MainWindow::saveProjectAs()
{
VersionedSaveDialog sfd( this, tr( "Save project" ), "",
tr( "LMMS Project (*.mmpz *.mmp);;"
@@ -779,7 +795,7 @@ bool MainWindow::saveProjectAs( void )
bool MainWindow::saveProjectAsNewVersion( void )
bool MainWindow::saveProjectAsNewVersion()
{
QString fileName = engine::getSong()->projectFileName();
if( fileName == "" )
@@ -799,7 +815,7 @@ bool MainWindow::saveProjectAsNewVersion( void )
void MainWindow::showSettingsDialog( void )
void MainWindow::showSettingsDialog()
{
setupDialog sd;
sd.exec();
@@ -808,7 +824,7 @@ void MainWindow::showSettingsDialog( void )
void MainWindow::aboutLMMS( void )
void MainWindow::aboutLMMS()
{
aboutDialog().exec();
}
@@ -816,7 +832,7 @@ void MainWindow::aboutLMMS( void )
void MainWindow::help( void )
void MainWindow::help()
{
QMessageBox::information( this, tr( "Help not available" ),
tr( "Currently there's no help "
@@ -865,7 +881,7 @@ void MainWindow::toggleBBEditorWin( bool forceShow )
void MainWindow::toggleSongEditorWin( void )
void MainWindow::toggleSongEditorWin()
{
toggleWindow( engine::songEditor() );
}
@@ -873,7 +889,7 @@ void MainWindow::toggleSongEditorWin( void )
void MainWindow::toggleProjectNotesWin( void )
void MainWindow::toggleProjectNotesWin()
{
toggleWindow( engine::getProjectNotes() );
}
@@ -881,7 +897,7 @@ void MainWindow::toggleProjectNotesWin( void )
void MainWindow::togglePianoRollWin( void )
void MainWindow::togglePianoRollWin()
{
toggleWindow( engine::pianoRoll() );
}
@@ -889,7 +905,7 @@ void MainWindow::togglePianoRollWin( void )
void MainWindow::toggleAutomationEditorWin( void )
void MainWindow::toggleAutomationEditorWin()
{
toggleWindow( engine::automationEditor() );
}
@@ -897,7 +913,7 @@ void MainWindow::toggleAutomationEditorWin( void )
void MainWindow::toggleFxMixerWin( void )
void MainWindow::toggleFxMixerWin()
{
toggleWindow( engine::fxMixerView() );
}
@@ -905,7 +921,7 @@ void MainWindow::toggleFxMixerWin( void )
void MainWindow::toggleControllerRack( void )
void MainWindow::toggleControllerRack()
{
toggleWindow( engine::getControllerRackView() );
}
@@ -913,7 +929,43 @@ void MainWindow::toggleControllerRack( void )
void MainWindow::undo( void )
void MainWindow::updatePlayPauseIcons()
{
engine::songEditor()->setPauseIcon( false );
engine::automationEditor()->setPauseIcon( false );
engine::getBBEditor()->setPauseIcon( false );
engine::pianoRoll()->setPauseIcon( false );
if( engine::getSong()->isPlaying() )
{
switch( engine::getSong()->playMode() )
{
case song::Mode_PlaySong:
engine::songEditor()->setPauseIcon( true );
break;
case song::Mode_PlayAutomationPattern:
engine::automationEditor()->setPauseIcon( true );
break;
case song::Mode_PlayBB:
engine::getBBEditor()->setPauseIcon( true );
break;
case song::Mode_PlayPattern:
engine::pianoRoll()->setPauseIcon( true );
break;
default:
break;
}
}
}
void MainWindow::undo()
{
engine::projectJournal()->undo();
}
@@ -921,7 +973,7 @@ void MainWindow::undo( void )
void MainWindow::redo( void )
void MainWindow::redo()
{
engine::projectJournal()->redo();
}
@@ -1015,7 +1067,7 @@ void MainWindow::timerEvent( QTimerEvent * _te)
void MainWindow::fillTemplatesMenu( void )
void MainWindow::fillTemplatesMenu()
{
m_templatesMenu->clear();
@@ -1064,7 +1116,7 @@ void MainWindow::showTool( QAction * _idx )
void MainWindow::browseHelp( void )
void MainWindow::browseHelp()
{
// file:// alternative for offline help
QString url = "http://lmms.sf.net/wiki/index.php?title=Main_Page";

View File

@@ -2,7 +2,7 @@
* ControllerView.cpp - view-component for an controller
*
* Copyright (c) 2008-2009 Paul Giblock <drfaygo/at/gmail.com>
* Copyright (c) 2011 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2011-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -30,6 +30,7 @@
#include <QtGui/QMdiSubWindow>
#include <QtGui/QPainter>
#include <QtGui/QInputDialog>
#include <QtGui/QWhatsThis>
#include "ControllerView.h"

View File

@@ -28,6 +28,7 @@
#include <QtGui/QMdiArea>
#include <QtGui/QMdiSubWindow>
#include <QtGui/QPainter>
#include <QtGui/QWhatsThis>
#include "EffectView.h"
#include "caption_menu.h"

View File

@@ -29,6 +29,7 @@
#include <QtGui/QMouseEvent>
#include <QtGui/QPainter>
#include <QtGui/QPalette>
#include <QtGui/QWhatsThis>
#ifndef __USE_XOPEN
#define __USE_XOPEN