2 * Copyright 2003-2014, Haiku, Inc.
3 * Distributed under the terms of the MIT license.
6 * Sikosis, Jérôme Duval
7 * yourpalal, Alex Wilson
10 #define MEDIA_WINDOW_H
15 #include <MediaAddOn.h>
16 #include <ParameterWeb.h>
17 #include <StringView.h>
20 #include <ObjectList.h>
22 #include "MediaIcons.h"
23 #include "MediaListItem.h"
24 #include "MediaViews.h"
26 #define SETTINGS_FILE "MediaPrefs Settings"
31 class MidiSettingsView
;
33 class MediaWindow
: public BWindow
{
35 MediaWindow(BRect frame
);
40 // methods to be called by MediaListItems...
41 void SelectNode(const dormant_node_info
* node
);
42 void SelectAudioSettings(const char* title
);
43 void SelectVideoSettings(const char* title
);
44 void SelectAudioMixer(const char* title
);
45 void SelectMidiSettings(const char* title
);
47 // methods to be called by SettingsViews...
48 void UpdateInputListItem(
49 MediaListItem::media_type type
,
50 const dormant_node_info
* node
);
51 void UpdateOutputListItem(
52 MediaListItem::media_type type
,
53 const dormant_node_info
* node
);
55 virtual bool QuitRequested();
56 virtual void MessageReceived(BMessage
* message
);
59 typedef BObjectList
<dormant_node_info
> NodeList
;
62 status_t
_InitMedia(bool first
);
65 void _FindNodes(media_type type
, uint64 kind
,
67 void _AddNodeItems(NodeList
&from
,
68 MediaListItem::media_type type
);
69 void _EmptyNodeLists();
70 void _UpdateListViewMinWidth();
72 NodeListItem
* _FindNodeListItem(dormant_node_info
* info
);
74 static status_t
_RestartMediaServices(void* data
);
76 void _ClearParamView();
77 void _MakeParamView();
78 void _MakeEmptyParamView();
81 SmartNode(const BMessenger
& notifyHandler
);
84 void SetTo(const dormant_node_info
* node
);
85 void SetTo(const media_node
& node
);
87 operator media_node();
92 BMessenger fMessenger
;
96 BSeparatorView
* fTitleView
;
97 BCardLayout
* fContentLayout
;
98 AudioSettingsView
* fAudioView
;
99 VideoSettingsView
* fVideoView
;
100 MidiSettingsView
* fMidiView
;
102 SmartNode fCurrentNode
;
103 BParameterWeb
* fParamWeb
;
106 NodeList fAudioInputs
;
107 NodeList fAudioOutputs
;
108 NodeList fVideoInputs
;
109 NodeList fVideoOutputs
;
112 thread_id fRestartThread
;
113 BAlert
* fRestartAlert
;
117 #endif // MEDIA_WINDOW_H