1 /* 2 * Copyright 2010, Stephan Aßmus <superstippi@gmx.de>. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef PLAY_PAUSE_BUTTON_H 6 #define PLAY_PAUSE_BUTTON_H 7 8 9 #include "SymbolButton.h" 10 11 12 class PlayPauseButton : public SymbolButton { 13 public: 14 PlayPauseButton(const char* name, 15 BShape* playSymbolShape, 16 BShape* pauseSymbolShape, 17 BMessage* message = NULL, 18 uint32 borders 19 = BControlLook::B_ALL_BORDERS); 20 21 virtual ~PlayPauseButton(); 22 23 // BButton interface 24 virtual void Draw(BRect updateRect); 25 virtual BSize MinSize(); 26 virtual BSize MaxSize(); 27 28 // PlayPauseButton 29 void SetPlaying(); 30 void SetPaused(); 31 void SetStopped(); 32 33 void SetSymbols(BShape* playSymbolShape, 34 BShape* pauseSymbolShape); 35 36 private: 37 void _SetPlaybackState(uint32 state); 38 39 private: 40 BShape* fPlaySymbol; 41 BShape* fPauseSymbol; 42 enum { 43 kStopped = 0, 44 kPaused, 45 kPlaying 46 }; 47 uint32 fPlaybackState; 48 }; 49 50 51 #endif // PLAY_PAUSE_BUTTON_H 52