~mixxxdevelopers/mixxx/engine-control-refactor

« back to all changes in this revision

Viewing changes to mixxx/src/library/playlisttablemodel.h

  • Committer: RJ Ryan
  • Date: 2013-06-04 00:41:29 UTC
  • mfrom: (2890.22.101 mixxx)
  • Revision ID: rryan@mixxx.org-20130604004129-8jjxkicsb3givu4a
MergingĀ fromĀ lp:mixxx.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#ifndef PLAYLISTTABLEMODEL_H
2
2
#define PLAYLISTTABLEMODEL_H
3
3
 
4
 
#include <QtSql>
5
 
#include <QItemDelegate>
6
 
#include <QtCore>
7
 
 
8
4
#include "library/basesqltablemodel.h"
9
5
#include "library/dao/playlistdao.h"
10
 
#include "library/dao/trackdao.h"
11
 
#include "library/librarytablemodel.h"
12
 
 
13
 
class TrackCollection;
14
6
 
15
7
class PlaylistTableModel : public BaseSqlTableModel {
16
8
    Q_OBJECT
17
9
  public:
18
10
    PlaylistTableModel(QObject* parent, TrackCollection* pTrackCollection,
19
 
                       QString settingsNamespace,bool showAll=false);
 
11
                       QString settingsNamespace, bool showAll=false);
20
12
    virtual ~PlaylistTableModel();
21
 
    void setPlaylist(int playlistId);
 
13
    void setTableModel(int playlistId = -1);
 
14
 
22
15
    int getPlaylist() const {
23
16
        return m_iPlaylistId;
24
17
    }
25
 
    virtual TrackPointer getTrack(const QModelIndex& index) const;
26
18
 
27
 
    virtual void search(const QString& searchText);
28
 
    virtual bool isColumnInternal(int column);
29
 
    virtual bool isColumnHiddenByDefault(int column);
30
 
    virtual void removeTrack(const QModelIndex& index);
31
 
    virtual void removeTracks(const QModelIndexList& indices);
32
 
    virtual bool addTrack(const QModelIndex& index, QString location);
33
 
    virtual bool appendTrack(int trackId);
 
19
    bool isColumnInternal(int column);
 
20
    bool isColumnHiddenByDefault(int column);
 
21
    // This function should only be used by AUTODJ
 
22
    void removeTrack(const QModelIndex& index);
 
23
    void removeTracks(const QModelIndexList& indices);
34
24
    // Adding multiple tracks at one to a playlist. Returns the number of
35
25
    // successful additions.
36
 
    virtual int addTracks(const QModelIndex& index, QList<QString> locations);
37
 
    virtual void moveTrack(const QModelIndex& sourceIndex, const QModelIndex& destIndex);
38
 
    virtual void shuffleTracks(const QModelIndex& shuffleStartIndex);
39
 
 
 
26
    int addTracks(const QModelIndex& index, QList<QString> locations);
 
27
    bool appendTrack(int trackId);
 
28
    void moveTrack(const QModelIndex& sourceIndex,
 
29
                           const QModelIndex& destIndex);
 
30
    void shuffleTracks(const QModelIndex& shuffleStartIndex);
40
31
    TrackModel::CapabilitiesFlags getCapabilities() const;
41
32
 
42
 
  private slots:
43
 
    void slotSearch(const QString& searchText);
44
 
 
45
 
  signals:
46
 
    void doSearch(const QString& searchText);
47
 
 
48
33
  private:
49
 
    TrackCollection* m_pTrackCollection;
50
34
    PlaylistDAO& m_playlistDao;
51
 
    TrackDAO& m_trackDao;
52
35
    int m_iPlaylistId;
53
36
    bool m_showAll;
54
37
};