Skip to content

Commit

Permalink
Set MAX_BUFFER_LEN to a more reasonable size
Browse files Browse the repository at this point in the history
  • Loading branch information
abique committed Sep 16, 2023
1 parent 8ddf0a2 commit 31f571b
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions src/util/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,35 @@
#include <Qt>

// Maximum buffer length to each EngineObject::process call.
//TODO: Replace this with mixxx::AudioParameters::bufferSize()
constexpr unsigned int MAX_BUFFER_LEN = 160000;
// Note: MAX_BUFFER_LEN shouldn't be use for audio processing,
// because the buffers should be sized according to the processing
// block in frames and then multiplied by the channel count.
// Then audio buffers used in I/O and non realtime operation
// should be sized according to their task with a balance in mind
// between CPU efficiency and memory usage.
//
// TODO: Replace this with mixxx::AudioParameters::bufferSize()
static constexpr const unsigned int MAX_PROCESS_FRAMES = 4096;
static constexpr const unsigned int MAX_PROCESS_CHANNELS = 2;
static constexpr const unsigned int MAX_BUFFER_LEN = MAX_PROCESS_CHANNELS * MAX_PROCESS_FRAMES;

constexpr int kMaxNumberOfDecks = 4;
static constexpr const int kMaxNumberOfDecks = 4;

// Keyboard shortcut components for showing the Track Properties dialog and
// for displaying the shortcut in the track context menu
const Qt::Modifier kPropertiesShortcutModifier = Qt::CTRL;
const Qt::Key kPropertiesShortcutKey = Qt::Key_Return;
static constexpr const Qt::Modifier kPropertiesShortcutModifier = Qt::CTRL;
static constexpr const Qt::Key kPropertiesShortcutKey = Qt::Key_Return;

// Keyboard shortcut for hiding track and removing from Crate/Playlist/AutoDJ queue.
// This is also used to display the shortcut in the track context menu.
// Also used for the 'Remove' actions in the library sidebar.
#ifdef Q_OS_MAC
// Note: On macOS, CTRL corresponds to the Command key.
const Qt::Modifier kHideRemoveShortcutModifier = Qt::CTRL;
const Qt::Key kHideRemoveShortcutKey = Qt::Key_Backspace;
static constexpr const Qt::Modifier kHideRemoveShortcutModifier = Qt::CTRL;
static constexpr const Qt::Key kHideRemoveShortcutKey = Qt::Key_Backspace;
#else
const Qt::Modifier kHideRemoveShortcutModifier = static_cast<Qt::Modifier>(0);
const Qt::Key kHideRemoveShortcutKey = Qt::Key_Delete;
static constexpr const Qt::Modifier kHideRemoveShortcutModifier = static_cast<Qt::Modifier>(0);
static constexpr const Qt::Key kHideRemoveShortcutKey = Qt::Key_Delete;
#endif

const Qt::Key kRenameSidebarItemShortcutKey = Qt::Key_F2;
static constexpr const Qt::Key kRenameSidebarItemShortcutKey = Qt::Key_F2;

0 comments on commit 31f571b

Please sign in to comment.