llprefsmedia.cpp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  1. /**
  2. * @file llprefsmedia.cpp
  3. * @brief Media preference implementation
  4. *
  5. * $LicenseInfo:firstyear=2001&license=viewergpl$
  6. *
  7. * Copyright (c) 2001-2009, Linden Research, Inc.
  8. *
  9. * Second Life Viewer Source Code
  10. * The source code in this file ("Source Code") is provided by Linden Lab
  11. * to you under the terms of the GNU General Public License, version 2.0
  12. * ("GPL"), unless you have obtained a separate licensing agreement
  13. * ("Other License"), formally executed by you and Linden Lab. Terms of
  14. * the GPL can be found in doc/GPL-license.txt in this distribution, or
  15. * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  16. *
  17. * There are special exceptions to the terms and conditions of the GPL as
  18. * it is applied to this Source Code. View the full text of the exception
  19. * in the file doc/FLOSS-exception.txt in this software distribution, or
  20. * online at
  21. * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  22. *
  23. * By copying, modifying or distributing this software, you acknowledge
  24. * that you have read and understood your obligations described above,
  25. * and agree to abide by those obligations.
  26. *
  27. * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  28. * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  29. * COMPLETENESS OR PERFORMANCE.
  30. * $/LicenseInfo$
  31. */
  32. #include "llviewerprecompiledheaders.h"
  33. #include "llprefsmedia.h"
  34. #include "llaudioengine.h"
  35. #include "llcheckboxctrl.h"
  36. #include "lluictrlfactory.h"
  37. #include "llpanelaudiovolume.h"
  38. #include "llviewercontrol.h"
  39. class LLPrefsMediaImpl : public LLPanel
  40. {
  41. public:
  42. LLPrefsMediaImpl();
  43. ~LLPrefsMediaImpl() override {}
  44. void refresh() override;
  45. void draw() override;
  46. void apply() { refreshValues(); }
  47. void cancel();
  48. private:
  49. void refreshValues();
  50. static void* createVolumePanel(void* user_data);
  51. static void onTabChanged(void* data, bool from_click);
  52. static void onCommitCheckBoxFilter(LLUICtrl* ctrl, void* user_data);
  53. static void onCommitCheckBoxAudio(LLUICtrl* ctrl, void* user_data);
  54. static void onCommitCheckBoxMedia(LLUICtrl* ctrl, void* user_data);
  55. static void onCommitCheckBoxMediaHUD(LLUICtrl* ctrl, void* user_data);
  56. static void onCommitCheckBoxSharedMedia(LLUICtrl* ctrl, void* user_data);
  57. static void onCommitChecIncomingIMSession(LLUICtrl* ctrl, void* user_data);
  58. private:
  59. LLTabContainer* mTabContainer;
  60. F32 mVolume;
  61. F32 mSounds;
  62. F32 mAmbient;
  63. F32 mMusic;
  64. F32 mMedia;
  65. F32 mVoice;
  66. F32 mUI;
  67. F32 mWind;
  68. F32 mDoppler;
  69. F32 mRolloff;
  70. F32 mHealthReductionThreshold;
  71. F32 mMoneyChangeThreshold;
  72. U32 mMediaAutoZoom;
  73. bool mMuteAudio;
  74. bool mMuteSounds;
  75. bool mMuteUI;
  76. bool mMuteAmbient;
  77. bool mMuteWind;
  78. bool mMuteMusic;
  79. bool mMuteMedia;
  80. bool mMuteVoice;
  81. bool mMuteWhenMinimized;
  82. bool mEnableGestureSounds;
  83. bool mEnableAttachmentSounds;
  84. bool mNeighborSimsSounds;
  85. bool mUISndAlertEnable;
  86. bool mUISndBadKeystrokeEnable;
  87. bool mUISndClickEnable;
  88. bool mUISndClickReleaseEnable;
  89. bool mUISndInvalidOpEnable;
  90. bool mUISndMoneyChangeDownEnable;
  91. bool mUISndMoneyChangeUpEnable;
  92. bool mUISndNewIncomingIMSessionEnable;
  93. bool mUISndNewIncomingPlayForGroup;
  94. bool mUISndObjectCreateEnable;
  95. bool mUISndObjectDeleteEnable;
  96. bool mUISndObjectRezInEnable;
  97. bool mUISndObjectRezOutEnable;
  98. bool mUISndPieMenuAppearEnable;
  99. bool mUISndPieMenuHideEnable;
  100. bool mUISndPieMenuSliceHighlightEnable;
  101. bool mUISndSnapshotEnable;
  102. bool mUISndStartIMEnable;
  103. bool mUISndTeleportOutEnable;
  104. bool mUISndTypingEnable;
  105. bool mUISndWindowCloseEnable;
  106. bool mUISndWindowOpenEnable;
  107. bool mUISndHealthReductionFEnable;
  108. bool mUISndHealthReductionMEnable;
  109. bool mEnableCollisionSounds;
  110. bool mMediaEnableFilter;
  111. bool mMediaLookupIP;
  112. bool mStreamingMusic;
  113. bool mNotifyStreamChanges;
  114. bool mStreamingMedia;
  115. bool mParcelMediaAutoPlay;
  116. bool mMediaOnAPrimUI;
  117. bool mPrimMediaMaster;
  118. bool mMediaShowOnOthers;
  119. bool mMediaShowWithinParcel;
  120. bool mMediaShowOutsideParcel;
  121. bool mRunningFMOD;
  122. bool mFirstRun;
  123. };
  124. //static
  125. void* LLPrefsMediaImpl::createVolumePanel(void* user_data)
  126. {
  127. LLPanelAudioVolume* panel = new LLPanelAudioVolume();
  128. return panel;
  129. }
  130. LLPrefsMediaImpl::LLPrefsMediaImpl()
  131. : mFirstRun(true)
  132. {
  133. mFactoryMap["Volume Panel"] = LLCallbackMap(createVolumePanel, NULL);
  134. LLUICtrlFactory::getInstance()->buildPanel(this,
  135. "panel_preferences_media.xml",
  136. &getFactoryMap());
  137. mTabContainer = getChild<LLTabContainer>("Audio and Media");
  138. LLPanel* tab = mTabContainer->getChild<LLPanel>("Audio");
  139. mTabContainer->setTabChangeCallback(tab, onTabChanged);
  140. mTabContainer->setTabUserData(tab, this);
  141. tab = mTabContainer->getChild<LLPanel>("Media");
  142. mTabContainer->setTabChangeCallback(tab, onTabChanged);
  143. mTabContainer->setTabUserData(tab, this);
  144. childSetCommitCallback("media_enable_filter", onCommitCheckBoxFilter, this);
  145. childSetCommitCallback("streaming_music", onCommitCheckBoxAudio, this);
  146. childSetCommitCallback("streaming_video", onCommitCheckBoxMedia, this);
  147. childSetCommitCallback("media_hud", onCommitCheckBoxMediaHUD, this);
  148. childSetCommitCallback("shared_media", onCommitCheckBoxSharedMedia, this);
  149. childSetCommitCallback("enable_UISndNewIncomingIMSessionEnable",
  150. onCommitChecIncomingIMSession, this);
  151. refresh();
  152. }
  153. void LLPrefsMediaImpl::draw()
  154. {
  155. if (mFirstRun)
  156. {
  157. mFirstRun = false;
  158. mTabContainer->selectTab(gSavedSettings.getS32("LastMediaPrefTab"));
  159. }
  160. LLPanel::draw();
  161. }
  162. void LLPrefsMediaImpl::refreshValues()
  163. {
  164. mVolume = gSavedSettings.getF32("AudioLevelMaster");
  165. mMuteAudio = gSavedSettings.getBool("MuteAudio");
  166. mUI = gSavedSettings.getF32("AudioLevelUI");
  167. mMuteUI = gSavedSettings.getBool("MuteUI");
  168. mSounds = gSavedSettings.getF32("AudioLevelSFX");
  169. mMuteSounds = gSavedSettings.getBool("MuteSounds");
  170. mAmbient = gSavedSettings.getF32("AudioLevelAmbient");
  171. mMuteAmbient = gSavedSettings.getBool("MuteAmbient");
  172. mWind = gSavedSettings.getF32("AudioLevelWind");
  173. mMuteWind = gSavedSettings.getBool("DisableWindAudio");
  174. mMusic = gSavedSettings.getF32("AudioLevelMusic");
  175. mMuteMusic = gSavedSettings.getBool("MuteMusic");
  176. mMedia = gSavedSettings.getF32("AudioLevelMedia");
  177. mMuteMedia = gSavedSettings.getBool("MuteMedia");
  178. mVoice = gSavedSettings.getF32("AudioLevelVoice");
  179. mMuteVoice = gSavedSettings.getBool("MuteVoice");
  180. mMediaAutoZoom = gSavedSettings.getU32("MediaAutoZoom");
  181. mMuteWhenMinimized = gSavedSettings.getBool("MuteWhenMinimized");
  182. mEnableGestureSounds = gSavedSettings.getBool("EnableGestureSounds");
  183. mEnableAttachmentSounds = gSavedSettings.getBool("EnableAttachmentSounds");
  184. mNeighborSimsSounds = gSavedSettings.getBool("NeighborSimsSounds");
  185. mDoppler = gSavedSettings.getF32("AudioLevelDoppler");
  186. mRolloff = gSavedSettings.getF32("AudioLevelRolloff");
  187. mMoneyChangeThreshold = gSavedSettings.getF32("UISndMoneyChangeThreshold");
  188. mHealthReductionThreshold =
  189. gSavedSettings.getF32("UISndHealthReductionThreshold");
  190. mMediaEnableFilter = gSavedSettings.getBool("MediaEnableFilter");
  191. mMediaLookupIP = gSavedSettings.getBool("MediaLookupIP");
  192. mStreamingMusic = gSavedSettings.getBool("EnableStreamingMusic");
  193. mNotifyStreamChanges = gSavedSettings.getBool("NotifyStreamChanges");
  194. mStreamingMedia = gSavedSettings.getBool("EnableStreamingMedia");
  195. mMediaOnAPrimUI = gSavedSettings.getBool("MediaOnAPrimUI");
  196. mParcelMediaAutoPlay = gSavedSettings.getBool("ParcelMediaAutoPlayEnable");
  197. mPrimMediaMaster = gSavedSettings.getBool("PrimMediaMasterEnabled");
  198. mMediaShowOnOthers = gSavedSettings.getBool("MediaShowOnOthers");
  199. mMediaShowWithinParcel = gSavedSettings.getBool("MediaShowWithinParcel");
  200. mMediaShowOutsideParcel = gSavedSettings.getBool("MediaShowOutsideParcel");
  201. mUISndAlertEnable = gSavedSettings.getBool("UISndAlertEnable");
  202. mUISndBadKeystrokeEnable =
  203. gSavedSettings.getBool("UISndBadKeystrokeEnable");
  204. mUISndClickEnable = gSavedSettings.getBool("UISndClickEnable");
  205. mUISndClickReleaseEnable =
  206. gSavedSettings.getBool("UISndClickReleaseEnable");
  207. mUISndInvalidOpEnable = gSavedSettings.getBool("UISndInvalidOpEnable");
  208. mUISndMoneyChangeDownEnable =
  209. gSavedSettings.getBool("UISndMoneyChangeDownEnable");
  210. mUISndMoneyChangeUpEnable =
  211. gSavedSettings.getBool("UISndMoneyChangeUpEnable");
  212. mUISndNewIncomingIMSessionEnable =
  213. gSavedSettings.getBool("UISndNewIncomingIMSessionEnable");
  214. mUISndNewIncomingPlayForGroup =
  215. gSavedSettings.getBool("UISndNewIncomingPlayForGroup");
  216. mUISndObjectCreateEnable =
  217. gSavedSettings.getBool("UISndObjectCreateEnable");
  218. mUISndObjectDeleteEnable =
  219. gSavedSettings.getBool("UISndObjectDeleteEnable");
  220. mUISndObjectRezInEnable = gSavedSettings.getBool("UISndObjectRezInEnable");
  221. mUISndObjectRezOutEnable =
  222. gSavedSettings.getBool("UISndObjectRezOutEnable");
  223. mUISndPieMenuAppearEnable =
  224. gSavedSettings.getBool("UISndPieMenuAppearEnable");
  225. mUISndPieMenuHideEnable = gSavedSettings.getBool("UISndPieMenuHideEnable");
  226. mUISndPieMenuSliceHighlightEnable =
  227. gSavedSettings.getBool("UISndPieMenuSliceHighlightEnable");
  228. mUISndSnapshotEnable = gSavedSettings.getBool("UISndSnapshotEnable");
  229. mUISndStartIMEnable = gSavedSettings.getBool("UISndStartIMEnable");
  230. mUISndTeleportOutEnable = gSavedSettings.getBool("UISndTeleportOutEnable");
  231. mUISndTypingEnable = gSavedSettings.getBool("UISndTypingEnable");
  232. mUISndWindowCloseEnable = gSavedSettings.getBool("UISndWindowCloseEnable");
  233. mUISndWindowOpenEnable = gSavedSettings.getBool("UISndWindowOpenEnable");
  234. mUISndHealthReductionFEnable =
  235. gSavedSettings.getBool("UISndHealthReductionFEnable");
  236. mUISndHealthReductionMEnable =
  237. gSavedSettings.getBool("UISndHealthReductionMEnable");
  238. mEnableCollisionSounds = gSavedSettings.getBool("EnableCollisionSounds");
  239. }
  240. void LLPrefsMediaImpl::refresh()
  241. {
  242. refreshValues();
  243. // Disable sub-settings check boxes when needed
  244. #if LL_FMOD
  245. mRunningFMOD = gAudiop && gAudiop->getDriverName(false) == "FMODStudio";
  246. #else
  247. mRunningFMOD = false;
  248. #endif
  249. childSetEnabled("notify_stream_changes",
  250. mRunningFMOD && mStreamingMusic);
  251. if (!mRunningFMOD)
  252. {
  253. gSavedSettings.setBool("NotifyStreamChanges", false);
  254. }
  255. childSetEnabled("media_hud", mStreamingMedia);
  256. childSetEnabled("text_box_zoom", mStreamingMedia && mMediaOnAPrimUI);
  257. childSetEnabled("auto_zoom", mStreamingMedia && mMediaOnAPrimUI);
  258. childSetEnabled("auto_streaming_video", mStreamingMedia);
  259. childSetEnabled("shared_media", mStreamingMedia);
  260. childSetEnabled("within_parcel", mStreamingMedia);
  261. childSetEnabled("outside_parcel", mStreamingMedia);
  262. if (!mStreamingMedia)
  263. {
  264. gSavedSettings.setBool("ParcelMediaAutoPlayEnable", false);
  265. mParcelMediaAutoPlay = false;
  266. }
  267. childSetEnabled("media_lookup_ip", mMediaEnableFilter);
  268. bool shared_media = mStreamingMedia && mPrimMediaMaster;
  269. childSetEnabled("on_others", shared_media);
  270. childSetEnabled("within_parcel", shared_media);
  271. childSetEnabled("outside_parcel", shared_media);
  272. childSetEnabled("enable_UISndNewIncomingPlayForGroup",
  273. mUISndNewIncomingIMSessionEnable);
  274. if (!mUISndNewIncomingIMSessionEnable)
  275. {
  276. gSavedSettings.setBool("UISndNewIncomingPlayForGroup", false);
  277. }
  278. }
  279. void LLPrefsMediaImpl::cancel()
  280. {
  281. gSavedSettings.setF32("AudioLevelMaster", mVolume);
  282. gSavedSettings.setBool("MuteAudio", mMuteAudio);
  283. gSavedSettings.setF32("AudioLevelUI", mUI);
  284. gSavedSettings.setBool("MuteUI", mMuteUI);
  285. gSavedSettings.setF32("AudioLevelSFX", mSounds);
  286. gSavedSettings.setBool("MuteSounds", mMuteSounds);
  287. gSavedSettings.setF32("AudioLevelAmbient", mAmbient);
  288. gSavedSettings.setBool("MuteAmbient", mMuteAmbient);
  289. gSavedSettings.setF32("AudioLevelWind", mWind);
  290. gSavedSettings.setBool("DisableWindAudio", mMuteWind);
  291. gSavedSettings.setF32("AudioLevelMusic", mMusic);
  292. gSavedSettings.setBool("MuteMusic", mMuteMusic);
  293. gSavedSettings.setF32("AudioLevelMedia", mMedia);
  294. gSavedSettings.setBool("MuteMedia", mMuteMedia);
  295. gSavedSettings.setF32("AudioLevelVoice", mVoice);
  296. gSavedSettings.setBool("MuteVoice", mMuteVoice);
  297. gSavedSettings.setBool("MuteWhenMinimized", mMuteWhenMinimized);
  298. gSavedSettings.setBool("EnableGestureSounds", mEnableGestureSounds);
  299. gSavedSettings.setBool("EnableAttachmentSounds", mEnableAttachmentSounds);
  300. gSavedSettings.setBool("NeighborSimsSounds", mNeighborSimsSounds);
  301. gSavedSettings.setF32("AudioLevelDoppler", mDoppler);
  302. gSavedSettings.setF32("AudioLevelRolloff", mRolloff);
  303. gSavedSettings.setF32("UISndMoneyChangeThreshold", mMoneyChangeThreshold);
  304. gSavedSettings.setF32("UISndHealthReductionThreshold",
  305. mHealthReductionThreshold);
  306. gSavedSettings.setBool("MediaEnableFilter", mMediaEnableFilter);
  307. gSavedSettings.setBool("MediaLookupIP", mMediaLookupIP);
  308. gSavedSettings.setBool("EnableStreamingMusic", mStreamingMusic);
  309. gSavedSettings.setBool("NotifyStreamChanges", mNotifyStreamChanges);
  310. gSavedSettings.setBool("EnableStreamingMedia", mStreamingMedia);
  311. gSavedSettings.setBool("MediaOnAPrimUI", mMediaOnAPrimUI);
  312. gSavedSettings.setU32("MediaAutoZoom", mMediaAutoZoom);
  313. gSavedSettings.setBool("ParcelMediaAutoPlayEnable", mParcelMediaAutoPlay);
  314. gSavedSettings.setBool("PrimMediaMasterEnabled", mPrimMediaMaster);
  315. gSavedSettings.setBool("MediaShowOnOthers", mMediaShowOnOthers);
  316. gSavedSettings.setBool("MediaShowWithinParcel", mMediaShowWithinParcel);
  317. gSavedSettings.setBool("MediaShowOutsideParcel", mMediaShowOutsideParcel);
  318. gSavedSettings.setBool("UISndAlertEnable", mUISndAlertEnable);
  319. gSavedSettings.setBool("UISndBadKeystrokeEnable",
  320. mUISndBadKeystrokeEnable);
  321. gSavedSettings.setBool("UISndClickEnable", mUISndClickEnable);
  322. gSavedSettings.setBool("UISndClickReleaseEnable",
  323. mUISndClickReleaseEnable);
  324. gSavedSettings.setBool("UISndInvalidOpEnable", mUISndInvalidOpEnable);
  325. gSavedSettings.setBool("UISndMoneyChangeDownEnable",
  326. mUISndMoneyChangeDownEnable);
  327. gSavedSettings.setBool("UISndMoneyChangeUpEnable",
  328. mUISndMoneyChangeUpEnable);
  329. gSavedSettings.setBool("UISndNewIncomingIMSessionEnable",
  330. mUISndNewIncomingIMSessionEnable);
  331. gSavedSettings.setBool("UISndNewIncomingPlayForGroup",
  332. mUISndNewIncomingPlayForGroup);
  333. gSavedSettings.setBool("UISndObjectCreateEnable",
  334. mUISndObjectCreateEnable);
  335. gSavedSettings.setBool("UISndObjectDeleteEnable",
  336. mUISndObjectDeleteEnable);
  337. gSavedSettings.setBool("UISndObjectRezInEnable", mUISndObjectRezInEnable);
  338. gSavedSettings.setBool("UISndObjectRezOutEnable",
  339. mUISndObjectRezOutEnable);
  340. gSavedSettings.setBool("UISndPieMenuAppearEnable",
  341. mUISndPieMenuAppearEnable);
  342. gSavedSettings.setBool("UISndPieMenuHideEnable", mUISndPieMenuHideEnable);
  343. gSavedSettings.setBool("UISndPieMenuSliceHighlightEnable",
  344. mUISndPieMenuSliceHighlightEnable);
  345. gSavedSettings.setBool("UISndSnapshotEnable", mUISndSnapshotEnable);
  346. gSavedSettings.setBool("UISndStartIMEnable", mUISndStartIMEnable);
  347. gSavedSettings.setBool("UISndTeleportOutEnable", mUISndTeleportOutEnable);
  348. gSavedSettings.setBool("UISndTypingEnable", mUISndTypingEnable);
  349. gSavedSettings.setBool("UISndWindowCloseEnable", mUISndWindowCloseEnable);
  350. gSavedSettings.setBool("UISndWindowOpenEnable", mUISndWindowOpenEnable);
  351. gSavedSettings.setBool("UISndHealthReductionFEnable",
  352. mUISndHealthReductionFEnable);
  353. gSavedSettings.setBool("UISndHealthReductionMEnable",
  354. mUISndHealthReductionMEnable);
  355. gSavedSettings.setBool("EnableCollisionSounds", mEnableCollisionSounds);
  356. }
  357. //static
  358. void LLPrefsMediaImpl::onTabChanged(void* data, bool from_click)
  359. {
  360. LLPrefsMediaImpl* self = (LLPrefsMediaImpl*)data;
  361. if (self && self->mTabContainer)
  362. {
  363. gSavedSettings.setS32("LastMediaPrefTab",
  364. self->mTabContainer->getCurrentPanelIndex());
  365. }
  366. }
  367. //static
  368. void LLPrefsMediaImpl::onCommitCheckBoxMedia(LLUICtrl* ctrl, void* user_data)
  369. {
  370. LLPrefsMediaImpl* self = (LLPrefsMediaImpl*)user_data;
  371. LLCheckBoxCtrl* check = (LLCheckBoxCtrl*)ctrl;
  372. if (!self || !check) return;
  373. bool enabled = check->get();
  374. if (!enabled)
  375. {
  376. gSavedSettings.setBool("ParcelMediaAutoPlayEnable", false);
  377. }
  378. self->refresh();
  379. }
  380. //static
  381. void LLPrefsMediaImpl::onCommitCheckBoxMediaHUD(LLUICtrl* ctrl,
  382. void* user_data)
  383. {
  384. LLPrefsMediaImpl* self = (LLPrefsMediaImpl*)user_data;
  385. LLCheckBoxCtrl* check = (LLCheckBoxCtrl*)ctrl;
  386. if (self && check)
  387. {
  388. self->refresh();
  389. bool enable = check->get();
  390. self->childSetEnabled("text_box_zoom", enable);
  391. self->childSetEnabled("auto_zoom", enable);
  392. }
  393. }
  394. //static
  395. void LLPrefsMediaImpl::onCommitCheckBoxSharedMedia(LLUICtrl* ctrl,
  396. void* user_data)
  397. {
  398. LLPrefsMediaImpl* self = (LLPrefsMediaImpl*)user_data;
  399. LLCheckBoxCtrl* check = (LLCheckBoxCtrl*)ctrl;
  400. if (self && check)
  401. {
  402. bool enable = check->get();
  403. self->childSetEnabled("on_others", enable);
  404. self->childSetEnabled("within_parcel", enable);
  405. self->childSetEnabled("outside_parcel", enable);
  406. }
  407. }
  408. //static
  409. void LLPrefsMediaImpl::onCommitChecIncomingIMSession(LLUICtrl* ctrl,
  410. void* user_data)
  411. {
  412. LLPrefsMediaImpl* self = (LLPrefsMediaImpl*)user_data;
  413. LLCheckBoxCtrl* check = (LLCheckBoxCtrl*)ctrl;
  414. if (self && check)
  415. {
  416. bool enable = check->get();
  417. gSavedSettings.setBool("UISndNewIncomingPlayForGroup", enable);
  418. self->childSetEnabled("enable_UISndNewIncomingPlayForGroup", enable);
  419. }
  420. }
  421. //static
  422. void LLPrefsMediaImpl::onCommitCheckBoxAudio(LLUICtrl* ctrl, void* user_data)
  423. {
  424. LLPrefsMediaImpl* self = (LLPrefsMediaImpl*)user_data;
  425. LLCheckBoxCtrl* check = (LLCheckBoxCtrl*)ctrl;
  426. if (!self || !check) return;
  427. self->childSetEnabled("notify_stream_changes",
  428. self->mRunningFMOD && check->get());
  429. }
  430. //static
  431. void LLPrefsMediaImpl::onCommitCheckBoxFilter(LLUICtrl* ctrl, void* user_data)
  432. {
  433. LLPrefsMediaImpl* self = (LLPrefsMediaImpl*)user_data;
  434. LLCheckBoxCtrl* check = (LLCheckBoxCtrl*)ctrl;
  435. if (self && check)
  436. {
  437. self->childSetEnabled("media_lookup_ip", check->get());
  438. }
  439. }
  440. //---------------------------------------------------------------------------
  441. LLPrefsMedia::LLPrefsMedia()
  442. : impl(* new LLPrefsMediaImpl())
  443. {
  444. }
  445. LLPrefsMedia::~LLPrefsMedia()
  446. {
  447. delete &impl;
  448. }
  449. void LLPrefsMedia::apply()
  450. {
  451. impl.apply();
  452. }
  453. void LLPrefsMedia::cancel()
  454. {
  455. impl.cancel();
  456. }
  457. LLPanel* LLPrefsMedia::getPanel()
  458. {
  459. return &impl;
  460. }