atraczyk | e9919eb | 2016-09-15 15:58:18 -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 <andreas.traczyk@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 | **************************************************************************/
|
Nicolas Jager | e069c41 | 2016-08-15 15:00:17 -0400 | [diff] [blame] | 19 | #include "pch.h"
|
| 20 |
|
| 21 | #include "VideoPage.xaml.h"
|
| 22 |
|
| 23 | using namespace RingClientUWP::Views;
|
| 24 |
|
| 25 | using namespace Concurrency;
|
| 26 | using namespace Platform;
|
| 27 | using namespace Windows::Devices::Enumeration;
|
| 28 | using namespace Windows::Foundation;
|
| 29 | using namespace Windows::Foundation::Collections;
|
| 30 | using namespace Windows::UI::Xaml;
|
| 31 | using namespace Windows::UI::Xaml::Controls;
|
| 32 | using namespace Windows::UI::Xaml::Controls::Primitives;
|
| 33 | using namespace Windows::UI::Xaml::Data;
|
| 34 | using namespace Windows::UI::Xaml::Input;
|
| 35 | using namespace Windows::UI::Xaml::Media;
|
| 36 | using namespace Windows::UI::Xaml::Navigation;
|
| 37 | using namespace Windows::Media::Capture;
|
atraczyk | e9919eb | 2016-09-15 15:58:18 -0400 | [diff] [blame^] | 38 | using namespace Windows::ApplicationModel::Core;
|
| 39 | using namespace Windows::UI::Core;
|
Nicolas Jager | e069c41 | 2016-08-15 15:00:17 -0400 | [diff] [blame] | 40 |
|
| 41 | VideoPage::VideoPage()
|
| 42 | {
|
| 43 | InitializeComponent();
|
| 44 | }
|
| 45 |
|
atraczyk | e9919eb | 2016-09-15 15:58:18 -0400 | [diff] [blame^] | 46 | void
|
| 47 | RingClientUWP::Views::VideoPage::OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e)
|
| 48 | {
|
| 49 | updatePageContent();
|
| 50 | }
|
Nicolas Jager | e069c41 | 2016-08-15 15:00:17 -0400 | [diff] [blame] | 51 |
|
atraczyk | e9919eb | 2016-09-15 15:58:18 -0400 | [diff] [blame^] | 52 | void RingClientUWP::Views::VideoPage::updatePageContent()
|
| 53 | {
|
| 54 | auto selectedContact = ViewModel::ContactsViewModel::instance->selectedContact;
|
| 55 | Contact^ contact = selectedContact?
|
| 56 | ViewModel::SmartPanelItemsViewModel::instance->findItem(selectedContact)->_contact:
|
| 57 | nullptr;
|
| 58 | if (!contact)
|
| 59 | return;
|
| 60 |
|
| 61 | _callee_->Text = contact->name_;
|
| 62 | }
|
Nicolas Jager | e069c41 | 2016-08-15 15:00:17 -0400 | [diff] [blame] | 63 |
|
| 64 | void RingClientUWP::Views::VideoPage::Button_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
|
| 65 | {
|
| 66 | }
|
| 67 |
|
| 68 |
|
| 69 | void RingClientUWP::Views::VideoPage::_btnCancel__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
|
| 70 | {
|
| 71 |
|
| 72 | }
|
| 73 |
|
| 74 | void RingClientUWP::Views::VideoPage::_btnHangUp__Tapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e)
|
| 75 | {
|
atraczyk | e9919eb | 2016-09-15 15:58:18 -0400 | [diff] [blame^] | 76 | Contact^ selectedContact = ViewModel::ContactsViewModel::instance->selectedContact;
|
| 77 | Call^ call = selectedContact?
|
| 78 | ViewModel::SmartPanelItemsViewModel::instance->findItem(selectedContact)->_call:
|
| 79 | nullptr;
|
| 80 | if (call)
|
| 81 | RingD::instance->hangUpCall(call);
|
Nicolas Jager | e069c41 | 2016-08-15 15:00:17 -0400 | [diff] [blame] | 82 | pressHangUpCall();
|
| 83 | }
|
| 84 |
|
| 85 |
|
| 86 | void RingClientUWP::Views::VideoPage::_btnPause__Tapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e)
|
| 87 | {
|
| 88 | pauseCall();
|
| 89 | }
|
| 90 |
|
| 91 |
|
| 92 | void RingClientUWP::Views::VideoPage::_btnChat__Tapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e)
|
| 93 | {
|
| 94 | chatPanelCall();
|
| 95 | }
|
| 96 |
|
| 97 |
|
| 98 | void RingClientUWP::Views::VideoPage::_btnAddFriend__Tapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e)
|
| 99 | {
|
| 100 | addContactCall();
|
| 101 | }
|
| 102 |
|
| 103 |
|
| 104 | void RingClientUWP::Views::VideoPage::_btnSwitch__Tapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e)
|
| 105 | {
|
| 106 | transferCall();
|
| 107 | }
|
| 108 |
|
| 109 |
|
| 110 | void RingClientUWP::Views::VideoPage::_btnMicrophone__Tapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e)
|
| 111 | {
|
| 112 | switchMicrophoneStateCall();
|
| 113 | }
|
| 114 |
|
| 115 |
|
| 116 | void RingClientUWP::Views::VideoPage::_btnMemo__Tapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e)
|
| 117 | {
|
| 118 | reccordVideoCall();
|
| 119 | }
|
| 120 |
|
| 121 |
|
| 122 | void RingClientUWP::Views::VideoPage::_btnHQ__Tapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e)
|
| 123 | {
|
| 124 | qualityVideoLevelCall();
|
| 125 | }
|
| 126 |
|
| 127 |
|
| 128 | void RingClientUWP::Views::VideoPage::_btnVideo__Tapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e)
|
| 129 | {
|
| 130 | switchVideoStateCall();
|
| 131 | }
|
| 132 |
|
| 133 |
|
| 134 | void RingClientUWP::Views::VideoPage::_videoControl__PointerMoved(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e)
|
| 135 | {
|
| 136 | if (barFading)
|
| 137 | myStoryboard->Begin();
|
| 138 | barFading_ = true;
|
| 139 | }
|
| 140 |
|
| 141 |
|
| 142 | void RingClientUWP::Views::VideoPage::btnAny_entered(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e)
|
| 143 | {
|
| 144 | barFading_ = false;
|
| 145 | myStoryboard->Stop();
|
| 146 | }
|
| 147 |
|
| 148 |
|
| 149 | void RingClientUWP::Views::VideoPage::btnAny_exited(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e)
|
| 150 | {
|
| 151 | barFading_ = true;
|
Nicolas Jager | e069c41 | 2016-08-15 15:00:17 -0400 | [diff] [blame] | 152 | } |