Skip to content
Merged
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
29 changes: 17 additions & 12 deletions res/translations/mixxx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2868,14 +2868,14 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/dlgautodj.ui" line="137"/>
<location filename="../../src/dlgautodj.ui" line="144"/>
<source>Turn Auto DJ on or off.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/dlgautodj.ui" line="140"/>
<location filename="../../src/dlgautodj.cpp" line="169"/>
<location filename="../../src/dlgautodj.cpp" line="170"/>
<location filename="../../src/dlgautodj.ui" line="147"/>
<location filename="../../src/dlgautodj.cpp" line="175"/>
<location filename="../../src/dlgautodj.cpp" line="176"/>
<source>Enable Auto DJ</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -3154,17 +3154,27 @@ You tried to learn: %1,%2</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/dlgdevelopertoolsdlg.ui" line="75"/>
<location filename="../../src/dlgdevelopertoolsdlg.ui" line="46"/>
<source>Dumps all ControlObject values to a csv-file saved in the settings path (e.g. ~/.mixxx)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/dlgdevelopertoolsdlg.ui" line="49"/>
<source>Dump to csv</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/dlgdevelopertoolsdlg.ui" line="85"/>
<source>Log</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/dlgdevelopertoolsdlg.ui" line="97"/>
<location filename="../../src/dlgdevelopertoolsdlg.ui" line="94"/>
<source>Search</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/dlgdevelopertoolsdlg.ui" line="125"/>
<location filename="../../src/dlgdevelopertoolsdlg.ui" line="135"/>
<source>Stats</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -3548,11 +3558,6 @@ Apply settings and continue?</source>
<source>Controllers</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/controllers/dlgprefcontrollersdlg.ui" line="32"/>
<source>Controllers allow you to control Mixxx with physical devices (for example USB MIDI or HID controllers). Controllers that Mixxx recognizes are shown in the &quot;Controllers&quot; section in the sidebar.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/controllers/dlgprefcontrollersdlg.ui" line="66"/>
<source>Mixxx did not detect any controllers. If you connected the controller while Mixxx was running you must restart Mixxx first.</source>
Expand Down
29 changes: 29 additions & 0 deletions src/dlgautodj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "library/playlisttablemodel.h"
#include "widget/wtracktableview.h"
#include "util/assert.h"
#include "util/time.h"

DlgAutoDJ::DlgAutoDJ(QWidget* parent,
ConfigObject<ConfigValue>* pConfig,
Expand Down Expand Up @@ -32,6 +33,9 @@ DlgAutoDJ::DlgAutoDJ(QWidget* parent,
m_pTrackTableView, SLOT(setTrackTableFont(QFont)));
connect(pLibrary, SIGNAL(setTrackTableRowHeight(int)),
m_pTrackTableView, SLOT(setTrackTableRowHeight(int)));
connect(m_pTrackTableView, SIGNAL(trackSelected(TrackPointer)),
this, SLOT(updateSelectionInfo()));


QBoxLayout* box = dynamic_cast<QBoxLayout*>(layout());
DEBUG_ASSERT_AND_HANDLE(box) { //Assumes the form layout is a QVBox/QHBoxLayout!
Expand Down Expand Up @@ -82,6 +86,8 @@ DlgAutoDJ::DlgAutoDJ(QWidget* parent,
connect(m_pAutoDJProcessor, SIGNAL(autoDJStateChanged(AutoDJProcessor::AutoDJState)),
this, SLOT(autoDJStateChanged(AutoDJProcessor::AutoDJState)));
autoDJStateChanged(m_pAutoDJProcessor->getState());

updateSelectionInfo();
}

DlgAutoDJ::~DlgAutoDJ() {
Expand Down Expand Up @@ -197,3 +203,26 @@ void DlgAutoDJ::setTrackTableFont(const QFont& font) {
void DlgAutoDJ::setTrackTableRowHeight(int rowHeight) {
m_pTrackTableView->setTrackTableRowHeight(rowHeight);
}

void DlgAutoDJ::updateSelectionInfo()
{
int duration = 0;

QModelIndexList indices = m_pTrackTableView->selectionModel()->selectedRows();

for (int i = 0; i < indices.size(); ++i) {
TrackPointer pTrack = m_pAutoDJTableModel->getTrack(indices.at(i));
if (pTrack) {
duration += pTrack->getDuration();
}
}

QString label;

if (!indices.isEmpty()) {
label.append(Time::formatSeconds(duration, false));
label.append(QString(" (%1)").arg(indices.size()));
}

labelSelectionInfo->setText(label);
}
1 change: 1 addition & 0 deletions src/dlgautodj.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class DlgAutoDJ : public QWidget, public Ui::DlgAutoDJ, public LibraryView {
void autoDJStateChanged(AutoDJProcessor::AutoDJState state);
void setTrackTableFont(const QFont& font);
void setTrackTableRowHeight(int rowHeight);
void updateSelectionInfo();

signals:
void addRandomButton(bool buttonChecked);
Expand Down
7 changes: 7 additions & 0 deletions src/dlgautodj.ui
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="labelSelectionInfo">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonAutoDJ">
<property name="toolTip">
Expand Down