dvdplayer class and player class
-
hello, I wrote a player class and I also wrote a dvdplayer class that is supposed to inherit from player class(both are very simple, no GUI, just simulateion) my question: 1. in dvdplayer what should I put as the type of disk tray and media reader, should I create a new class? //dvdplayer.h #ifndef DVDPLAYER_H #define DVDPLAYER_H #include "player.h" #include #include "mystring.h" #include "button.h" #include "terminal.h" class dvdplayer:public player { public: dvdplayer(const char * info); ~dvdplayer(); virtual int play(); virtual int stop(); virtual int powerOn(); virtual int powerOff(); int videoConnect(); int audioConnect(); void insert(); void remove(); private: terminal vedio_out; terminal audio_out; //disk_tray; //media_reader; }; #endif 2. Can somebody give me some suggestion on both player and dvdplayer class? I am a student who just start to learn C++, Thanks for your help! //player.h #ifndef PLAYER_H #define PLAYER_H #include "mystring.h" #include "terminal.h" #include "button.h" class player { public: Player(const char * info); virtual ~player(); void getPlayerInfo(); //enum status {Playing, Paused, Stopped, Ejected, Open, Close, connected, disconnected); void acConnect(); void setPlayerInfo(); //void acConnect(); void acDisconnect(); virtual int play() = 0; virtual int stop() = 0; virtual int powerOn() = 0; virtual int powerOff() = 0; protected: button player; button stop; button power; mystring PlayerInfo(); terminal AC; }; #endif _____________________________________ #include "player.h" player::player(const char* info) { setPlayerInfo(info); AC.setState(0); //set 0 to terminal ac denotes disconnect; } //constructor; player::~player() { delete playerInfo; delete polayer; delete power; delete stop; delete AC; } //destructor; void player::acConnect(); { if(AC.getState == 0) AC.setState(1); else cout<<"AC has already connected"<