Skip to content

Commit

Permalink
Merge branch 'master' into feature/clipboardRefactor
Browse files Browse the repository at this point in the history
	Fixes conflict introduced by LMMS#5661 ("Fix for Mixer volume percentage labels are off by a factor of 100") on src/gui/AutomatableModelView.cpp.

	Note: This merge was force-pushed after a hard reset, because there were some issues with submodules being included on the last time I pushed the merge. That new merge is an attempt to fix that.
  • Loading branch information
IanCaio committed Oct 5, 2020
2 parents f194146 + 3fa4b98 commit edb06d7
Show file tree
Hide file tree
Showing 64 changed files with 1,073 additions and 869 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ jobs:
- run:
name: Install Homebrew dependencies
command: |
# unlink Homebrew's python 2 to prevent an node-gyp error
brew unlink python@2 || true
brew update && brew install ccache fftw cmake pkg-config libogg libvorbis lame libsndfile libsamplerate jack sdl libgig libsoundio stk fluid-synth portaudio fltk qt5 carla
# uninstall Homebrew's python 2 to prevent errors on brew install
brew uninstall python@2 || true
brew update && brew install ccache fftw cmake pkg-config libogg libvorbis lame libsndfile libsamplerate jack sdl libgig libsoundio lilv lv2 stk fluid-synth portaudio fltk qt5 carla
- run:
name: Install nodejs dependencies
command: npm install -g appdmg
Expand Down
2 changes: 1 addition & 1 deletion .travis/osx..install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

PACKAGES="cmake pkg-config libogg libvorbis lame libsndfile libsamplerate jack sdl libgig libsoundio stk fluid-synth portaudio node fltk qt carla"
PACKAGES="cmake pkg-config libogg libvorbis lame libsndfile libsamplerate lilv lv2 jack sdl libgig libsoundio stk fluid-synth portaudio node fltk qt carla"

if "${TRAVIS}"; then
PACKAGES="$PACKAGES ccache"
Expand Down
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ IF(VERSION_STAGE)
SET(VERSION "${VERSION}-${VERSION_STAGE}")
ENDIF()
IF(VERSION_BUILD)
SET(VERSION "${VERSION}.${VERSION_BUILD}")
SET(VERSION "${VERSION}-${VERSION_BUILD}")
ENDIF()

# Override version information for non-base builds
Expand Down Expand Up @@ -487,9 +487,9 @@ If(WANT_GIG)
ENDIF(WANT_GIG)

# check for pthreads
IF(LMMS_BUILD_LINUX OR LMMS_BUILD_APPLE OR LMMS_BUILD_OPENBSD OR LMMS_BUILD_FREEBSD)
IF(LMMS_BUILD_LINUX OR LMMS_BUILD_APPLE OR LMMS_BUILD_OPENBSD OR LMMS_BUILD_FREEBSD OR LMMS_BUILD_HAIKU)
FIND_PACKAGE(Threads)
ENDIF(LMMS_BUILD_LINUX OR LMMS_BUILD_APPLE OR LMMS_BUILD_OPENBSD OR LMMS_BUILD_FREEBSD)
ENDIF(LMMS_BUILD_LINUX OR LMMS_BUILD_APPLE OR LMMS_BUILD_OPENBSD OR LMMS_BUILD_FREEBSD OR LMMS_BUILD_HAIKU)

# check for sndio (roaraudio won't work yet)
IF(WANT_SNDIO)
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ Information about what you can do and how can be found in the

Before coding a new big feature, please _always_
[file an issue](https://github.com/LMMS/lmms/issues/new) for your idea and
suggestions about your feature and about the intended implementation on GitHub
or post to the LMMS developers mailinglist (lmms-devel@lists.sourceforge.net)
and wait for replies! Maybe there are different ideas, improvements, hints or
suggestions about your feature and about the intended implementation on GitHub,
or ask in one of the tech channels on Discord and wait for replies! Maybe there are different ideas, improvements, or hints, or
maybe your feature is not welcome/needed at the moment.
2 changes: 1 addition & 1 deletion cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ IF(VERSION_STAGE)
SET(CPACK_PACKAGE_VERSION_PATCH "${CPACK_PACKAGE_VERSION_PATCH}-${VERSION_STAGE}")
ENDIF()
IF(VERSION_BUILD)
SET(CPACK_PACKAGE_VERSION_PATCH "${CPACK_PACKAGE_VERSION_PATCH}.${VERSION_BUILD}")
SET(CPACK_PACKAGE_VERSION_PATCH "${CPACK_PACKAGE_VERSION_PATCH}-${VERSION_BUILD}")
ENDIF()
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME_UCASE}")
SET(CPACK_SOURCE_GENERATOR "TBZ2")
Expand Down
36 changes: 31 additions & 5 deletions cmake/modules/VersionInfo.cmake
Original file line number Diff line number Diff line change
@@ -1,29 +1,56 @@
FIND_PACKAGE(Git)
IF(GIT_FOUND AND NOT FORCE_VERSION)
# Look for git tag information (e.g. Tagged: "v1.0.0", Non-tagged: "v1.0.0-123-a1b2c3d")
SET(MAJOR_VERSION 0)
SET(MINOR_VERSION 0)
SET(PATCH_VERSION 0)
# Look for git tag information (e.g. Tagged: "v1.0.0", Untagged: "v1.0.0-123-a1b2c3d")
# Untagged format: [latest tag]-[number of commits]-[latest commit hash]
EXECUTE_PROCESS(
COMMAND "${GIT_EXECUTABLE}" describe --tags --match v[0-9].[0-9].[0-9]*
OUTPUT_VARIABLE GIT_TAG
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
TIMEOUT 10
OUTPUT_STRIP_TRAILING_WHITESPACE)
# Read: TAG_LIST = GIT_TAG.split("-")
STRING(REPLACE "-" ";" TAG_LIST "${GIT_TAG}")
# Read: TAG_LIST_LENGTH = TAG_LIST.length()
LIST(LENGTH TAG_LIST TAG_LIST_LENGTH)
# Untagged versions contain at least 2 dashes, giving 3 strings on split.
# Hence, for untagged versions TAG_LIST_LENGTH = [dashes in latest tag] + 3.
# Corollary: if TAG_LIST_LENGTH <= 2, the version must be tagged.
IF(TAG_LIST_LENGTH GREATER 0)
# Set FORCE_VERSION to TAG_LIST[0], strip any 'v's to get MAJ.MIN.PAT
LIST(GET TAG_LIST 0 FORCE_VERSION)
STRING(REPLACE "v" "" FORCE_VERSION "${FORCE_VERSION}")
# Split FORCE_VERSION on '.' and populate MAJOR/MINOR/PATCH_VERSION
STRING(REPLACE "." ";" MAJ_MIN_PAT "${FORCE_VERSION}")
LIST(GET MAJ_MIN_PAT 0 MAJOR_VERSION)
LIST(GET MAJ_MIN_PAT 1 MINOR_VERSION)
LIST(GET MAJ_MIN_PAT 2 PATCH_VERSION)
ENDIF()
# 1 dash total: Dash in latest tag, no additional commits => pre-release
IF(TAG_LIST_LENGTH EQUAL 2)
LIST(GET TAG_LIST 1 VERSION_STAGE)
SET(FORCE_VERSION "${FORCE_VERSION}-${VERSION_STAGE}")
# 2 dashes: Assume untagged with no dashes in latest tag name => stable + commits
ELSEIF(TAG_LIST_LENGTH EQUAL 3)
# Get the number of commits and latest commit hash
LIST(GET TAG_LIST 1 EXTRA_COMMITS)
SET(FORCE_VERSION "${FORCE_VERSION}.${EXTRA_COMMITS}")
LIST(GET TAG_LIST 2 COMMIT_HASH)
# Bump the patch version
MATH(EXPR PATCH_VERSION "${PATCH_VERSION}+1")
# Set the version to MAJOR.MINOR.PATCH-EXTRA_COMMITS+COMMIT_HASH
SET(FORCE_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}")
SET(FORCE_VERSION "${FORCE_VERSION}-${EXTRA_COMMITS}+${COMMIT_HASH}")
# 3 dashes: Assume untagged with 1 dash in latest tag name => pre-release + commits
ELSEIF(TAG_LIST_LENGTH EQUAL 4)
# Get pre-release stage, number of commits, and latest commit hash
LIST(GET TAG_LIST 1 VERSION_STAGE)
LIST(GET TAG_LIST 2 EXTRA_COMMITS)
SET(FORCE_VERSION
"${FORCE_VERSION}-${VERSION_STAGE}.${EXTRA_COMMITS}")
LIST(GET TAG_LIST 3 COMMIT_HASH)
# Set the version to MAJOR.MINOR.PATCH-VERSION_STAGE.EXTRA_COMMITS+COMMIT_HASH
SET(FORCE_VERSION "${FORCE_VERSION}-${VERSION_STAGE}")
SET(FORCE_VERSION "${FORCE_VERSION}.${EXTRA_COMMITS}+${COMMIT_HASH}")
ENDIF()
ENDIF()

Expand Down Expand Up @@ -74,4 +101,3 @@ MESSAGE("\n"
"* Override version: -DFORCE_VERSION=x.x.x-x\n"
"* Ignore Git information: -DFORCE_VERSION=internal\n"
)

Binary file added data/themes/default/insert_bar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/themes/default/remove_bar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions include/AutomatableModelView.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,16 @@ class LMMS_EXPORT AutomatableModelView : public ModelView

void addDefaultActions( QMenu* menu );

void setConversionFactor( float factor );
float getConversionFactor();


protected:
virtual void mousePressEvent( QMouseEvent* event );

QString m_description;
QString m_unit;
float m_conversionFactor; // Factor to be applied when the m_model->value is displayed
} ;


Expand Down
12 changes: 11 additions & 1 deletion include/ConfigManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@

class LmmsCore;


const QString PROJECTS_PATH = "projects/";
const QString TEMPLATE_PATH = "templates/";
const QString PRESETS_PATH = "presets/";
Expand All @@ -55,6 +54,9 @@ const QString PORTABLE_MODE_FILE = "/portable_mode.txt";
class LMMS_EXPORT ConfigManager : public QObject
{
Q_OBJECT

using UpgradeMethod = void(ConfigManager::*)();

public:
static inline ConfigManager * inst()
{
Expand Down Expand Up @@ -219,6 +221,10 @@ class LMMS_EXPORT ConfigManager : public QObject
return m_version;
}

// Used when the configversion attribute is not present in a configuration file.
// Returns the appropriate config file version based on the LMMS version.
unsigned int legacyConfigVersion();

QString defaultVersion() const;


Expand Down Expand Up @@ -270,6 +276,9 @@ class LMMS_EXPORT ConfigManager : public QObject
void upgrade_1_1_91();
void upgrade();

// List of all upgrade methods
static const std::vector<UpgradeMethod> UPGRADE_METHODS;

QString m_workingDir;
QString m_dataDir;
QString m_vstDir;
Expand All @@ -286,6 +295,7 @@ class LMMS_EXPORT ConfigManager : public QObject
QString m_backgroundPicFile;
QString m_lmmsRcFile;
QString m_version;
unsigned int m_configVersion;
QStringList m_recentlyOpenedProjects;

typedef QVector<QPair<QString, QString> > stringPairVector;
Expand Down
20 changes: 13 additions & 7 deletions include/DataFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,16 @@

#include "lmms_export.h"
#include "MemoryManager.h"
#include "ProjectVersion.h"

class QTextStream;

class LMMS_EXPORT DataFile : public QDomDocument
{
MM_OPERATORS

using UpgradeMethod = void(DataFile::*)();

public:
enum Types
{
Expand Down Expand Up @@ -84,6 +88,8 @@ class LMMS_EXPORT DataFile : public QDomDocument
return m_type;
}

unsigned int legacyFileVersion();

private:
static Type type( const QString& typeName );
static QString typeName( Type type );
Expand All @@ -107,8 +113,13 @@ class LMMS_EXPORT DataFile : public QDomDocument
void upgrade_1_1_0();
void upgrade_1_1_91();
void upgrade_1_2_0_rc3();
void upgrade_1_2_0_rc2_42();
void upgrade_1_3_0();
void upgrade_noHiddenClipNames();

// List of all upgrade methods
static const std::vector<UpgradeMethod> UPGRADE_METHODS;
// List of ProjectVersions for the legacyFileVersion method
static const std::vector<ProjectVersion> UPGRADE_VERSIONS;

void upgrade();

Expand All @@ -125,14 +136,9 @@ class LMMS_EXPORT DataFile : public QDomDocument
QDomElement m_content;
QDomElement m_head;
Type m_type;
unsigned int m_fileVersion;

} ;


const int LDF_MAJOR_VERSION = 1;
const int LDF_MINOR_VERSION = 0;
const QString LDF_VERSION_STRING = QString::number( LDF_MAJOR_VERSION ) + "." + QString::number( LDF_MINOR_VERSION );


#endif

5 changes: 2 additions & 3 deletions include/Fader.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class LMMS_EXPORT Fader : public QWidget, public FloatModelView

void setDisplayConversion( bool b )
{
m_displayConversion = b;
m_conversionFactor = b ? 100.0 : 1.0;
}

inline void setHintText( const QString & _txt_before,
Expand Down Expand Up @@ -155,8 +155,7 @@ class LMMS_EXPORT Fader : public QWidget, public FloatModelView
QPixmap * m_back;
QPixmap * m_leds;
QPixmap * m_knob;

bool m_displayConversion;

bool m_levelsDisplayedInDBFS;

int m_moveStartPoint;
Expand Down
30 changes: 22 additions & 8 deletions include/FileBrowser.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ class FileBrowser : public SideBarWidget

private slots:
void reloadTree( void );
void expandItems( QTreeWidgetItem * item=NULL, QList<QString> expandedDirs = QList<QString>() );
void expandItems( QTreeWidgetItem * item=nullptr, QList<QString> expandedDirs = QList<QString>() );
// call with item=NULL to filter the entire tree
bool filterItems( const QString & filter, QTreeWidgetItem * item=NULL );
bool filterItems( const QString & filter, QTreeWidgetItem * item=nullptr );
void giveFocusToFilter();

private:
Expand Down Expand Up @@ -105,29 +105,38 @@ class FileBrowserTreeWidget : public QTreeWidget
void mousePressEvent( QMouseEvent * me ) override;
void mouseMoveEvent( QMouseEvent * me ) override;
void mouseReleaseEvent( QMouseEvent * me ) override;
void keyPressEvent( QKeyEvent * ke ) override;
void keyReleaseEvent( QKeyEvent * ke ) override;
void hideEvent( QHideEvent * he ) override;


private:
//! Start a preview of a file item
void previewFileItem(FileItem* file);
//! If a preview is playing, stop it.
void stopPreview();

void handleFile( FileItem * fi, InstrumentTrack * it );
void openInNewInstrumentTrack( TrackContainer* tc );
void openInNewInstrumentTrack( TrackContainer* tc, FileItem* item );


bool m_mousePressed;
QPoint m_pressPos;

//! This should only be accessed or modified when m_pphMutex is held
PlayHandle* m_previewPlayHandle;
QMutex m_pphMutex;

FileItem * m_contextMenuItem;
QList<QAction*> getContextActions(FileItem* item, bool songEditor);


private slots:
void activateListItem( QTreeWidgetItem * item, int column );
void openInNewInstrumentTrackBBE( void );
void openInNewInstrumentTrackSE( void );
void sendToActiveInstrumentTrack( void );
void openInNewInstrumentTrack( FileItem* item, bool songEditor );
bool openInNewSampleTrack( FileItem* item );
void sendToActiveInstrumentTrack( FileItem* item );
void updateDirectory( QTreeWidgetItem * item );
void openContainingFolder();
void openContainingFolder( FileItem* item );

} ;

Expand Down Expand Up @@ -234,6 +243,11 @@ class FileItem : public QTreeWidgetItem
return( m_handling );
}

inline bool isTrack( void ) const
{
return m_handling == LoadAsPreset || m_handling == LoadByPlugin;
}

QString extension( void );
static QString extension( const QString & file );

Expand Down
Loading

0 comments on commit edb06d7

Please sign in to comment.