3rdparty/licenseReport: Add seperate LGPL checks
[haiku.git] / src / add-ons / media / media-add-ons / mixer / MixerSettings.h
blob1b9ff7df20e0e85baa7487f9cd4929a16a9bc6de
1 /*
2 * Copyright 2007 Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef _MIXER_SETTINGS_H
6 #define _MIXER_SETTINGS_H
9 #include <Message.h>
10 #include <Path.h>
12 class BLocker;
13 class MixerInput;
14 class MixerOutput;
17 #define MAX_INPUT_SETTINGS 50
19 class MixerSettings {
20 public:
21 MixerSettings();
22 ~MixerSettings();
24 void SetSettingsFile(const char *file);
26 bool AttenuateOutput();
27 void SetAttenuateOutput(bool yesno);
29 bool NonLinearGainSlider();
30 void SetNonLinearGainSlider(bool yesno);
32 bool UseBalanceControl();
33 void SetUseBalanceControl(bool yesno);
35 bool AllowOutputChannelRemapping();
36 void SetAllowOutputChannelRemapping(bool yesno);
38 bool AllowInputChannelRemapping();
39 void SetAllowInputChannelRemapping(bool yesno);
41 int InputGainControls();
42 void SetInputGainControls(int value);
44 int ResamplingAlgorithm();
45 void SetResamplingAlgorithm(int value);
47 bool RefuseOutputFormatChange();
48 void SetRefuseOutputFormatChange(bool yesno);
50 bool RefuseInputFormatChange();
51 void SetRefuseInputFormatChange(bool yesno);
53 void SaveConnectionSettings(MixerInput *input);
54 void LoadConnectionSettings(MixerInput *input);
56 void SaveConnectionSettings(MixerOutput *output);
57 void LoadConnectionSettings(MixerOutput *output);
59 protected:
60 void StartDeferredSave();
61 void StopDeferredSave();
63 void Save();
64 void Load();
66 static int32 _save_thread_(void *arg);
67 void SaveThread();
69 BLocker *fLocker;
70 BPath *fSettingsFile;
71 volatile bool fSettingsDirty;
72 volatile bigtime_t fSettingsLastChange;
73 volatile thread_id fSaveThread;
74 volatile sem_id fSaveThreadWaitSem;
75 volatile bool fSaveThreadRunning;
77 struct settings {
78 bool AttenuateOutput;
79 bool NonLinearGainSlider;
80 bool UseBalanceControl;
81 bool AllowOutputChannelRemapping;
82 bool AllowInputChannelRemapping;
83 int InputGainControls;
84 int ResamplingAlgorithm;
85 bool RefuseOutputFormatChange;
86 bool RefuseInputFormatChange;
89 volatile settings fSettings;
91 BMessage fOutputSetting;
92 BMessage fInputSetting[MAX_INPUT_SETTINGS];
95 #endif // _MIXER_SETTINGS_H