Changeset 188 for smplayer/trunk/src/playlist.h
- Timestamp:
- Jan 24, 2017, 12:41:54 PM (8 years ago)
- Location:
- smplayer/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
smplayer/trunk
- Property svn:mergeinfo changed
/smplayer/vendor/current merged: 186
- Property svn:mergeinfo changed
-
smplayer/trunk/src/playlist.h
r181 r188 1 1 /* smplayer, GUI front-end for mplayer. 2 Copyright (C) 2006-201 6Ricardo Villalba <rvm@users.sourceforge.net>2 Copyright (C) 2006-2017 Ricardo Villalba <rvm@users.sourceforge.net> 3 3 4 4 This program is free software; you can redistribute it and/or modify … … 30 30 #define PLAYLIST_DOWNLOAD 31 31 //#define PLAYLIST_DOUBLE_TOOLBAR 32 //#define PLAYLIST_DELETE_FROM_DISK 32 33 33 34 class PLItem : public QStandardItem { 34 35 public: 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 }; 36 38 37 39 PLItem(); … … 42 44 void setName(const QString name); 43 45 void setDuration(double duration); 46 void setExtraParams(const QStringList & pars); 47 void setVideoURL(const QString & url); 44 48 void setPlayed(bool played); 45 49 void setPosition(int position); … … 49 53 QString name(); 50 54 double duration(); 55 QStringList extraParams(); 56 QString videoURL(); 51 57 bool played(); 52 58 int position(); … … 107 113 108 114 public 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); 110 116 111 117 // Start playing, from item 0 if shuffle is off, or from … … 117 123 void playNext(); 118 124 void playPrev(); 125 126 void playNextAuto(); // Called from GUI when a file finished 119 127 120 128 void resumePlay(); … … 137 145 void addDirectory(QString dir); 138 146 147 #ifdef PLAYLIST_DELETE_FROM_DISK 139 148 void deleteSelectedFileFromDisk(); 149 #endif 140 150 141 151 bool maybeSave(); 142 152 void load(); 143 bool save(); 153 154 bool saveCurrentPlaylist(); 155 bool save(const QString & filename = QString::null); 144 156 145 157 #ifdef PLAYLIST_DOWNLOAD … … 173 185 void setPlayFilesFromStart(bool b) { play_files_from_start = b; }; 174 186 void setIgnorePlayerErrors(bool b) { ignore_player_errors = b; }; 187 void setStartPlayOnLoad(bool b) { start_play_on_load = b; }; 175 188 void setAutomaticallyPlayNext(bool b) { automatically_play_next = b; }; 189 void setAutoSort(bool b); 190 void setSortCaseSensitive(bool b); 191 void setFilterCaseSensitive(bool b); 176 192 177 193 bool directoryRecursion() { return recursive_add_directory; }; … … 180 196 bool playFilesFromStart() { return play_files_from_start; }; 181 197 bool ignorePlayerErrors() { return ignore_player_errors; }; 198 bool startPlayOnLoad() { return start_play_on_load; }; 182 199 bool automaticallyPlayNext() { return automatically_play_next; }; 200 bool autoSort(); 201 bool sortCaseSensitive(); 202 bool filterCaseSensitive(); 183 203 184 204 #ifdef PLAYLIST_DOWNLOAD … … 195 215 signals: 196 216 void requestToPlayFile(const QString & filename, int seek = -1); 217 void requestToPlayStream(const QString & filename, QStringList params = QStringList()); 218 197 219 void requestToAddCurrentFile(); 198 220 void playlistEnded(); 199 221 void visibilityChanged(bool visible); 200 222 void modifiedChanged(bool); 223 void windowTitleChanged(const QString & title); 201 224 202 225 protected: … … 206 229 int chooseRandomItem(); 207 230 QString lastDir(); 231 232 void setPlaylistFilename(const QString &); 233 QString playlistFilename() { return playlist_filename; }; 234 235 void updateWindowTitle(); 208 236 209 237 protected slots: … … 216 244 void editItem(int row); 217 245 246 void copyURL(); 247 void openFolder(); 248 249 #ifdef CHROMECAST_SUPPORT 250 void playOnChromecast(); 251 #else 252 void openURLInWeb(); 253 #endif 254 218 255 void saveSettings(); 219 256 void loadSettings(); … … 228 265 void showLoadingAnimation(bool b); 229 266 #endif 267 268 void setPositionColumnVisible(bool b); 269 void setNameColumnVisible(bool b); 270 void setDurationColumnVisible(bool b); 271 void setFilenameColumnVisible(bool b); 230 272 231 273 protected: … … 245 287 protected: 246 288 QString playlist_path; 289 QString playlist_filename; 247 290 QString latest_dir; 248 291 292 QMenu * file_menu; 249 293 QMenu * add_menu; 250 294 QMenu * remove_menu; … … 259 303 QToolBar * toolbar2; 260 304 #endif 305 306 QToolButton * file_button; 261 307 QToolButton * add_button; 262 308 QToolButton * remove_button; … … 269 315 #endif 270 316 MyAction * saveAct; 317 MyAction * saveAsAct; 271 318 MyAction * playAct; 272 319 MyAction * prevAct; … … 274 321 MyAction * repeatAct; 275 322 MyAction * shuffleAct; 323 MyAction * showSearchAct; 276 324 277 325 MyAction * moveUpAct; … … 287 335 MyAction * removeAllAct; 288 336 337 #ifdef PLAYLIST_DELETE_FROM_DISK 289 338 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; 290 354 291 355 QSettings * set; … … 309 373 int row_spacing; 310 374 375 bool start_play_on_load; 311 376 bool automatically_play_next; 312 377 bool ignore_player_errors;
Note:
See TracChangeset
for help on using the changeset viewer.