1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #include <cppuhelper/supportsservice.hxx>
12 #include "gtkmanager.hxx"
13 #include "gtkplayer.hxx"
15 #include <tools/urlobj.hxx>
16 #include <rtl/ref.hxx>
18 using namespace ::com::sun::star
;
20 namespace avmedia::gtk
24 Manager::~Manager() {}
26 uno::Reference
<media::XPlayer
> SAL_CALL
Manager::createPlayer(const OUString
& rURL
)
28 const INetURLObject
aURL(rURL
);
29 OUString sMainURL
= aURL
.GetMainURL(INetURLObject::DecodeMechanism::Unambiguous
);
31 rtl::Reference
<GtkPlayer
> xPlayer(new GtkPlayer
);
32 if (!xPlayer
->create(sMainURL
))
37 OUString SAL_CALL
Manager::getImplementationName() { return "com.sun.star.comp.media.Manager_Gtk"; }
39 sal_Bool SAL_CALL
Manager::supportsService(const OUString
& ServiceName
)
41 return cppu::supportsService(this, ServiceName
);
44 uno::Sequence
<OUString
> SAL_CALL
Manager::getSupportedServiceNames()
46 return { "com.sun.star.media.Manager" };
51 extern "C" SAL_DLLPUBLIC_EXPORT
css::uno::XInterface
*
52 com_sun_star_comp_media_Manager_Gtk_get_implementation(css::uno::XComponentContext
*,
53 css::uno::Sequence
<css::uno::Any
> const&)
55 return cppu::acquire(new avmedia::gtk::Manager());
58 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */