head 1.6; access; symbols pkgsrc-2013Q2:1.6.0.24 pkgsrc-2013Q2-base:1.6 pkgsrc-2012Q4:1.6.0.22 pkgsrc-2012Q4-base:1.6 pkgsrc-2011Q4:1.6.0.20 pkgsrc-2011Q4-base:1.6 pkgsrc-2011Q2:1.6.0.18 pkgsrc-2011Q2-base:1.6 pkgsrc-2009Q4:1.6.0.16 pkgsrc-2009Q4-base:1.6 pkgsrc-2008Q4:1.6.0.14 pkgsrc-2008Q4-base:1.6 pkgsrc-2008Q3:1.6.0.12 pkgsrc-2008Q3-base:1.6 cube-native-xorg:1.6.0.10 cube-native-xorg-base:1.6 pkgsrc-2008Q2:1.6.0.8 pkgsrc-2008Q2-base:1.6 pkgsrc-2008Q1:1.6.0.6 pkgsrc-2008Q1-base:1.6 pkgsrc-2007Q4:1.6.0.4 pkgsrc-2007Q4-base:1.6 pkgsrc-2007Q3:1.6.0.2 pkgsrc-2007Q3-base:1.6 pkgsrc-2007Q2:1.5.0.8 pkgsrc-2007Q2-base:1.5 pkgsrc-2007Q1:1.5.0.6 pkgsrc-2007Q1-base:1.5 pkgsrc-2006Q4:1.5.0.4 pkgsrc-2006Q4-base:1.5 pkgsrc-2006Q3:1.5.0.2 pkgsrc-2006Q3-base:1.5 pkgsrc-2006Q2:1.3.0.2 pkgsrc-2006Q2-base:1.3 pkgsrc-2006Q1:1.2.0.18 pkgsrc-2006Q1-base:1.2 pkgsrc-2005Q4:1.2.0.16 pkgsrc-2005Q4-base:1.2 pkgsrc-2005Q3:1.2.0.14 pkgsrc-2005Q3-base:1.2 pkgsrc-2005Q2:1.2.0.12 pkgsrc-2005Q2-base:1.2 pkgsrc-2005Q1:1.2.0.10 pkgsrc-2005Q1-base:1.2 pkgsrc-2004Q4:1.2.0.8 pkgsrc-2004Q4-base:1.2 pkgsrc-2004Q3:1.2.0.6 pkgsrc-2004Q3-base:1.2 pkgsrc-2004Q2:1.2.0.4 pkgsrc-2004Q2-base:1.2 pkgsrc-2004Q1:1.2.0.2 pkgsrc-2004Q1-base:1.2; locks; strict; comment @# @; 1.6 date 2007.09.19.23.59.58; author wiz; state dead; branches; next 1.5; 1.5 date 2006.09.15.15.14.38; author jmmv; state Exp; branches; next 1.4; 1.4 date 2006.08.28.10.02.33; author jmmv; state Exp; branches; next 1.3; 1.3 date 2006.03.30.21.16.53; author jmmv; state Exp; branches; next 1.2; 1.2 date 2004.01.17.01.12.43; author xtraeme; state dead; branches; next 1.1; 1.1 date 2003.12.29.12.05.20; author xtraeme; state Exp; branches; next ; desc @@ 1.6 log @Move gnome2-applets to gnome-applets to make directory name match PKGNAME. @ text @$NetBSD: patch-ac,v 1.5 2006/09/15 15:14:38 jmmv Exp $ --- configure.orig 2006-09-04 16:08:23.000000000 +0200 +++ configure @@@@ -24862,7 +24862,7 @@@@ _ACEOF test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - ac_define_dir=`eval echo $"${datadir}/locale"` + ac_define_dir=`eval echo "${datadir}/locale"` ac_define_dir=`eval echo $ac_define_dir` GNOMELOCALEDIR="$ac_define_dir" @@@@ -28780,7 +28780,7 @@@@ gladedir="${pkgdatadir}/glade" test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - ac_define_dir=`eval echo $"${iconsdir}"` + ac_define_dir=`eval echo "${iconsdir}"` ac_define_dir=`eval echo $ac_define_dir` GNOME_ICONDIR="$ac_define_dir" @@@@ -28793,7 +28793,7 @@@@ _ACEOF test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - ac_define_dir=`eval echo $"${pixmapsdir}"` + ac_define_dir=`eval echo "${pixmapsdir}"` ac_define_dir=`eval echo $ac_define_dir` GNOME_PIXMAPSDIR="$ac_define_dir" @@@@ -28806,7 +28806,7 @@@@ _ACEOF test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - ac_define_dir=`eval echo $"${gladedir}"` + ac_define_dir=`eval echo "${gladedir}"` ac_define_dir=`eval echo $ac_define_dir` GNOME_GLADEDIR="$ac_define_dir" @@@@ -28819,7 +28819,7 @@@@ _ACEOF test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - ac_define_dir=`eval echo $"${datadir}"` + ac_define_dir=`eval echo "${datadir}"` ac_define_dir=`eval echo $ac_define_dir` DATADIR="$ac_define_dir" @@@@ -28832,7 +28832,7 @@@@ _ACEOF test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - ac_define_dir=`eval echo $"${sysconfdir}"` + ac_define_dir=`eval echo "${sysconfdir}"` ac_define_dir=`eval echo $ac_define_dir` SYSCONFDIR="$ac_define_dir" @@@@ -28845,7 +28845,7 @@@@ _ACEOF test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - ac_define_dir=`eval echo $"${libdir}"` + ac_define_dir=`eval echo "${libdir}"` ac_define_dir=`eval echo $ac_define_dir` LIBDIR="$ac_define_dir" @@@@ -28858,7 +28858,7 @@@@ _ACEOF test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - ac_define_dir=`eval echo $"$prefix"` + ac_define_dir=`eval echo "$prefix"` ac_define_dir=`eval echo $ac_define_dir` PREFIX="$ac_define_dir" @ 1.5 log @Update to 2.16.0: Changes in GNOME-Applets 2.16.0 =============================== "Codename Pantomime" This is it, the brass ring, the 2.16 GNOME applets release. This is the release that will mean so much to so many people. Thanks to everyone who contributed, to get the full list of changes, you'll have to read back a ways. Changes (since 2.15.90): - reenable stickynotes (Davyd Madeley) - geyes: new Tango based theme (Davyd Madeley, Andrew Kerr) - modemlights: latest icons (Lapo Calamandrei, Davyd Madeley) Translations: - eu (Inaki Larranaga) - ca (Jordi Mallach, Xavier Conde Rueda, Josep Puigdemont i Casamajó) - or (Subhransu Behera) - el (Kostas Papadimas, Nikos Charonitakis) - bn_IN (Runa Bhattacharjee) - bg (Alexander Shopov) - mk (Jovan Naumovski, Arangel Angov) - hi (Rajesh Ranjan) - pt (Duarte Loreto) - hu (Gabor Kelemen) - nl (Tino Meinen, Wouter Bolsterlee) - fr (Robert-André Mauchin) - lt (Gintautas Miliauskas) - vi (Clytie Siddall) - th (Theppitak Karoonboonyanan) - de (Hendrik Richter) - fi (Ilkka Tuohela) - sl (Matic Zgur) - sv (Daniel Nylander) - ml (Ani Peter) - es (Francisco Javier F. Serrador) - gu (Ankit Patel) - ja (Satoru SATOH) - ru (Leonid Kanter) - et (Priit Laes) - mg (Thierry Randrianiriana) Changes in GNOME-Applets 2.15.90 ================================ "Codename Kinetica Perpetua" This is the release candidate of GNOME-Applets. Changes: - Stickynotes transparently upgrades to Tomboy (Davyd Madeley) - new icons for everything except GSwitchit and Invest Applet (Lapo Calamandrei, Davyd Madeley) - Multiload: compiler compatibility fixes (Brian Cameron) - CpuFreq: reduce numb er of file reads (Carlos Garcia Campos) - CpuFreq: plugged memory leak (Paolo Borelli) - Gweather: remove dead locations from Locations DB (Davyd Madeley) - Invest: fix bugs and installation problems (Davyd Madeley) - Invest: fix localisation (Wouter Bolsterlee) - mixer: plug memory leak (Paolo Borelli) - transapplet: plug memory leak (Paolo Borelli) Translations: - ml (Ani Peter) - ca (Zavier Conde Rueda) - ka (Vladimer Sichinava) - sv (Daniel Nylander) - bg (Alexander Shopov) - ku (Erdal Ronahi) - id (Ahmad Riza H Nst) - ja (Satoru SATOH) - es (Francisco Javier F. Serrador) - ku (Rêzan Tovjîn) - sl (Matic Žgur) - ru (Leonid Kanter) - hu (Mate ORY) - de (Jochen Skulj) - gu (Ankit Patel) - vi (Clytie Siddall) - uk (Maxim Dziumanenko) - fi (Ilkka Tuohela) - mg (Thierry Randrianiriana) - et (Priit Laes) - mk (Jovan Naumovski) - ko (Changwoo Ryu) - nl (Wouter Bolsterlee) - dz (Guntupalli Karunakar) - nb (Kjartan Maraas) - th (Theppitak Karoonboonyanan) - pl (Artur Flinta) - or (Subhransu Behera) Changes in GNOME-Applets 2.15.3 =============================== "Codename Vegematables" Changes: - Fix trashapplet/drivemount .server files (Davyd Madeley) - gswitchit fixes (Sergey Udaltsov) - libgweather: check for NULL pointers (Kevin Bauder) - mixer: set ATK names (Ronald S. Bultje) - multiload: update tooltip only when needed (Benoit Dejean) - multiload: use inbuild panel transparency API (Benjamin Otte) - drivemount: use GNOME-VFS to determine if a drive needs ejecting or unmounting (Martin Pitt) - gweather: make applet display properly on vertical panels (Joshua Crawford) Translations: - eu (Inaki Larranaga) - ml (Ani Peter) - lv (Raivis Dejus) - mr (Rahul Bhalerao) - mk (Jovan Naumovski) - nb (Kjartan Maraas) - zh_CN (Funda Wang) - cy (Rhys Jones) - es (Francisco Javier F. Serrador) - or (Subhransu Behera) - gu (Ankit Patel) - nl (Tino Meinen) - fi (Ilkka Tuohela) - id (Ahmad Riza H Nst) - sl (Matic Žgur) Changes in GNOME-Applets 2.15.2 =============================== "Codename Cauchy" This is the first beta of GNOME-Applets 2.15 that will become 2.16. Changes in GNOME-Applets 2.15.1.1 ================================= "Codename Riemann" This release contains a build fix that stopped gswitchit being buildable in 2.15.1. Changes: - fix build to make gswitchit buildable (Fryderyk Dziarmagowski) - cpufreq: libcpufreq support, reworked selector (Carlos Garcia Campos) - mixer: fix up some GObject macros (Stefan Kost) Changes in GNOME-Applets 2.15.1 =============================== "Codename Gauss" This is the first (and rather late) tarball for the GNOME 2.15 development branch of GNOME-Applets. This branch will lead into GNOME 2.16. It may be highly unstable and do things you really didn't want it to do. You can keep both pieces, file a bug and ideally submit a patch. If you want the latest stable branch, check out GNOME-Applets 2.14 (available as the gnome-2-14 branch of CVS). Changes: - invest-applet replaces gtik (Davyd Madeley, Raphael Slinck) - switch to using po/LINUAS (Kjartan Maraas) - cpufreq: add support for libcpufreq (Carlos Garcia Campos) - gswitchit: update for new libxklavier (Sergey Udaltsov) - refactor configure.in (Davyd Madeley) - continued GWeather refactoring (makes GWeather more easily portable) (Philip Langdale) Plus other bug fixes and translations. Thanks everyone. @ text @d1 1 a1 1 $NetBSD: patch-ac,v 1.4 2006/08/28 10:02:33 jmmv Exp $ @ 1.4 log @Fix paths to installed files to solve, at least, Sticky Notes crashes. I'm sure this fixes many other problems in other applets. Bump PKGREVISION to 1. @ text @d1 1 a1 1 $NetBSD: patch-ac,v 1.3 2006/03/30 21:16:53 jmmv Exp $ d3 1 a3 1 --- configure.orig 2006-07-31 16:55:31.000000000 +0200 d5 1 a5 1 @@@@ -23363,7 +23363,7 @@@@ _ACEOF d14 1 a14 10 @@@@ -26471,7 +26471,7 @@@@ else fi -if test "x$SU_TOOL" == "x" -o "x$HAVE_LIBUTIL" != "xtrue" -o "x$P_MODEMLIGHTS" != "xmodemlights"; then +if test "x$SU_TOOL" = "x" -o "x$HAVE_LIBUTIL" != "xtrue" -o "x$P_MODEMLIGHTS" != "xmodemlights"; then { echo "$as_me:$LINENO: WARNING: *** modemlights applet will not be built ***" >&5 echo "$as_me: WARNING: *** modemlights applet will not be built ***" >&2;} else @@@@ -27125,7 +27125,7 @@@@ gladedir="${pkgdatadir}/glade" d23 1 a23 1 @@@@ -27138,7 +27138,7 @@@@ _ACEOF d32 1 a32 1 @@@@ -27151,7 +27151,7 @@@@ _ACEOF d41 1 a41 1 @@@@ -27164,7 +27164,7 @@@@ _ACEOF d50 1 a50 1 @@@@ -27177,7 +27177,7 @@@@ _ACEOF d59 1 a59 1 @@@@ -27190,7 +27190,7 @@@@ _ACEOF d68 1 a68 1 @@@@ -27203,7 +27203,7 @@@@ _ACEOF @ 1.3 log @Update to 2.14.0: Changes in GNOME-Applets 2.14.0 =============================== "Codename Squolo" This is the first release of GNOME Applets for GNOME 2.14. The end of another great 6 months by the contributors of GNOME. Changes: - Fix potential snprintf() overflow in charpick Translations: - cs (Petr Tomeš) - et (Ivar Smolin, Priit Laes) - pt_BR (Guilherme de S. Pastore) - pt (Duarte Loreto) - sq (Elian Myftiu) - nn (Kjartan Maraas) - sv (Daniel Nylander) - ro (Mugurel Tudor) - bg (Alexander Shopov, Rostislav Raykov) - uk (Maxim Dziumanenko) - it (Luca Ferretti) - cy (Rhys Jones) - bn (Simos Xenitellis) - sq (Elian Myftiu) - da (David Nielsen, Ole Laursen) - es (Francisco Javier F. Serrador) - pl (GNOME PL Team) - nl (Tino Meinen) - nb (Kjartan Maraas) Changes in GNOME-Applets 2.13.90 (2.14.0 RC1) ============================================= "Codename Schmoozie" This is the first release candidate of GNOME Applets for GNOME 2.14. Changes: - Mixer icons more logical (Jan Arne Petersen) - Fix crasher in multiload caused by dragging panel around (Davyd Madeley) Translations: - zh_TW (Chao-Hsiung Liao) - zh_HK (Chao-Hsiung Liao) - ka (David Lodge, Vladimer Sichinava) - ru (Leonid Kanter) - eu (Inaki Larranaga) - el (Kostas Papadimas) - et (Ivar Smolin) - sr (Slobodan D. Sredojevic) - gl (Ignacio Casal Quinteiro) - gu (Ankit Patel) - ja (Satoru SATOH) - ca (Josep Puigdemont i Casamajó) - es (Francisco Javier F. Serrador) - lt (Žygimantas Beručka) - hu (Mate ORY, Gabor Kelemen) - fa (Elnaz Sarbar, Farzaneh Sarafraz, Roozbeh Pournader) - fi (Ilkka Tuohela) - vi (Clytie Siddall) - cs (Miloslav Trmac) - zh_CN (Funda Wang) - de (Hendrik Richter) - th (Theppitak Karoonboonyanan) - cy (Rhys Jones) - it (Stefano Canepa) The GNOME Applets documentation requires updating for GNOME 2.14, if you feel that you could assist with this, please feel free to contribute documentation and improvements. Bugs and bug fixes will also be accepted (of course)! Changes in GNOME-Applets 2.13.4 ================================ "Codename Squarko" This is the second beta release of GNOME Applets for the GNOME 2.13 series. String freeze is now in effect. Changes: - Correctly configure for GStreamer 0.8 --with-gstreamer=0.8 (Davyd Madeley) - Mini-commander will not be compiled and transparently upgrade you to Deskbar-Applet, compile with --enable-mini-commander to be switched back to Mini-commander again (Davyd Madeley) - Catch a possible divide by zero in charpick (Davyd Madeley) - Drivemount fixes for background handling and media ejection (Ryan Lortie) - GWeather fixes (Davyd Madeley, Philip Langdale, Claudio Saavedra) - Replace sscanf with g_strsplit in libgweather to prevent stack smashing (Davyd Madeley, Ryan Lortie) - Fix invalid free in stickynotes (Davyd Madeley) Translations: - et (Ivar Smolin) - ta (Jayaradha) - pt (Duarte Loreto) - th (Theppitak Karoonboonyanan) - zh_TW (Chao-Hsiung Liao) - zh_HK (Chao-Hsiung Liao) - pt_BR (Raphael Higino) - sr, sr@@Latn (Slobodan D. Sredojevic) The GNOME-Applets documentation requires updating for GNOME 2.14, if you feel that you could assist with this, please feel free to contribute documentation improvements. Bugs and bug fixes will of course also be accepted ;) This tarball was produced with Love (tm). Changes in GNOME-Applets 2.13.3 ================================ "Codename Stardust" This is the first beta release of GNOME Applets for the GNOME 2.13 series. Changes: - Fix compiler warnings (Davyd Madeley) - Clean up configure.in andd summary (Davyd Madeley) - Add support for GStreamer 0.10 (Tim-Philipp Müller, Saleem Abdulrasool, Sylvain Bertrand, Davyd Madeley) - Center battery low warning dialog (Davyd Madeley) - Update libnotify API (Davyd Madeley, Wouter Bolsterlee) - Move drivemount to the new libpanel-applet background handling API (Ryan Lortie) - Turn GWeather preferences into a GObject derived from GtkDialog (Philip Langdale) - Fix critical warning in stickynotes (Davyd Madeley) - Build fixes for trash applet (Glynn Foster) - gcc 2.95 fixes for Stickynotes (Jens Granseuer) Thanks to all of the translators, even though I again haven't listed you. For testers, be aware that restarting GNOME Panel appears to trigger bug 327972 (http://bugzilla.gnome.org/show_bug.cgi?id=327972) in some circumstances. I'm not yet sure why. Changes in GNOME-Applets 2.13.2 ================================ "Codename Indigo" This is the second development release of GNOME Applets for the GNOME 2.13 series. It also marks the beginning of the feature freeze. Changes: - Make HAL optional in the build (John N. Laliberte) - Use new libpanel-applet transparency implementation in battstat (Ryan Lortie) - Use libnotify 0.3 API for battstat (Michael Vogt) - CPUFreq HIG fixes (Dennis Cranston) - GSwitchit HIG fixes (Sergey Udaltsov) - Locations Love (Jerimiah Cole, Pedro Villavicencio Garrido, Theppitak Karoonboonyanan, Adam Schreiber, Funda Wang) - Gweather: add pressure unit: atmospheres (Alexandros Frantzis) - Update sun/moon pictures at sunset/rise (Frank Solensky) - Gweather, memory leak fixes (Kjartan Maraas) - Gweather doc fixes (Vincent Untz) - Dew point is optional (Frank Solensky) - METAR parser tester (Frank Solensky) - Mixer, fix memory leaks, interpret arrow keys correctly, give unique names to mixers with same name (Ronald S. Bultje) - Mixer, don't remove the tooltip when scrolling (Michael Hofmann) - Fix critical warning in modemlights (Kjartan Maraas) - Fix crasher in modemlights (Sebastien Bacher) - Multiload, don't poll network filesystems (Benoît Dejean) - Fix graph drawing issues (Baz Zoetekouw) - Multiload documentation fixes (Vincent Untz) - Add "Hide Notes" option to the stickynotes menu (Jaap A. Haitsma) - Let stickynotes remember their positions (André Martins) - Ensure default titles are UTF-8 (Ryuichi Arafune, Davyd Madeley) - Use correct cursor when dragging things to the trash (Bas van der Lei) - Ensure trashapplet always fits on panel (Michael Hofmann) Changes in GNOME-Applets 2.13.1 ================================ "Codename Mobius" This is the first development release of GNOME Applets for the GNOME 2.13 series. Changes: - Split GWeather into the GWeather frontend and libgweather which has the parsers for weather servers and the preferences. (Philip Langdale) Fixes: - Code cleanup, gcc 2.95 fixes, etc. (Jens Granseuer, Kjartan Marass, Laszlo Peter, Aurelien Jarno) - Battery applet text will rotate on side panels (Ryan Lortie) - Implement a is_suspend_unavailable() hook for vendors to patch (Ryan Lortie) - Stop drivemount icons exloderizing the applet (Michael Hofmann) - GSwitchit plugin updates (Sergey Udaltsov) - French documentation (Christophe Bliard) - Locations Love (Ryan Lortie, Farzaneh Sarafraz) - Reduce flicker when positioning the mixer (Ronald S. Bultje) - Other mixer fixes (Kazuki Shimura, Ronald S. Bultje) - Fix a major stickynotes crasher (Jaap A. Haitsma) Translations: - zh_TW (Abel Cheung) - cs (Miloslav Trmac) - gu (Ankit Patel) - th (Theppitak Karoonboonyanan) - es (Francisco Javier F. Serrador) - gl (Ignacio Casal Quinteiro) - en_CA (Adam Weinberger) - bg (Alexander Shopov) - pt_BR (Guilherme de S. Pastore) - bn (Mahay Alam Khan) - nl (Tino Meinen) - fa (Masoud Ahmadzadeh, Meelad Zakaria) - ku (Erdal Ronahi) @ text @d1 1 a1 1 $NetBSD$ d3 1 a3 1 --- configure.orig 2006-03-19 23:21:47.000000000 +0100 d5 10 a14 1 @@@@ -26469,7 +26469,7 @@@@ else d23 63 @ 1.2 log @Update to 2.4.2 Changes: Overall + Help updates AccessX applet + Fix memory management and pixbuf handling Battstat + Leak fixes + Distribute the soundlist file + Major improvements in cpu usage with ACPI + Fix event handling after above patch Cdplayer + Clean up and fix leaks + Dist file for NetBSD Charpick + Remove unneeded include that broke build on some platforms Gweather + Fix a whole bunch of locations and add some new ones + Fix warning on help invocation Mailcheck + Remove duplicate definitions causing build time warnings Mini-commander + Remove compiler warning Mixer + Leak fixes Modemlights + Leak fixes Multiload + Fix memory reporting @ text @d1 1 a1 1 $NetBSD: patch-ac,v 1.1 2003/12/29 12:05:20 xtraeme Exp $ d3 11 a13 350 --- /dev/null 2003-10-26 20:58:41.000000000 +0000 +++ cdplayer/cdrom-bsd.c 2003-10-26 20:58:37.000000000 +0000 @@@@ -0,0 +1,347 @@@@ +#include +#include +#include +#include +#include +#include + +#include +#include +#include "cdrom-interface.h" + +#define ASSIGN_MSF(dest, src) \ +{ \ + (dest).minute = (src).minute; \ + (dest).second = (src).second; \ + (dest).frame = (src).frame; \ +} + +int +cdrom_play(cdrom_device_t cdp, int start, int stop) +{ + struct ioc_play_track ti; + + ti.start_track = start; + ti.start_index = 1; + ti.end_track = stop; + ti.end_index = 1; + + if ((ioctl(cdp->device, CDIOCPREVENT) == -1) || + (ioctl(cdp->device, CDIOCPLAYTRACKS, &ti) == -1)) { + cdp->my_errno = errno; + ioctl(cdp->device, CDIOCALLOW); + return DISC_IO_ERROR; + } + return DISC_NO_ERROR; +} + +int +cdrom_play_msf(cdrom_device_t cdp, cdrom_msf_t * start) +{ + struct ioc_play_msf msf; + + if (cdrom_read_track_info(cdp) == DISC_IO_ERROR) + return DISC_IO_ERROR; + msf.start_m = start->minute; + msf.start_s = start->second; + msf.start_f = start->frame; + + msf.end_m = cdp->track_info[cdp->nr_track].address.minute; + msf.end_s = cdp->track_info[cdp->nr_track].address.second; + msf.end_f = cdp->track_info[cdp->nr_track].address.frame; + + if ((ioctl(cdp->device, CDIOCPREVENT) == -1) || + (ioctl(cdp->device, CDIOCPLAYMSF, &msf) == -1)) { + cdp->my_errno = errno; + ioctl(cdp->device, CDIOCALLOW); + return DISC_IO_ERROR; + } + return DISC_NO_ERROR; +} + +int +cdrom_pause(cdrom_device_t cdp) +{ + if (ioctl(cdp->device, CDIOCPAUSE) == -1) { + cdp->my_errno = errno; + ioctl(cdp->device, CDIOCALLOW); + return DISC_IO_ERROR; + } + return DISC_IO_ERROR; +} + +int +cdrom_resume(cdrom_device_t cdp) +{ + if (ioctl(cdp->device, CDIOCRESUME) == -1) { + cdp->my_errno = errno; + ioctl(cdp->device, CDIOCALLOW); + return DISC_IO_ERROR; + } + return DISC_NO_ERROR; +} + + +int +cdrom_stop(cdrom_device_t cdp) +{ + if ((ioctl(cdp->device, CDIOCSTOP) == -1) || + (ioctl(cdp->device, CDIOCALLOW) == -1)) { + cdp->my_errno = errno; + return DISC_IO_ERROR; + } + return DISC_NO_ERROR; +} + +int +cdrom_read_track_info(cdrom_device_t cdp) +{ + struct ioc_toc_header toc; +#ifdef __FreeBSD__ + struct ioc_read_toc_single_entry tocentry; +#else + struct ioc_read_toc_entry tocentry; +#endif + int i, j, nr_track; + + if (ioctl(cdp->device, CDIOREADTOCHEADER, &toc) == -1) { + cdp->my_errno = errno; + ioctl(cdp->device, CDIOCALLOW); + return DISC_IO_ERROR; + } + cdp->track0 = toc.starting_track; + cdp->track1 = toc.ending_track; + nr_track = cdp->track1 - cdp->track0; + if (nr_track <= 0) + return DISC_IO_ERROR; + + if (nr_track != cdp->nr_track) { + if (cdp->track_info) + g_free(cdp->track_info); + cdp->nr_track = nr_track; + cdp->track_info = g_malloc((cdp->nr_track) * sizeof(track_info_t)); + } + for (i = 0, j = cdp->track0; i < cdp->nr_track; i, j) { + tocentry.starting_track = j; + tocentry.address_format = CD_MSF_FORMAT; + +#ifdef __FreeBSD__ + if (ioctl(cdp->device, CDIOREADTOCENTRY, &tocentry) == -1) { +#else + if (ioctl(cdp->device, CDIOREADTOCENTRYS, &tocentry) == -1) { +#endif + cdp->my_errno = errno; + ioctl(cdp->device, CDIOCALLOW); + return DISC_IO_ERROR; + } + /* fill the trackinfo field */ + cdp->track_info[i].track = j; + cdp->track_info[i].audio_track = tocentry.data->control != + 0x04 ? 1 : 0; + ASSIGN_MSF(cdp->track_info[i].address, tocentry.data->addr.msf); + } + + tocentry.starting_track = 0xAA; + tocentry.address_format = CD_MSF_FORMAT; +#ifdef __FreeBSD__ + if (ioctl(cdp->device, CDIOREADTOCENTRY, &tocentry) == -1) { +#else + if (ioctl(cdp->device, CDIOREADTOCENTRYS, &tocentry) == -1) { +#endif + cdp->my_errno = errno; + ioctl(cdp->device, CDIOCALLOW); + return DISC_IO_ERROR; + } + cdp->track_info[i].track = j; + cdp->track_info[i].audio_track = 0; + ASSIGN_MSF(cdp->track_info[i].address, tocentry.data->addr.msf); + + return DISC_NO_ERROR; +} + +int +cdrom_get_status(cdrom_device_t cdp, cdrom_device_status_t * stat) +{ + struct ioc_read_subchannel subchnl; + struct cd_sub_channel_info subchnlinfo; + + subchnl.address_format = CD_MSF_FORMAT; + subchnl.data_format = CD_CURRENT_POSITION; + subchnl.track = 0; + subchnl.data_len = sizeof(subchnlinfo); + subchnl.data = &subchnlinfo; + if (ioctl(cdp->device, CDIOCREADSUBCHANNEL, &subchnl) == -1) { + cdp->my_errno = errno; + ioctl(cdp->device, CDIOCALLOW); + return DISC_IO_ERROR; + } + stat->track = subchnlinfo.what.position.track_number; + ASSIGN_MSF(stat->relative_address, subchnlinfo.what.position.reladdr.msf); + ASSIGN_MSF(stat->absolute_address, subchnlinfo.what.position.absaddr.msf); + switch (subchnlinfo.header.audio_status) { + case CD_AS_PLAY_IN_PROGRESS: + ioctl(cdp->device, CDIOCPREVENT); + stat->audio_status = DISC_PLAY; + break; + case CD_AS_PLAY_PAUSED: + ioctl(cdp->device, CDIOCPREVENT); + stat->audio_status = DISC_PAUSED; + break; + case CD_AS_PLAY_COMPLETED: + if (cdrom_read_track_info(cdp) == DISC_IO_ERROR) + return DISC_IO_ERROR; + stat->track = cdp->nr_track; + ASSIGN_MSF(stat->relative_address, + cdp->track_info[cdp->nr_track].address); + ASSIGN_MSF(stat->absolute_address, + cdp->track_info[cdp->nr_track].address); + ioctl(cdp->device, CDIOCALLOW); + stat->audio_status = DISC_COMPLETED; + break; + case CD_AS_AUDIO_INVALID: + case CD_AS_NO_STATUS: + case CD_AS_PLAY_ERROR: + ioctl(cdp->device, CDIOCALLOW); + stat->audio_status = DISC_STOP; + break; + default: + ioctl(cdp->device, CDIOCALLOW); + stat->audio_status = DISC_ERROR; + } + return (stat->audio_status == DISC_ERROR ? + DISC_IO_ERROR : DISC_NO_ERROR); +} + +cdrom_device_t +cdrom_open(char *device, int *errcode) +{ + cdrom_device_t cdp; + + cdp = g_malloc(sizeof(struct cdrom_device)); + + cdp->device = open(device, O_RDONLY); + if (cdp->device == -1) { + *errcode = errno; + g_free(cdp); + return NULL; + } + cdp->nr_track = 0; + cdp->track_info = NULL; + return cdp; +} + +void +cdrom_close(cdrom_device_t cdp) +{ + if (cdp->nr_track) + g_free(cdp->track_info); + close(cdp->device); + g_free(cdp); +} + +int +cdrom_load(cdrom_device_t cdp) +{ + if ((ioctl(cdp->device, CDIOCCLOSE) == -1) || + (ioctl(cdp->device, CDIOCALLOW) == -1)) { + cdp->my_errno = errno; + return DISC_IO_ERROR; + } + return DISC_NO_ERROR; +} + +int +cdrom_eject(cdrom_device_t cdp) +{ + if ((ioctl(cdp->device, CDIOCEJECT) == -1) || + (ioctl(cdp->device, CDIOCALLOW) == -1)) { + cdp->my_errno = errno; + return DISC_IO_ERROR; + } + return DISC_NO_ERROR; +} + +int +cdrom_next(cdrom_device_t cdp) +{ + cdrom_device_status_t stat; + + if ((cdrom_read_track_info(cdp) == DISC_IO_ERROR) || + (cdrom_get_status(cdp, &stat) == DISC_IO_ERROR)) + return DISC_IO_ERROR; + return cdrom_play(cdp, stat.track, cdp->track1); +} + +int +cdrom_prev(cdrom_device_t cdp) +{ + cdrom_device_status_t stat; + + if ((cdrom_read_track_info(cdp) == DISC_IO_ERROR) || + (cdrom_get_status(cdp, &stat) == DISC_IO_ERROR)) + return DISC_IO_ERROR; + return cdrom_play(cdp, stat.track - 1, cdp->track1); +} + +int +cdrom_rewind(cdrom_device_t cdp) +{ + cdrom_device_status_t stat; + int track; + + if ((cdrom_read_track_info(cdp) == DISC_IO_ERROR) || + (cdrom_get_status(cdp, &stat) == DISC_IO_ERROR)) + return DISC_IO_ERROR; + if (stat.absolute_address.second != 0) + stat.absolute_address.second--; + else { + stat.absolute_address.second = 0; + if (stat.absolute_address.minute > 0) + stat.absolute_address.minute--; + } + stat.absolute_address.frame = 0; + return cdrom_play_msf(cdp, &stat.absolute_address); +} + +int +cdrom_ff(cdrom_device_t cdp) +{ + cdrom_device_status_t stat; + int track; + + if ((cdrom_read_track_info(cdp) == DISC_IO_ERROR) || + (cdrom_get_status(cdp, &stat) == DISC_IO_ERROR)) + return DISC_IO_ERROR; + stat.absolute_address.second; + if (stat.absolute_address.second >= 60) { + stat.absolute_address.minute; + stat.absolute_address.second = 0; + } + stat.absolute_address.frame = 0; + return cdrom_play_msf(cdp, &stat.absolute_address); +} + +int +cdrom_track_length(cdrom_device_t cdp, int track, cdrom_msf_t * length) +{ + int index, s1, s2, i; + + if ((track < cdp->track0) || (track > cdp->track1)) + return DISC_INDEX_OUT_OF_RANGE; + index = track - cdp->track0; + + s1 = cdp->track_info[index].address.second; + s2 = cdp->track_info[index].address.second; + length->second = s1 = s1 - s2; + if (s1 < 0) { + i = 1; + length->second = s1; + } else + i = 0; + + length->minute = cdp->track_info[index].address.minute - + cdp->track_info[index].address.minute - i; + + return 0; +} + @ 1.1 log @Update to 2.4.1, thanks to Min Sik kim and Soren Jacobsen. Changes include several translation updates, addition of new features and some bug fixing. Please review the Changelog file to see a full list of changes. @ text @d1 1 a1 1 $NetBSD$ @