// This file is part of VSTGUI. It is subject to the license terms
// in the LICENSE file found in the top-level directory of this
// distribution and at http://github.com/steinbergmedia/vstgui/LICENSE

#pragma once

#include "../iplatformtimer.h"

#if MAC

#include <CoreFoundation/CoreFoundation.h>

//------------------------------------------------------------------------
namespace VSTGUI {

//-----------------------------------------------------------------------------
class MacTimer : public IPlatformTimer
{
public:
	explicit MacTimer (IPlatformTimerCallback* callback);
	~MacTimer () override;

	bool start (uint32_t fireTime) override;
	bool stop () override;
private:
	static void timerCallback (CFRunLoopTimerRef timer, void *info);

	IPlatformTimerCallback* callback;
	CFRunLoopTimerRef timer;
};

//------------------------------------------------------------------------
} // VSTGUI

#endif // MAC
