3
MediaTomb - http://www.mediatomb.cc/
5
online_service.cc - this file is part of MediaTomb.
7
Copyright (C) 2005 Gena Batyan <bgeradz@mediatomb.cc>,
8
Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>
10
Copyright (C) 2006-2008 Gena Batyan <bgeradz@mediatomb.cc>,
11
Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>,
12
Leonhard Wimmer <leo@mediatomb.cc>
14
MediaTomb is free software; you can redistribute it and/or modify
15
it under the terms of the GNU General Public License version 2
16
as published by the Free Software Foundation.
18
MediaTomb is distributed in the hope that it will be useful,
19
but WITHOUT ANY WARRANTY; without even the implied warranty of
20
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
GNU General Public License for more details.
23
You should have received a copy of the GNU General Public License
24
version 2 along with MediaTomb; if not, write to the Free Software
25
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
27
$Id: online_service.cc 1698 2008-02-23 20:48:30Z lww $
30
/// \file online_service.cc
33
#include "autoconfig.h"
36
#ifdef ONLINE_SERVICES
38
#include "online_service.h"
42
char service_prefixes[] = { 'Y', 'S', '\0' };
44
OnlineServiceList::OnlineServiceList()
46
service_list = Ref<Array<OnlineService> > (new Array<OnlineService>(OS_Max));
49
void OnlineServiceList::registerService(Ref<OnlineService> service)
54
if (service->getServiceType() >= OS_Max)
56
throw _Exception(_("Requested service with illegal type!"));
59
service_list->set(service, service->getServiceType());
62
Ref<OnlineService> OnlineServiceList::getService(service_type_t service)
64
if ((service > OS_Max) || (service < 0))
67
return service_list->get(service);
70
OnlineService::OnlineService()
77
char OnlineService::getStoragePrefix(service_type_t service)
79
if ((service < 0) || (service >= OS_Max))
80
throw _Exception(_("Illegal service requested\n"));
82
return service_prefixes[service];
85
char OnlineService::getStoragePrefix()
87
return getStoragePrefix(getServiceType());
90
#endif//ONLINE_SERVICES