xref: /haiku/src/preferences/media/MediaListItem.h (revision cbe35e2031cb2bfb757422f35006bb9bd382bed1)
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, uint32 level, bool isVideo, BList *icons, uint32 modifiers=0);
26 		MediaListItem(const char* label, uint32 level, bool isVideo, BList *icons, uint32 modifiers=0);
27 		~MediaListItem();
28 
29 		virtual void Update(BView *owner, const BFont *finfo);
30 		virtual void DrawItem(BView *owner, BRect frame, bool complete = false);
31 
32 		void SetDefault(bool isDefaultInput, bool isInput);
33 		void SetAudioMixer(bool isAudioMixer);
34 		bool IsDefault(bool isInput) { return isInput ? mIsDefaultInput : mIsDefaultOutput; }
35 		bool IsAudioMixer() { return mIsAudioMixer; }
36 		bool IsVideo() { return mIsVideo; }
37 		const char *GetLabel() { return mLabel; }
38 
39 		dormant_node_info *mInfo;
40 
41 		static int Compare(const void *firstArg, const void *secondArg);
42 
43 	private:
44 		const char *mLabel;
45 		bool mIsAudioMixer;
46 		bool mIsVideo;
47 		bool mIsDefaultInput;
48 		bool mIsDefaultOutput;
49 		dormant_node_info node_info;
50 		BList *mIcons;
51 };
52 
53 #endif	/* __MEDIALISTITEM_H__ */
54