Ignore:
Timestamp:
Jan 24, 2017, 12:41:54 PM (8 years ago)
Author:
Silvan Scherrer
Message:

SMPlayer: update trunk to version 17.1.0

Location:
smplayer/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • smplayer/trunk

  • smplayer/trunk/src/playlist.h

    r181 r188  
    11/*  smplayer, GUI front-end for mplayer.
    2     Copyright (C) 2006-2016 Ricardo Villalba <rvm@users.sourceforge.net>
     2    Copyright (C) 2006-2017 Ricardo Villalba <rvm@users.sourceforge.net>
    33
    44    This program is free software; you can redistribute it and/or modify
     
    3030#define PLAYLIST_DOWNLOAD
    3131//#define PLAYLIST_DOUBLE_TOOLBAR
     32//#define PLAYLIST_DELETE_FROM_DISK
    3233
    3334class PLItem : public QStandardItem {
    3435public:
    35          enum PLItem_Roles { Role_Played = Qt::UserRole + 2, Role_Current = Qt::UserRole + 3 };
     36         enum PLItem_Roles { Role_Played = Qt::UserRole + 2, Role_Current = Qt::UserRole + 3, Role_Params = Qt::UserRole + 4,
     37                         Role_Video_URL = Qt::UserRole + 5  };
    3638
    3739        PLItem();
     
    4244        void setName(const QString name);
    4345        void setDuration(double duration);
     46        void setExtraParams(const QStringList & pars);
     47        void setVideoURL(const QString & url);
    4448        void setPlayed(bool played);
    4549        void setPosition(int position);
     
    4953        QString name();
    5054        double duration();
     55        QStringList extraParams();
     56        QString videoURL();
    5157        bool played();
    5258        int position();
     
    107113
    108114public slots:
    109         void addItem(QString filename, QString name, double duration);
     115        void addItem(QString filename, QString name, double duration, QStringList params = QStringList(), QString video_url = QString::null);
    110116
    111117        // Start playing, from item 0 if shuffle is off, or from
     
    117123        void playNext();
    118124        void playPrev();
     125
     126        void playNextAuto(); // Called from GUI when a file finished
    119127
    120128        void resumePlay();
     
    137145        void addDirectory(QString dir);
    138146
     147#ifdef PLAYLIST_DELETE_FROM_DISK
    139148        void deleteSelectedFileFromDisk();
     149#endif
    140150
    141151        bool maybeSave();
    142152        void load();
    143         bool save();
     153
     154        bool saveCurrentPlaylist();
     155        bool save(const QString & filename = QString::null);
    144156
    145157#ifdef PLAYLIST_DOWNLOAD
     
    173185        void setPlayFilesFromStart(bool b) { play_files_from_start = b; };
    174186        void setIgnorePlayerErrors(bool b) { ignore_player_errors = b; };
     187        void setStartPlayOnLoad(bool b) { start_play_on_load = b; };
    175188        void setAutomaticallyPlayNext(bool b) { automatically_play_next = b; };
     189        void setAutoSort(bool b);
     190        void setSortCaseSensitive(bool b);
     191        void setFilterCaseSensitive(bool b);
    176192
    177193        bool directoryRecursion() { return recursive_add_directory; };
     
    180196        bool playFilesFromStart() { return play_files_from_start; };
    181197        bool ignorePlayerErrors() { return ignore_player_errors; };
     198        bool startPlayOnLoad() { return start_play_on_load; };
    182199        bool automaticallyPlayNext() { return automatically_play_next; };
     200        bool autoSort();
     201        bool sortCaseSensitive();
     202        bool filterCaseSensitive();
    183203
    184204#ifdef PLAYLIST_DOWNLOAD
     
    195215signals:
    196216        void requestToPlayFile(const QString & filename, int seek = -1);
     217        void requestToPlayStream(const QString & filename, QStringList params = QStringList());
     218
    197219        void requestToAddCurrentFile();
    198220        void playlistEnded();
    199221        void visibilityChanged(bool visible);
    200222        void modifiedChanged(bool);
     223        void windowTitleChanged(const QString & title);
    201224
    202225protected:
     
    206229        int chooseRandomItem();
    207230        QString lastDir();
     231
     232        void setPlaylistFilename(const QString &);
     233        QString playlistFilename() { return playlist_filename; };
     234
     235        void updateWindowTitle();
    208236
    209237protected slots:
     
    216244        void editItem(int row);
    217245
     246        void copyURL();
     247        void openFolder();
     248
     249#ifdef CHROMECAST_SUPPORT
     250        void playOnChromecast();
     251#else
     252        void openURLInWeb();
     253#endif
     254
    218255        void saveSettings();
    219256        void loadSettings();
     
    228265        void showLoadingAnimation(bool b);
    229266#endif
     267
     268        void setPositionColumnVisible(bool b);
     269        void setNameColumnVisible(bool b);
     270        void setDurationColumnVisible(bool b);
     271        void setFilenameColumnVisible(bool b);
    230272
    231273protected:
     
    245287protected:
    246288        QString playlist_path;
     289        QString playlist_filename;
    247290        QString latest_dir;
    248291
     292        QMenu * file_menu;
    249293        QMenu * add_menu;
    250294        QMenu * remove_menu;
     
    259303        QToolBar * toolbar2;
    260304#endif
     305
     306        QToolButton * file_button;
    261307        QToolButton * add_button;
    262308        QToolButton * remove_button;
     
    269315#endif
    270316        MyAction * saveAct;
     317        MyAction * saveAsAct;
    271318        MyAction * playAct;
    272319        MyAction * prevAct;
     
    274321        MyAction * repeatAct;
    275322        MyAction * shuffleAct;
     323        MyAction * showSearchAct;
    276324
    277325        MyAction * moveUpAct;
     
    287335        MyAction * removeAllAct;
    288336
     337#ifdef PLAYLIST_DELETE_FROM_DISK
    289338        MyAction * deleteSelectedFileFromDiskAct;
     339#endif
     340
     341        MyAction * copyURLAct;
     342        MyAction * openFolderAct;
     343
     344#ifdef CHROMECAST_SUPPORT
     345        MyAction * playOnChromecastAct;
     346#else
     347        MyAction * openURLInWebAct;
     348#endif
     349
     350        MyAction * showPositionColumnAct;
     351        MyAction * showNameColumnAct;
     352        MyAction * showDurationColumnAct;
     353        MyAction * showFilenameColumnAct;
    290354
    291355        QSettings * set;
     
    309373        int row_spacing;
    310374
     375        bool start_play_on_load;
    311376        bool automatically_play_next;
    312377        bool ignore_player_errors;
Note: See TracChangeset for help on using the changeset viewer.