Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/library/basesqltablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ QVariant BaseSqlTableModel::data(const QModelIndex& index, int role) const {
if (column == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_DURATION)) {
int duration = value.toInt();
if (duration > 0) {
value = mixxx::Duration::formatSeconds(duration);
value = mixxx::Duration::formatTime(duration);
} else {
value = QString();
}
Expand Down
2 changes: 1 addition & 1 deletion src/library/crate/cratesummary.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class CrateSummary: public Crate {
}
// Returns the duration formatted as a string H:MM:SS
QString getTrackDurationText() const {
return mixxx::Duration::formatSeconds(getTrackDuration(), mixxx::Duration::Precision::SECONDS);
return mixxx::Duration::formatTime(getTrackDuration(), mixxx::Duration::Precision::SECONDS);
}

private:
Expand Down
41 changes: 41 additions & 0 deletions src/preferences/dialog/dlgprefdeck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "control/controlobject.h"
#include "mixxx.h"
#include "defs_urls.h"
#include "util/duration.h"

namespace {
constexpr int kDefaultRateRangePercent = 8;
Expand Down Expand Up @@ -106,6 +107,33 @@ DlgPrefDeck::DlgPrefDeck(QWidget * parent, MixxxMainWindow * mixxx,
connect(buttonGroupTrackTime, SIGNAL(buttonClicked(QAbstractButton*)),
this, SLOT(slotSetTrackTimeDisplay(QAbstractButton *)));

// display time format

m_pControlTrackTimeFormat = new ControlObject(
ConfigKey("[Controls]", "TimeFormat"));
connect(m_pControlTrackTimeDisplay, SIGNAL(valueChanged(double)),
this, SLOT(slotTimeFormatChanged(double)));

QLocale locale;
// Track Display model
comboBoxTimeFormat->clear();
comboBoxTimeFormat->addItem(tr("hh:mm:ss.zzz - Traditional"),
static_cast<int>(TrackTime::DisplayFormat::TRADITIONAL));
comboBoxTimeFormat->addItem(tr("s%1zz - Seconds").arg(mixxx::DurationBase::kCentisecondSeperator),
static_cast<int>(TrackTime::DisplayFormat::SECOND));
comboBoxTimeFormat->addItem(tr("k.sss%1zz - Kiloseconds").arg(mixxx::DurationBase::kCentisecondSeperator),
static_cast<int>(TrackTime::DisplayFormat::KILO_SECOND));
comboBoxTimeFormat->addItem(tr("hs.ss%1zz - Hectoseconds").arg(mixxx::DurationBase::kCentisecondSeperator),
static_cast<int>(TrackTime::DisplayFormat::HECTO_SECOND));

double time_format = static_cast<double>(
m_pConfig->getValue(
ConfigKey("[Controls]", "TimeFormat"),
static_cast<int>(TrackTime::DisplayFormat::TRADITIONAL)));
m_pControlTrackTimeFormat->set(time_format);
comboBoxTimeFormat->setCurrentIndex(
comboBoxTimeFormat->findData(time_format));

// Override Playing Track on Track Load
// The check box reflects the opposite of the config value
m_bDisallowTrackLoadToPlayingDeck = !m_pConfig->getValue(
Expand Down Expand Up @@ -495,11 +523,24 @@ void DlgPrefDeck::slotRateRampingModeLinearButton(bool checked) {
}
}

void DlgPrefDeck::slotTimeFormatChanged(double v) {
int i = static_cast<int>(v);

m_pConfig->set(ConfigKey("[Controls]","TimeFormat"), ConfigValue(v));
comboBoxTimeFormat->setCurrentIndex(
comboBoxTimeFormat->findData(i));
}

void DlgPrefDeck::slotApply() {
double timeDisplay = static_cast<double>(m_timeDisplayMode);
m_pConfig->set(ConfigKey("[Controls]","PositionDisplay"), ConfigValue(timeDisplay));
m_pControlTrackTimeDisplay->set(timeDisplay);

// time format
double timeFormat = comboBoxTimeFormat->itemData(comboBoxTimeFormat->currentIndex()).toDouble();
m_pControlTrackTimeFormat->set(timeFormat);
m_pConfig->setValue(ConfigKey("[Controls]", "TimeFormat"), timeFormat);

// Set cue mode for every deck
for (ControlProxy* pControl : m_cueControls) {
pControl->set(m_iCueMode);
Expand Down
9 changes: 9 additions & 0 deletions src/preferences/dialog/dlgprefdeck.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ namespace TrackTime {
Remaining,
ElapsedAndRemaining,
};
enum class DisplayFormat {
TRADITIONAL,
SECOND,
KILO_SECOND,
HECTO_SECOND,
};
}

enum class KeylockMode {
Expand Down Expand Up @@ -67,6 +73,8 @@ class DlgPrefDeck : public DlgPreferencePage, public Ui::DlgPrefDeckDlg {
void slotRateRampingModeLinearButton(bool);
void slotRateRampSensitivitySlider(int);

void slotTimeFormatChanged(double);

void slotNumDecksChanged(double, bool initializing=false);
void slotNumSamplersChanged(double, bool initializing=false);

Expand All @@ -85,6 +93,7 @@ class DlgPrefDeck : public DlgPreferencePage, public Ui::DlgPrefDeckDlg {

UserSettingsPointer m_pConfig;
ControlObject* m_pControlTrackTimeDisplay;
ControlObject* m_pControlTrackTimeFormat;
ControlProxy* m_pNumDecks;
ControlProxy* m_pNumSamplers;
QList<ControlProxy*> m_cueControls;
Expand Down
113 changes: 63 additions & 50 deletions src/preferences/dialog/dlgprefdeckdlg.ui
Original file line number Diff line number Diff line change
Expand Up @@ -20,41 +20,16 @@
<string>Deck options</string>
</property>
<layout class="QGridLayout" name="GridLayout1">
<item row="0" column="0">
<widget class="QLabel" name="labelCueMode">
<property name="spacing">
<number>10</number>
</property>
<item row="3" column="0">
<widget class="QLabel" name="labelAutoCue">
<property name="text">
<string>Cue mode</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
<string>Auto cue</string>
</property>
<property name="buddy">
<cstring>ComboBoxCueMode</cstring>
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<widget class="QComboBox" name="ComboBoxCueMode">
<property name="toolTip">
<string>Mixxx mode:
- Cue button while pause at cue point = preview
- Cue button while pause not at cue point = set cue point
- Cue button while playing = pause at cue point
Mixxx mode (no blinking):
- Same as Mixxx mode but with no blinking indicators
Pioneer mode:
- Same as Mixxx mode with a flashing play button
Denon mode:
- Cue button at cue point = preview
- Cue button not at cue point = pause at cue point
- Play = set cue point
Numark mode:
- Same as Denon mode, but without a flashing play button
CUP mode:
- Cue button while pause at cue point = play after release
- Cue button while pause not at cue point = set cue point and play after release
- Cue button while playing = go to cue point and play after release
</string>
<cstring>checkBoxSeekToCue</cstring>
</property>
</widget>
</item>
Expand All @@ -77,6 +52,24 @@ CUP mode:
</property>
</widget>
</item>
<item row="4" column="1" colspan="2">
<widget class="QCheckBox" name="checkBoxDisallowLoadToPlayingDeck">
<property name="text">
<string>Do not load tracks into playing decks</string>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2">
<widget class="QCheckBox" name="checkBoxSeekToCue">
<property name="toolTip">
<string>Automatically seeks to the first saved cue point on track load.
If none exists, seeks to the beginning of the track.</string>
</property>
<property name="text">
<string>Jump to main cue point on track load</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
Expand Down Expand Up @@ -111,44 +104,64 @@ CUP mode:
</item>
</layout>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelAutoCue">
<item row="0" column="0">
<widget class="QLabel" name="labelCueMode">
<property name="text">
<string>Auto cue</string>
<string>Cue mode</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="buddy">
<cstring>checkBoxSeekToCue</cstring>
<cstring>ComboBoxCueMode</cstring>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<widget class="QCheckBox" name="checkBoxSeekToCue">
<item row="0" column="1" colspan="2">
<widget class="QComboBox" name="ComboBoxCueMode">
<property name="toolTip">
<string>Automatically seeks to the first saved cue point on track load.
If none exists, seeks to the beginning of the track.</string>
</property>
<property name="text">
<string>Jump to main cue point on track load</string>
<string>Mixxx mode:
- Cue button while pause at cue point = preview
- Cue button while pause not at cue point = set cue point
- Cue button while playing = pause at cue point
Mixxx mode (no blinking):
- Same as Mixxx mode but with no blinking indicators
Pioneer mode:
- Same as Mixxx mode with a flashing play button
Denon mode:
- Cue button at cue point = preview
- Cue button not at cue point = pause at cue point
- Play = set cue point
Numark mode:
- Same as Denon mode, but without a flashing play button
CUP mode:
- Cue button while pause at cue point = play after release
- Cue button while pause not at cue point = set cue point and play after release
- Cue button while playing = go to cue point and play after release
</string>
</property>
</widget>
</item>
<item row="3" column="0">
<item row="4" column="0">
<widget class="QLabel" name="labelPlayingTrackProtection">
<property name="text">
<string>Playing track protection</string>
<string>Pla&amp;ying track protection</string>
</property>
<property name="buddy">
<cstring>checkBoxDisallowLoadToPlayingDeck</cstring>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2">
<widget class="QCheckBox" name="checkBoxDisallowLoadToPlayingDeck">
<item row="2" column="0">
<widget class="QLabel" name="labelTimeDisplay">
<property name="text">
<string>Do not load tracks into playing decks</string>
<string>Time Format</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBoxTimeFormat"/>
</item>
</layout>
</widget>
</item>
Expand Down Expand Up @@ -755,13 +768,13 @@ CUP mode:
</connection>
</connections>
<buttongroups>
<buttongroup name="buttonGroupKeyLockMode"/>
<buttongroup name="buttonGroupKeyUnlockMode"/>
<buttongroup name="buttonGroupSpeedPitchReset">
<property name="exclusive">
<bool>false</bool>
</property>
</buttongroup>
<buttongroup name="buttonGroupKeyLockMode"/>
<buttongroup name="buttonGroupKeyUnlockMode"/>
<buttongroup name="buttonGroupTrackTime"/>
<buttongroup name="buttonGroupSpeedBendBehavior"/>
</buttongroups>
Expand Down
Loading