ClanLib  2.3.7
cd_drive.h
Go to the documentation of this file.
1 /*
2 ** ClanLib SDK
3 ** Copyright (c) 1997-2011 The ClanLib Team
4 **
5 ** This software is provided 'as-is', without any express or implied
6 ** warranty. In no event will the authors be held liable for any damages
7 ** arising from the use of this software.
8 **
9 ** Permission is granted to anyone to use this software for any purpose,
10 ** including commercial applications, and to alter it and redistribute it
11 ** freely, subject to the following restrictions:
12 **
13 ** 1. The origin of this software must not be misrepresented; you must not
14 ** claim that you wrote the original software. If you use this software
15 ** in a product, an acknowledgment in the product documentation would be
16 ** appreciated but is not required.
17 ** 2. Altered source versions must be plainly marked as such, and must not be
18 ** misrepresented as being the original software.
19 ** 3. This notice may not be removed or altered from any source distribution.
20 **
21 ** Note: Some of the libraries ClanLib may link to may have additional
22 ** requirements or restrictions.
23 **
24 ** File Author(s):
25 **
26 ** (if your name is missing here, please add it)
27 */
28 
31 
32 #pragma once
33 
34 #include "api_sound.h"
35 #include "../Core/System/sharedptr.h"
36 #include "../Core/Text/string_types.h"
37 #include <vector>
38 
39 class CL_CDDrive_Impl;
40 
46 {
49 
50 public:
54  CL_CDDrive();
55 
56  virtual ~CL_CDDrive();
57 
61 
62 public:
64  static std::vector<CL_CDDrive> &get_drives();
65 
67  bool is_null() const { return !impl; }
68 
70  void throw_if_null() const;
71 
73  CL_String8 get_drive_path();
74 
76  CL_String8 get_cd_name();
77 
79  int get_num_tracks();
80 
82  bool is_playing();
83 
85  int get_cur_track();
86 
88  int get_cur_frame();
89 
93 
94 public:
99  bool play_tracks(int track, int end_track=0);
100 
105  bool play_frames(int frame, int end_frame=0);
106 
108  bool play_track(int track);
109 
111  void stop();
112 
114  void pause();
115 
117  void resume();
118 
122 
123 private:
124  CL_SharedPtr<CL_CDDrive_Impl> impl;
126 };
127