1 /* 2 * Copyright 2007-2010, Haiku. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Stephan Aßmus <superstippi@gmx.de> 7 * Fredrik Modéen <fredrik@modeen.se> 8 */ 9 #ifndef PLAYLIST_WINDOW_H 10 #define PLAYLIST_WINDOW_H 11 12 13 #include <Entry.h> 14 #include <Window.h> 15 16 #include "ListenerAdapter.h" 17 18 19 class BMenuBar; 20 class BMenuItem; 21 class CommandStack; 22 class Controller; 23 class Notifier; 24 class Playlist; 25 class PlaylistListView; 26 class RWLocker; 27 class BButton; 28 class BFilePanel; 29 30 31 enum { 32 // file 33 M_PLAYLIST_OPEN = 'open', 34 M_PLAYLIST_SAVE = 'save', 35 M_PLAYLIST_SAVE_AS = 'svas', 36 M_PLAYLIST_SAVE_RESULT = 'psrs', 37 38 // edit 39 M_PLAYLIST_RANDOMIZE = 'rand', 40 M_PLAYLIST_REMOVE = 'rmov', 41 M_PLAYLIST_MOVE_TO_TRASH = 'trsh' 42 }; 43 44 45 class PlaylistWindow : public BWindow { 46 public: 47 PlaylistWindow(BRect frame, 48 Playlist* playlist, 49 Controller* controller); 50 virtual ~PlaylistWindow(); 51 52 virtual bool QuitRequested(); 53 virtual void MessageReceived(BMessage* message); 54 55 private: 56 void _CreateMenu(BRect& frame); 57 void _ObjectChanged(const Notifier* object); 58 void _SavePlaylist(const BMessage* filePanelMessage); 59 void _SavePlaylist(const entry_ref& ref); 60 void _SavePlaylist(BEntry& origEntry, 61 BEntry& tempEntry, const char* finalName); 62 63 Playlist* fPlaylist; 64 PlaylistListView* fListView; 65 66 BView* fTopView; 67 BMenuItem* fUndoMI; 68 BMenuItem* fRedoMI; 69 70 RWLocker* fLocker; 71 CommandStack* fCommandStack; 72 ListenerAdapter fCommandStackListener; 73 74 entry_ref fSavedPlaylistRef; 75 }; 76 77 78 #endif // PLAYLIST_WINDOW_H 79