/*
 * (c) 2005 Research Group Dr. Fuhrmann, University of Karlsruhe, Germany
 * All rights reserved.
 *
 * Author:
 *         Stefan Denk <denk@ira.uka.de>
 *         Kendy Kutzner <kutzner@ira.uka.de>
 *
 * $Id: vtchannel.h,v 1.4 2006/01/05 10:31:45 denk Exp $
 *
 */

#ifndef _VTCHANNEL_H_
#define _VTCHANNEL_H_

#include <string>
using namespace std;

#include <channels.h>


/** Representation of a channel.
 * It is not possible to rely on VDRs cChannel object, since not all channels
 * this plugin has information about are available at the local VDR. This
 * class has possibilities to convert to/from VDR cChannel pointers if the
 * channels are available.
 */
class vtchannel {
	private:
		/** The channel representation
		 */
		string _channel;
	public:
		/// Convert to VDR channel.
		cChannel * tovdr() const;
		/// Convert from VDR channel.
		void fromvdr(const cChannel *);
		/// Create object from string (probably received from network)
		vtchannel(const string &c){_channel=c;}
		/// Create object from cChannel (from VDR)
		vtchannel(const cChannel * c){fromvdr(c);}
		/// Init empty
		vtchannel(){_channel.clear();}
		/// Return what we are
		const string& name() const{return _channel;}
		/// Empty
		void clear(){_channel.clear();}
		/// Set new value
		void set(const string &c){_channel = c;}
		/// Compare two channels
		bool operator<(const vtchannel & other) const;
};


#endif // _VTCHANNEL_H_
