/** * Copyright (c) 2005 Claudio Bustos * This code is hereby licensed for public consumption under the * GNU GPL v2. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * Archivo de cabecera para la extensión rb_cdio */ #ifndef __RUBY_CDIO_H__ #define __RUBY_CDIO_H__ #include #include #include #include #include #include #include #include #include #include #include // if we got cddb, include the library #ifdef HAVE_CDDB_CDDB_H #ifndef HAVE_CDDB #define HAVE_CDDB 1 #endif #include #endif /** Test **/ #if LIBCDIO_VERSION_NUM < 73 #error rb_cdio 0.2.0 needs libcdio>=0.73 #endif /** End tests **/ #define GET_CDIO(self,p) \ CdIo* p; \ Data_Get_Struct(self, CdIo, p); \ if(NULL==p) {rb_raise(rb_eException,"No pointer to CdIo");} #define GET_TRACK(obj,p,t) \ CdIo* p; \ track_t t; \ Data_Get_Struct(rb_iv_get(obj, "@cd"), CdIo, p); \ if(NULL==p) {rb_raise(rb_eException,"No pointer to CdIo");} \ t=FIX2INT(rb_iv_get(obj,"@number")); #define HASH_STR(hash,str1,str2) \ rb_hash_aset(hash,rb_str_new2(str1),rb_str_new2(str2)); #undef CDIO_DRIVE_CAP_WRITE_DVD #define CDIO_DRIVE_CAP_WRITE_DVD ( \ CDIO_DRIVE_CAP_WRITE_DVD_R \ | CDIO_DRIVE_CAP_WRITE_DVD_PR \ | CDIO_DRIVE_CAP_WRITE_DVD_RAM \ | CDIO_DRIVE_CAP_WRITE_DVD_RW \ | CDIO_DRIVE_CAP_WRITE_DVD_RPW \ ) // module CdIo VALUE mCdIo; // class CdIo::Cd VALUE cCdIoCd; // module CdIo::CdDa VALUE mCdIoCdda; // class CdIo::Track VALUE cCdIoTrack; // class CdIo::TrackIso9660 VALUE cCdIoTrackIso9660; VALUE cCdIoTrackCdda; // class CdIo::Tracks VALUE cCdIoTracks; // module CdIo::Exception VALUE mCdIoException; // Exceptions VALUE eCdIoError; VALUE eCdIoUnsupported; VALUE eCdIoUnitit; VALUE eCdIoNotPermitted; VALUE eCdIoBadParameter; VALUE eCdIoBadPointer; VALUE eCdIoNoDriver; VALUE eCdIoCddbError; VALUE eCdIoCddbConn; int Init_CdIo(); // Metodos para el módulo CdIo VALUE rb_cdio_open(int argc, VALUE * argv, VALUE module); VALUE rb_cdio_get_devices(int argc, VALUE * argv, VALUE module); // ok VALUE rb_cdio_get_default_device(int argc, VALUE * argv, VALUE module); // ok, // con // cero // argumentos VALUE rb_cdio_get_drive_cap_dev(VALUE module, VALUE device); VALUE rb_cdio_driver_describe(VALUE module, VALUE driver); VALUE rb_cdio_track_format_describe(VALUE module, VALUE track_format); // creado // por // mi VALUE rb_cdio_track_type_describe(VALUE module, VALUE track_type); // creada // por // mi VALUE rb_cdio_discmode_describe(VALUE module, VALUE discmode); // creada // por // mi VALUE rb_cdio_is_binfile(VALUE module, VALUE name); VALUE rb_cdio_is_cuefile(VALUE module, VALUE name); VALUE rb_cdio_is_nrg(VALUE module, VALUE name); VALUE rb_cdio_is_tocfile(VALUE module, VALUE name); VALUE rb_cdio_is_device(int argc, VALUE * argv, VALUE module); VALUE rb_cdio_close_tray(VALUE module, VALUE name); /* * Métodos para clase CdIo::Cd */ VALUE rb_cdio_cd_new(int argc, VALUE * argv, VALUE class); // ok VALUE rb_cdio_cd_init(VALUE class, VALUE device, VALUE driver); // ok VALUE rb_cdio_cd_get_tracks(VALUE class); // ok VALUE rb_cdio_cd_get_first_track(VALUE class); // ok VALUE rb_cdio_cd_get_arg(VALUE obj, VALUE arg); VALUE rb_cdio_cd_is_cd(VALUE obj); VALUE rb_cdio_cd_is_dvd(VALUE obj); VALUE rb_cdio_cd_get_freedb(VALUE obj); VALUE rb_cdio_cd_get_drive_cap(VALUE obj); VALUE rb_cdio_cd_get_hwinfo(VALUE obj); VALUE rb_cdio_cd_close(VALUE obj); VALUE rb_cdio_cd_eject(VALUE obj); VALUE rb_cdio_cd_get_cdtext(VALUE obj); // module functions CdDa VALUE rb_cdio_cdda_get_volume(VALUE obj); VALUE rb_cdio_cdda_set_volume(VALUE obj,VALUE vol); VALUE rb_cdio_cdda_play(int argc,VALUE* argv,VALUE obj); VALUE rb_cdio_cdda_pause(VALUE obj); VALUE rb_cdio_cdda_resume(VALUE obj); VALUE rb_cdio_cdda_stop(VALUE obj); VALUE rb_cdio_cdda_subchannel(VALUE obj); VALUE rb_cdio_cdda_cddb_id(VALUE obj); VALUE rb_cdio_cdda_cddb(VALUE obj); VALUE rb_cdio_cdda_cddb_matches(VALUE obj); VALUE rb_cdio_cdda_cddb_fetch(VALUE obj,VALUE match); VALUE rb_cdio_cdda_category(VALUE obj); VALUE rb_cdio_cdda_title(VALUE obj); VALUE rb_cdio_cdda_artist(VALUE obj); VALUE rb_cdio_cdda_year(VALUE obj); VALUE rb_cdio_cdda_genre(VALUE obj); VALUE rb_cdio_cdda_length(VALUE obj); VALUE rb_cdio_cdda_extra_data(VALUE obj); /** * Métodos para la clase CdIo::Tracks */ VALUE rb_cdio_tracks_init(VALUE obj, VALUE cd); VALUE rb_cdio_tracks_each(int argc, VALUE * argv, VALUE obj); VALUE rb_cdio_tracks_diff(VALUE obj, VALUE a, VALUE b); VALUE rb_cdio_tracks_index(VALUE obj, VALUE index); /* * Métodos para la clase CdIo::Track */ VALUE rb_cdio_track_init(VALUE obj, VALUE oCd, VALUE i_track); // ok VALUE rb_cdio_track_green(VALUE obj); // ok VALUE rb_cdio_track_get_cdtext(VALUE obj); /* TrackIso9660*/ VALUE rb_cdio_trackiso9660_init(VALUE obj, VALUE oCd, VALUE i_track); /* TrackCdda */ VALUE rb_cdio_trackcdda_play(VALUE obj); /* * Métodos comunes */ VALUE get_cap(cdio_drive_read_cap_t * read_cap, cdio_drive_write_cap_t * write_cap, cdio_drive_misc_cap_t * misc_cap); VALUE get_cdtext(const cdtext_t * cdtext); VALUE get_track(VALUE obj, track_t i); #endif