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 mixxx/src/analyserqueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ bool AnalyserQueue::doAnalysis(TrackPointer tio, SoundSourceProxy* pSoundSource)
dieflag = true;
}

for (int i = 0; i < read; i++) {
for (int i = 0; i < read; ++i) {
samples[i] = ((float)data16[i])/32767.0f;
}

Expand Down
2 changes: 1 addition & 1 deletion mixxx/src/dlgautodj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ DlgAutoDJ::DlgAutoDJ(QWidget* parent, ConfigObject<ConfigValue>* pConfig,
this, SLOT(transitionValueChanged(int)));

connect(pushButtonAutoDJ, SIGNAL(toggled(bool)),
this, SLOT(toggleAutoDJButton(bool))); _blah;
this, SLOT(toggleAutoDJButton(bool))); _blah;

m_pCOEnabledAutoDJ = new ControlPushButton(
ConfigKey("[AutoDJ]", "enabled"));
Expand Down
107 changes: 48 additions & 59 deletions mixxx/src/dlgprefplaylist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,22 @@
* *
***************************************************************************/

#include <QUrl>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the standard is to put these in alphabetical order, and to put a newline between < includes and " includes.

#include <QDesktopServices>
#include <QFileDialog>
#include "dlgprefplaylist.h"
#ifdef __PROMO__
#include "library/promotracksfeature.h"
#endif
#include "soundsourceproxy.h"
//#include "plugindownloader.h"
#include <QtCore>
#include <QtGui>

#define MIXXX_ADDONS_URL "http://www.mixxx.org/wiki/doku.php/add-ons"

DlgPrefPlaylist::DlgPrefPlaylist(QWidget * parent, ConfigObject<ConfigValue> * _config)
: QWidget(parent) {
config = _config;

DlgPrefPlaylist::DlgPrefPlaylist(QWidget * parent, ConfigObject<ConfigValue> * config)
: QWidget(parent),
m_pconfig(config) {
setupUi(this);
slotUpdate();
checkbox_ID3_sync->setVisible(false);
Expand All @@ -47,11 +49,11 @@ DlgPrefPlaylist::DlgPrefPlaylist(QWidget * parent, ConfigObject<ConfigValue> * _
this, SLOT(slotM4ADownloadProgress(qint64, qint64)));
*/

// Connection
connect(PushButtonBrowsePlaylist, SIGNAL(clicked()), this, SLOT(slotBrowseDir()));
connect(LineEditSongfiles, SIGNAL(returnPressed()), this, SLOT(slotApply()));
connect(PushButtonBrowsePlaylist, SIGNAL(clicked()),
this, SLOT(slotBrowseDir()));
//connect(pushButtonM4A, SIGNAL(clicked()), this, SLOT(slotM4ACheck()));
connect(pushButtonExtraPlugins, SIGNAL(clicked()), this, SLOT(slotExtraPlugins()));
connect(pushButtonExtraPlugins, SIGNAL(clicked()),
this, SLOT(slotExtraPlugins()));

bool enablePromoGroupbox = false;
#ifdef __PROMO__
Expand All @@ -69,12 +71,10 @@ DlgPrefPlaylist::DlgPrefPlaylist(QWidget * parent, ConfigObject<ConfigValue> * _
}
}

DlgPrefPlaylist::~DlgPrefPlaylist()
{
DlgPrefPlaylist::~DlgPrefPlaylist() {
}

void DlgPrefPlaylist::slotExtraPlugins()
{
void DlgPrefPlaylist::slotExtraPlugins() {
QDesktopServices::openUrl(QUrl(MIXXX_ADDONS_URL));
}

Expand Down Expand Up @@ -140,67 +140,56 @@ void DlgPrefPlaylist::slotM4ACheck()
}
}*/

void DlgPrefPlaylist::slotUpdate()
{
// Song path
LineEditSongfiles->setText(config->getValueString(ConfigKey("[Playlist]","Directory")));
void DlgPrefPlaylist::slotUpdate() {
// Library Path
LineEditSongfiles->setText(m_pconfig->getValueString(
ConfigKey("[Playlist]","Directory")));
//Bundled songs stat tracking
checkBoxPromoStats->setChecked((bool)config->getValueString(ConfigKey("[Promo]","StatTracking")).toInt());
checkBox_library_scan->setChecked((bool)config->getValueString(ConfigKey("[Library]","RescanOnStartup")).toInt());
checkbox_ID3_sync->setChecked((bool)config->getValueString(ConfigKey("[Library]","WriteAudioTags")).toInt());
checkBox_use_relative_path->setChecked((bool)config->getValueString(ConfigKey("[Library]","UseRelativePathOnExport")).toInt());
checkBox_show_rhythmbox->setChecked((bool)config->getValueString(ConfigKey("[Library]","ShowRhythmboxLibrary"),"1").toInt());
checkBox_show_itunes->setChecked((bool)config->getValueString(ConfigKey("[Library]","ShowITunesLibrary"),"1").toInt());
checkBox_show_traktor->setChecked((bool)config->getValueString(ConfigKey("[Library]","ShowTraktorLibrary"),"1").toInt());
checkBoxPromoStats->setChecked((bool)m_pconfig->getValueString(
ConfigKey("[Promo]","StatTracking")).toInt());
checkBox_library_scan->setChecked((bool)m_pconfig->getValueString(
ConfigKey("[Library]","RescanOnStartup")).toInt());
checkbox_ID3_sync->setChecked((bool)m_pconfig->getValueString(
ConfigKey("[Library]","WriteAudioTags")).toInt());
checkBox_use_relative_path->setChecked((bool)m_pconfig->getValueString(
ConfigKey("[Library]","UseRelativePathOnExport")).toInt());
checkBox_show_rhythmbox->setChecked((bool)m_pconfig->getValueString(
ConfigKey("[Library]","ShowRhythmboxLibrary"),"1").toInt());
checkBox_show_itunes->setChecked((bool)m_pconfig->getValueString(
ConfigKey("[Library]","ShowITunesLibrary"),"1").toInt());
checkBox_show_traktor->setChecked((bool)m_pconfig->getValueString(
ConfigKey("[Library]","ShowTraktorLibrary"),"1").toInt());
}

void DlgPrefPlaylist::slotBrowseDir()
{
QString fd = QFileDialog::getExistingDirectory(this, tr("Choose music library directory"),
config->getValueString(ConfigKey("[Playlist]","Directory")));
if (fd != "")
{
void DlgPrefPlaylist::slotBrowseDir() {
QString fd = QFileDialog::getExistingDirectory(this,
tr("Choose music library directory"),
m_pconfig->getValueString(ConfigKey("[Playlist]","Directory")));
if (fd != "") {
LineEditSongfiles->setText(fd);
}
}

void DlgPrefPlaylist::slotApply()
{

config->set(ConfigKey("[Promo]","StatTracking"),
void DlgPrefPlaylist::slotApply() {
m_pconfig->set(ConfigKey("[Promo]","StatTracking"),
ConfigValue((int)checkBoxPromoStats->isChecked()));

config->set(ConfigKey("[Library]","RescanOnStartup"),
m_pconfig->set(ConfigKey("[Library]","RescanOnStartup"),
ConfigValue((int)checkBox_library_scan->isChecked()));

config->set(ConfigKey("[Library]","WriteAudioTags"),
m_pconfig->set(ConfigKey("[Library]","WriteAudioTags"),
ConfigValue((int)checkbox_ID3_sync->isChecked()));

config->set(ConfigKey("[Library]","UseRelativePathOnExport"),
m_pconfig->set(ConfigKey("[Library]","UseRelativePathOnExport"),
ConfigValue((int)checkBox_use_relative_path->isChecked()));

config->set(ConfigKey("[Library]","ShowRhythmboxLibrary"),
m_pconfig->set(ConfigKey("[Library]","ShowRhythmboxLibrary"),
ConfigValue((int)checkBox_show_rhythmbox->isChecked()));

config->set(ConfigKey("[Library]","ShowITunesLibrary"),
m_pconfig->set(ConfigKey("[Library]","ShowITunesLibrary"),
ConfigValue((int)checkBox_show_itunes->isChecked()));

config->set(ConfigKey("[Library]","ShowTraktorLibrary"),
m_pconfig->set(ConfigKey("[Library]","ShowTraktorLibrary"),
ConfigValue((int)checkBox_show_traktor->isChecked()));

config->Save();

// Update playlist if path has changed
if (LineEditSongfiles->text() != config->getValueString(ConfigKey("[Playlist]","Directory")))
{
// Check for valid directory and put up a dialog if invalid!!!

config->set(ConfigKey("[Playlist]","Directory"), LineEditSongfiles->text());

// Save preferences
config->Save();

// Emit apply signal
if (LineEditSongfiles->text() !=
m_pconfig->getValueString(ConfigKey("[Playlist]","Directory"))) {
m_pconfig->set(ConfigKey("[Playlist]","Directory"), LineEditSongfiles->text());
emit(apply());
}
m_pconfig->Save();
}
33 changes: 17 additions & 16 deletions mixxx/src/dlgprefplaylist.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,40 +22,41 @@
#include "configobject.h"

class QWidget;

/**
*@author Tue & Ken Haste Andersen
*/

class DlgPrefPlaylist : public QWidget, public Ui::DlgPrefPlaylistDlg {
Q_OBJECT
public:
DlgPrefPlaylist(QWidget *parent, ConfigObject<ConfigValue> *_config);
public:
DlgPrefPlaylist(QWidget *parent, ConfigObject<ConfigValue> *config);
~DlgPrefPlaylist();
public slots:
/** Update widget */
public slots:
// Update widget
void slotUpdate();
/** Dialog to browse for music file directory */
// Dialog to browse for music file directory
void slotBrowseDir();
/** Apply changes to widget */
// Apply changes to widget
void slotApply();
/** Starts up the PluginDownloader if the plugin isn't present */
// Starts up the PluginDownloader if the plugin isn't present
//void slotM4ACheck();
/** Set the label and enabled state on the M4A button
depending on whether the M4A plugin is installed. */
// Set the label and enabled state on the M4A button
// depending on whether the M4A plugin is installed.
//void setupM4AButton(bool forceInstalled=false);
/** Display UI indication of plugin download progress.*/
// Display UI indication of plugin download progress.
//void slotM4ADownloadProgress(qint64, qint64);
/** M4A plugin download is finished... */
// M4A plugin download is finished...
//void slotM4ADownloadFinished();

void slotExtraPlugins();

signals:
signals:
void apply();
private:
/** Pointer to config object */
ConfigObject<ConfigValue> *config;
/** SoundSource Plugin Downloader */

private:
ConfigObject<ConfigValue> *m_pconfig;
// SoundSource Plugin Downloader
//PluginDownloader* m_pPluginDownloader;
};

Expand Down
3 changes: 2 additions & 1 deletion mixxx/src/dlgprepare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ DlgPrepare::DlgPrepare(QWidget* parent,
m_pTrackTablePlaceholder->hide();
box->insertWidget(1, m_pPrepareLibraryTableView);

m_pPrepareLibraryTableModel = new PrepareLibraryTableModel(this, pTrackCollection);
m_pPrepareLibraryTableModel = new PrepareLibraryTableModel(this,
pTrackCollection);
m_pPrepareLibraryTableView->loadTrackModel(m_pPrepareLibraryTableModel);

/*
Expand Down
4 changes: 3 additions & 1 deletion mixxx/src/library/cratefeature.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ class TrackCollection;
class CrateFeature : public LibraryFeature {
Q_OBJECT
public:
CrateFeature(QObject* parent, TrackCollection* pTrackCollection, ConfigObject<ConfigValue>* pConfig);
CrateFeature(QObject* parent,
TrackCollection* pTrackCollection,
ConfigObject<ConfigValue>* pConfig);
virtual ~CrateFeature();

QVariant title();
Expand Down
20 changes: 7 additions & 13 deletions mixxx/src/library/hiddentablemodel.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
#ifndef HIDDENTABLEMODEL_H
#define HIDDENTABLEMODEL_H

#include <QtSql>
#include <QItemDelegate>
#include <QtCore>

#include "trackmodel.h"
#include "library/dao/trackdao.h"
#include "library/basesqltablemodel.h"

class TrackCollection;
Expand All @@ -16,13 +10,13 @@ class HiddenTableModel : public BaseSqlTableModel {
public:
HiddenTableModel(QObject* parent, TrackCollection* pTrackCollection);
virtual ~HiddenTableModel();
virtual TrackPointer getTrack(const QModelIndex& index) const;
virtual void search(const QString& searchText);
virtual bool isColumnInternal(int column);
virtual bool isColumnHiddenByDefault(int column);
virtual void purgeTracks(const QModelIndexList& indices);
virtual void unhideTracks(const QModelIndexList& indices);
virtual bool addTrack(const QModelIndex& index, QString location);
TrackPointer getTrack(const QModelIndex& index) const;
void search(const QString& searchText);
bool isColumnInternal(int column);
bool isColumnHiddenByDefault(int column);
void purgeTracks(const QModelIndexList& indices);
void unhideTracks(const QModelIndexList& indices);
bool addTrack(const QModelIndex& index, QString location);

Qt::ItemFlags flags(const QModelIndex &index) const;
TrackModel::CapabilitiesFlags getCapabilities() const;
Expand Down
9 changes: 3 additions & 6 deletions mixxx/src/library/library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,19 +217,16 @@ void Library::slotRestoreSearch(const QString& text) {
emit(restoreSearch(text));
}

void Library::slotRefreshLibraryModels()
{
void Library::slotRefreshLibraryModels() {
m_pMixxxLibraryFeature->refreshLibraryModels();
m_pPrepareFeature->refreshLibraryModels();
}

void Library::slotCreatePlaylist()
{
void Library::slotCreatePlaylist() {
m_pPlaylistFeature->slotCreatePlaylist();
}

void Library::slotCreateCrate()
{
void Library::slotCreateCrate() {
m_pCrateFeature->slotCreateCrate();
}

Expand Down
14 changes: 7 additions & 7 deletions mixxx/src/library/librarytablemodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ class LibraryTableModel : public BaseSqlTableModel {
QString settingsNamespace="mixxx.db.model.library");
virtual ~LibraryTableModel();

virtual TrackPointer getTrack(const QModelIndex& index) const;
virtual void search(const QString& searchText);
virtual bool isColumnInternal(int column);
virtual bool isColumnHiddenByDefault(int column);
virtual bool addTrack(const QModelIndex& index, QString location);
TrackPointer getTrack(const QModelIndex& index) const;
void search(const QString& searchText);
bool isColumnInternal(int column);
bool isColumnHiddenByDefault(int column);
bool addTrack(const QModelIndex& index, QString location);
// Takes a list of locations and add the tracks to the library. Returns the
// number of successful additions.
virtual int addTracks(const QModelIndex& index, QList<QString> locations);
virtual void moveTrack(const QModelIndex& sourceIndex,
int addTracks(const QModelIndex& index, QList<QString> locations);
void moveTrack(const QModelIndex& sourceIndex,
const QModelIndex& destIndex);
TrackModel::CapabilitiesFlags getCapabilities() const;
static const QString DEFAULT_LIBRARYFILTER;
Expand Down
2 changes: 1 addition & 1 deletion mixxx/src/library/playlistfeature.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class PlaylistFeature : public BasePlaylistFeature {
void decorateChild(TreeItem *pChild, int playlist_id);

private:
virtual QString getRootViewHtml() const;
QString getRootViewHtml() const;
};

#endif /* PLAYLISTFEATURE_H */
2 changes: 1 addition & 1 deletion mixxx/src/library/setlogfeature.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class SetlogFeature : public BasePlaylistFeature {


private:
virtual QString getRootViewHtml() const;
QString getRootViewHtml() const;

QLinkedList<int> m_recentTracks;
QAction *m_pJoinWithPreviousAction;
Expand Down
3 changes: 2 additions & 1 deletion mixxx/src/library/treeitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
* - cratefeature.cpp
* - *feature.cpp
*/
TreeItem::TreeItem(const QString &data, const QString &data_path, LibraryFeature* feature, TreeItem* parent) {
TreeItem::TreeItem(const QString &data, const QString &data_path,
LibraryFeature* feature, TreeItem* parent) {
m_data = data;
m_dataPath = data_path;
m_parentItem = parent;
Expand Down
Loading