2012-01-21 21:57:41 +01:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2010
|
|
|
|
* by dude
|
|
|
|
*
|
|
|
|
* This software is provided 'as-is', without any express or implied
|
|
|
|
* warranty. In no event will the authors be held liable for any
|
|
|
|
* damages arising from the use of this software.
|
|
|
|
*
|
|
|
|
* Permission is granted to anyone to use this software for any
|
|
|
|
* purpose, including commercial applications, and to alter it and
|
|
|
|
* redistribute it freely, subject to the following restrictions:
|
|
|
|
*
|
|
|
|
* 1. The origin of this software must not be misrepresented; you
|
|
|
|
* must not claim that you wrote the original software. If you use
|
|
|
|
* this software in a product, an acknowledgment in the product
|
|
|
|
* documentation would be appreciated but is not required.
|
|
|
|
*
|
|
|
|
* 2. Altered source versions must be plainly marked as such, and
|
|
|
|
* must not be misrepresented as being the original software.
|
|
|
|
*
|
|
|
|
* 3. This notice may not be removed or altered from any source
|
|
|
|
* distribution.
|
|
|
|
*
|
|
|
|
* Channel Launcher Class
|
|
|
|
*
|
|
|
|
* for WiiXplorer 2010
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#ifndef _CHANNELS_H_
|
|
|
|
#define _CHANNELS_H_
|
|
|
|
|
2012-05-06 14:03:43 +02:00
|
|
|
#include <vector>
|
2012-01-21 21:57:41 +01:00
|
|
|
#include <string>
|
|
|
|
|
2012-08-05 15:48:15 +02:00
|
|
|
#include "memory/smartptr.hpp"
|
2012-01-21 21:57:41 +01:00
|
|
|
#include "banner.h"
|
|
|
|
|
|
|
|
#define IMET_MAX_NAME_LEN 0x2a
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
u64 title;
|
|
|
|
char id[4];
|
|
|
|
wchar_t name[IMET_MAX_NAME_LEN+1];
|
|
|
|
} Channel;
|
|
|
|
|
|
|
|
class Channels
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Channels();
|
|
|
|
~Channels();
|
|
|
|
|
|
|
|
void Init(u32 channelType, string lang, bool reload = false);
|
|
|
|
|
2012-07-10 13:25:27 +02:00
|
|
|
u32 Load(u64 title);
|
2012-01-21 21:57:41 +01:00
|
|
|
u8 GetRequestedIOS(u64 title);
|
2012-05-20 14:34:48 +02:00
|
|
|
|
2012-01-21 21:57:41 +01:00
|
|
|
int Count();
|
|
|
|
wchar_t *GetName(int index);
|
|
|
|
char *GetId(int index);
|
|
|
|
u64 GetTitle(int index);
|
|
|
|
Channel *GetChannel(int index);
|
|
|
|
|
|
|
|
static Banner * GetBanner(u64 title, bool imetOnly = false);
|
|
|
|
private:
|
|
|
|
bool init;
|
|
|
|
u32 channelType;
|
|
|
|
string langCode;
|
|
|
|
|
2012-05-06 14:03:43 +02:00
|
|
|
vector<Channel> channels;
|
2012-01-21 21:57:41 +01:00
|
|
|
|
|
|
|
static int GetLanguage(const char *lang);
|
|
|
|
u64* GetChannelList(u32* count);
|
|
|
|
static bool GetAppNameFromTmd(u64 title, char* app, bool dol = false, u32* bootcontent = NULL);
|
|
|
|
static bool GetChannelNameFromApp(u64 title, wchar_t* name, int language);
|
|
|
|
|
|
|
|
void Search(u32 channelType, string lang);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|