Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a preference option for the order that tracks will be loaded in 4-deck skins #6

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
eb0fd22
Add a preference option for the order that tracks will be loaded in 4…
ywwg May 21, 2013
57ea2f1
Address most notes. Still need to add [Skin] COs for samplers and pre…
ywwg May 21, 2013
aa98cdd
Make sure we have enough samplers and previewdecks to match the skin
ywwg May 21, 2013
f1af434
put definition back in header
ywwg May 21, 2013
8977f64
not getting number of decks on load, but otherwise working ok
ywwg May 22, 2013
b4923bc
clean up, and fix loading config at startup
ywwg May 22, 2013
40aae88
remove unused function
ywwg May 22, 2013
7498860
Merge branch 'master' into 4deck_loadorder
ywwg Aug 7, 2013
8781005
clean up merge conflicts
ywwg Aug 8, 2013
6e81002
fix preferences UI
ywwg Aug 8, 2013
d4e62c1
Actually activate the selected deck ordering.
ywwg Aug 8, 2013
d07623f
Merge branch 'master' into 4deck_loadorder
ywwg Aug 16, 2013
a7f52a9
Rewrite skins that use incorrect [Master] attribute
ywwg Aug 16, 2013
7dadc86
Make sure to activate new deck orders.
ywwg Aug 16, 2013
b205142
Merge branch 'master' into 4deck_loadorder
ywwg Aug 16, 2013
7574921
Change deck orientations after skin has been loaded
ywwg Aug 18, 2013
84eef00
Merge branch 'master' into 4deck_loadorder
ywwg Oct 21, 2013
77c7ce3
Merge branch 'master' into 4deck_loadorder
ywwg Dec 30, 2013
733bdd7
eliminate [Skin]/decks COs
ywwg Dec 21, 2013
4ad2ac9
fix deck order not getting saved/loaded properly
ywwg Dec 21, 2013
da78681
Fix tracks not loading on startup
ywwg Dec 22, 2013
36f4ba3
Revert changes in skins -- don't need [Skin] attributes
ywwg Dec 30, 2013
1d9b748
Fix bad merges
ywwg Dec 30, 2013
2a4fa40
Merge branch 'master' into 4deck_loadorder
ywwg Feb 3, 2014
f3d0f4a
Temporarily make deck ordering non-configurable. 4-deck setups defau…
ywwg Feb 3, 2014
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/baseplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ BasePlayer::~BasePlayer() {

}

const QString BasePlayer::getGroup() {
const QString BasePlayer::getGroup() const {
return m_group;
}
2 changes: 1 addition & 1 deletion src/baseplayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class BasePlayer : public QObject {
BasePlayer(QObject* pParent, QString group);
virtual ~BasePlayer();

const QString getGroup();
const QString getGroup() const;

private:
const QString m_group;
Expand Down
60 changes: 60 additions & 0 deletions src/dlgprefcontrols.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ DlgPrefControls::DlgPrefControls(QWidget * parent, MixxxApp * mixxx,
ComboBoxAutoDjRequeue->setCurrentIndex(m_pConfig->getValueString(ConfigKey("[Auto DJ]", "Requeue")).toInt());
connect(ComboBoxAutoDjRequeue, SIGNAL(activated(int)), this, SLOT(slotSetAutoDjRequeue(int)));

// Ordering of decks, if configurable
int deck_count = static_cast<int>(m_pNumDecks->get());
updateDeckOrderCombo(deck_count);
connect(ComboBoxDeckOrder, SIGNAL(activated(int)), this, SLOT(slotSetDeckOrder(int)));

#ifdef __AUTODJCRATES__

// The minimum available for randomly-selected tracks
Expand Down Expand Up @@ -448,6 +453,14 @@ void DlgPrefControls::slotSetAutoDjRequeue(int)
m_pConfig->set(ConfigKey("[Auto DJ]", "Requeue"), ConfigValue(ComboBoxAutoDjRequeue->currentIndex()));
}

void DlgPrefControls::slotSetDeckOrder(int)
{
QString deckorder = ComboBoxDeckOrder->currentText();
m_pConfig->set(ConfigKey("[Controls]", "DeckOrder"), ConfigValue(deckorder));
updateDeckOrderCombo(static_cast<int>(m_pNumDecks->get()));
m_pPlayerManager->setDeckOrder(deckorder);
}

void DlgPrefControls::slotSetAutoDjMinimumAvailable(int a_iValue) {
#ifdef __AUTODJCRATES__
QString str;
Expand Down Expand Up @@ -497,6 +510,8 @@ void DlgPrefControls::slotSetSkin(int)
checkSkinResolution(ComboBoxSkinconf->currentText())
? warningLabel->hide() : warningLabel->show();
slotUpdateSchemes();
const int deck_count = static_cast<int>(m_pNumDecks->get());
updateDeckOrderCombo(deck_count);
}

void DlgPrefControls::slotSetPositionDisplay(int)
Expand Down Expand Up @@ -596,6 +611,7 @@ void DlgPrefControls::slotApply()
else
m_pConfig->set(ConfigKey("[Controls]","RateDir"), ConfigValue(1));

slotSetDeckOrder(ComboBoxDeckOrder->currentIndex());
}

void DlgPrefControls::slotSetFrameRate(int frameRate) {
Expand Down Expand Up @@ -759,6 +775,7 @@ void DlgPrefControls::slotNumDecksChanged(double new_count) {
m_iNumConfiguredDecks = numdecks;
slotSetRateDir(m_pConfig->getValueString(ConfigKey("[Controls]","RateDir")).toInt());
slotSetRateRange(m_pConfig->getValueString(ConfigKey("[Controls]","RateRange")).toInt());
updateDeckOrderCombo(numdecks);
}

void DlgPrefControls::slotNumSamplersChanged(double new_count) {
Expand All @@ -783,3 +800,46 @@ void DlgPrefControls::slotNumSamplersChanged(double new_count) {
slotSetRateDir(m_pConfig->getValueString(ConfigKey("[Controls]","RateDir")).toInt());
slotSetRateRange(m_pConfig->getValueString(ConfigKey("[Controls]","RateRange")).toInt());
}

void DlgPrefControls::updateDeckOrderCombo(int deck_count) {
// We always try to find the configured order because the skin deckcount value isn't set
// at construction time. We'll receive a signal when that value changes, this function
// will get called, and then we'll set the proper ordering. Since we update the config
// every time they change the value, this shouldn't cause weird overwrites.

// Temporarily, all 4-deck setups will use the same order
QString config_order;
if (deck_count == 4) {
config_order = "CABD";
} else {
config_order = PlayerManager::getDefaultOrder(deck_count).label;
}

// Eventually, load from config:
//QString config_order = m_pConfig->getValueString(ConfigKey("[Controls]", "DeckOrder"));
//textDeckOrder->setVisible(deck_count != 0);
//ComboBoxDeckOrder->setVisible(deck_count != 0);
ComboBoxDeckOrder->clear();
if (deck_count == 0) {
return;
}

int deckorder_index = -1;
int i = 0;
foreach(const PlayerManager::DeckOrderingManager::deck_order_t& order,
PlayerManager::getDeckOrderings(deck_count)) {
ComboBoxDeckOrder->addItem(order.label);
if (order.label == config_order) {
deckorder_index = i;
}
++i;
}
if (deckorder_index >= 0) {
ComboBoxDeckOrder->setCurrentIndex(deckorder_index);
if (ComboBoxDeckOrder->currentText() != config_order) {
m_pConfig->set(ConfigKey("[Controls]", "DeckOrder"),
ConfigValue(ComboBoxDeckOrder->currentText()));
}
m_pPlayerManager->setDeckOrder(config_order);
}
}
4 changes: 3 additions & 1 deletion src/dlgprefcontrols.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ class DlgPrefControls : public DlgPreferencePage, public Ui::DlgPrefControlsDlg
void slotSetAutoDjMinimumAvailable(int);
void slotSetAutoDjUseIgnoreTime(int);
void slotSetAutoDjIgnoreTime(const QTime &a_rTime);
void slotSetDeckOrder(int);
void slotSetRateRamp(bool);
void slotSetRateRampSensitivity(int);
void slotSetLocale(int);


void slotSetFrameRate(int frameRate);
void slotSetWaveformType(int index);
void slotSetWaveformOverviewType(int index);
Expand All @@ -84,13 +84,15 @@ class DlgPrefControls : public DlgPreferencePage, public Ui::DlgPrefControlsDlg
void slotSetNormalizeOverview( bool normalize);
void slotWaveformMeasured(float frameRate, int rtErrorCnt);

private slots:
void slotNumDecksChanged(double);
void slotNumSamplersChanged(double);

private:
void initWaveformControl();
void notifyRebootNecessary();
bool checkSkinResolution(QString skin);
void updateDeckOrderCombo(int deck_count);

ConfigObject<ConfigValue>* m_pConfig;
ControlObject* m_pControlPositionDisplay;
Expand Down
60 changes: 38 additions & 22 deletions src/dlgprefcontrolsdlg.ui
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
</property>
</widget>
</item>
<item row="3" column="0">
<item row="4" column="0">
<widget class="QLabel" name="TextLabel6_2_2_3">
<property name="enabled">
<bool>true</bool>
Expand All @@ -99,7 +99,7 @@
</property>
</widget>
</item>
<item row="3" column="1" colspan="2">
<item row="4" column="1" colspan="2">
<widget class="QComboBox" name="ComboBoxPosition">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
Expand All @@ -112,7 +112,7 @@
</property>
</widget>
</item>
<item row="4" column="0">
<item row="5" column="0">
<widget class="QLabel" name="TextLabel6_2_2_3_2">
<property name="enabled">
<bool>true</bool>
Expand All @@ -131,7 +131,7 @@
</property>
</widget>
</item>
<item row="4" column="1" colspan="2">
<item row="5" column="1" colspan="2">
<widget class="QComboBox" name="ComboBoxTooltips">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
Expand All @@ -144,7 +144,7 @@
</property>
</widget>
</item>
<item row="5" column="0">
<item row="6" column="0">
<widget class="QLabel" name="TextLabel6">
<property name="enabled">
<bool>true</bool>
Expand All @@ -163,7 +163,7 @@
</property>
</widget>
</item>
<item row="5" column="1" colspan="2">
<item row="6" column="1" colspan="2">
<widget class="QComboBox" name="ComboBoxRateRange">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
Expand All @@ -176,7 +176,7 @@
</property>
</widget>
</item>
<item row="6" column="0">
<item row="7" column="0">
<widget class="QLabel" name="TextLabel6_2">
<property name="enabled">
<bool>true</bool>
Expand All @@ -195,7 +195,7 @@
</property>
</widget>
</item>
<item row="6" column="1" colspan="2">
<item row="7" column="1" colspan="2">
<widget class="QComboBox" name="ComboBoxRateDir">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
Expand All @@ -208,7 +208,23 @@
</property>
</widget>
</item>
<item row="9" column="0">
<item row="3" column="1" colspan="2">
<widget class="QComboBox" name="ComboBoxDeckOrder"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="textDeckOrder">
<property name="text">
<string>Deck track load order</string>
</property>
<property name="buddy">
<cstring>ComboBoxDeckOrder</cstring>
</property>
<property name="visible">
<bool>false</bool>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="textLabelAllowTrackLoadToPlayingDeck">
<property name="text">
<string>Track load behavior</string>
Expand All @@ -218,10 +234,10 @@
</property>
</widget>
</item>
<item row="9" column="1" colspan="2">
<item row="10" column="1" colspan="2">
<widget class="QComboBox" name="ComboBoxAllowTrackLoadToPlayingDeck"/>
</item>
<item row="8" column="0">
<item row="9" column="0">
<widget class="QLabel" name="labelCueBehaviour">
<property name="text">
<string>Cue behavior</string>
Expand All @@ -231,10 +247,10 @@
</property>
</widget>
</item>
<item row="8" column="1" colspan="2">
<item row="9" column="1" colspan="2">
<widget class="QComboBox" name="ComboBoxCueDefault"/>
</item>
<item row="7" column="0">
<item row="8" column="0">
<widget class="QLabel" name="textLabelCueRecall">
<property name="text">
<string>Auto Recall Cue</string>
Expand All @@ -244,10 +260,10 @@
</property>
</widget>
</item>
<item row="7" column="1" colspan="2">
<item row="8" column="1" colspan="2">
<widget class="QComboBox" name="ComboBoxCueRecall"/>
</item>
<item row="10" column="0">
<item row="11" column="0">
<widget class="QLabel" name="textAutoDjRequeue">
<property name="text">
<string>Re-queue tracks in Auto DJ</string>
Expand All @@ -257,10 +273,10 @@
</property>
</widget>
</item>
<item row="10" column="1" colspan="2">
<item row="11" column="1" colspan="2">
<widget class="QComboBox" name="ComboBoxAutoDjRequeue"/>
</item>
<item row="13" column="0">
<item row="14" column="0">
<widget class="QLabel" name="textLabelLocale">
<property name="text">
<string>Locale</string>
Expand All @@ -270,7 +286,7 @@
</property>
</widget>
</item>
<item row="13" column="1" colspan="2">
<item row="14" column="1" colspan="2">
<widget class="QComboBox" name="ComboBoxLocale"/>
</item>
<item row="1" column="1" colspan="2">
Expand All @@ -283,14 +299,14 @@
</property>
</widget>
</item>
<item row="11" column="0">
<item row="12" column="0">
<widget class="QLabel" name="autoDjMinimumAvailableLabel">
<property name="text">
<string>Auto DJ: Minimum available tracks [%]</string>
</property>
</widget>
</item>
<item row="11" column="1" colspan="2">
<item row="12" column="1" colspan="2">
<widget class="QSpinBox" name="autoDjMinimumAvailableSpinBox">
<property name="toolTip">
<string>This percentage of tracks are always available for selecting, regardless of when they were last played.</string>
Expand All @@ -303,7 +319,7 @@
</property>
</widget>
</item>
<item row="12" column="0">
<item row="13" column="0">
<widget class="QCheckBox" name="autoDjIgnoreTimeCheckBox">
<property name="toolTip">
<string>Uncheck, to ignore all played tracks.</string>
Expand All @@ -313,7 +329,7 @@
</property>
</widget>
</item>
<item row="12" column="1" colspan="2">
<item row="13" column="1" colspan="2">
<widget class="QTimeEdit" name="autoDjIgnoreTimeEdit">
<property name="toolTip">
<string>Duration after which a track is eligible for selection by Auto DJ again</string>
Expand Down
Loading