Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into revamp-buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
sakertooth committed Oct 30, 2024
2 parents faad99d + b5de1d5 commit 3d53aa8
Show file tree
Hide file tree
Showing 66 changed files with 247,979 additions and 196,325 deletions.
5 changes: 2 additions & 3 deletions .tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ host = https://www.transifex.com
minimum_perc = 51
#Need to finish at least 51% before merging back

[lmms.lmms]
[o:lmms:p:lmms:r:lmms]
file_filter = data/locale/<lang>.ts
source_file = data/locale/en.ts
source_lang = en
type = QT

type = QT
21,614 changes: 12,016 additions & 9,598 deletions data/locale/cs.ts

Large diffs are not rendered by default.

20,491 changes: 11,456 additions & 9,035 deletions data/locale/de.ts

Large diffs are not rendered by default.

20,641 changes: 11,530 additions & 9,111 deletions data/locale/es.ts

Large diffs are not rendered by default.

18,733 changes: 10,580 additions & 8,153 deletions data/locale/eu.ts

Large diffs are not rendered by default.

21,501 changes: 11,957 additions & 9,544 deletions data/locale/fr.ts

Large diffs are not rendered by default.

17,408 changes: 9,918 additions & 7,490 deletions data/locale/he.ts

Large diffs are not rendered by default.

22,064 changes: 12,242 additions & 9,822 deletions data/locale/hu_HU.ts

Large diffs are not rendered by default.

20,055 changes: 11,234 additions & 8,821 deletions data/locale/id.ts

Large diffs are not rendered by default.

22,655 changes: 12,532 additions & 10,123 deletions data/locale/it.ts

Large diffs are not rendered by default.

20,065 changes: 11,242 additions & 8,823 deletions data/locale/ja.ts

Large diffs are not rendered by default.

22,566 changes: 12,644 additions & 9,922 deletions data/locale/ko.ts

Large diffs are not rendered by default.

21,686 changes: 12,052 additions & 9,634 deletions data/locale/nl.ts

Large diffs are not rendered by default.

22,483 changes: 12,466 additions & 10,017 deletions data/locale/pl.ts

Large diffs are not rendered by default.

20,114 changes: 11,270 additions & 8,844 deletions data/locale/pt.ts

Large diffs are not rendered by default.

22,414 changes: 12,411 additions & 10,003 deletions data/locale/ru.ts

Large diffs are not rendered by default.

21,989 changes: 12,269 additions & 9,720 deletions data/locale/sl.ts

Large diffs are not rendered by default.

22,799 changes: 12,604 additions & 10,195 deletions data/locale/sv.ts

Large diffs are not rendered by default.

22,874 changes: 12,649 additions & 10,225 deletions data/locale/tr.ts

Large diffs are not rendered by default.

20,489 changes: 11,454 additions & 9,035 deletions data/locale/uk.ts

Large diffs are not rendered by default.

21,332 changes: 12,020 additions & 9,312 deletions data/locale/zh_CN.ts

Large diffs are not rendered by default.

19,369 changes: 10,894 additions & 8,475 deletions data/locale/zh_TW.ts

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions data/themes/classic/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ lmms--gui--TrackContentWidget {

/* gear button in tracks */

lmms--gui--TrackOperationsWidget > QPushButton {
lmms--gui--TrackOperationsWidget QPushButton {
max-height: 26px;
max-width: 26px;
min-height: 26px;
Expand All @@ -384,20 +384,20 @@ lmms--gui--TrackOperationsWidget > QPushButton {
border: none;
}

lmms--gui--TrackOperationsWidget > QPushButton::menu-indicator {
lmms--gui--TrackOperationsWidget QPushButton::menu-indicator {
image: url("resources:trackop.png");
subcontrol-origin: padding;
subcontrol-position: center;
position: relative;
top: 1px;
}

lmms--gui--TrackOperationsWidget > QPushButton::menu-indicator:hover {
lmms--gui--TrackOperationsWidget QPushButton::menu-indicator:hover {
image: url("resources:trackop_h.png");
}

lmms--gui--TrackOperationsWidget > QPushButton::menu-indicator:pressed,
lmms--gui--TrackOperationsWidget > QPushButton::menu-indicator:checked {
lmms--gui--TrackOperationsWidget QPushButton::menu-indicator:pressed,
lmms--gui--TrackOperationsWidget QPushButton::menu-indicator:checked {
image: url("resources:trackop_c.png");
position: relative;
top: 2px;
Expand Down
19 changes: 4 additions & 15 deletions data/themes/default/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ lmms--gui--TrackContentWidget {

/* gear button in tracks */

lmms--gui--TrackOperationsWidget > QPushButton {
lmms--gui--TrackOperationsWidget QPushButton {
max-height: 26px;
max-width: 26px;
min-height: 26px;
Expand All @@ -420,16 +420,16 @@ lmms--gui--TrackOperationsWidget > QPushButton {
border: none;
}

lmms--gui--TrackOperationsWidget > QPushButton::menu-indicator {
lmms--gui--TrackOperationsWidget QPushButton::menu-indicator {
image: url("resources:trackop.png");
subcontrol-origin: padding;
subcontrol-position: center;
position: relative;
top: 1px;
}

lmms--gui--TrackOperationsWidget > QPushButton::menu-indicator:pressed,
lmms--gui--TrackOperationsWidget > QPushButton::menu-indicator:checked {
lmms--gui--TrackOperationsWidget QPushButton::menu-indicator:pressed,
lmms--gui--TrackOperationsWidget QPushButton::menu-indicator:checked {
image: url("resources:trackop.png");
position: relative;
top: 2px;
Expand Down Expand Up @@ -601,35 +601,24 @@ lmms--gui--TrackLabelButton:hover {
background: #3B424A;
border: 1px solid #515B66;
border-radius: none;
font-size: 11px;
font-weight: normal;
padding: 2px 1px;
}

lmms--gui--TrackLabelButton:pressed {
background: #262B30;
border-radius: none;
font-size: 11px;
font-weight: normal;
padding: 2px 1px;
}

lmms--gui--TrackLabelButton:checked {
border: 1px solid #485059;
background: #1C1F24;
background-image: url("resources:track_shadow_p.png");
border-radius: none;
font-size: 11px;
font-weight: normal;
padding: 2px 1px;
}

lmms--gui--TrackLabelButton:checked:pressed {
border: 1px solid #2f353b;
background: #0e1012;
background-image: url("resources:track_shadow_p.png");
font-size: 11px;
padding: 2px 1px;
font-weight: solid;
}

Expand Down
2 changes: 2 additions & 0 deletions include/AutomationEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ protected slots:
QScrollBar * m_leftRightScroll;
QScrollBar * m_topBottomScroll;

void adjustLeftRightScoll(int value);

TimePos m_currentPosition;

Action m_action;
Expand Down
2 changes: 1 addition & 1 deletion include/Editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class Editor : public QMainWindow
DropToolBar * addDropToolBar(Qt::ToolBarArea whereToAdd, QString const & windowTitle);
DropToolBar * addDropToolBar(QWidget * parent, Qt::ToolBarArea whereToAdd, QString const & windowTitle);

void closeEvent( QCloseEvent * _ce ) override;
void closeEvent(QCloseEvent * event) override;
protected slots:
virtual void play() {}
virtual void record() {}
Expand Down
3 changes: 2 additions & 1 deletion include/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ class MainWindow : public QMainWindow
LMMS_EXPORT SubWindow* addWindowedWidget(QWidget *w, Qt::WindowFlags windowFlags = QFlag(0));


void refocus();

///
/// \brief Asks whether changes made to the project are to be saved.
///
Expand Down Expand Up @@ -195,7 +197,6 @@ private slots:
void finalize();

void toggleWindow( QWidget *window, bool forceShow = false );
void refocus();

void exportProject(bool multiExport = false);
void handleSaveResult(QString const & filename, bool songSavedSuccessfully);
Expand Down
3 changes: 1 addition & 2 deletions include/PeakController.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ public slots:
static int m_loadCount;
static bool m_buggedFile;

float m_attackCoeff;
float m_decayCoeff;
float m_coeff;
bool m_coeffNeedsUpdate;
} ;

Expand Down
2 changes: 2 additions & 0 deletions include/PianoRoll.h
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,8 @@ protected slots:
QScrollBar * m_leftRightScroll;
QScrollBar * m_topBottomScroll;

void adjustLeftRightScoll(int value);

TimePos m_currentPosition;
bool m_recording;
bool m_doAutoQuantization{false};
Expand Down
1 change: 1 addition & 0 deletions include/PixmapButton.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class LMMS_EXPORT PixmapButton : public AutomatableButton
void setInactiveGraphic( const QPixmap & _pm, bool _update = true );

QSize sizeHint() const override;
QSize minimumSizeHint() const override;

signals:
void doubleClicked();
Expand Down
6 changes: 1 addition & 5 deletions include/PluginView.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@ class LMMS_EXPORT PluginView : public QWidget, public ModelView
{
}

void setResizable(bool resizable) { m_isResizable = resizable; }
bool isResizable() { return m_isResizable; }

private:
bool m_isResizable = false;
virtual bool isResizable() const { return false; }
};

} // namespace lmms::gui
Expand Down
2 changes: 2 additions & 0 deletions include/SongEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ private slots:

QScrollBar * m_leftRightScroll;

void adjustLeftRightScoll(int value);

LcdSpinBox * m_tempoSpinBox;

TimeLineWidget * m_timeLine;
Expand Down
2 changes: 2 additions & 0 deletions include/SubWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ class LMMS_EXPORT SubWindow : public QMdiSubWindow
void paintEvent( QPaintEvent * pe ) override;
void changeEvent( QEvent * event ) override;

QPushButton* addTitleButton(const std::string& iconName, const QString& toolTip);

signals:
void focusLost();

Expand Down
84 changes: 58 additions & 26 deletions include/TimePos.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#ifndef LMMS_TIME_POS_H
#define LMMS_TIME_POS_H

#include <algorithm>
#include <cassert>
#include "lmms_export.h"
#include "lmms_basics.h"

Expand All @@ -51,8 +53,8 @@ class LMMS_EXPORT TimeSig
public:
TimeSig( int num, int denom );
TimeSig( const MeterModel &model );
int numerator() const;
int denominator() const;
int numerator() const { return m_num; }
int denominator() const { return m_denom; }
private:
int m_num;
int m_denom;
Expand All @@ -69,42 +71,72 @@ class LMMS_EXPORT TimePos
TimePos( const tick_t ticks = 0 );

TimePos quantize(float) const;
TimePos toAbsoluteBar() const;
TimePos toAbsoluteBar() const { return getBar() * s_ticksPerBar; }

TimePos& operator+=( const TimePos& time );
TimePos& operator-=( const TimePos& time );
TimePos& operator+=(const TimePos& time)
{
m_ticks += time.m_ticks;
return *this;
}

TimePos& operator-=(const TimePos& time)
{
m_ticks -= time.m_ticks;
return *this;
}

// return the bar, rounded down and 0-based
bar_t getBar() const;
bar_t getBar() const { return m_ticks / s_ticksPerBar; }

// return the bar, rounded up and 0-based
bar_t nextFullBar() const;
bar_t nextFullBar() const { return (m_ticks + (s_ticksPerBar - 1)) / s_ticksPerBar; }

void setTicks(tick_t ticks) { m_ticks = ticks; }
tick_t getTicks() const { return m_ticks; }

void setTicks( tick_t ticks );
tick_t getTicks() const;
operator int() const { return m_ticks; }

operator int() const;
tick_t ticksPerBeat(const TimeSig& sig) const { return ticksPerBar(sig) / sig.numerator(); }

tick_t ticksPerBeat( const TimeSig &sig ) const;
// Remainder ticks after bar is removed
tick_t getTickWithinBar( const TimeSig &sig ) const;
tick_t getTickWithinBar(const TimeSig& sig) const { return m_ticks % ticksPerBar(sig); }

// Returns the beat position inside the bar, 0-based
tick_t getBeatWithinBar( const TimeSig &sig ) const;
tick_t getBeatWithinBar(const TimeSig& sig) const { return getTickWithinBar(sig) / ticksPerBeat(sig); }

// Remainder ticks after bar and beat are removed
tick_t getTickWithinBeat( const TimeSig &sig ) const;
tick_t getTickWithinBeat(const TimeSig& sig) const { return getTickWithinBar(sig) % ticksPerBeat(sig); }

// calculate number of frame that are needed this time
f_cnt_t frames( const float framesPerTick ) const;

double getTimeInMilliseconds( bpm_t beatsPerMinute ) const;

static TimePos fromFrames( const f_cnt_t frames, const float framesPerTick );
static tick_t ticksPerBar();
static tick_t ticksPerBar( const TimeSig &sig );
static int stepsPerBar();
static void setTicksPerBar( tick_t tpt );
static TimePos stepPosition( int step );
static double ticksToMilliseconds( tick_t ticks, bpm_t beatsPerMinute );
static double ticksToMilliseconds( double ticks, bpm_t beatsPerMinute );
f_cnt_t frames(const float framesPerTick) const
{
// Before, step notes used to have negative length. This
// assert is a safeguard against negative length being
// introduced again (now using Note Types instead #5902)
assert(m_ticks >= 0);
return static_cast<f_cnt_t>(m_ticks * framesPerTick);
}

double getTimeInMilliseconds(bpm_t beatsPerMinute) const { return ticksToMilliseconds(getTicks(), beatsPerMinute); }

static TimePos fromFrames(const f_cnt_t frames, const float framesPerTick)
{
return TimePos(static_cast<int>(frames / framesPerTick));
}

static tick_t ticksPerBar() { return s_ticksPerBar; }
static tick_t ticksPerBar(const TimeSig& sig) { return DefaultTicksPerBar * sig.numerator() / sig.denominator(); }

static int stepsPerBar() { return std::max(1, ticksPerBar() / DefaultBeatsPerBar); }
static void setTicksPerBar(tick_t ticks) { s_ticksPerBar = ticks; }
static TimePos stepPosition(int step) { return step * ticksPerBar() / stepsPerBar(); }

static double ticksToMilliseconds(tick_t ticks, bpm_t beatsPerMinute)
{
return ticksToMilliseconds(static_cast<double>(ticks), beatsPerMinute);
}

static double ticksToMilliseconds(double ticks, bpm_t beatsPerMinute) { return (ticks * 1250) / beatsPerMinute; }

private:
tick_t m_ticks;
Expand Down
68 changes: 68 additions & 0 deletions include/TrackGrip.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* TrackGrip.h - Grip that can be used to move tracks
*
* Copyright (c) 2024- Michael Gregorius
*
* 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 LMMS_GUI_TRACK_GRIP_H
#define LMMS_GUI_TRACK_GRIP_H

#include <QWidget>


class QPixmap;

namespace lmms
{

class Track;

namespace gui
{

class TrackGrip : public QWidget
{
Q_OBJECT
public:
TrackGrip(Track* track, QWidget* parent = 0);
~TrackGrip() override = default;

signals:
void grabbed();
void released();

protected:
void mousePressEvent(QMouseEvent*) override;
void mouseReleaseEvent(QMouseEvent*) override;
void paintEvent(QPaintEvent*) override;

private:
Track* m_track = nullptr;
bool m_isGrabbed = false;
static QPixmap* s_grabbedPixmap;
static QPixmap* s_releasedPixmap;
};

} // namespace gui

} // namespace lmms

#endif // LMMS_GUI_TRACK_GRIP_H
Loading

0 comments on commit 3d53aa8

Please sign in to comment.