Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/2.4' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer committed Feb 8, 2023
2 parents 95d03bf + 3fa009f commit dfd8823
Show file tree
Hide file tree
Showing 50 changed files with 1,773 additions and 415 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,8 @@ add_library(mixxx-lib STATIC EXCLUDE_FROM_ALL
src/musicbrainz/musicbrainzxml.cpp
src/musicbrainz/tagfetcher.cpp
src/musicbrainz/web/acoustidlookuptask.cpp
src/musicbrainz/web/coverartarchiveimagetask.cpp
src/musicbrainz/web/coverartarchivelinkstask.cpp
src/musicbrainz/web/musicbrainzrecordingstask.cpp
src/network/jsonwebtask.cpp
src/network/networktask.cpp
Expand Down
3 changes: 3 additions & 0 deletions src/effects/effectslot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,9 @@ void EffectSlot::showParameter(EffectParameterPointer pParameter) {
}

void EffectSlot::swapParameters(EffectParameterType type, int index1, int index2) {
if (index1 == index2) {
return;
}
VERIFY_OR_DEBUG_ASSERT(m_loadedParameters[type].size() > index1) {
return;
}
Expand Down
11 changes: 6 additions & 5 deletions src/engine/enginebuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ void EngineBuffer::ejectTrack() {
TrackPointer pOldTrack = m_pCurrentTrack;
m_pause.lock();

m_visualPlayPos->set(0.0, 0.0, 0.0, 0.0, 0.0);
m_visualPlayPos->set(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
doSeekPlayPos(mixxx::audio::kStartFramePos, SEEK_EXACT);

m_pCurrentTrack.reset();
Expand Down Expand Up @@ -1399,19 +1399,20 @@ void EngineBuffer::updateIndicators(double speed, int iBufferSize) {

// Update visual control object, this needs to be done more often than the
// playpos slider
m_visualPlayPos->set(fFractionalPlaypos,
m_visualPlayPos->set(
fFractionalPlaypos,
speed * m_baserate_old,
static_cast<int>(iBufferSize) /
m_trackEndPositionOld.toEngineSamplePos(),
fractionalPlayposFromAbsolute(m_slipPosition),
tempoTrackSeconds);
tempoTrackSeconds,
iBufferSize / kSamplesPerFrame / m_sampleRate.toDouble() * 1000000.0);

// TODO: Especially with long audio buffers, jitter is visible. This can be fixed by moving the
// ClockControl::updateIndicators into the waveform update loop which is synced with the display refresh rate.
// Via the visual play position it's possible to access to the sample that is currently played,
// and not the one that have been processed as in the current solution.
const auto sampleRate = mixxx::audio::SampleRate::fromDouble(m_pSampleRate->get());
m_pClockControl->updateIndicators(speed * m_baserate_old, m_playPosition, sampleRate);
m_pClockControl->updateIndicators(speed * m_baserate_old, m_playPosition, m_sampleRate);
}

void EngineBuffer::hintReader(const double dRate) {
Expand Down
158 changes: 92 additions & 66 deletions src/engine/enginemaster.cpp

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/engine/enginemaster.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,10 @@ class EngineMaster : public QObject, public AudioSource {
void processChannels(int iBufferSize);

ChannelHandleFactoryPointer m_pChannelHandleFactory;
void applyMasterEffects();
void processHeadphones(const CSAMPLE_GAIN masterMixGainInHeadphones);
void applyMasterEffects(int iBufferSize);
void processHeadphones(
const CSAMPLE_GAIN masterMixGainInHeadphones,
int iBufferSize);
bool sidechainMixRequired() const;

EngineEffectsManager* m_pEngineEffectsManager;
Expand All @@ -285,7 +287,6 @@ class EngineMaster : public QObject, public AudioSource {
QVarLengthArray<ChannelInfo*, kPreallocatedChannels> m_activeTalkoverChannels;

mixxx::audio::SampleRate m_sampleRate;
unsigned int m_iBufferSize;

// Mixing buffers for each output.
CSAMPLE* m_pOutputBusBuffers[3];
Expand All @@ -303,7 +304,6 @@ class EngineMaster : public QObject, public AudioSource {
ControlObject* m_pHeadGain;
ControlObject* m_pMasterSampleRate;
ControlObject* m_pMasterLatency;
ControlObject* m_pMasterAudioBufferSize;
ControlObject* m_pAudioLatencyOverloadCount;
ControlObject* m_pNumMicsConfigured;
ControlPotmeter* m_pAudioLatencyUsage;
Expand Down
20 changes: 19 additions & 1 deletion src/library/dlgcoverartfullsize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ DlgCoverArtFullSize::DlgCoverArtFullSize(
WCoverArtMenu* pCoverMenu)
: QDialog(parent),
m_pPlayer(pPlayer),
m_pCoverMenu(pCoverMenu) {
m_pCoverMenu(pCoverMenu),
m_coverPressed(false) {
CoverArtCache* pCache = CoverArtCache::instance();
if (pCache) {
connect(pCache,
Expand Down Expand Up @@ -82,6 +83,19 @@ void DlgCoverArtFullSize::init(TrackPointer pTrack) {
slotLoadTrack(pTrack);
}

void DlgCoverArtFullSize::initFetchedCoverArt(const QByteArray& fetchedCoverArtBytes) {
m_pixmap.loadFromData(fetchedCoverArtBytes);

// The real size will be calculated later by adjustImageAndDialogSize().
resize(100, 100);
show();
setWindowTitle(tr("Fetched Cover Art"));
raise();
activateWindow();

adjustImageAndDialogSize();
}

void DlgCoverArtFullSize::slotLoadTrack(TrackPointer pTrack) {
if (m_pLoadedTrack != nullptr) {
disconnect(m_pLoadedTrack.get(),
Expand Down Expand Up @@ -158,6 +172,10 @@ void DlgCoverArtFullSize::slotCoverFound(

m_pixmap = pixmap;

adjustImageAndDialogSize();
}

void DlgCoverArtFullSize::adjustImageAndDialogSize() {
if (m_pixmap.isNull()) {
coverArt->setPixmap(QPixmap());
hide();
Expand Down
2 changes: 2 additions & 0 deletions src/library/dlgcoverartfullsize.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class DlgCoverArtFullSize
~DlgCoverArtFullSize() override = default;

void init(TrackPointer pTrack);
void initFetchedCoverArt(const QByteArray& fetchedCoverArtBytes);
void mousePressEvent(QMouseEvent* event) override;
void mouseReleaseEvent(QMouseEvent* ) override;
void mouseMoveEvent(QMouseEvent* ) override;
Expand All @@ -38,6 +39,7 @@ class DlgCoverArtFullSize
mixxx::cache_key_t requestedCacheKey,
bool coverInfoUpdated);
void slotTrackCoverArtUpdated();
void adjustImageAndDialogSize();

// slots that handle signals from WCoverArtMenu
void slotCoverMenu(const QPoint& pos);
Expand Down
Loading

0 comments on commit dfd8823

Please sign in to comment.