xref: /haiku/src/preferences/media/MediaListItem.h (revision 1294543de9ac0eff000eaea1b18368c36435d08e)
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 MediaListItem : public BListItem {
24 public:
25 								MediaListItem(dormant_node_info* info,
26 									uint32 level, bool isVideo, BList* icons,
27 									uint32 modifiers=0);
28 								MediaListItem(const char* label, uint32 level,
29 									bool isVideo, BList* icons,
30 									uint32 modifiers=0);
31 	virtual						~MediaListItem();
32 
33 	virtual	void				Update(BView* owner, const BFont* font);
34 	virtual	void				DrawItem(BView* owner, BRect frame,
35 									bool complete = false);
36 
37 			void				SetDefault(bool isDefaultInput, bool isInput);
38 			void				SetAudioMixer(bool isAudioMixer);
39 
40 
41 	bool IsDefault(bool isInput)
42 	{
43 		return isInput ? fIsDefaultInput : fIsDefaultOutput;
44 	}
45 
46 	bool IsAudioMixer() { return fIsAudioMixer; }
47 	bool IsVideo() { return fIsVideo; }
48 	const char* GetLabel() { return fLabel; }
49 
50 
51 			dormant_node_info*	fInfo;
52 
53 	static	int					Compare(const void* firstArg,
54 									const void* secondArg);
55 
56 private:
57 			const char*			fLabel;
58 			bool				fIsAudioMixer;
59 			bool				fIsVideo;
60 			bool				fIsDefaultInput;
61 			bool				fIsDefaultOutput;
62 			//dormant_node_info	fNodeInfo;
63 			BList*				fIcons;
64 };
65 
66 #endif	/* __MEDIALISTITEM_H__ */
67