/usr/include/libkcompactdisc/kcompactdisc.h is in libkcompactdisc-dev 4:4.13.0-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 | /*
* KCompactDisc - A CD drive interface for the KDE Project.
*
* Copyright (C) 2005 Shaheedur R. Haque <srhaque@iee.org>
* Copyright (C) 2007 Alexander Kern <alex.kern@gmx.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef KCOMPACTDISC_H
#define KCOMPACTDISC_H
#include <QtCore/QObject>
#include <QtCore/QTimer>
#include <QtCore/QStringList>
#include <kdemacros.h>
#include <kurl.h>
#if defined Q_OS_WIN
#ifndef KCOMPACTDISC_EXPORT
# ifdef MAKE_KCOMPACTDISC_LIB
# define KCOMPACTDISC_EXPORT KDE_EXPORT
# else
# define KCOMPACTDISC_EXPORT KDE_IMPORT
# endif
#endif
#else /* UNIX */
/* export statements for unix */
#define KCOMPACTDISC_EXPORT KDE_EXPORT
#endif
class KCompactDiscPrivate;
/**
* KCompactDisc - A CD drive interface for the KDE Project.
*
* The disc interface is modelled by these slots:
*
* @see #playoutTrack(unsigned track): Play specified track.
* @see #playoutPosition(unsigned position): seek to specified position.
* @see #playNext(): Play next track in the playlist.
* @see #playPrev(): Play previous track in the playlist.
* @see #pauseResumePlayout(): Toggle between pause/resume.
* @see #stopPlayout(): Stop playout:
* @see #eject(): Stop playout and eject disc or Close
* tray and try to read TOC from disc.
*
* The progress of playout is modelled by these signals:
*
* @see #playoutPositionChanged(unsigned position): A position in a track.
* @see #playoutTrackChanged(unsigned track): A playout of this track is started.
*
*
* The shape of playlist is controlled by these accessors.
*
* @see #setRandomPlaylist(bool): Shuffle the playlist.
* @see #setLoopPlaylist(bool): Couple begin and end of playlist.
*
*
* The disc lifecycle is modelled by these signals:
*
* @see #discChanged(...): A new disc was inserted.
* @see #discStatusChanged(KCompactDisc::Playing): A disc started playout.
* @see #discStatusChanged(KCompactDisc::Paused): A disc was paused.
* @see #discStatusChanged(KCompactDisc::Stopped): The disc stopped.
* @see #discStatusChanged(KCompactDisc::NoDisc): The disc is removed. No disc in tray or data disc.
* @see #discStatusChanged(KCompactDisc::NotReady): The disc is present. But playout is not possible.
* @see #discInformation(QStringList info): A content for disc information is arrived.
*
*
* The volume control is modelled by these slots:
*
* @see #setVolume(unsigned): A new volume value.
* @see #setBalance(unsigned): A new balance value.
*
*
* And these signals:
*
* @see #volumeChanged(unsigned): A current volume value.
* @see #balanceChanged(unsigned): A current balance value.
*
*
* All times in this interface are in seconds. Valid track numbers are
* positive numbers; zero is not a valid track number.
*/
class KCOMPACTDISC_EXPORT KCompactDisc : public QObject
{
Q_OBJECT
/*
Q_CLASSINFO("D-Bus Interface", "org.kde.KSCD")
public Q_SLOTS:
Q_SCRIPTABLE bool playing();
Q_SCRIPTABLE void play() { play(); }
Q_SCRIPTABLE void stop() { stop(); }
Q_SCRIPTABLE void previous() { prev(); }
Q_SCRIPTABLE void next() { next(); }
Q_SCRIPTABLE void jumpTo(int seconds) { jumpToTime(seconds); }
Q_SCRIPTABLE void eject() { eject(); }
Q_SCRIPTABLE void toggleLoop() { loop(); }
Q_SCRIPTABLE void toggleShuffle() { random(); }
Q_SCRIPTABLE void toggleTimeDisplay() { cycleplaytimemode(); }
Q_SCRIPTABLE void cddbDialog() { CDDialogSelected(); }
Q_SCRIPTABLE void optionDialog() { showConfig(); }
Q_SCRIPTABLE void setTrack(int t) { trackSelected(t > 0 ? t - 1 : 0); }
Q_SCRIPTABLE void volumeDown() { decVolume(); }
Q_SCRIPTABLE void volumeUp() { incVolume(); }
Q_SCRIPTABLE void setVolume(int v);
Q_SCRIPTABLE void setDevice(const QString& dev);
Q_SCRIPTABLE int getVolume() { return Prefs::volume(); }
Q_SCRIPTABLE int currentTrack();
Q_SCRIPTABLE int currentTrackLength();
Q_SCRIPTABLE int currentPosition();
Q_SCRIPTABLE int getStatus();
Q_SCRIPTABLE QString currentTrackTitle();
Q_SCRIPTABLE QString currentAlbum();
Q_SCRIPTABLE QString currentArtist();
Q_SCRIPTABLE QStringList trackList();
*/
public:
enum InformationMode
{
Synchronous, // Return and emit signal when cdrom and cddb information arrives.
Asynchronous // Block until cdrom and cddb infromation has been obtained
};
enum DiscCommand
{
Play,
Pause,
Next,
Prev,
Stop,
Eject,
Loop,
Random
};
enum DiscStatus
{
Playing,
Paused,
Stopped,
Ejected,
NoDisc,
NotReady,
Error
};
enum DiscInfo
{
Cdtext,
Cddb,
PhononMetadata
};
KCompactDisc(InformationMode = KCompactDisc::Synchronous);
virtual ~KCompactDisc();
/**
* @param device Name of CD device, e.g. /dev/cdrom.
* @param digitalPlayback Select digital or analog playback.
* @param audioSystem For digital playback, system to use, e.g. "phonon".
* @param audioDevice For digital playback, device to use.
* @return true if the device seemed usable.
*/
bool setDevice(
const QString &device,
unsigned volume = 50,
bool digitalPlayback = true,
const QString &audioSystem = QString(),
const QString &audioDevice = QString());
/**
* If the url is a media:/ or system:/ URL returns
* the device it represents, otherwise returns device
*/
static QString urlToDevice(const KUrl& url);
/**
* All installed audio backends.
*/
static const QStringList audioSystems();
/**
* All present CDROM devices.
*/
static const QStringList cdromDeviceNames();
/**
* The default CDROM device for this system.
*/
static const QString defaultCdromDeviceName();
/**
* The Url of default CDROM device for this system.
*/
static const KUrl defaultCdromDeviceUrl();
/**
* The Url of named CDROM device for this system.
*/
static const KUrl cdromDeviceUrl(const QString &);
/**
* The Udi of default CDROM device for this system.
*/
static const QString defaultCdromDeviceUdi();
/**
* The Udi of named CDROM device for this system.
*/
static const QString cdromDeviceUdi(const QString &);
/**
* SCSI parameter VENDOR of current CDROM device.
*
* @return Null string if no usable device set.
*/
const QString &deviceVendor();
/**
* SCSI parameter MODEL of current CDROM device.
*
* @return Null string if no usable device set.
*/
const QString &deviceModel();
/**
* SCSI parameter REVISION of current CDROM device.
*
* @return Null string if no usable device set.
*/
const QString &deviceRevision();
/**
* Current CDROM device.
*
* @return Null string if no usable device set.
*/
const QString &deviceName();
/**
* Current device as Kurl.
*/
const KUrl deviceUrl();
/**
* Current disc, 0 if no disc or impossible to calculate id.
*/
unsigned discId();
/**
* CDDB signature of disc, empty if no disc or not possible to deliever.
*/
const QList<unsigned> &discSignature();
/**
* Artist for whole disc.
*
* @return Disc artist or null string.
*/
const QString &discArtist();
/**
* Title of disc.
*
* @return Disc title or null string.
*/
const QString &discTitle();
/**
* Known length of disc.
*
* @return Disc length in seconds.
*/
unsigned discLength();
/**
* Current position on the disc.
*
* @return Position in seconds.
*/
unsigned discPosition();
/**
* Current status.
*
* @return Current status.
*/
KCompactDisc::DiscStatus discStatus();
/**
* Status as string.
*
* @return Status as QString.
*/
QString discStatusString(KCompactDisc::DiscStatus status);
/**
* Artist of current track.
*
* @return Track artist or null string.
*/
QString trackArtist();
/**
* Artist of given track.
*
* @return Track artist or null string.
*/
QString trackArtist(unsigned track);
/**
* Title of current track.
*
* @return Track title or null string.
*/
QString trackTitle();
/**
* Title of given track.
*
* @return Track title or null string.
*/
QString trackTitle(unsigned track);
/**
* Length of current track.
*
* @return Track length in seconds.
*/
unsigned trackLength();
/**
* Length of given track.
*
* @param track Track number.
* @return Track length in seconds.
*/
unsigned trackLength(unsigned track);
/**
* Current track.
*
* @return Track number.
*/
unsigned track();
/**
* Current track position.
*
* @return Track position in seconds.
*/
unsigned trackPosition();
/**
* Number of tracks.
*/
unsigned tracks();
/**
* Is status playing.
*/
bool isPlaying();
/**
* Is status pausing.
*/
bool isPaused();
/**
* Is status no disc.
*/
bool isNoDisc();
/**
* @return if the track is actually an audio track.
*/
bool isAudio(unsigned track);
public Q_SLOTS:
/**
* Start playout of track.
*/
void playTrack(unsigned int track);
/**
* Start playout or seek to given position of track.
*/
void playPosition(unsigned int position);
/* GUI bindings */
/**
* Start playout.
*/
void play();
/**
* Start playout of next track.
*/
void next();
/**
* Start playout of previous track.
*/
void prev();
/**
* Pause/resume playout.
*/
void pause();
/**
* Stop playout.
*/
void stop();
/**
* Open/close tray.
*/
void eject();
/**
* Switch endless playout on/off.
*/
void loop();
/**
* Switch random playout on/off.
*/
void random();
/**
* Pipe GUI command.
*/
void doCommand(KCompactDisc::DiscCommand);
void metadataLookup();
Q_SIGNALS:
/**
* A new position in a track. This signal is delivered at
* approximately 1 second intervals while a track is playing. At first sight,
* this might seem overzealous, but it is likely that any CD player UI will use
* this to track the second-by-second position, so we may as well do it for
* them.
*
* @param position Position within track in seconds.
*/
void playoutPositionChanged(unsigned int position);
/**
* A new track is started.
*
* @param track Track number.
*/
void playoutTrackChanged(unsigned int track);
public Q_SLOTS:
void setRandomPlaylist(bool);
void setLoopPlaylist(bool);
void setAutoMetadataLookup(bool);
Q_SIGNALS:
void randomPlaylistChanged(bool);
void loopPlaylistChanged(bool);
Q_SIGNALS:
/**
* A new Disc is inserted
*
*/
void discChanged(unsigned int tracks);
/**
* A new Disc information is arrived
*
*/
void discInformation(KCompactDisc::DiscInfo info);
/**
* A Disc status changed
*
*/
void discStatusChanged(KCompactDisc::DiscStatus status);
public Q_SLOTS:
/**
* Set volume
*/
void setVolume(unsigned int volume);
/**
* Set balance
*/
void setBalance(unsigned int balance);
Q_SIGNALS:
/**
* New volume
*/
void volumeChanged(unsigned int volume);
/**
* New balance
*/
void balanceChanged(unsigned int balance);
protected:
KCompactDiscPrivate * d_ptr;
KCompactDisc(KCompactDiscPrivate &dd, QObject *parent);
private:
Q_DECLARE_PRIVATE(KCompactDisc)
#ifdef USE_WMLIB
friend class KWMLibCompactDiscPrivate;
#endif
friend class KPhononCompactDiscPrivate;
};
#endif
|