docs/ikteam: Delete most files.
[haiku.git] / src / preferences / media / MediaWindow.h
bloba9390bf080ff84d1f16fb526b54e96719cf56107
1 /*
2 * Copyright 2003-2014, Haiku, Inc.
3 * Distributed under the terms of the MIT license.
5 * Authors:
6 * Sikosis, Jérôme Duval
7 * yourpalal, Alex Wilson
8 */
9 #ifndef MEDIA_WINDOW_H
10 #define MEDIA_WINDOW_H
13 #include <Alert.h>
14 #include <ListView.h>
15 #include <MediaAddOn.h>
16 #include <ParameterWeb.h>
17 #include <StringView.h>
18 #include <Window.h>
20 #include <ObjectList.h>
22 #include "MediaIcons.h"
23 #include "MediaListItem.h"
24 #include "MediaViews.h"
26 #define SETTINGS_FILE "MediaPrefs Settings"
29 class BCardLayout;
30 class BSeparatorView;
31 class MidiSettingsView;
33 class MediaWindow : public BWindow {
34 public:
35 MediaWindow(BRect frame);
36 ~MediaWindow();
38 status_t InitCheck();
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);
58 private:
59 typedef BObjectList<dormant_node_info> NodeList;
61 void _InitWindow();
62 status_t _InitMedia(bool first);
64 void _FindNodes();
65 void _FindNodes(media_type type, uint64 kind,
66 NodeList& into);
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();
80 struct SmartNode {
81 SmartNode(const BMessenger& notifyHandler);
82 ~SmartNode();
84 void SetTo(const dormant_node_info* node);
85 void SetTo(const media_node& node);
86 bool IsSet();
87 operator media_node();
89 private:
90 void _FreeNode();
91 media_node* fNode;
92 BMessenger fMessenger;
95 BListView* fListView;
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;
111 status_t fInitCheck;
112 thread_id fRestartThread;
113 BAlert* fRestartAlert;
117 #endif // MEDIA_WINDOW_H