Skip to content

Commit

Permalink
Merge branch 'master' into feature/midiCCSupport
Browse files Browse the repository at this point in the history
  • Loading branch information
IanCaio committed Sep 9, 2020
2 parents e0a3939 + 5efb3a1 commit d18b25b
Show file tree
Hide file tree
Showing 113 changed files with 1,851 additions and 963 deletions.
14 changes: 13 additions & 1 deletion data/themes/classic/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ QLineEdit {
border: 2px inset rgba(91,101,113,128);
background: #49515b;
color: #e0e0e0;
selection-background-color: #202020;
}


Expand Down Expand Up @@ -118,7 +119,7 @@ QMenu::indicator:selected {
background-color: #747474;
}

positionLine {
PositionLine {
qproperty-tailGradient: false;
qproperty-lineColor: rgb(255, 255, 255);
}
Expand All @@ -138,6 +139,17 @@ PianoRoll {
qproperty-ghostNoteBorders: true;
qproperty-barColor: #4afd85;
qproperty-markedSemitoneColor: rgba( 0, 255, 200, 60 );
/* Piano keys */
qproperty-whiteKeyWidth: 64;
qproperty-whiteKeyActiveTextColor: #000;
qproperty-whiteKeyActiveTextShadow: rgb( 240, 240, 240 );
qproperty-whiteKeyActiveBackground: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 #43e97b, stop:1 #3bcd6c);
qproperty-whiteKeyInactiveTextColor: rgb( 128, 128, 128);
qproperty-whiteKeyInactiveTextShadow: rgb( 240, 240, 240 );
qproperty-whiteKeyInactiveBackground: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 #eeeeee, stop:1 #ffffff);
qproperty-blackKeyWidth: 48;
qproperty-blackKeyActiveBackground: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 #43e97b, stop:1 #3bcd6c);
qproperty-blackKeyInactiveBackground: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 #333, stop:1 #000);
/* Grid colors */
qproperty-lineColor: rgba( 128, 128, 128, 80 );
qproperty-beatLineColor: rgba( 128, 128, 128, 160 );
Expand Down
14 changes: 13 additions & 1 deletion data/themes/default/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ QLineEdit {
border: 1px;
background: #101213;
color: #d1d8e4;
selection-background-color: #17793b;
}

QLineEdit:read-only {
Expand Down Expand Up @@ -150,7 +151,7 @@ QMenu::indicator:selected {
background-color: #101213;
}

positionLine {
PositionLine {
qproperty-tailGradient: true;
qproperty-lineColor: rgb(255, 255, 255);
}
Expand All @@ -170,6 +171,17 @@ PianoRoll {
qproperty-ghostNoteBorders: false;
qproperty-barColor: #078f3a;
qproperty-markedSemitoneColor: rgba(255, 255, 255, 30);
/* Piano keys */
qproperty-whiteKeyWidth: 64;
qproperty-whiteKeyActiveTextColor: #000;
qproperty-whiteKeyActiveTextShadow: #fff;
qproperty-whiteKeyActiveBackground: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 #43e97b, stop:1 #3bcd6c);
qproperty-whiteKeyInactiveTextColor: #000;
qproperty-whiteKeyInactiveTextShadow: #fff;
qproperty-whiteKeyInactiveBackground: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 #eeeeee, stop:1 #ffffff);
qproperty-blackKeyWidth: 48;
qproperty-blackKeyActiveBackground: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 #43e97b, stop:1 #3bcd6c);
qproperty-blackKeyInactiveBackground: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 #333, stop:1 #000);
/* Grid colors */
qproperty-lineColor: #292929;
qproperty-beatLineColor: #2d6b45;
Expand Down
2 changes: 1 addition & 1 deletion include/AudioAlsa.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class AudioAlsa : public QThread, public AudioDevice

inline static QString name()
{
return QT_TRANSLATE_NOOP( "setupWidget",
return QT_TRANSLATE_NOOP( "AudioDeviceSetupWidget",
"ALSA (Advanced Linux Sound Architecture)" );
}

Expand Down
2 changes: 1 addition & 1 deletion include/AudioDummy.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class AudioDummy : public QThread, public AudioDevice

inline static QString name()
{
return QT_TRANSLATE_NOOP( "setupWidget", "Dummy (no sound output)" );
return QT_TRANSLATE_NOOP( "AudioDeviceSetupWidget", "Dummy (no sound output)" );
}


Expand Down
2 changes: 1 addition & 1 deletion include/AudioJack.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class AudioJack : public QObject, public AudioDevice

inline static QString name()
{
return QT_TRANSLATE_NOOP( "setupWidget",
return QT_TRANSLATE_NOOP( "AudioDeviceSetupWidget",
"JACK (JACK Audio Connection Kit)" );
}

Expand Down
2 changes: 1 addition & 1 deletion include/AudioOss.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class AudioOss : public QThread, public AudioDevice

inline static QString name()
{
return QT_TRANSLATE_NOOP( "setupWidget", "OSS (Open Sound System)" );
return QT_TRANSLATE_NOOP( "AudioDeviceSetupWidget", "OSS (Open Sound System)" );
}

static QString probeDevice();
Expand Down
2 changes: 1 addition & 1 deletion include/AudioPortAudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class AudioPortAudio : public AudioDevice

inline static QString name()
{
return QT_TRANSLATE_NOOP( "setupWidget", "PortAudio" );
return QT_TRANSLATE_NOOP( "AudioDeviceSetupWidget", "PortAudio" );
}


Expand Down
2 changes: 1 addition & 1 deletion include/AudioPulseAudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class AudioPulseAudio : public QThread, public AudioDevice

inline static QString name()
{
return QT_TRANSLATE_NOOP( "setupWidget", "PulseAudio" );
return QT_TRANSLATE_NOOP( "AudioDeviceSetupWidget", "PulseAudio" );
}

static QString probeDevice();
Expand Down
2 changes: 1 addition & 1 deletion include/AudioSdl.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class AudioSdl : public AudioDevice

inline static QString name()
{
return QT_TRANSLATE_NOOP( "setupWidget",
return QT_TRANSLATE_NOOP( "AudioDeviceSetupWidget",
"SDL (Simple DirectMedia Layer)" );
}

Expand Down
2 changes: 1 addition & 1 deletion include/AudioSndio.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class AudioSndio : public QThread, public AudioDevice

inline static QString name( void )
{
return QT_TRANSLATE_NOOP( "setupWidget", "sndio" );
return QT_TRANSLATE_NOOP( "AudioDeviceSetupWidget", "sndio" );
}

class setupWidget : public AudioDeviceSetupWidget
Expand Down
2 changes: 1 addition & 1 deletion include/AudioSoundIo.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class AudioSoundIo : public AudioDevice

inline static QString name()
{
return QT_TRANSLATE_NOOP( "setupWidget", "soundio" );
return QT_TRANSLATE_NOOP( "AudioDeviceSetupWidget", "soundio" );
}

class setupWidget : public AudioDeviceSetupWidget
Expand Down
1 change: 1 addition & 0 deletions include/AutomationEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ protected slots:
float m_bottomLevel;
float m_topLevel;

void centerTopBottomScroll();
void updateTopBottomLevels();

QScrollBar * m_leftRightScroll;
Expand Down
22 changes: 20 additions & 2 deletions include/ColorChooser.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,39 @@
*
*/

#include <QColorDialog>
#include <QApplication>
#include <QColor>
#include <QColorDialog>
#include <QKeyEvent>
#include <QVector>

class ColorChooser: public QColorDialog
{
public:
ColorChooser(const QColor &initial, QWidget *parent): QColorDialog(initial, parent) {};
ColorChooser(QWidget *parent): QColorDialog(parent) {};
//! For getting a color without having to initialise a color dialog
ColorChooser() {};
enum class Palette {Default, Track, Mixer};
//! Set global palette via array, checking bounds
void setPalette (QVector<QColor>);
//! Set global paletter via enum
void setPalette (Palette);
//! Set palette via enum, return self pointer for chaining
ColorChooser* withPalette (Palette);
//! Return a certain palette
static QVector<QColor> getPalette (Palette);

protected:
// Forward key events to the parent to prevent stuck notes when the dialog gets focus
//! Forward key events to the parent to prevent stuck notes when the dialog gets focus
void keyReleaseEvent(QKeyEvent *event) override
{
QKeyEvent ke(*event);
QApplication::sendEvent(parentWidget(), &ke);
}
private:
//! Copy the current QColorDialog palette into an array
static QVector<QColor> defaultPalette();
//! Generate a nice palette, with adjustable value
static QVector<QColor> nicePalette (int);
};
4 changes: 2 additions & 2 deletions include/ComboBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
#include "ComboBoxModel.h"
#include "AutomatableModelView.h"



class LMMS_EXPORT ComboBox : public QWidget, public IntModelView
{
Q_OBJECT
Expand All @@ -51,6 +49,8 @@ class LMMS_EXPORT ComboBox : public QWidget, public IntModelView
return castModel<ComboBoxModel>();
}

static constexpr int DEFAULT_HEIGHT = 22;

public slots:
void selectNext();
void selectPrevious();
Expand Down
5 changes: 5 additions & 0 deletions include/FxLine.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@
#ifndef FX_LINE_H
#define FX_LINE_H

#include <QColorDialog>
#include <QGraphicsView>
#include <QLineEdit>
#include <QWidget>

#include "ColorChooser.h"
#include "Knob.h"
#include "LcdWidget.h"
#include "SendButtonIndicator.h"
Expand Down Expand Up @@ -101,6 +103,9 @@ class FxLine : public QWidget

public slots:
void renameChannel();
void resetColor();
void changeColor();
void randomColor();

private slots:
void renameFinished();
Expand Down
7 changes: 7 additions & 0 deletions include/FxMixer.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@

#include <atomic>

#include <QColor>

class FxRoute;
typedef QVector<FxRoute *> FxRouteVector;

Expand Down Expand Up @@ -70,6 +72,11 @@ class FxChannel : public ThreadableJob
bool requiresProcessing() const override { return true; }
void unmuteForSolo();


// TODO C++17 and above: use std::optional insteads
QColor m_color;
bool m_hasColor;


std::atomic_int m_dependenciesMet;
void incrementDeps();
Expand Down
2 changes: 1 addition & 1 deletion include/InstrumentSoundShaping.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class InstrumentSoundShaping : public Model, public JournallingObject
FloatModel m_filterCutModel;
FloatModel m_filterResModel;

static const QString targetNames[InstrumentSoundShaping::NumTargets][3];
static const char *const targetNames[InstrumentSoundShaping::NumTargets][3];


friend class InstrumentSoundShapingView;
Expand Down
81 changes: 81 additions & 0 deletions include/Lv2Features.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
* Lv2Features.h - Lv2Features class
*
* Copyright (c) 2020-2020 Johannes Lorenz <jlsf2013$users.sourceforge.net, $=@>
*
* 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 LV2FEATURES_H
#define LV2FEATURES_H

#include "lmmsconfig.h"

#ifdef LMMS_HAVE_LV2

#include <lv2.h>
#include <map>
#include <vector>
#include "Lv2Manager.h"

/**
Feature container
References all available features for a plugin and maps them to their URIs.
The public member functions should be called in descending order:
1. initCommon: map plugin-common features
2. operator[]: map plugin-specific features
3. createFeatureVectors: create the feature vectors required for
lilv_plugin_instantiate
4. access the latter
*/
class Lv2Features
{
public:
//! Return if a feature is supported by LMMS
static bool isFeatureSupported(const char *featName);

Lv2Features();

//! Register only plugin-common features
void initCommon();
//! Return reference to feature data with given URI featName
void*& operator[](const char* featName);
//! Fill m_features and m_featurePointers with all features
void createFeatureVectors();
//! Return LV2_Feature pointer vector, suited for lilv_plugin_instantiate
const LV2_Feature* const* featurePointers() const
{
return m_featurePointers.data();
}

private:
//! feature storage
std::vector<LV2_Feature> m_features;
//! pointers to m_features, required for lilv_plugin_instantiate
std::vector<const LV2_Feature*> m_featurePointers;
//! features + data, ordered by URI
std::map<const char*, void*, Lv2Manager::CmpStr> m_featureByUri;
};

#endif // LMMS_HAVE_LV2

#endif // LV2FEATURES_H
23 changes: 23 additions & 0 deletions include/Lv2Manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@
#ifdef LMMS_HAVE_LV2

#include <map>
#include <set>
#include <lilv/lilv.h>

#include "Lv2Basics.h"
#include "Lv2UridMap.h"
#include "Plugin.h"


Expand Down Expand Up @@ -114,10 +116,31 @@ class Lv2Manager
Iterator begin() { return m_lv2InfoMap.begin(); }
Iterator end() { return m_lv2InfoMap.end(); }

//! strcmp based key comparator for std::set and std::map
struct CmpStr
{
bool operator()(char const *a, char const *b) const;
};

UridMap& uridMap() { return m_uridMap; }
//! Return all
const std::set<const char*, CmpStr>& supportedFeatureURIs() const
{
return m_supportedFeatureURIs;
}
bool isFeatureSupported(const char* featName) const;

private:
// general data
bool m_debug; //!< if set, debug output will be printed
LilvWorld* m_world;
Lv2InfoMap m_lv2InfoMap;
std::set<const char*, CmpStr> m_supportedFeatureURIs;

// feature data that are common for all Lv2Proc
UridMap m_uridMap;

// functions
bool isSubclassOf(const LilvPluginClass *clvss, const char *uriStr);
};

Expand Down
Loading

0 comments on commit d18b25b

Please sign in to comment.