rb_cdio 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. data/ChangeLog.txt +26 -0
  2. data/LICENSE +340 -0
  3. data/README.EXT +1051 -0
  4. data/README.txt +16 -0
  5. data/VERSION +1 -0
  6. data/doc/classes/CdIo.html +523 -0
  7. data/doc/classes/CdIo.src/M000001.html +17 -0
  8. data/doc/classes/CdIo.src/M000002.html +17 -0
  9. data/doc/classes/CdIo.src/M000003.html +17 -0
  10. data/doc/classes/CdIo.src/M000004.html +17 -0
  11. data/doc/classes/CdIo.src/M000005.html +17 -0
  12. data/doc/classes/CdIo.src/M000006.html +17 -0
  13. data/doc/classes/CdIo.src/M000007.html +17 -0
  14. data/doc/classes/CdIo.src/M000008.html +17 -0
  15. data/doc/classes/CdIo.src/M000009.html +17 -0
  16. data/doc/classes/CdIo.src/M000010.html +17 -0
  17. data/doc/classes/CdIo.src/M000011.html +17 -0
  18. data/doc/classes/CdIo.src/M000012.html +17 -0
  19. data/doc/classes/CdIo.src/M000013.html +17 -0
  20. data/doc/classes/CdIo.src/M000014.html +17 -0
  21. data/doc/classes/CdIo.src/M000015.html +17 -0
  22. data/doc/classes/CdIo.src/M000016.html +17 -0
  23. data/doc/classes/CdIo/Cd.html +348 -0
  24. data/doc/classes/CdIo/Cd.src/M000011.html +17 -0
  25. data/doc/classes/CdIo/Cd.src/M000012.html +17 -0
  26. data/doc/classes/CdIo/Cd.src/M000013.html +17 -0
  27. data/doc/classes/CdIo/Cd.src/M000014.html +17 -0
  28. data/doc/classes/CdIo/Cd.src/M000015.html +17 -0
  29. data/doc/classes/CdIo/Cd.src/M000016.html +17 -0
  30. data/doc/classes/CdIo/Cd.src/M000017.html +17 -0
  31. data/doc/classes/CdIo/Cd.src/M000018.html +17 -0
  32. data/doc/classes/CdIo/Cd.src/M000019.html +17 -0
  33. data/doc/classes/CdIo/Cd.src/M000021.html +17 -0
  34. data/doc/classes/CdIo/Cd.src/M000022.html +17 -0
  35. data/doc/classes/CdIo/Cd.src/M000023.html +17 -0
  36. data/doc/classes/CdIo/Cd.src/M000024.html +17 -0
  37. data/doc/classes/CdIo/Cd.src/M000025.html +17 -0
  38. data/doc/classes/CdIo/Cd.src/M000026.html +17 -0
  39. data/doc/classes/CdIo/Cd.src/M000027.html +17 -0
  40. data/doc/classes/CdIo/Cd.src/M000028.html +17 -0
  41. data/doc/classes/CdIo/Cd.src/M000029.html +17 -0
  42. data/doc/classes/CdIo/Cd.src/M000030.html +17 -0
  43. data/doc/classes/CdIo/Cd.src/M000031.html +17 -0
  44. data/doc/classes/CdIo/Cd.src/M000032.html +17 -0
  45. data/doc/classes/CdIo/Cd.src/M000033.html +17 -0
  46. data/doc/classes/CdIo/Cd.src/M000034.html +17 -0
  47. data/doc/classes/CdIo/Cd.src/M000035.html +17 -0
  48. data/doc/classes/CdIo/Cd.src/M000036.html +17 -0
  49. data/doc/classes/CdIo/CdText.html +111 -0
  50. data/doc/classes/CdIo/Device.html +111 -0
  51. data/doc/classes/CdIo/Track.html +246 -0
  52. data/doc/classes/CdIo/Track.src/M000009.html +17 -0
  53. data/doc/classes/CdIo/Track.src/M000010.html +17 -0
  54. data/doc/classes/CdIo/Track.src/M000011.html +17 -0
  55. data/doc/classes/CdIo/Track.src/M000017.html +17 -0
  56. data/doc/classes/CdIo/Track.src/M000018.html +17 -0
  57. data/doc/classes/CdIo/Track.src/M000019.html +17 -0
  58. data/doc/classes/CdIo/Track.src/M000020.html +17 -0
  59. data/doc/classes/CdIo/TrackIso9660.html +159 -0
  60. data/doc/classes/CdIo/Tracks.html +199 -0
  61. data/doc/classes/CdIo/Tracks.src/M000020.html +17 -0
  62. data/doc/classes/CdIo/Tracks.src/M000021.html +17 -0
  63. data/doc/classes/CdIo/Tracks.src/M000022.html +17 -0
  64. data/doc/created.rid +1 -0
  65. data/doc/files/rb_cdio_def_rb.html +169 -0
  66. data/doc/files/test/testall_rb.html +110 -0
  67. data/doc/fr_class_index.html +31 -0
  68. data/doc/fr_file_index.html +27 -0
  69. data/doc/fr_method_index.html +48 -0
  70. data/doc/index.html +24 -0
  71. data/ext/CdIo.c +41 -20
  72. data/ext/CdIo.h +19 -9
  73. data/ext/CdIo_Cd.c +35 -52
  74. data/ext/CdIo_Common.c +56 -12
  75. data/ext/CdIo_Modulo.c +54 -34
  76. data/ext/CdIo_Track.c +24 -7
  77. data/ext/CdIo_TrackIso9660.c +1 -1
  78. data/ext/CdIo_Tracks.c +66 -0
  79. data/mkmf.log +26 -0
  80. data/rb_cdio.def.rb +187 -0
  81. data/svn-commit.tmp +5 -0
  82. data/tags +47 -0
  83. data/test/testclose.rb +19 -0
  84. data/test/testmethods.rb +28 -0
  85. metadata +253 -20
  86. data/ext/CdIo.o +0 -0
  87. data/ext/CdIo_Cd.o +0 -0
  88. data/ext/CdIo_Common.o +0 -0
  89. data/ext/CdIo_Modulo.o +0 -0
  90. data/ext/CdIo_Track.o +0 -0
  91. data/ext/CdIo_TrackIso9660.o +0 -0
  92. data/ext/Makefile +0 -127
  93. data/test/data/Makefile +0 -677
  94. data/test/data/Makefile.am +0 -78
  95. data/test/data/Makefile.in +0 -677
  96. data/test/data/testassert +0 -117
  97. data/test/data/testbincue +0 -117
  98. data/test/data/testdefault +0 -117
  99. data/test/data/testischar +0 -117
  100. data/test/data/testiso9660 +0 -117
  101. data/test/data/testtoc +0 -117
data/ext/CdIo_Modulo.c CHANGED
@@ -87,23 +87,26 @@ rb_cdio_driver_describe(VALUE module, VALUE driver)
87
87
  VALUE
88
88
  rb_cdio_open(int argc, VALUE * argv, VALUE module)
89
89
  {
90
- VALUE source,driver,block;
91
- VALUE argv_2[2];
92
- //def open(source=nil,driver=nil) &block
93
- rb_scan_args(argc, argv, "02&", &source, &driver,&block);
94
- if(Qnil!=source) {
95
- Check_Type(source,T_STRING);
90
+ VALUE source,
91
+ driver,
92
+ block;
93
+ VALUE argv_2[2];
94
+ // def open(source=nil,driver=nil) &block
95
+ rb_scan_args(argc, argv, "02&", &source, &driver, &block);
96
+ if (Qnil != source) {
97
+ Check_Type(source, T_STRING);
96
98
  }
97
99
  FIXNUM_P(driver);
98
- argv_2[0]=source;
99
- argv_2[1]=driver;
100
- VALUE cd= rb_cdio_cd_new(2, argv_2, cCdIoCd);
101
- if (Qnil==block) {
102
- return cd;
100
+ argv_2[0] = source;
101
+ argv_2[1] = driver;
102
+ VALUE cd = rb_cdio_cd_new(2, argv_2, cCdIoCd);
103
+ if (Qnil == block) {
104
+ return cd;
103
105
  } else {
104
- rb_gc_start();
105
- rb_yield(cd);
106
- return Qnil;
106
+ rb_gc_start();
107
+ rb_yield(cd);
108
+ cd = Qnil;
109
+ return Qnil;
107
110
  }
108
111
  }
109
112
 
@@ -190,37 +193,54 @@ rb_cdio_track_type_describe(VALUE module, VALUE track)
190
193
  return rb_str_new2(desc);
191
194
  }
192
195
 
193
- static VALUE _is_file_bool(bool (*pf)(const char *n),VALUE name) {
194
- Check_Type(name,T_STRING);
196
+ static VALUE
197
+ _is_file_bool(bool(*pf) (const char *n), VALUE name)
198
+ {
199
+ Check_Type(name, T_STRING);
195
200
  SafeStringValue(name);
196
- bool res = pf(StringValuePtr(name));
197
- return res ? Qtrue : Qfalse;
201
+ bool res = pf(StringValuePtr(name));
202
+ return res ? Qtrue : Qfalse;
198
203
  }
199
204
 
200
- static VALUE _is_file_char(char *(*pf)(const char *n),VALUE name) {
201
- Check_Type(name,T_STRING);
205
+ static VALUE
206
+ _is_file_char(char *(*pf) (const char *n), VALUE name)
207
+ {
208
+ Check_Type(name, T_STRING);
202
209
  SafeStringValue(name);
203
- char *bin = pf(StringValuePtr(name));
204
- if(NULL==bin) {
205
- return Qnil;
210
+ char *bin = pf(StringValuePtr(name));
211
+ if (NULL == bin) {
212
+ return Qnil;
206
213
  } else {
207
- return rb_str_new2(bin);
214
+ return rb_str_new2(bin);
208
215
  }
209
216
  }
210
217
 
211
- VALUE rb_cdio_is_binfile(VALUE module, VALUE name) {
212
- return _is_file_char(&cdio_is_binfile,name);
218
+ VALUE
219
+ rb_cdio_is_binfile(VALUE module, VALUE name)
220
+ {
221
+ return _is_file_char(&cdio_is_binfile, name);
213
222
  }
214
- VALUE rb_cdio_is_cuefile(VALUE module, VALUE name) {
215
- return _is_file_char(&cdio_is_cuefile,name);
223
+
224
+ VALUE
225
+ rb_cdio_is_cuefile(VALUE module, VALUE name)
226
+ {
227
+ return _is_file_char(&cdio_is_cuefile, name);
216
228
  }
217
- VALUE rb_cdio_is_nrg(VALUE module, VALUE name) {
218
- return _is_file_bool(&cdio_is_nrg,name);
229
+
230
+ VALUE
231
+ rb_cdio_is_nrg(VALUE module, VALUE name)
232
+ {
233
+ return _is_file_bool(&cdio_is_nrg, name);
219
234
  }
220
- VALUE rb_cdio_is_tocfile(VALUE module, VALUE name) {
221
- return _is_file_bool(cdio_is_tocfile,name);
235
+
236
+ VALUE
237
+ rb_cdio_is_tocfile(VALUE module, VALUE name)
238
+ {
239
+ return _is_file_bool(cdio_is_tocfile, name);
222
240
  }
223
- VALUE rb_cdio_is_device(int argc, VALUE * argv, VALUE module) {
241
+
242
+ VALUE
243
+ rb_cdio_is_device(int argc, VALUE * argv, VALUE module)
244
+ {
224
245
  return Qnil;
225
246
  }
226
-
data/ext/CdIo_Track.c CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  #include "CdIo.h"
11
11
  /**
12
- * Funcin extraida de cd-info.c
12
+ * Funci?n extraida de cd-info.c
13
13
  */
14
14
 
15
15
 
@@ -31,17 +31,18 @@ rb_cdio_track_number(VALUE obj)
31
31
  VALUE
32
32
  rb_cdio_track_green(VALUE obj)
33
33
  {
34
- GET_CDIO(rb_iv_get(obj, "@cd"),p_cdio);
34
+ GET_CDIO(rb_iv_get(obj, "@cd"), p_cdio);
35
35
  if (cdio_get_track_green(p_cdio, rb_cdio_track_number(obj))) {
36
36
  return Qtrue;
37
37
  } else {
38
38
  return Qfalse;
39
39
  }
40
40
  }
41
+
41
42
  VALUE
42
43
  rb_cdio_track_init(VALUE obj, VALUE cd, VALUE track)
43
44
  {
44
- // Verificacin de tipos.
45
+ // Verificaci?n de tipos.
45
46
  lsn_t lsn;
46
47
  int i_track;
47
48
  FIXNUM_P(track);
@@ -50,6 +51,18 @@ rb_cdio_track_init(VALUE obj, VALUE cd, VALUE track)
50
51
  }
51
52
  GET_CDIO(cd, p_cdio);
52
53
  i_track = FIX2INT(track);
54
+ // Verify track number
55
+ track_t min,
56
+ max;
57
+ min = cdio_get_first_track_num(p_cdio);
58
+ max = min + cdio_get_num_tracks(p_cdio) - 1;
59
+ if (i_track != CDIO_CDROM_LEADOUT_TRACK
60
+ && (i_track < min || i_track > max)) {
61
+ char buffer[64];
62
+ sprintf(buffer, "The track %d doesn't exists", i_track);
63
+ rb_raise(rb_eException, buffer);
64
+ }
65
+
53
66
  /** :cd :number :format, :green, :lba,:lsn,:msf,:sec_count*/
54
67
  rb_iv_set(obj, "@cd", cd);
55
68
  rb_iv_set(obj, "@number", track);
@@ -80,12 +93,16 @@ rb_cdio_track_init(VALUE obj, VALUE cd, VALUE track)
80
93
  cdio_iso_analysis_t iso_analysis;
81
94
  fs = cdio_guess_cd_type(p_cdio, 0, i_track, &iso_analysis);
82
95
  rb_iv_set(obj, "@track_type", INT2FIX(fs));
83
-
96
+ rb_iv_set(obj, "@leadout",
97
+ (i_track == CDIO_CDROM_LEADOUT_TRACK) ? Qtrue : Qfalse);
84
98
  return obj;
85
99
  }
86
100
 
87
- VALUE rb_cdio_track_get_cdtext(VALUE obj) {
88
- GET_CDIO(rb_iv_get(obj, "@cd"),p_cdio);
89
- const cdtext_t *cdtext = cdio_get_cdtext(p_cdio, rb_cdio_track_number(obj));
101
+ VALUE
102
+ rb_cdio_track_get_cdtext(VALUE obj)
103
+ {
104
+ GET_CDIO(rb_iv_get(obj, "@cd"), p_cdio);
105
+ const cdtext_t *cdtext =
106
+ cdio_get_cdtext(p_cdio, rb_cdio_track_number(obj));
90
107
  return get_cdtext(cdtext);
91
108
  }
@@ -9,7 +9,7 @@
9
9
 
10
10
 
11
11
  #include "CdIo.h"
12
- static bool
12
+ static bool
13
13
  read_iso9660_pvd(const CdIo * p_cdio, track_format_t track_format, /* out
14
14
  */
15
15
  iso9660_pvd_t * p_pvd)
data/ext/CdIo_Tracks.c ADDED
@@ -0,0 +1,66 @@
1
+ #include "CdIo.h"
2
+ VALUE
3
+ rb_cdio_tracks_init(VALUE obj, VALUE cd)
4
+ {
5
+ if (Qtrue != rb_obj_is_instance_of(cd, cCdIoCd)) {
6
+ rb_raise(rb_eArgError, "Arg 1 must be a CdIo::Cd");
7
+ }
8
+ rb_iv_set(obj, "@cd", cd);
9
+ VALUE aTracks;
10
+ aTracks = rb_ary_new();
11
+ GET_CDIO(cd, p_cdio);
12
+ track_t first_track_num;
13
+ track_t num_tracks;
14
+ first_track_num = cdio_get_first_track_num(p_cdio);
15
+ num_tracks = cdio_get_num_tracks(p_cdio);
16
+ // printf("C->Primera pista: %d\n",first_track_num);
17
+ // printf("C->Numero pistas: %d\n",num_tracks);
18
+ int j,
19
+ i = first_track_num;
20
+ for (j = 0; j < num_tracks; i++, j++) {
21
+ rb_ary_push(aTracks, get_track(cd, i));
22
+ }
23
+ rb_iv_set(obj, "@tracks", aTracks);
24
+ return obj;
25
+ }
26
+
27
+ VALUE
28
+ rb_cdio_tracks_each(int argc, VALUE * argv, VALUE obj)
29
+ {
30
+ VALUE block;
31
+ int len,
32
+ i;
33
+ rb_scan_args(argc, argv, "00&", &block);
34
+ VALUE aTracks = rb_iv_get(obj, "@tracks");
35
+ len = RARRAY(aTracks)->len;
36
+ for (i = 0; i < len; i++) {
37
+ rb_yield(rb_ary_entry(aTracks, i));
38
+ }
39
+ return aTracks;
40
+ }
41
+
42
+ VALUE
43
+ rb_cdio_tracks_diff(VALUE obj, VALUE a, VALUE b)
44
+ {
45
+ int ia,
46
+ ib,
47
+ ret;
48
+ ia = rb_cdio_track_number(a);
49
+ ib = rb_cdio_track_number(b);
50
+ if (ia > ib) {
51
+ ret = 1;
52
+ } else if (ia < ib) {
53
+ ret = -1;
54
+ } else {
55
+ ret = 0;
56
+ }
57
+ return INT2FIX(ret);
58
+ }
59
+
60
+ VALUE
61
+ rb_cdio_tracks_index(VALUE obj, VALUE index)
62
+ {
63
+
64
+ FIXNUM_P(index);
65
+ return get_track(rb_iv_get(obj, "@cd"), FIX2INT(index));
66
+ }
data/mkmf.log ADDED
@@ -0,0 +1,26 @@
1
+ have_library: checking for cdio_open() in -lcdio... -------------------- yes
2
+
3
+ "i686-pc-linux-gnu-gcc -o conftest -I/home/cdx/ruby/rb_cdio -I/usr/lib/ruby/1.8/i686-linux -O2 -march=athlon-xp -m3dnow -msse -mfpmath=sse -mmmx -pipe -ffast-math -fPIC conftest.c -L'/usr/lib' -Wl,-R'/usr/lib' -lruby18-static -lcdio -ldl -lcrypt -lm -lc"
4
+ checked program was:
5
+ /* begin */
6
+
7
+ /*top*/
8
+ int main() { return 0; }
9
+ int t() { cdio_open(); return 0; }
10
+ /* end */
11
+
12
+ --------------------
13
+
14
+ have_library: checking for iso9660_get_system_id() in -liso9660... -------------------- yes
15
+
16
+ "i686-pc-linux-gnu-gcc -o conftest -I/home/cdx/ruby/rb_cdio -I/usr/lib/ruby/1.8/i686-linux -O2 -march=athlon-xp -m3dnow -msse -mfpmath=sse -mmmx -pipe -ffast-math -fPIC conftest.c -L'/usr/lib' -Wl,-R'/usr/lib' -lcdio -lruby18-static -liso9660 -lcdio -ldl -lcrypt -lm -lc"
17
+ checked program was:
18
+ /* begin */
19
+
20
+ /*top*/
21
+ int main() { return 0; }
22
+ int t() { iso9660_get_system_id(); return 0; }
23
+ /* end */
24
+
25
+ --------------------
26
+
data/rb_cdio.def.rb ADDED
@@ -0,0 +1,187 @@
1
+ #!/bin/env ruby
2
+ # = rb_cdio
3
+ # This package create bindings to the library libcdio
4
+ #
5
+ # == Version
6
+ # :include:VERSION
7
+ #
8
+ # == Changelog
9
+ # :include:ChangeLog.txt
10
+ #
11
+
12
+ # = Module CdIo
13
+ # The module CdIo defines constants, classes and methods
14
+ # to retrieve information of Cd devices and images,
15
+ # using the libcdio library.
16
+ #
17
+ #
18
+ # The name of the constants are the same of libcdio, so theirs values
19
+ # can change on different OS and versions of the library
20
+
21
+ module CdIo
22
+ CDIO_DISC_MODE_CD_DA=0
23
+ CDIO_DISC_MODE_CD_DATA=1
24
+ CDIO_DISC_MODE_CD_MIXED=3
25
+ CDIO_DISC_MODE_CD_XA=2
26
+ CDIO_DISC_MODE_DVD_OTHER=10
27
+ CDIO_DISC_MODE_DVD_PR=8
28
+ CDIO_DISC_MODE_DVD_PRW=9
29
+ CDIO_DISC_MODE_DVD_R=6
30
+ CDIO_DISC_MODE_DVD_RAM=5
31
+ CDIO_DISC_MODE_DVD_ROM=4
32
+ CDIO_DISC_MODE_DVD_RW=7
33
+ CDIO_DISC_MODE_ERROR=12
34
+ CDIO_DISC_MODE_NO_INFO=11
35
+ # Driver for a .bin or .cue file
36
+ DRIVER_BINCUE=8
37
+ DRIVER_CDRDAO=7
38
+ # Driver for a device (cd or dvd)
39
+ DRIVER_DEVICE=10
40
+ DRIVER_FREEBSD=2
41
+ DRIVER_LINUX=3
42
+ DRIVER_NRG=9
43
+ DRIVER_OSX=5
44
+ DRIVER_SOLARIS=4
45
+ DRIVER_UNKNOWN=0
46
+ DRIVER_WIN32=6
47
+ TRACK_FORMAT_AUDIO=0
48
+ TRACK_FORMAT_CDI=1
49
+ TRACK_FORMAT_DATA=3
50
+ TRACK_FORMAT_ERROR=5
51
+ TRACK_FORMAT_PSX=4
52
+ TRACK_FORMAT_XA=2
53
+ # The number for the leadout track of a cd
54
+ CDIO_CDROM_LEADOUT_TRACK=170
55
+ # Returns all active devices (with a cd or dvd inside)
56
+ #
57
+ # CdIo.get_devices #=> ["/dev/cdrom"]
58
+ def CdIo.devices
59
+ end
60
+ # Returns a string for the default device
61
+ #
62
+ # CdIo.get_default_device #=> "/dev/cdrom"
63
+ def CdIo.default_device(cd=nil)
64
+ end
65
+ # Returns a hash with the capabilities of the device
66
+ #
67
+ # CdIo.get_drive_cap_dev("/dev/cdrom") #=> {"misc"=>{"close_tray"=>true, "mcn"=>false, "media_changed"=>false, "select_disk"=>false, "lock"=>true, "isrc"=>false, "multi_session"=>true, "misc_reset"=>false, "eject"=>true, "select_speed"=>false, "file"=>false}, "read"=>{"dvd-rw"=>false, "audio"=>true, "c2_errs"=>false, "dvd-r"=>false, "cd-da"=>true, "dvd-rom"=>false, "cd-r"=>true, "dvd-ram"=>false, "dvr+r"=>false, "cd+g"=>false, "dvd+rw"=>false, "cd-rw"=>true}, "write"=>{"dvd-rw"=>false, "cd"=>false, "dvd-r"=>false, "burn_proof"=>false, "dvd+r"=>false, "cd-r"=>false, "dvd"=>false, "dvd-ram"=>false, "dvd+rw"=>false, "mount_rainier"=>false, "cd-rw"=>false}}
68
+ #
69
+ def CdIo.drive_cap_dev(device)
70
+ end
71
+ # Returns the description for the driver id
72
+ #
73
+ # CdIo.driver_describe(CdIo::DRIVER_LINUX) #=>"GNU/Linux ioctl and MMC driver"
74
+ def CdIo.driver_describe(driver)
75
+ end
76
+ # Returns the description for the discmode id
77
+ #
78
+ # CdIo.discmode_describe(CdIo::CDIO_DISC_MODE_CD_DA) #=> "CD-DA"
79
+ def CdIo.discmode_describe(driver)
80
+ end
81
+ # Returns the description for the track_format id
82
+ #
83
+ # CdIo.track_format_describe(CdIo::TRACK_FORMAT_XA) #=> "XA"
84
+ def CdIo.track_format_describe(track_format)
85
+ end
86
+ # Returns the description for the type of a CdIo::Track object
87
+ #
88
+ # CdIo.track_type_describe(cd.tracks[1]) #=> "audio"
89
+ def CdIo.track_type_describe(track)
90
+ end
91
+ # Create a CdIo::Cd object.
92
+ #
93
+ # * With no device, use the default device
94
+ # * With no driver, use CdIo::DRIVER_UNKNOWN
95
+ # If you provide a block, the argument will be a CdIo::Cd object
96
+ # it will be freed at the end of the block.
97
+ #
98
+ # CdIo.open("/dev/cdrom") #=><CdIo::Cd:0xb7d85f7c>
99
+ #
100
+ # CdIo.open() {|cd| p cd} #=><CdIo::Cd:0xb7d85f7c>
101
+ #
102
+ def CdIo.open(device=nil,driver=nil,&block)
103
+ end
104
+ class Cd
105
+ attr_reader :device, :mcn, :driver_name, :driver_id, :first_track_num, :disc_mode, :num_tracks, :stat_size, :cddb_id
106
+ #
107
+ # Create a new Cd::CdIo object.
108
+ # The first argument is an String for a device or a cue/bin/toc/nrg file
109
+ # The seconf argument is the constant for a Driver (default CdIo::DRIVER_UNKNOWN)
110
+ # * CdIo::Cd.new()
111
+ # * CdIo::Cd.new("/dev/cdrom")
112
+ # * CdIo::Cd.new("/dev/cdrom", CdIo::DRIVER_UNKNOWN)
113
+ #
114
+ def initialize(device,driver)
115
+ end
116
+ # Returns a hash with cdtext data for the cd, nil if doesn't exists
117
+ #
118
+ # cd.cdtext # =>cdtext information
119
+ def cdtext(track)
120
+ end
121
+ # Returns an array of CdIo::Track for the cd
122
+ #
123
+ # cd.tracks #=>[#<CdIo::TrackIso9660:0xb7d88100>]
124
+ def tracks
125
+ end
126
+
127
+ # Returns true if CdIo::Cd is a cd, else otherwise
128
+ def is_cd?
129
+ end
130
+ # Returns true if CdIo::Cd is a dvd, else otherwise
131
+ def is_dvd?
132
+ end
133
+ # Returns a hash with the capabilities of the device.
134
+ # See CdIo.drive_cap_dev
135
+ def drive_cap
136
+ end
137
+ # Return a hash with information for the hardware
138
+ #
139
+ # cd.hwinfo #=>{"revision"=>"1.00", "vendor"=>"HL-DT-ST", "model"=>"CD-ROM GCR-8520B"}
140
+ def hwinfo
141
+ end
142
+ # Closes the device.
143
+ # Actually, do nothing :P
144
+ def close
145
+ end
146
+ end
147
+ # Provides access to the tracks of a CdIo::Cd object
148
+ class Tracks
149
+ # Returns a CdIo::Tracks object por a given CdIo::Cd
150
+ include Enumerable
151
+ def initialize(cd)
152
+ end
153
+ # Iterates through the tracks
154
+ #
155
+ # tracks.each {|track| p track}
156
+ def each(&block)
157
+ end
158
+ # Returns a track by the index.
159
+ # You can use CdIo::CDIO_CDROM_LEADOUT_TRACK to get the
160
+ # leadout track
161
+ #
162
+ # tracks[CdIo::CDIO_CDROM_LEADOUT_TRACK] => #<CdIo::Track:0xb7d867ec @leadout=true, @min=69, @sec_count=0, @frames=22, @lsn=311872, @format=5, @track_type=15, @msf="69:20:22", @number=170, @sec=20, @cd=#<CdIo::Cd:0xb7d84b7c>, @lba=312022>
163
+ def [](index)
164
+ end
165
+ end
166
+ # Representation of a track for a CdIo::Cd object
167
+ class Track
168
+ attr_reader :cd, :number, :format, :lba,:lsn,:min,:sec,:frames,:sec_count, :leadout
169
+ # Returns a track for a given CdIo::Cd object and a number track.
170
+ #
171
+ # Use CdIo::Cd.tracks instead
172
+ #
173
+ def initialize(cd,track)
174
+ end
175
+ # Returns true if track is a green track type (mode 2)
176
+ def green?
177
+ end
178
+ # Returns a hash with the cdtext data, or nil if doesn't exists.
179
+ def cdtext
180
+ end
181
+ end
182
+ # Representation of a Iso 9660 Track for a CdIo::Cd object.
183
+ # Have some extra attributes, like system_id, volume_id....
184
+ class TrackIso9660 < Track
185
+ attr_reader :system_id, :volume_id, :volumeset_id, :preparer_id, :publisher_id, :application_id
186
+ end
187
+ end