Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

cdaudio_win32.h

Go to the documentation of this file.
00001 #ifndef header_cdaudio_win32
00002 #define header_cdaudio_win32
00003 
00004 #include "API/Core/Sound/cd_audio.h"
00005 
00006 /* Conversion functions from frames to Minute/Second/Frames and vice versa */
00007 #define CD_FPS  75
00008 #define FRAMES_TO_MSF(f, M,S,F) {                                       \
00009         int value = f;                                                  \
00010         *(F) = value%CD_FPS;                                            \
00011         value /= CD_FPS;                                                \
00012         *(S) = value%60;                                                \
00013         value /= 60;                                                    \
00014         *(M) = value;                                                   \
00015 }
00016 #define MSF_TO_FRAMES(M, S, F)  ((M)*60*CD_FPS+(S)*CD_FPS+(F))
00017 
00018 class CL_CDDrive_Win32 : public CL_CDDrive
00019 {
00020 public:
00021         CL_CDDrive_Win32(std::string path, std::string name);
00022         virtual ~CL_CDDrive_Win32();
00023 
00024         virtual bool init();
00025 
00026         virtual std::string get_drive_path();
00027         virtual std::string get_cd_name();
00028 
00029         virtual int get_num_tracks();
00030 
00031         virtual bool is_playing();
00032         virtual int get_cur_track();
00033         virtual int get_cur_frame();
00034 
00035         virtual bool play_tracks(int track, int end_track=0);
00036         virtual bool play_frames(int frame, int end_frame=0);
00037         virtual bool play_track(int track);
00038 
00039         virtual void stop();
00040         virtual void pause();
00041         virtual void resume();
00042 private:
00043         std::string path, name;
00044         MCIDEVICEID id;
00045         
00046         struct STrack
00047         {
00048                 unsigned int id;
00049                 unsigned int start_frame;
00050                 unsigned int length_frames;
00051                 bool is_audio;
00052         };
00053         std::vector<STrack> tracks;
00054         unsigned int num_tracks;
00055 
00056         int cur_track;
00057         int cur_frame;
00058         bool cd_playing;
00059 
00060         bool send_command(unsigned int msg, unsigned int flags, void *arg);
00061         bool read_toc();
00062         void update_status();
00063 };
00064 
00065 #endif

Generated at Wed Apr 4 19:53:59 2001 for ClanLib by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001