Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master #7

Merged
merged 39 commits into from
May 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
9aa997e
Allow TabWidget to be variable sized
JohannesLorenz Mar 16, 2019
dd43127
Allow instrument views to grow with contents
JohannesLorenz Mar 16, 2019
5101aa0
Make Model class visitable
JohannesLorenz Mar 16, 2019
7e7141f
Fix too small instrument tabs
JohannesLorenz Mar 17, 2019
d52c220
Fix instrument window tab sizes
JohannesLorenz Mar 28, 2019
82e3ba7
[Equalizer] Bright analyzer colors, opacity increased (#4772)
0xf0xx0 Apr 6, 2019
91f9f1a
Don't try to connect to nonexistent controllers (#4939)
enp2s0 Apr 14, 2019
5a56969
Allow sample track TCOs to resize smaller than one bar (#4933)
Spekular Apr 15, 2019
5784dd6
Use local cursor for TrackContentObjectView (#4918)
Apr 15, 2019
96cc5e0
Add PluginIssue class (#4901)
JohannesLorenz Apr 17, 2019
d06f508
Move macro definition out of class
JohannesLorenz Apr 20, 2019
91099e2
Fix -1 offset in plugin tab
JohannesLorenz Apr 20, 2019
53942a1
Fix bad identation in old code
JohannesLorenz Apr 20, 2019
e1df16c
Coding conventions
JohannesLorenz Apr 20, 2019
407444e
FileBrowser: Backup expanded directories and restore that state when …
Apr 3, 2019
22fb650
Merge branch 'variable-tab-widget'
JohannesLorenz Apr 22, 2019
a685049
Allow build for Wayland w/o X11Extras, if VST off
nykula Apr 19, 2019
d537561
Document Effect::checkGate
JohannesLorenz Apr 22, 2019
7ae4e85
Document graph widget
JohannesLorenz Apr 22, 2019
b5e408d
Update wiki submodule
JohannesLorenz Apr 22, 2019
c80f0bf
Fix wiki submodule
PhysSong Apr 24, 2019
461facc
Fix notes getting stuck under high CPU conditions (#4908)
DomClark Apr 24, 2019
160d306
Record chords (#4938)
alxdttn Apr 24, 2019
ca9a956
Make more connections direct for automation (#4942)
DomClark Apr 26, 2019
0fd5693
Improve dcast
JohannesLorenz Apr 26, 2019
8d005e7
AutomatableModelTest: Improve tests
JohannesLorenz Apr 27, 2019
777da5e
Fix CI on windows
JohannesLorenz Apr 27, 2019
2c134d6
Code style + Extend for TempoSyncKnob
JohannesLorenz Apr 27, 2019
c9ed6fc
Merge pull request #4902 from JohannesLorenz/model-visitor
JohannesLorenz Apr 27, 2019
8bcdf06
Travis: fix a debootstrap error from missing keyrings
PhysSong Apr 29, 2019
32df2d7
Don't draw note detuning info over the volume/panning area (#4965)
PhysSong May 5, 2019
cb6b4ec
Show/Focus BBEditor on TrackLabelButton click #4946 (#4959)
May 5, 2019
8f4757e
Use extracted linuxdeployqt directly
PhysSong May 6, 2019
9ff882d
Fix invisible note editing handles when a note has detuning info
PhysSong May 6, 2019
6d7ce58
Merge branch 'stable-1.2'
PhysSong May 6, 2019
d54c79d
Fix the wrong merge
PhysSong May 6, 2019
28143e6
playing/recording pianoRoll's chord notes (#4963)
sharpblade4 May 24, 2019
fb1b18e
Merge pull request #4990 from sharpblade4/fix#4963_nextver
JohannesLorenz May 25, 2019
46c74d0
Making clearer the hierarchy. (#4967)
devnexen May 27, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis/debian_pkgs.sha256
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
314ef4af137903dfb13e8c3ef1e6ea56cfdb23808d52ec4f5f50e288c73610c5 pbuilder_0.229.1_all.deb
fa82aa8ed3055c6f6330104deedf080b26778295e589426d4c4dd0f2c2a5defa debootstrap_1.0.95_all.deb
2ef4c09f7841b72f93412803ddd142f72658536dbfabe00e449eb548f432f3f8 debian-archive-keyring_2017.7ubuntu1_all.deb
5 changes: 3 additions & 2 deletions .travis/linux.debian-sid.install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
set -e

sudo apt-get install -y \
debian-archive-keyring \
dpkg \
pbuilder

# work around a pbuilder bug which breaks ccache
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=666525
# and also missing signing keys in Trusty's debian-archive-keyring
cd /tmp
wget http://archive.ubuntu.com/ubuntu/pool/main/p/pbuilder/pbuilder_0.229.1_all.deb
wget http://archive.ubuntu.com/ubuntu/pool/main/d/debootstrap/debootstrap_1.0.95_all.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/d/debian-archive-keyring/debian-archive-keyring_2017.7ubuntu1_all.deb
sha256sum -c "$TRAVIS_BUILD_DIR/.travis/debian_pkgs.sha256"
sudo dpkg -i pbuilder_0.229.1_all.deb debootstrap_1.0.95_all.deb
sudo dpkg -i pbuilder_0.229.1_all.deb debootstrap_1.0.95_all.deb debian-archive-keyring_2017.7ubuntu1_all.deb
cd "$OLDPWD"
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ SET(QT_LIBRARIES
Qt5::Xml
)

IF(LMMS_BUILD_LINUX)
IF(LMMS_BUILD_LINUX AND WANT_VST)
FIND_PACKAGE(Qt5 COMPONENTS X11Extras REQUIRED)
LIST(APPEND QT_LIBRARIES Qt5::X11Extras)
ENDIF()
Expand Down
4 changes: 3 additions & 1 deletion cmake/linux/package_linux.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@ else
success "Downloaded $LINUXDEPLOYQT"
# Extract AppImage and replace LINUXDEPLOYQT variable with extracted binary
# to support systems without fuse
# Also, we need to set LD_LIBRARY_PATH, but linuxdepoyqt's AppRun unsets it
# See https://github.com/probonopd/linuxdeployqt/pull/370/
"$LINUXDEPLOYQT" --appimage-extract > /dev/null 2>&1
LINUXDEPLOYQT="squashfs-root/AppRun"
LINUXDEPLOYQT="squashfs-root/usr/bin/linuxdeployqt"
success "Extracted $APPIMAGETOOL"
fi

Expand Down
2 changes: 1 addition & 1 deletion doc/wiki
Submodule wiki updated from 42193f to 19179c
55 changes: 55 additions & 0 deletions include/AutomatableModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "MidiTime.h"
#include "ValueBuffer.h"
#include "MemoryManager.h"
#include "ModelVisitor.h"

// simple way to map a property of a view to a model
#define mapPropertyFromModelPtr(type,getfunc,setfunc,modelname) \
Expand All @@ -59,6 +60,11 @@
modelname.setValue( (float) val ); \
}

// use this to make subclasses visitable
#define MODEL_IS_VISITABLE \
void accept(ModelVisitor& v) override { v.visit(*this); } \
void accept(ConstModelVisitor& v) const override { v.visit(*this); }



class ControllerConnection;
Expand All @@ -68,6 +74,7 @@ class LMMS_EXPORT AutomatableModel : public Model, public JournallingObject
Q_OBJECT
MM_OPERATORS
public:

typedef QVector<AutomatableModel *> AutoModelVector;

enum ScaleType
Expand All @@ -80,6 +87,35 @@ class LMMS_EXPORT AutomatableModel : public Model, public JournallingObject

virtual ~AutomatableModel();

// Implement those by using the MODEL_IS_VISITABLE macro
virtual void accept(ModelVisitor& v) = 0;
virtual void accept(ConstModelVisitor& v) const = 0;

public:
/**
@brief Return this class casted to Target
@test AutomatableModelTest.cpp
@param doThrow throw an assertion if the cast fails, instead of
returning a nullptr
@return the casted class if Target is the exact or a base class of
*this, nullptr otherwise
*/
template<class Target>
Target* dynamicCast(bool doThrow = false)
{
DCastVisitor<Target> vis; accept(vis);
if (doThrow && !vis.result) { Q_ASSERT(false); }
return vis.result;
}

//! const overload, see overloaded function
template<class Target>
const Target* dynamicCast(bool doThrow = false) const
{
ConstDCastVisitor<Target> vis; accept(vis);
if (doThrow && !vis.result) { Q_ASSERT(false); }
return vis.result;
}

bool isAutomated() const;
bool isAutomatedOrControlled() const
Expand Down Expand Up @@ -283,6 +319,22 @@ public slots:


private:
// dynamicCast implementation
template<class Target>
struct DCastVisitor : public ModelVisitor
{
Target* result = nullptr;
void visit(Target& tar) { result = &tar; }
};

// dynamicCast implementation
template<class Target>
struct ConstDCastVisitor : public ConstModelVisitor
{
const Target* result = nullptr;
void visit(const Target& tar) { result = &tar; }
};

static bool mustQuoteName(const QString &name);

virtual void saveSettings( QDomDocument& doc, QDomElement& element )
Expand Down Expand Up @@ -382,6 +434,7 @@ template <typename T> class LMMS_EXPORT TypedAutomatableModel : public Automatab
class LMMS_EXPORT FloatModel : public TypedAutomatableModel<float>
{
Q_OBJECT
MODEL_IS_VISITABLE
public:
FloatModel( float val = 0, float min = 0, float max = 0, float step = 0,
Model * parent = NULL,
Expand All @@ -399,6 +452,7 @@ class LMMS_EXPORT FloatModel : public TypedAutomatableModel<float>
class LMMS_EXPORT IntModel : public TypedAutomatableModel<int>
{
Q_OBJECT
MODEL_IS_VISITABLE
public:
IntModel( int val = 0, int min = 0, int max = 0,
Model* parent = NULL,
Expand All @@ -414,6 +468,7 @@ class LMMS_EXPORT IntModel : public TypedAutomatableModel<int>
class LMMS_EXPORT BoolModel : public TypedAutomatableModel<bool>
{
Q_OBJECT
MODEL_IS_VISITABLE
public:
BoolModel( const bool val = false,
Model* parent = NULL,
Expand Down
1 change: 1 addition & 0 deletions include/ComboBoxModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
class LMMS_EXPORT ComboBoxModel : public IntModel
{
Q_OBJECT
MODEL_IS_VISITABLE
public:
ComboBoxModel( Model* parent = NULL,
const QString& displayName = QString(),
Expand Down
7 changes: 7 additions & 0 deletions include/Effect.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,13 @@ class LMMS_EXPORT Effect : public Plugin


protected:
/**
Effects should call this at the end of audio processing

If the setting "Keep effects running even without input" is disabled,
after "decay" ms of a signal below "gate", the effect is turned off
and won't be processed again until it receives new audio input
*/
void checkGate( double _out_sum );

virtual PluginView * instantiateView( QWidget * );
Expand Down
6 changes: 5 additions & 1 deletion include/FileBrowser.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class FileBrowser : public SideBarWidget

private slots:
void reloadTree( void );
void expandItems( QTreeWidgetItem * item=NULL );
void expandItems( QTreeWidgetItem * item=NULL, QList<QString> expandedDirs = QList<QString>() );
// call with item=NULL to filter the entire tree
bool filterItems( const QString & filter, QTreeWidgetItem * item=NULL );
void giveFocusToFilter();
Expand Down Expand Up @@ -87,6 +87,10 @@ class FileBrowserTreeWidget : public QTreeWidget
FileBrowserTreeWidget( QWidget * parent );
virtual ~FileBrowserTreeWidget() = default;

//! This method returns a QList with paths (QString's) of all directories
//! that are expanded in the tree.
QList<QString> expandedDirs( QTreeWidgetItem * item = nullptr ) const;


protected:
virtual void contextMenuEvent( QContextMenuEvent * e );
Expand Down
38 changes: 32 additions & 6 deletions include/Graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,18 @@ class LMMS_EXPORT Graph : public QWidget, public ModelView
public:
enum graphStyle
{
NearestStyle,
LinearStyle,
LinearNonCyclicStyle,
BarStyle,
NearestStyle, //!< draw as stairs
LinearStyle, //!< connect each 2 samples with a line, with wrapping
LinearNonCyclicStyle, //!< LinearStyle without wrapping
BarStyle, //!< draw thick bars
NumGraphStyles
};

/**
* @brief Constructor
* @param _width Pixel width of widget
* @param _height Pixel height of widget
*/
Graph( QWidget * _parent, graphStyle _style = Graph::LinearStyle,
int _width = 132,
int _height = 104
Expand Down Expand Up @@ -111,10 +116,24 @@ protected slots:
} ;


/**
@brief 2 dimensional function plot

Function plot graph with discrete x scale and continous y scale
This makes it possible to display "#x" samples
*/
class LMMS_EXPORT graphModel : public Model
{
Q_OBJECT
public:
/**
* @brief Constructor
* @param _min Minimum y value to display
* @param _max Maximum y value to display
* @param _size Number of samples (e.g. x value)
* @param _step Step size on y axis where values snap to, or 0.0f
* for "no snapping"
*/
graphModel( float _min,
float _max,
int _size,
Expand Down Expand Up @@ -146,14 +165,21 @@ class LMMS_EXPORT graphModel : public Model
return( m_samples.data() );
}

void convolve(const float *convolution, const int convolutionLength, const int centerOffset);
//! Make cyclic convolution
//! @param convolution Samples to convolve with
//! @param convolutionLength Number of samples to take for each sum
//! @param centerOffset Offset for resulting values
void convolve(const float *convolution,
const int convolutionLength, const int centerOffset);

public slots:
//! Set range of y values
void setRange( float _min, float _max );

void setLength( int _size );

//! Update one sample
void setSampleAt( int x, float val );
//! Update samples array
void setSamples( const float * _value );

void setWaveToSine();
Expand Down
3 changes: 3 additions & 0 deletions include/InstrumentTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,9 @@ protected slots:
private:
virtual void modelChanged();
void viewInstrumentInDirection(int d);
//! adjust size of any child widget of the main tab
//! required to keep the old look when using a variable sized tab widget
void adjustTabSize(QWidget *w);

InstrumentTrack * m_track;
InstrumentTrackView * m_itv;
Expand Down
64 changes: 64 additions & 0 deletions include/ModelVisitor.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* ModelVisitor.h - visitors for automatable models
*
* Copyright (c) 2019-2019 Johannes Lorenz <j.git$$$lorenz-ho.me, $$$=@>
*
* This file is part of LMMS - https://lmms.io
*
* 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., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
*/

#ifndef MODELVISITOR_H
#define MODELVISITOR_H

class AutomatableModel;
class BoolModel;
class IntModel;
class FloatModel;
class ComboBoxModel;
class TempoSyncKnobModel;

class ModelVisitor
{
template<class ParentType = AutomatableModel, class ModelType>
void up(ModelType& m) { visit(static_cast<ParentType&>(m)); }
public:
virtual void visit(AutomatableModel& ) {}
virtual void visit(BoolModel& m);
virtual void visit(IntModel& m);
virtual void visit(FloatModel& m);
virtual void visit(ComboBoxModel& m);
virtual void visit(TempoSyncKnobModel& m);
virtual ~ModelVisitor();
};

class ConstModelVisitor
{
template<class ParentType = AutomatableModel, class ModelType>
void up(const ModelType& m) {
visit(static_cast<const ParentType&>(m)); }
public:
virtual void visit(const AutomatableModel& ) {}
virtual void visit(const BoolModel& m);
virtual void visit(const IntModel& m);
virtual void visit(const FloatModel& m);
virtual void visit(const ComboBoxModel& m);
virtual void visit(const TempoSyncKnobModel& m);
virtual ~ConstModelVisitor();
};

#endif // MODELVISITOR_H
1 change: 1 addition & 0 deletions include/NotePlayHandle.h
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ class LMMS_EXPORT NotePlayHandle : public PlayHandle, public Note
NotePlayHandleList m_subNotes; // used for chords and arpeggios
volatile bool m_released; // indicates whether note is released
bool m_releaseStarted;
bool m_hasMidiNote;
bool m_hasParent; // indicates whether note has parent
NotePlayHandle * m_parent; // parent note
bool m_hadChildren;
Expand Down
2 changes: 2 additions & 0 deletions include/PianoRoll.h
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ protected slots:
void testPlayNote( Note * n );
void testPlayKey( int _key, int _vol, int _pan );
void pauseTestNotes(bool pause = true );
void playChordNotes(int key, int velocity=-1);
void pauseChordNotes(int key);

QList<int> getAllOctavesForKey( int keyToMirror ) const;

Expand Down
Loading