1 // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 2 // 3 // Copyright (c) 2003, OpenBeOS 4 // 5 // This software is part of the OpenBeOS distribution and is covered 6 // by the OpenBeOS license. 7 // 8 // 9 // File: MediaListItem.h 10 // Author: Sikosis, Jérôme Duval 11 // Description: Media Preferences 12 // Created : June 25, 2003 13 // 14 // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 15 #ifndef __MEDIALISTITEM_H__ 16 #define __MEDIALISTITEM_H__ 17 18 19 #include <ListItem.h> 20 #include <MediaAddOn.h> 21 22 23 class MediaIcons; 24 25 26 class MediaListItem : public BListItem { 27 public: 28 MediaListItem(dormant_node_info* info, 29 uint32 level, bool isVideo, 30 MediaIcons* icons, uint32 modifiers = 0); 31 MediaListItem(const char* label, uint32 level, 32 bool isVideo, MediaIcons* icons, 33 uint32 modifiers=0); 34 virtual ~MediaListItem(); 35 36 virtual void Update(BView* owner, const BFont* font); 37 virtual void DrawItem(BView* owner, BRect frame, 38 bool complete = false); 39 40 void SetDefault(bool isDefaultInput, bool isInput); 41 void SetAudioMixer(bool isAudioMixer); 42 43 44 bool IsDefault(bool isInput) 45 { 46 return isInput ? fIsDefaultInput : fIsDefaultOutput; 47 } 48 49 bool IsAudioMixer() { return fIsAudioMixer; } 50 bool IsVideo() { return fIsVideo; } 51 const char* GetLabel() { return fLabel; } 52 53 54 dormant_node_info* fInfo; 55 56 static int Compare(const void* firstArg, 57 const void* secondArg); 58 59 private: 60 const char* fLabel; 61 bool fIsAudioMixer; 62 bool fIsVideo; 63 bool fIsDefaultInput; 64 bool fIsDefaultOutput; 65 //dormant_node_info fNodeInfo; 66 MediaIcons* fIcons; 67 }; 68 69 #endif /* __MEDIALISTITEM_H__ */ 70