/******************************************************************************* Copyright © 2017 Philips Lighting Holding B.V. All Rights Reserved. ********************************************************************************/ #pragma once #include #include "EffectPlayer.h" #include #include #include "afxwin.h" using huestream::HueStreamPtr; using huestream::BridgePtr; using huestream::GroupPtr; class CStreamTestDlg : public CDialogEx { public: CStreamTestDlg(CWnd* pParent = NULL); #ifdef AFX_DESIGN_TIME enum { IDD = IDD_STREAMTEST_DIALOG }; #endif protected: void DoDataExchange(CDataExchange* pDX) override; HICON m_hIcon; HueStreamPtr m_hueStream; EffectPlayerPtr m_effectPlayer; list m_msgHistory; BOOL OnInitDialog() override; afx_msg void OnSysCommand(UINT nID, LPARAM lParam); afx_msg void OnPaint(); afx_msg HCURSOR OnQueryDragIcon(); DECLARE_MESSAGE_MAP() void InitializeHueStream(); void AddDebugMsg(string msg); void SetUserMessage(string msg) const; void SetIpAndCredentials(LPCSTR ip, LPCSTR uname, LPCSTR key); void SetGroups(BridgePtr bridge); void DrawLights(); void ClearLights(); void SetConnecting(bool isConnecting); double GetSpeed() const; bool CanPlayEffect(); double TransparencyToAlpha(CString transpararency); vector split(const std::string &s, char delim); void EnableSaw(); void EnableSquare(); void EnableSine(); void EnableColorloop(); void EnableMarquee(); void EnableFireballs(); void EnablePolice(); void DisableSaw(); void DisableSquare(); void DisableSine(); void DisableColorloop(); void DisableMarquee(); void DisableFireballs(); void DisablePolice(); void DisableAll(); CCriticalSection m_cs; UINT_PTR m_timerVal = 0; bool m_connecting = false; CEdit m_edit_ip; CEdit m_edit_username; CEdit m_edit_key; CEdit m_edit_log; CComboBox m_combo_group; CComboBox m_combo_lang; CSliderCtrl m_slider_speed; bool m_saw_toggle = false; bool m_square_toggle = false; bool m_sine_toggle = false; bool m_marquee_toggle = false; bool m_colorloop_toggle = false; bool m_fireballs_toggle = false; bool m_police_toggle = false; public: afx_msg void OnBnClickedButtonConnect(); afx_msg void OnBnClickedExplosion(); afx_msg void OnBnClickedRedWhiteBlue(); afx_msg void OnBnClickedCombi(); afx_msg void OnBnClickedButtonManual(); afx_msg void OnBnClickedButtonReset(); afx_msg void OnBnClickedButtonSequenceRound(); afx_msg void OnBnClickedSeqeffectltor(); afx_msg void OnBnClickedSequencerandom(); afx_msg void OnComboChangedGroup(); afx_msg void OnComboChangedLanguage(); afx_msg void OnBnClickedSaw(); afx_msg void OnBnClickedSquare(); afx_msg void OnBnClickedSine(); afx_msg void OnBnClickedMarquee(); afx_msg void OnBnClickedColorloop(); afx_msg void OnBnClickedFireballs(); afx_msg void OnBnClickedPolice(); afx_msg void OnChangeAlphaSaw(); afx_msg void OnChangeAlphaSquare(); afx_msg void OnChangeAlphaSine(); afx_msg void OnChangeAlphaColorloop(); afx_msg void OnChangeAlphaMarquee(); afx_msg void OnChangeAlphaFireballs(); afx_msg void OnChangeAlphaPolice(); afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pSlider); afx_msg void OnTimer (UINT_PTR TimerVal); void ShutDown(); };