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>
|
|
|
|
#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;
|
|
|
|
|
2012-10-20 00:01:30 +02:00
|
|
|
class Channels : private vector<Channel>
|
2012-01-21 21:57:41 +01:00
|
|
|
{
|
2012-10-07 21:59:50 +02:00
|
|
|
public:
|
2012-10-20 00:01:30 +02:00
|
|
|
void Init(string lang);
|
2012-10-15 21:16:14 +02:00
|
|
|
void Cleanup();
|
2012-10-07 21:59:50 +02:00
|
|
|
|
|
|
|
u32 Load(u64 title);
|
|
|
|
u8 GetRequestedIOS(u64 title);
|
|
|
|
|
|
|
|
u32 Count();
|
|
|
|
wchar_t *GetName(int index);
|
|
|
|
char *GetId(int index);
|
|
|
|
u64 GetTitle(int index);
|
|
|
|
Channel *GetChannel(int index);
|
|
|
|
|
2012-10-15 21:16:14 +02:00
|
|
|
void GetBanner(u64 title, bool imetOnly = false);
|
2012-10-07 21:59:50 +02:00
|
|
|
private:
|
|
|
|
string langCode;
|
|
|
|
|
2012-10-15 21:16:14 +02:00
|
|
|
int GetLanguage(const char *lang);
|
2012-10-07 21:59:50 +02:00
|
|
|
u64* GetChannelList(u32* count);
|
2012-10-15 21:16:14 +02:00
|
|
|
bool GetAppNameFromTmd(u64 title, char* app, bool dol = false, u32* bootcontent = NULL);
|
|
|
|
bool GetChannelNameFromApp(u64 title, wchar_t* name, int language);
|
2012-10-07 21:59:50 +02:00
|
|
|
|
2012-10-20 00:01:30 +02:00
|
|
|
void Search();
|
2012-01-21 21:57:41 +01:00
|
|
|
};
|
|
|
|
|
2012-10-04 17:16:04 +02:00
|
|
|
extern Channels ChannelHandle;
|
|
|
|
|
2012-01-21 21:57:41 +01:00
|
|
|
#endif
|