1 // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
3 // Copyright (c) 2003, OpenBeOS
5 // This software is part of the OpenBeOS distribution and is covered
6 // by the OpenBeOS license.
10 // Author: Sikosis, Jérôme Duval
11 // Description: Media Preferences
12 // Created : June 25, 2003
14 // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
15 #ifndef __MEDIAVIEWS_H__
16 #define __MEDIAVIEWS_H__
17 #include <GroupView.h>
18 #include <MediaAddOn.h>
21 #include <ObjectList.h>
35 const uint32 ML_RESTART_MEDIA_SERVER
= 'resr';
36 const uint32 ML_DEFAULT_CHANNEL_CHANGED
= 'chch';
39 class NodeMenuItem
: public BMenuItem
42 NodeMenuItem(const dormant_node_info
* info
,
43 BMessage
* message
, char shortcut
= 0,
44 uint32 modifiers
= 0);
45 virtual status_t
Invoke(BMessage
* message
= NULL
);
47 const dormant_node_info
* NodeInfo() const {return fInfo
;}
50 const dormant_node_info
* fInfo
;
54 class ChannelMenuItem
: public BMenuItem
57 ChannelMenuItem(media_input
* input
,
58 BMessage
* message
, char shortcut
= 0,
59 uint32 modifiers
= 0);
60 virtual ~ChannelMenuItem();
62 int32
DestinationID();
65 virtual status_t
Invoke(BMessage
* message
= NULL
);
72 class SettingsView
: public BGroupView
75 typedef BObjectList
<dormant_node_info
> NodeList
;
78 void AddInputNodes(NodeList
& nodes
);
79 void AddOutputNodes(NodeList
& nodes
);
81 virtual void SetDefaultInput(const dormant_node_info
* info
);
82 virtual void SetDefaultOutput(const dormant_node_info
* info
);
84 virtual void MessageReceived(BMessage
* message
);
85 virtual void AttachedToWindow();
90 BMenu
* InputMenu() {return fInputMenu
;}
91 BMenu
* OutputMenu() {return fOutputMenu
;}
93 BButton
* MakeRestartButton();
95 void _EmptyMenu(BMenu
* menu
);
96 MediaWindow
* _MediaWindow() const;
99 void _PopulateMenu(BMenu
* menu
, NodeList
& nodes
,
100 const BMessage
& message
);
101 NodeMenuItem
* _FindNodeItem(BMenu
* menu
,
102 const dormant_node_info
* nodeInfo
);
103 void _ClearMenuSelection(BMenu
* menu
);
110 class AudioSettingsView
: public SettingsView
115 void SetDefaultChannel(int32 channelID
);
117 virtual void SetDefaultInput(const dormant_node_info
* info
);
118 virtual void SetDefaultOutput(const dormant_node_info
* info
);
120 virtual void MessageReceived(BMessage
* message
);
121 virtual void AttachedToWindow();
124 BMenuField
* _MakeChannelMenu();
125 BCheckBox
* _MakeVolumeCheckBox();
126 void _FillChannelMenu(const dormant_node_info
* info
);
128 void _ShowDeskbarVolumeControl();
129 void _HideDeskbarVolumeControl();
131 ChannelMenuItem
* _ChannelMenuItemAt(int32 index
);
134 BCheckBox
* fVolumeCheckBox
;
138 class VideoSettingsView
: public SettingsView
143 virtual void SetDefaultInput(const dormant_node_info
* info
);
144 virtual void SetDefaultOutput(const dormant_node_info
* info
);