
#include "audio.h"

bool Audio::change_state(GstState new_state)
{
	GstStateChangeReturn ret;
	ret = gst_element_set_state(GST_ELEMENT(player), new_state);
	switch(ret) {
		case GST_STATE_CHANGE_SUCCESS:
		case GST_STATE_CHANGE_ASYNC:
			return true;
		default:
			return false;
	}
}

bool Audio::play()
{
	return change_state(GST_STATE_PLAYING);
}

bool Audio::pause()
{
	return change_state(GST_STATE_PAUSED);
}
