Merge branch 'master' of https://github.com/LMMS/lmms into StCyr_ArtworkTabs

This commit is contained in:
Cyrille Bollu
2016-05-04 15:23:42 +02:00
254 changed files with 68158 additions and 19709 deletions

54
include/AudioSndio.h Normal file
View File

@@ -0,0 +1,54 @@
#ifndef _AUDIO_SNDIO_H
#define _AUDIO_SNDIO_H
#include "lmmsconfig.h"
#ifdef LMMS_HAVE_SNDIO
#include <sndio.h>
#include "AudioDevice.h"
#include "AudioDeviceSetupWidget.h"
class LcdSpinBox;
class QLineEdit;
class AudioSndio : public AudioDevice, public QThread
{
public:
AudioSndio( bool & _success_ful, Mixer * _mixer );
virtual ~AudioSndio();
inline static QString name( void )
{
return QT_TRANSLATE_NOOP( "setupWidget", "sndio" );
}
class setupWidget : public AudioDeviceSetupWidget
{
public:
setupWidget( QWidget * _parent );
virtual ~setupWidget();
virtual void saveSettings( void );
private:
QLineEdit * m_device;
LcdSpinBox * m_channels;
} ;
private:
virtual void startProcessing( void );
virtual void stopProcessing( void );
virtual void applyQualitySettings( void );
virtual void run( void );
struct sio_hdl *m_hdl;
struct sio_par m_par;
} ;
#endif /* LMMS_HAVE_SNDIO */
#endif /* _AUDIO_SNDIO_H */

View File

@@ -55,6 +55,7 @@ class AutomationEditor : public QWidget, public JournallingObject
Q_PROPERTY(QColor vertexColor READ vertexColor WRITE setVertexColor)
Q_PROPERTY(QBrush scaleColor READ scaleColor WRITE setScaleColor)
Q_PROPERTY(QBrush graphColor READ graphColor WRITE setGraphColor)
Q_PROPERTY(QColor crossColor READ crossColor WRITE setCrossColor)
public:
void setCurrentPattern(AutomationPattern * new_pattern);
@@ -80,10 +81,12 @@ public:
QBrush graphColor() const;
QColor vertexColor() const;
QBrush scaleColor() const;
QColor crossColor() const;
void setGridColor(const QColor& c);
void setGraphColor(const QBrush& c);
void setVertexColor(const QColor& c);
void setScaleColor(const QBrush& c);
void setCrossColor(const QColor& c);
enum EditModes
{
@@ -159,7 +162,7 @@ private:
} ;
// some constants...
static const int SCROLLBAR_SIZE = 16;
static const int SCROLLBAR_SIZE = 14;
static const int TOP_MARGIN = 16;
static const int DEFAULT_Y_DELTA = 6;
@@ -237,6 +240,7 @@ private:
QBrush m_graphColor;
QColor m_vertexColor;
QBrush m_scaleColor;
QColor m_crossColor;
friend class AutomationEditorWindow;

View File

@@ -25,6 +25,8 @@
#ifndef AUTOMATION_PATTERN_VIEW_H
#define AUTOMATION_PATTERN_VIEW_H
#include <QStaticText>
#include "Track.h"
class AutomationPattern;
@@ -34,9 +36,6 @@ class AutomationPatternView : public TrackContentObjectView
{
Q_OBJECT
// theming qproperties
Q_PROPERTY( QColor fgColor READ fgColor WRITE setFgColor )
Q_PROPERTY( QColor textColor READ textColor WRITE setTextColor )
public:
AutomationPatternView( AutomationPattern * _pat, TrackView * _parent );
@@ -59,12 +58,7 @@ protected slots:
protected:
virtual void constructContextMenu( QMenu * );
virtual void mouseDoubleClickEvent(QMouseEvent * me );
virtual void paintEvent( QPaintEvent * _pe );
virtual void resizeEvent( QResizeEvent * _re )
{
m_needsUpdate = true;
TrackContentObjectView::resizeEvent( _re );
}
virtual void paintEvent( QPaintEvent * pe );
virtual void dragEnterEvent( QDragEnterEvent * _dee );
virtual void dropEvent( QDropEvent * _de );
@@ -72,7 +66,8 @@ protected:
private:
AutomationPattern * m_pat;
QPixmap m_paintPixmap;
bool m_needsUpdate;
QStaticText m_staticTextName;
static QPixmap * s_pat_rec;

View File

@@ -29,6 +29,7 @@
#include <QtCore/QObject>
#include <QtCore/QMap>
#include <QStaticText>
#include "Track.h"
@@ -107,14 +108,16 @@ protected slots:
protected:
void paintEvent( QPaintEvent * );
void mouseDoubleClickEvent( QMouseEvent * _me );
virtual void paintEvent( QPaintEvent * pe );
virtual void mouseDoubleClickEvent( QMouseEvent * _me );
virtual void constructContextMenu( QMenu * );
private:
BBTCO * m_bbTCO;
QPixmap m_paintPixmap;
QStaticText m_staticTextName;
} ;

View File

@@ -51,8 +51,6 @@ public:
return castModel<ComboBoxModel>();
}
virtual QSize sizeHint() const;
public slots:
void selectNext();
void selectPrevious();

View File

@@ -230,7 +230,7 @@ public:
const QString & value );
void deleteValue( const QString & cls, const QString & attribute);
void loadConfigFile();
void loadConfigFile( const QString & configFile = "" );
void saveConfigFile();
@@ -260,7 +260,7 @@ private:
void upgrade_1_1_90();
void upgrade();
const QString m_lmmsRcFile;
QString m_lmmsRcFile;
QString m_workingDir;
QString m_dataDir;
QString m_artworkDir;

View File

@@ -122,6 +122,7 @@ private:
void upgrade_0_4_0_20080622();
void upgrade_0_4_0_beta1();
void upgrade_0_4_0_rc2();
void upgrade_1_1_91();
void upgrade();

View File

@@ -31,6 +31,7 @@
class DetuningHelper : public InlineAutomation
{
Q_OBJECT
MM_OPERATORS
public:
DetuningHelper() :

View File

@@ -81,6 +81,7 @@ public:
class DummyEffect : public Effect
{
Q_OBJECT
public:
DummyEffect( Model * _parent, const QDomElement& originalPluginData ) :
Effect( NULL, _parent, NULL ),

View File

@@ -28,6 +28,9 @@
#include "Instrument.h"
#include "InstrumentView.h"
#include "Engine.h"
#include <string.h>
class DummyInstrument : public Instrument
@@ -42,8 +45,10 @@ public:
{
}
virtual void playNote( NotePlayHandle *, sampleFrame * )
virtual void playNote( NotePlayHandle *, sampleFrame * buffer )
{
memset( buffer, 0, sizeof( sampleFrame ) *
Engine::mixer()->framesPerPeriod() );
}
virtual void saveSettings( QDomDocument &, QDomElement & )

View File

@@ -201,7 +201,7 @@ public:
QString fullName() const
{
return QDir::cleanPath(m_path) + "/" + text(0);
return QFileInfo(m_path, text(0)).absoluteFilePath();
}
inline FileTypes type( void ) const

View File

@@ -28,6 +28,7 @@
#include <QWidget>
#include <QLabel>
#include <QStaticText>
#include "Knob.h"
#include "LcdWidget.h"
@@ -41,6 +42,10 @@ class FxLine : public QWidget
Q_OBJECT
public:
Q_PROPERTY( QBrush backgroundActive READ backgroundActive WRITE setBackgroundActive )
Q_PROPERTY( QColor strokeOuterActive READ strokeOuterActive WRITE setStrokeOuterActive )
Q_PROPERTY( QColor strokeOuterInactive READ strokeOuterInactive WRITE setStrokeOuterInactive )
Q_PROPERTY( QColor strokeInnerActive READ strokeInnerActive WRITE setStrokeInnerActive )
Q_PROPERTY( QColor strokeInnerInactive READ strokeInnerInactive WRITE setStrokeInnerInactive )
FxLine( QWidget * _parent, FxMixerView * _mv, int _channelIndex);
~FxLine();
@@ -57,19 +62,38 @@ public:
QBrush backgroundActive() const;
void setBackgroundActive( const QBrush & c );
QColor strokeOuterActive() const;
void setStrokeOuterActive( const QColor & c );
QColor strokeOuterInactive() const;
void setStrokeOuterInactive( const QColor & c );
QColor strokeInnerActive() const;
void setStrokeInnerActive( const QColor & c );
QColor strokeInnerInactive() const;
void setStrokeInnerInactive( const QColor & c );
static const int FxLineHeight;
private:
static void drawFxLine( QPainter* p, const FxLine *fxLine, const QString& name, bool isActive, bool sendToThis, bool receiveFromThis );
void drawFxLine( QPainter* p, const FxLine *fxLine, const QString& name, bool isActive, bool sendToThis, bool receiveFromThis );
FxMixerView * m_mv;
LcdWidget* m_lcd;
int m_channelIndex;
QBrush m_backgroundActive;
QColor m_strokeOuterActive;
QColor m_strokeOuterInactive;
QColor m_strokeInnerActive;
QColor m_strokeInnerInactive;
static QPixmap * s_sendBgArrow;
static QPixmap * s_receiveBgArrow;
QStaticText m_staticTextName;
private slots:
void renameChannel();
void removeChannel();

View File

@@ -194,11 +194,6 @@ public:
return m_fxChannels.size();
}
inline QVector<FxChannel *> fxChannels() const
{
return m_fxChannels;
}
FxRouteVector m_fxRoutes;
private:

View File

@@ -56,13 +56,13 @@ public:
do
{
nphsLeft = false;
foreach( const NotePlayHandle * cnph, nphv )
for( const NotePlayHandle * constNotePlayHandle : nphv )
{
NotePlayHandle * nph = const_cast<NotePlayHandle *>( cnph );
if( nph->state() != ThreadableJob::Done && ! nph->isFinished() )
NotePlayHandle * notePlayHandle = const_cast<NotePlayHandle *>( constNotePlayHandle );
if( notePlayHandle->state() != ThreadableJob::Done && ! notePlayHandle->isFinished() )
{
nphsLeft = true;
nph->process();
notePlayHandle->process();
}
}
}

View File

@@ -227,6 +227,7 @@ protected slots:
void updateBaseNote();
void updatePitch();
void updatePitchRange();
void updateEffectChannel();
private:

View File

@@ -38,7 +38,7 @@ class TextFloat;
enum knobTypes
{
knobDark_28, knobBright_26, knobSmall_17, knobGreen_17, knobVintage_32, knobStyled
knobDark_28, knobBright_26, knobSmall_17, knobVintage_32, knobStyled
} ;
@@ -65,6 +65,8 @@ class EXPORT Knob : public QWidget, public FloatModelView
mapPropertyFromModel(float,volumeRatio,setVolumeRatio,m_volumeRatio);
Q_PROPERTY(knobTypes knobNum READ knobNum WRITE setknobNum)
Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor)
void initUi( const QString & _name ); //!< to be called by ctors
void onKnobNumUpdated(); //!< to be called when you updated @a m_knobNum
@@ -81,35 +83,38 @@ public:
setDescription( _txt_before );
setUnit( _txt_after );
}
void setLabel( const QString & _txt );
void setLabel( const QString & txt );
void setTotalAngle( float _angle );
void setTotalAngle( float angle );
// Begin styled knob accessors
float innerRadius() const;
void setInnerRadius( float _r );
void setInnerRadius( float r );
float outerRadius() const;
void setOuterRadius( float _r );
void setOuterRadius( float r );
knobTypes knobNum() const;
void setknobNum( knobTypes _k );
void setknobNum( knobTypes k );
QPointF centerPoint() const;
float centerPointX() const;
void setCenterPointX( float _c );
void setCenterPointX( float c );
float centerPointY() const;
void setCenterPointY( float _c );
void setCenterPointY( float c );
float lineWidth() const;
void setLineWidth( float _w );
void setLineWidth( float w );
QColor outerColor() const;
void setOuterColor( const QColor & _c );
void setOuterColor( const QColor & c );
QColor lineColor() const;
void setlineColor( const QColor & _c );
void setlineColor( const QColor & c );
QColor arcColor() const;
void setarcColor( const QColor & _c );
void setarcColor( const QColor & c );
QColor textColor() const;
void setTextColor( const QColor & c );
signals:
@@ -186,6 +191,8 @@ private:
QColor m_outerColor;
QColor m_lineColor; //!< unused yet
QColor m_arcColor; //!< unused yet
QColor m_textColor;
knobTypes m_knobNum;

View File

@@ -34,6 +34,11 @@
class EXPORT LcdWidget : public QWidget
{
Q_OBJECT
// theming qproperties
Q_PROPERTY( QColor textColor READ textColor WRITE setTextColor )
Q_PROPERTY( QColor textShadowColor READ textShadowColor WRITE setTextShadowColor )
public:
LcdWidget( QWidget* parent, const QString& name = QString::null );
LcdWidget( int numDigits, QWidget* parent, const QString& name = QString::null );
@@ -54,13 +59,19 @@ public:
inline int numDigits() const { return m_numDigits; }
inline void setNumDigits( int n ) { m_numDigits = n; updateSize(); }
QColor textColor() const;
void setTextColor( const QColor & c );
QColor textShadowColor() const;
void setTextShadowColor( const QColor & c );
public slots:
virtual void setMarginWidth( int _width );
virtual void setMarginWidth( int width );
protected:
virtual void paintEvent( QPaintEvent * _me );
virtual void paintEvent( QPaintEvent * pe );
virtual void updateSize();
@@ -81,6 +92,9 @@ private:
QString m_label;
QPixmap* m_lcdPixmap;
QColor m_textColor;
QColor m_textShadowColor;
int m_cellWidth;
int m_cellHeight;
int m_numDigits;

View File

@@ -30,6 +30,7 @@
#include <QtCore/QList>
#include <QMainWindow>
#include "ConfigManager.h"
#include "SubWindow.h"
class QAction;
@@ -81,11 +82,31 @@ public:
///
bool mayChangeProject(bool stopPlayback);
void autoSaveTimerStart()
// Auto save timer intervals. The slider in SetupDialog.cpp wants
// minutes and the rest milliseconds.
static const int DEFAULT_SAVE_INTERVAL_MINUTES = 2;
static const int DEFAULT_AUTO_SAVE_INTERVAL = DEFAULT_SAVE_INTERVAL_MINUTES * 60 * 1000;
static const int m_autoSaveShortTime = 10 * 1000; // 10s short loop
void autoSaveTimerReset( int msec = ConfigManager::inst()->
value( "ui", "saveinterval" ).toInt()
* 60 * 1000 )
{
m_autoSaveTimer.start( 1000 * 60 ); // 1 minute
if( msec < m_autoSaveShortTime ) // No 'saveinterval' in .lmmsrc.xml
{
msec = DEFAULT_AUTO_SAVE_INTERVAL;
}
m_autoSaveTimer.start( msec );
}
int getAutoSaveTimerInterval()
{
return m_autoSaveTimer.interval();
}
void runAutoSave();
enum SessionState
{
Normal,
@@ -155,7 +176,6 @@ public slots:
void redo();
void autoSave();
void runAutoSave();
protected:
virtual void closeEvent( QCloseEvent * _ce );
@@ -204,6 +224,7 @@ private:
QBasicTimer m_updateTimer;
QTimer m_autoSaveTimer;
int m_autoSaveInterval;
friend class GuiApplication;

48
include/MidiSndio.h Normal file
View File

@@ -0,0 +1,48 @@
#ifndef _MIDI_SNDIO_H
#define _MIDI_SNDIO_H
#include "lmmsconfig.h"
#ifdef LMMS_HAVE_SNDIO
#include <QtCore/QThread>
#include <QtCore/QFile>
#include <sndio.h>
#include "MidiClient.h"
class QLineEdit;
class MidiSndio : public MidiClientRaw, public QThread
{
public:
MidiSndio( void );
virtual ~MidiSndio();
static QString probeDevice(void);
inline static QString name(void)
{
return QT_TRANSLATE_NOOP("MidiSetupWidget", "sndio MIDI");
}
inline static QString configSection()
{
return "MidiSndio";
}
protected:
virtual void sendByte(const unsigned char c);
virtual void run(void);
private:
struct mio_hdl *m_hdl;
volatile bool m_quit;
} ;
#endif /* LMMS_HAVE_SNDIO */
#endif /* _MIDI_SNDIO_H */

View File

@@ -224,7 +224,7 @@ public:
return m_playHandles;
}
void removePlayHandles( Track * _track, bool removeIPHs = true );
void removePlayHandlesOfTypes( Track * _track, const quint8 types );
bool hasNotePlayHandles();
@@ -314,8 +314,7 @@ public:
m_playHandleRemovalMutex.unlock();
}
static float peakValueLeft( sampleFrame * _ab, const f_cnt_t _frames );
static float peakValueRight( sampleFrame * _ab, const f_cnt_t _frames );
void getPeakValues( sampleFrame * _ab, const f_cnt_t _frames, float & peakLeft, float & peakRight ) const;
bool criticalXRuns() const;

View File

@@ -206,11 +206,13 @@ public:
void mute();
/*! Returns index of NotePlayHandle in vector of note-play-handles
belonging to this instrument track - used by arpeggiator */
belonging to this instrument track - used by arpeggiator.
Ignores child note-play-handles, returns -1 when called on one */
int index() const;
/*! returns list of note-play-handles belonging to given instrument track,
if allPlayHandles = true, also released note-play-handles are returned */
/*! Returns list of note-play-handles belonging to given instrument track.
If allPlayHandles = true, also released note-play-handles and children
are returned */
static ConstNotePlayHandleList nphsOfInstrumentTrack( const InstrumentTrack* Track, bool allPlayHandles = false );
/*! Returns whether given NotePlayHandle instance is equal to *this */

View File

@@ -31,6 +31,7 @@
#include <QDialog>
#include <QtCore/QThread>
#include <QPixmap>
#include <QStaticText>
#include "Note.h"
@@ -159,9 +160,6 @@ class PatternView : public TrackContentObjectView
{
Q_OBJECT
// theming qproperties
Q_PROPERTY( QColor fgColor READ fgColor WRITE setFgColor )
Q_PROPERTY( QColor textColor READ textColor WRITE setTextColor )
public:
PatternView( Pattern* pattern, TrackView* parent );
virtual ~PatternView();
@@ -182,12 +180,7 @@ protected:
virtual void constructContextMenu( QMenu * );
virtual void mousePressEvent( QMouseEvent * _me );
virtual void mouseDoubleClickEvent( QMouseEvent * _me );
virtual void paintEvent( QPaintEvent * _pe );
virtual void resizeEvent( QResizeEvent * _re )
{
m_needsUpdate = true;
TrackContentObjectView::resizeEvent( _re );
}
virtual void paintEvent( QPaintEvent * pe );
virtual void wheelEvent( QWheelEvent * _we );
@@ -199,7 +192,8 @@ private:
Pattern* m_pat;
QPixmap m_paintPixmap;
bool m_needsUpdate;
QStaticText m_staticTextName;
} ;

View File

@@ -59,6 +59,11 @@ class PianoRoll : public QWidget
Q_PROPERTY( QColor barColor READ barColor WRITE setBarColor )
Q_PROPERTY( float noteBorderRadiusX READ noteBorderRadiusX WRITE setNoteBorderRadiusX )
Q_PROPERTY( float noteBorderRadiusY READ noteBorderRadiusY WRITE setNoteBorderRadiusY )
Q_PROPERTY( QColor selectedNoteColor READ selectedNoteColor WRITE setSelectedNoteColor )
Q_PROPERTY( QColor textColor READ textColor WRITE setTextColor )
Q_PROPERTY( QColor textColorLight READ textColorLight WRITE setTextColorLight )
Q_PROPERTY( QColor textShadow READ textShadow WRITE setTextShadow )
Q_PROPERTY( QColor markedSemitoneColor READ markedSemitoneColor WRITE setMarkedSemitoneColor )
public:
enum EditModes
{
@@ -115,6 +120,16 @@ public:
void setNoteBorderRadiusX( float b );
float noteBorderRadiusY() const;
void setNoteBorderRadiusY( float b );
QColor selectedNoteColor() const;
void setSelectedNoteColor( const QColor & c );
QColor textColor() const;
void setTextColor( const QColor & c );
QColor textColorLight() const;
void setTextColorLight( const QColor & c );
QColor textShadow() const;
void setTextShadow( const QColor & c );
QColor markedSemitoneColor() const;
void setMarkedSemitoneColor( const QColor & c );
protected:
@@ -133,7 +148,7 @@ protected:
int getKey( int y ) const;
static void drawNoteRect( QPainter & p, int x, int y,
int width, const Note * n, const QColor & noteCol,
float radiusX, float radiusY );
float radiusX, float radiusY, const QColor & selCol );
void removeSelection();
void selectAll();
NoteVector getSelectedNotes();
@@ -358,6 +373,11 @@ private:
QColor m_barColor;
float m_noteBorderRadiusX;
float m_noteBorderRadiusY;
QColor m_selectedNoteColor;
QColor m_textColor;
QColor m_textColorLight;
QColor m_textShadow;
QColor m_markedSemitoneColor;
signals:
void positionChanged( const MidiTime & );

View File

@@ -40,11 +40,10 @@ class PlayHandle : public ThreadableJob
public:
enum Types
{
TypeNotePlayHandle,
TypeInstrumentPlayHandle,
TypeSamplePlayHandle,
TypePresetPreviewHandle,
TypeCount
TypeNotePlayHandle = 0x01,
TypeInstrumentPlayHandle = 0x02,
TypeSamplePlayHandle = 0x04,
TypePresetPreviewHandle = 0x08
} ;
typedef Types Type;

View File

@@ -38,6 +38,11 @@ public:
PresetPreviewPlayHandle( const QString& presetFile, bool loadByPlugin = false, DataFile *dataFile = 0 );
virtual ~PresetPreviewPlayHandle();
virtual inline bool affinityMatters() const
{
return true;
}
virtual void play( sampleFrame* buffer );
virtual bool isFinished() const;

View File

@@ -221,9 +221,6 @@ public:
~shmFifo()
{
#ifndef USE_QT_SHMEM
shmdt( m_data );
#endif
// master?
if( m_master )
{
@@ -235,6 +232,9 @@ public:
sem_destroy( m_messageSem );
#endif
}
#ifndef USE_QT_SHMEM
shmdt( m_data );
#endif
}
inline bool isInvalid() const

View File

@@ -88,10 +88,6 @@ signals:
class SampleTCOView : public TrackContentObjectView
{
Q_OBJECT
// theming qproperties
Q_PROPERTY( QColor fgColor READ fgColor WRITE setFgColor )
Q_PROPERTY( QColor textColor READ textColor WRITE setTextColor )
public:
SampleTCOView( SampleTCO * _tco, TrackView * _tv );
@@ -102,6 +98,7 @@ public slots:
void updateSample();
protected:
virtual void contextMenuEvent( QContextMenuEvent * _cme );
virtual void mousePressEvent( QMouseEvent * _me );
@@ -113,6 +110,7 @@ protected:
private:
SampleTCO * m_tco;
QPixmap m_paintPixmap;
} ;

View File

@@ -44,7 +44,6 @@ class QSlider;
class TabBar;
class SetupDialog : public QDialog
{
Q_OBJECT
@@ -84,6 +83,11 @@ private slots:
void setDefaultSoundfont( const QString & _sf );
void setBackgroundArtwork( const QString & _ba );
// performance settings widget
void setAutoSaveInterval( int time );
void resetAutoSaveInterval();
void displaySaveIntervalHelp();
// audio settings widget
void audioInterfaceChanged( const QString & _driver );
void displayAudioHelp();
@@ -175,6 +179,10 @@ private:
bool m_smoothScroll;
bool m_enableAutoSave;
int m_saveInterval;
QSlider * m_saveIntervalSlider;
QLabel * m_saveIntervalLbl;
bool m_oneInstrumentTrackWindow;
bool m_compactTrackButtons;
bool m_syncVSTPlugins;

View File

@@ -45,10 +45,10 @@ class TimeLineWidget;
class positionLine : public QWidget
{
public:
positionLine( QWidget * _parent );
positionLine( QWidget * parent );
private:
virtual void paintEvent( QPaintEvent * _pe );
virtual void paintEvent( QPaintEvent * pe );
} ;
@@ -63,43 +63,44 @@ public:
SelectMode
};
SongEditor( Song * _song );
SongEditor( Song * song );
~SongEditor();
void saveSettings( QDomDocument& doc, QDomElement& element );
void loadSettings( const QDomElement& element );
public slots:
void scrolled( int _new_pos );
void scrolled( int new_pos );
void setEditMode(EditMode mode);
void setEditMode( EditMode mode );
void setEditModeDraw();
void setEditModeSelect();
void updatePosition( const MidiTime & t );
protected:
virtual void closeEvent( QCloseEvent * _ce );
virtual void closeEvent( QCloseEvent * ce );
private slots:
void setHighQuality( bool );
void setMasterVolume( int _new_val );
void setMasterVolume( int new_val );
void showMasterVolumeFloat();
void updateMasterVolumeFloat( int _new_val );
void updateMasterVolumeFloat( int new_val );
void hideMasterVolumeFloat();
void setMasterPitch( int _new_val );
void setMasterPitch( int new_val );
void showMasterPitchFloat();
void updateMasterPitchFloat( int _new_val );
void updateMasterPitchFloat( int new_val );
void hideMasterPitchFloat();
void updateScrollBar( int );
void updatePosition( const MidiTime & _t );
void updateScrollBar(int len);
void zoomingChanged();
private:
virtual void keyPressEvent( QKeyEvent * _ke );
virtual void wheelEvent( QWheelEvent * _we );
virtual void keyPressEvent( QKeyEvent * ke );
virtual void wheelEvent( QWheelEvent * we );
virtual bool allowRubberband() const;
@@ -136,7 +137,7 @@ class SongEditorWindow : public Editor
{
Q_OBJECT
public:
SongEditorWindow(Song* song);
SongEditorWindow( Song* song );
QSize sizeHint() const;

View File

@@ -23,18 +23,19 @@
* Boston, MA 02110-1301 USA.
*
*/
#ifndef SUBWINDOW_H
#define SUBWINDOW_H
#include <QEvent>
#include <QGraphicsDropShadowEffect>
#include <QMdiSubWindow>
#include <QRect>
#include <QLabel>
#include <QPainter>
#include <QPushButton>
#include <QString>
#include "export.h"
class QMoveEvent;
class QResizeEvent;
class QWidget;
@@ -43,16 +44,43 @@ class QWidget;
class EXPORT SubWindow : public QMdiSubWindow
{
Q_OBJECT
Q_PROPERTY( QBrush activeColor READ activeColor WRITE setActiveColor )
Q_PROPERTY( QColor textShadowColor READ textShadowColor WRITE setTextShadowColor )
Q_PROPERTY( QColor borderColor READ borderColor WRITE setBorderColor )
public:
SubWindow(QWidget *parent=NULL, Qt::WindowFlags windowFlags=0);
SubWindow( QWidget *parent = NULL, Qt::WindowFlags windowFlags = 0 );
// same as QWidet::normalGeometry, but works properly under X11 (see https://bugreports.qt.io/browse/QTBUG-256)
QRect getTrueNormalGeometry() const;
QBrush activeColor() const;
QColor textShadowColor() const;
QColor borderColor() const;
void setActiveColor( const QBrush & b );
void setTextShadowColor( const QColor &c );
void setBorderColor( const QColor &c );
protected:
// hook the QWidget move/resize events to update the tracked geometry
virtual void moveEvent(QMoveEvent * event);
virtual void resizeEvent(QResizeEvent * event);
virtual void moveEvent( QMoveEvent * event );
virtual void resizeEvent( QResizeEvent * event );
virtual void paintEvent( QPaintEvent * pe );
private:
const QSize m_buttonSize;
const int m_titleBarHeight;
QPushButton * m_closeBtn;
QPushButton * m_minimizeBtn;
QPushButton * m_maximizeBtn;
QPushButton * m_restoreBtn;
QBrush m_activeColor;
QColor m_textShadowColor;
QColor m_borderColor;
QPoint m_position;
QRect m_trackedNormalGeom;
QLabel * m_windowTitle;
QGraphicsDropShadowEffect * m_shadow;
static void elideText( QLabel *label, QString text );
};
#endif
#endif

View File

@@ -54,7 +54,6 @@ class TrackContainerView;
class TrackContentWidget;
class TrackView;
typedef QWidget trackSettingsWidget;
const int DEFAULT_SETTINGS_WIDGET_WIDTH = 224;
const int TRACK_OP_WIDTH = 78;
@@ -191,8 +190,12 @@ class TrackContentObjectView : public selectableObject, public ModelView
Q_OBJECT
// theming qproperties
Q_PROPERTY( QColor fgColor READ fgColor WRITE setFgColor )
Q_PROPERTY( QColor mutedColor READ mutedColor WRITE setMutedColor )
Q_PROPERTY( QColor mutedBackgroundColor READ mutedBackgroundColor WRITE setMutedBackgroundColor )
Q_PROPERTY( QColor selectedColor READ selectedColor WRITE setSelectedColor )
Q_PROPERTY( QColor textColor READ textColor WRITE setTextColor )
Q_PROPERTY( QColor textShadowColor READ textShadowColor WRITE setTextShadowColor )
Q_PROPERTY( bool gradient READ gradient WRITE setGradient )
public:
TrackContentObjectView( TrackContentObject * tco, TrackView * tv );
@@ -204,16 +207,29 @@ public:
{
return m_tco;
}
// qproperty access func
QColor fgColor() const;
// qproperty access func
QColor mutedColor() const;
QColor mutedBackgroundColor() const;
QColor selectedColor() const;
QColor textColor() const;
void setFgColor( const QColor & c );
QColor textShadowColor() const;
bool gradient() const;
void setMutedColor( const QColor & c );
void setMutedBackgroundColor( const QColor & c );
void setSelectedColor( const QColor & c );
void setTextColor( const QColor & c );
void setTextShadowColor( const QColor & c );
void setGradient( const bool & b );
// access needsUpdate member variable
bool needsUpdate();
void setNeedsUpdate( bool b );
public slots:
virtual bool close();
void cut();
void remove();
virtual void update();
protected:
virtual void constructContextMenu( QMenu * )
@@ -227,6 +243,11 @@ protected:
virtual void mousePressEvent( QMouseEvent * me );
virtual void mouseMoveEvent( QMouseEvent * me );
virtual void mouseReleaseEvent( QMouseEvent * me );
virtual void resizeEvent( QResizeEvent * re )
{
m_needsUpdate = true;
selectableObject::resizeEvent( re );
}
float pixelsPerTact();
@@ -267,9 +288,14 @@ private:
MidiTime m_oldTime;// used for undo/redo while mouse-button is pressed
// qproperty fields
QColor m_fgColor;
QColor m_mutedColor;
QColor m_mutedBackgroundColor;
QColor m_selectedColor;
QColor m_textColor;
QColor m_textShadowColor;
bool m_gradient;
bool m_needsUpdate;
inline void setInitialMousePos( QPoint pos )
{
m_initialMousePos = pos;
@@ -613,7 +639,7 @@ public:
return &m_trackOperationsWidget;
}
inline trackSettingsWidget * getTrackSettingsWidget()
inline QWidget * getTrackSettingsWidget()
{
return &m_trackSettingsWidget;
}
@@ -676,7 +702,7 @@ private:
TrackContainerView * m_trackContainerView;
TrackOperationsWidget m_trackOperationsWidget;
trackSettingsWidget m_trackSettingsWidget;
QWidget m_trackSettingsWidget;
TrackContentWidget m_trackContentWidget;
Actions m_action;

View File

@@ -34,7 +34,7 @@
#include <cmath>
using namespace std;
#if defined (LMMS_BUILD_WIN32) || defined (LMMS_BUILD_APPLE) || defined(LMMS_BUILD_HAIKU) || defined (__FreeBSD__)
#if defined (LMMS_BUILD_WIN32) || defined (LMMS_BUILD_APPLE) || defined(LMMS_BUILD_HAIKU) || defined (__FreeBSD__) || defined(__OpenBSD__)
#ifndef isnanf
#define isnanf(x) isnan(x)
#endif

View File

@@ -24,6 +24,10 @@
#define PLATFORM "OS X"
#endif
#ifdef LMMS_BUILD_OPENBSD
#define PLATFORM "OpenBSD"
#endif
#ifdef LMMS_BUILD_WIN32
#define PLATFORM "win32"
#endif