VideoTrackPrivate.h [plain text]
#ifndef VideoTrackPrivate_h
#define VideoTrackPrivate_h
#include <wtf/Forward.h>
#include <wtf/Noncopyable.h>
#include <wtf/RefCounted.h>
#include <wtf/text/AtomicString.h>
#if ENABLE(VIDEO_TRACK)
namespace WebCore {
class VideoTrackPrivate;
class VideoTrackPrivateClient {
public:
virtual ~VideoTrackPrivateClient() { }
virtual void willRemoveVideoTrackPrivate(VideoTrackPrivate*) = 0;
};
class VideoTrackPrivate : public RefCounted<VideoTrackPrivate> {
WTF_MAKE_NONCOPYABLE(VideoTrackPrivate); WTF_MAKE_FAST_ALLOCATED;
public:
static PassRefPtr<VideoTrackPrivate> create()
{
return adoptRef(new VideoTrackPrivate());
}
virtual ~VideoTrackPrivate() { }
void setClient(VideoTrackPrivateClient* client) { m_client = client; }
VideoTrackPrivateClient* client() { return m_client; }
virtual void setSelected(bool selected) { m_selected = selected; };
virtual bool selected() const { return m_selected; }
enum Kind { Alternative, Captions, Main, Sign, Subtitles, Commentary, None };
virtual Kind kind() const { return None; }
virtual AtomicString id() const { return emptyAtom; }
virtual AtomicString label() const { return emptyAtom; }
virtual AtomicString language() const { return emptyAtom; }
virtual int videoTrackIndex() const { return 0; }
void willBeRemoved()
{
if (m_client)
m_client->willRemoveVideoTrackPrivate(this);
}
protected:
VideoTrackPrivate()
: m_selected(false)
{
}
private:
VideoTrackPrivateClient* m_client;
bool m_selected;
};
}
#endif
#endif