Nicolas Jager | 7c409f3 | 2016-09-08 09:35:16 -0400 | [diff] [blame] | 1 | /**************************************************************************
|
| 2 | * Copyright (C) 2016 by Savoir-faire Linux *
|
| 3 | * Author: Jäger Nicolas <nicolas.jager@savoirfairelinux.com> *
|
| 4 | * Author: Traczyk Andreas <traczyk.andreas@savoirfairelinux.com> *
|
| 5 | * *
|
| 6 | * This program is free software; you can redistribute it and/or modify *
|
| 7 | * it under the terms of the GNU General Public License as published by *
|
| 8 | * the Free Software Foundation; either version 3 of the License, or *
|
| 9 | * (at your option) any later version. *
|
| 10 | * *
|
| 11 | * This program is distributed in the hope that it will be useful, *
|
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
| 14 | * GNU General Public License for more details. *
|
| 15 | * *
|
| 16 | * You should have received a copy of the GNU General Public License *
|
| 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
| 18 | **************************************************************************/
|
| 19 | #include "pch.h"
|
| 20 |
|
| 21 | #include "SmartPanelItem.h"
|
| 22 |
|
| 23 | using namespace Windows::ApplicationModel::Core;
|
| 24 | using namespace Platform;
|
| 25 | using namespace Windows::Data::Json;
|
| 26 | using namespace Windows::UI::Core;
|
| 27 |
|
| 28 | using namespace RingClientUWP;
|
| 29 | using namespace RingClientUWP::Controls;
|
| 30 | using namespace ViewModel;
|
| 31 |
|
| 32 | SmartPanelItem::SmartPanelItem()
|
Nicolas Jager | c551c36 | 2016-10-01 19:24:50 -0400 | [diff] [blame] | 33 | {
|
Nicolas Jager | 9edbea3 | 2016-10-03 09:13:53 -0400 | [diff] [blame] | 34 | _callId = "";
|
Nicolas Jager | 61e6f0e | 2016-11-04 15:12:08 -0400 | [diff] [blame] | 35 | videoMuted_ = false;
|
Nicolas Jager | 9d85be9 | 2016-12-10 16:10:31 -0500 | [diff] [blame] | 36 | isSelected_ = false;
|
| 37 | isHovered_ = false;
|
Nicolas Jager | 9edbea3 | 2016-10-03 09:13:53 -0400 | [diff] [blame] | 38 |
|
Nicolas Jager | 083b3ae | 2016-10-04 08:46:19 -0400 | [diff] [blame] | 39 | RingD::instance->callPlaced += ref new RingClientUWP::CallPlaced(this, &RingClientUWP::Controls::SmartPanelItem::OncallPlaced);
|
Nicolas Jager | c551c36 | 2016-10-01 19:24:50 -0400 | [diff] [blame] | 40 | }
|
Nicolas Jager | 7c409f3 | 2016-09-08 09:35:16 -0400 | [diff] [blame] | 41 |
|
Nicolas Jager | 61e6f0e | 2016-11-04 15:12:08 -0400 | [diff] [blame] | 42 | void RingClientUWP::Controls::SmartPanelItem::muteVideo(bool state)
|
| 43 | {
|
| 44 | videoMuted_ = state;
|
| 45 | RingD::instance->muteVideo(_callId, state);
|
| 46 | }
|
| 47 |
|
Nicolas Jager | 7c409f3 | 2016-09-08 09:35:16 -0400 | [diff] [blame] | 48 | void
|
| 49 | SmartPanelItem::NotifyPropertyChanged(String^ propertyName)
|
| 50 | {
|
| 51 | CoreApplicationView^ view = CoreApplication::MainView;
|
| 52 | view->CoreWindow->Dispatcher->RunAsync(
|
Nicolas Jager | 9edbea3 | 2016-10-03 09:13:53 -0400 | [diff] [blame] | 53 | CoreDispatcherPriority::High,
|
Nicolas Jager | 7c409f3 | 2016-09-08 09:35:16 -0400 | [diff] [blame] | 54 | ref new DispatchedHandler([this, propertyName]()
|
| 55 | {
|
| 56 | PropertyChanged(this, ref new PropertyChangedEventArgs(propertyName));
|
| 57 | }));
|
Nicolas Jager | 083b3ae | 2016-10-04 08:46:19 -0400 | [diff] [blame] | 58 | }
|
| 59 |
|
| 60 | void RingClientUWP::Controls::SmartPanelItem::OncallPlaced(Platform::String ^callId)
|
| 61 | {
|
| 62 | if (_callId == callId) {
|
atraczyk | 85e1231 | 2016-11-03 10:31:23 -0400 | [diff] [blame] | 63 | _callStatus = CallStatus::SEARCHING;
|
Nicolas Jager | 083b3ae | 2016-10-04 08:46:19 -0400 | [diff] [blame] | 64 | }
|
| 65 | }
|