//////////////////////////////////////////////////////////////////////////////
//
// Asura_PS3_AVChat2.h
//
// Copyright (c) 2008 Rebellion. All rights reserved.
//
// Description:
//
//     wrapper for PS3 AVChat2 library
//
//////////////////////////////////////////////////////////////////////////////

// B E G I N   F I L E   W R A P P E R ///////////////////////////////////////

#ifdef ASURA_USE_PRAGMA_ONCE
    #pragma once
#endif

#ifndef ASURA_PS3_AVCHAT2_H___
#define ASURA_PS3_AVCHAT2_H___ 1

// I N C L U D E S ///////////////////////////////////////////////////////////
#include <sysutil/sysutil_avc2.h>

// F O R W A R D   D E C L A R A T I O N S ///////////////////////////////////
class Asura_PS3_AVChat2_Member;

// C L A S S   D E C L A R A T I O N S ///////////////////////////////////////
class Asura_PS3_AVChat2
{
public:
	
	static void Initialise(u_short usMaxPlayers);
	static void Shutdown();

	static void JoinChat(const SceNpMatching2RoomId* pxRoomID, SceNpMatching2RoomMemberId xLocalRoomMemberID);
	static void LeaveChat( bool bForcedDisconnect );

	static bool IsPlayerSpeaking(SceNpMatching2RoomMemberId xRoomMemberID);
	static bool IsMicrophoneAttached();

private:

	static void UpdatePlayerSpeakingStatus(SceNpMatching2RoomMemberId xRoomMemberID, u_int uVolume);
	static void PlayerJoined(SceNpMatching2RoomMemberId xRoomMemberID);
	static void PlayerLeft(SceNpMatching2RoomMemberId xRoomMemberID);

	static void AVC2Callback( CellSysutilAvc2EventId xEventId, CellSysutilAvc2EventParam xEventParam, void* pUserdata );

	static Asura_PS3_AVChat2_Member* s_pxMembers;
	static u_int s_uMaxMembers;
	static u_int s_uNumMembers;
};

// E N D   F I L E   W R A P P E R ///////////////////////////////////////////

#endif // #ifndef ASURA_PS3_AVCHAT2_H___
