Commit e8296450 authored by Ghislain MARY's avatar Ghislain MARY

Fix resources location.

parent 0fcd0157
...@@ -13,9 +13,6 @@ sip_tls_port=-1 ...@@ -13,9 +13,6 @@ sip_tls_port=-1
log_collection_upload_server_url=https://www.linphone.org:444/lft.php log_collection_upload_server_url=https://www.linphone.org:444/lft.php
file_transfer_server_url=https://www.linphone.org:444/lft.php file_transfer_server_url=https://www.linphone.org:444/lft.php
[sound]
hold_music=Assets/Sounds/toy-mono.wav
[video] [video]
automatically_accept=0 automatically_accept=0
automatically_initiate=0 automatically_initiate=0
......
...@@ -17,8 +17,6 @@ video_jitt_comp=60 ...@@ -17,8 +17,6 @@ video_jitt_comp=60
nortp_timeout=30 nortp_timeout=30
[sound] [sound]
remote_ring=Assets/Sounds/ringback.wav
local_ring=Assets/Sounds/rings/notes_of_the_optimistic.mkv
dtmf_player_amp=0.1 dtmf_player_amp=0.1
[misc] [misc]
......
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<!-- A reference to the entire .Net Framework and Windows SDK are automatically included --> <!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
<Content Include="Assets\images\nowebcamCIF.jpg"> <Content Include="Assets\nowebcamCIF.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Assets\linphonerc" /> <Content Include="Assets\linphonerc" />
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
<Content Include="Assets\avatar.png" /> <Content Include="Assets\avatar.png" />
<Content Include="Assets\avatar2.png" /> <Content Include="Assets\avatar2.png" />
<Content Include="Assets\linphone_user.png" /> <Content Include="Assets\linphone_user.png" />
<Content Include="Assets\Sounds\rings\notes_of_the_optimistic.mkv" /> <Content Include="Assets\notes_of_the_optimistic.mkv" />
<Content Include="Assets\rootca.pem" /> <Content Include="Assets\rootca.pem" />
<None Include="Linphone_StoreKey.pfx" /> <None Include="Linphone_StoreKey.pfx" />
<None Include="project.json" /> <None Include="project.json" />
...@@ -232,13 +232,13 @@ ...@@ -232,13 +232,13 @@
<Content Include="Assets\led_disconnected.png" /> <Content Include="Assets\led_disconnected.png" />
<Content Include="Assets\led_error.png" /> <Content Include="Assets\led_error.png" />
<Content Include="Assets\led_inprogress.png" /> <Content Include="Assets\led_inprogress.png" />
<Content Include="Assets\Sounds\incoming_chat.wav"> <Content Include="Assets\incoming_chat.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Assets\Sounds\ringback.wav"> <Content Include="Assets\ringback.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Assets\Sounds\toy-mono.wav"> <Content Include="Assets\dont_wait_too_long.mkv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Assets\SplashScreen.scale-200.png" /> <Content Include="Assets\SplashScreen.scale-200.png" />
...@@ -392,11 +392,11 @@ ...@@ -392,11 +392,11 @@
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" /> <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<PropertyGroup> <PropertyGroup>
<PreBuildEvent> <PreBuildEvent>
XCopy /I /Y $(ProjectDir)..\submodules\linphone\mediastreamer2\src\voip\nowebcamCIF.jpg $(ProjectDir)Assets\images XCopy /I /Y $(ProjectDir)..\submodules\linphone\mediastreamer2\src\voip\nowebcamCIF.jpg $(ProjectDir)Assets
XCopy /I /Y $(ProjectDir)..\submodules\linphone\share\incoming_chat.wav $(ProjectDir)Assets\Sounds XCopy /I /Y $(ProjectDir)..\submodules\linphone\share\incoming_chat.wav $(ProjectDir)Assets
XCopy /I /Y $(ProjectDir)..\submodules\linphone\share\toy-mono.wav $(ProjectDir)Assets\Sounds XCopy /I /Y $(ProjectDir)..\submodules\linphone\share\dont_wait_too_long.mkv $(ProjectDir)Assets
XCopy /I /Y $(ProjectDir)..\submodules\linphone\share\ringback.wav $(ProjectDir)Assets\Sounds XCopy /I /Y $(ProjectDir)..\submodules\linphone\share\ringback.wav $(ProjectDir)Assets
XCopy /I /Y $(ProjectDir)..\submodules\linphone\share\rings\notes_of_the_optimistic.mkv $(ProjectDir)Assets\Sounds\rings</PreBuildEvent> XCopy /I /Y $(ProjectDir)..\submodules\linphone\share\rings\notes_of_the_optimistic.mkv $(ProjectDir)Assets</PreBuildEvent>
</PropertyGroup> </PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
......
...@@ -53,6 +53,7 @@ namespace Linphone.Model { ...@@ -53,6 +53,7 @@ namespace Linphone.Model {
public Core Core { public Core Core {
get { get {
if (_core == null) { if (_core == null) {
ConfigurePaths();
EnableLogCollection(true); EnableLogCollection(true);
Config config = new Config(GetConfigPath(), GetFactoryConfigPath()); Config config = new Config(GetConfigPath(), GetFactoryConfigPath());
_core = new Core(this, config); _core = new Core(this, config);
...@@ -132,6 +133,17 @@ namespace Linphone.Model { ...@@ -132,6 +133,17 @@ namespace Linphone.Model {
}, period); }, period);
} }
private void ConfigurePaths() {
string packagePath = Windows.ApplicationModel.Package.Current.InstalledLocation.Path;
string assetsPath = packagePath + "\\Assets";
Factory.TopResourcesDir = assetsPath;
Factory.DataResourcesDir = assetsPath;
Factory.SoundResourcesDir = assetsPath;
Factory.RingResourcesDir = assetsPath;
Factory.ImageResourcesDir = assetsPath;
Factory.MspluginsDir = ".";
}
public void EnableLogCollection(bool enable) { public void EnableLogCollection(bool enable) {
Core.LogCollectionEnabled = enable ? LogCollectionState.EnabledWithoutPreviousLogHandler : LogCollectionState.Disabled; Core.LogCollectionEnabled = enable ? LogCollectionState.EnabledWithoutPreviousLogHandler : LogCollectionState.Disabled;
Core.LogCollectionPath = ApplicationData.Current.LocalFolder.Path; Core.LogCollectionPath = ApplicationData.Current.LocalFolder.Path;
......
...@@ -57,6 +57,8 @@ set(SOURCE_FILES ...@@ -57,6 +57,8 @@ set(SOURCE_FILES
Core.h Core.h
CoreListener.h CoreListener.h
Enums.h Enums.h
Factory.cpp
Factory.h
PayloadType.cpp PayloadType.cpp
PayloadType.h PayloadType.h
ProxyConfig.cpp ProxyConfig.cpp
......
/*
Factory.cpp
Copyright (C) 2015 Belledonne Communications, Grenoble, France
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "ApiLock.h"
#include "Factory.h"
using namespace BelledonneCommunications::Linphone::Native;
using namespace Platform;
Platform::String^ Factory::TopResourcesDir::get()
{
API_LOCK;
return Utils::cctops(linphone_factory_get_top_resources_dir(linphone_factory_get()));
}
void Factory::TopResourcesDir::set(Platform::String^ value)
{
API_LOCK;
const char *cvalue = Utils::pstoccs(value);
linphone_factory_set_top_resources_dir(linphone_factory_get(), cvalue);
delete(cvalue);
}
Platform::String^ Factory::DataResourcesDir::get()
{
API_LOCK;
return Utils::cctops(linphone_factory_get_data_resources_dir(linphone_factory_get()));
}
void Factory::DataResourcesDir::set(Platform::String^ value)
{
API_LOCK;
const char *cvalue = Utils::pstoccs(value);
linphone_factory_set_data_resources_dir(linphone_factory_get(), cvalue);
delete(cvalue);
}
Platform::String^ Factory::SoundResourcesDir::get()
{
API_LOCK;
return Utils::cctops(linphone_factory_get_sound_resources_dir(linphone_factory_get()));
}
void Factory::SoundResourcesDir::set(Platform::String^ value)
{
API_LOCK;
const char *cvalue = Utils::pstoccs(value);
linphone_factory_set_sound_resources_dir(linphone_factory_get(), cvalue);
delete(cvalue);
}
Platform::String^ Factory::RingResourcesDir::get()
{
API_LOCK;
return Utils::cctops(linphone_factory_get_ring_resources_dir(linphone_factory_get()));
}
void Factory::RingResourcesDir::set(Platform::String^ value)
{
API_LOCK;
const char *cvalue = Utils::pstoccs(value);
linphone_factory_set_ring_resources_dir(linphone_factory_get(), cvalue);
delete(cvalue);
}
Platform::String^ Factory::ImageResourcesDir::get()
{
API_LOCK;
return Utils::cctops(linphone_factory_get_image_resources_dir(linphone_factory_get()));
}
void Factory::ImageResourcesDir::set(Platform::String^ value)
{
API_LOCK;
const char *cvalue = Utils::pstoccs(value);
linphone_factory_set_image_resources_dir(linphone_factory_get(), cvalue);
delete(cvalue);
}
Platform::String^ Factory::MspluginsDir::get()
{
API_LOCK;
return Utils::cctops(linphone_factory_get_msplugins_dir(linphone_factory_get()));
}
void Factory::MspluginsDir::set(Platform::String^ value)
{
API_LOCK;
const char *cvalue = Utils::pstoccs(value);
linphone_factory_set_msplugins_dir(linphone_factory_get(), cvalue);
delete(cvalue);
}
/*
Factory.h
Copyright (C) 2015 Belledonne Communications, Grenoble, France
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#pragma once
// Do not treat doxygen documentation as XML
#pragma warning(push)
#pragma warning(disable : 4635)
#include "linphone/factory.h"
#pragma warning(pop)
namespace BelledonneCommunications
{
namespace Linphone
{
namespace Native
{
/// <summary>
/// Factory object.
/// </summary>
[Windows::Foundation::Metadata::WebHostHidden]
public ref class Factory sealed
{
public:
static property Platform::String^ TopResourcesDir
{
Platform::String^ get();
void set(Platform::String^ value);
}
static property Platform::String^ DataResourcesDir
{
Platform::String^ get();
void set(Platform::String^ value);
}
static property Platform::String^ SoundResourcesDir
{
Platform::String^ get();
void set(Platform::String^ value);
}
static property Platform::String^ RingResourcesDir
{
Platform::String^ get();
void set(Platform::String^ value);
}
static property Platform::String^ ImageResourcesDir
{
Platform::String^ get();
void set(Platform::String^ value);
}
static property Platform::String^ MspluginsDir
{
Platform::String^ get();
void set(Platform::String^ value);
}
};
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment