KCDDB

client.h
1/*
2 SPDX-FileCopyrightText: 2002 Rik Hemsley (rikkus) <rik@kde.org>
3 SPDX-FileCopyrightText: 2002-2005 Benjamin C. Meyer <ben at meyerhome dot net>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#ifndef KCDDB_CLIENT_H
9#define KCDDB_CLIENT_H
10
11#include "cdinfo.h"
12#include "kcddb.h"
13#include "config.h"
14
15#include <QObject>
16
17namespace KCDDB
18{
19 class Lookup;
20 class Submit;
21
22 /**
23 * Class used to obtain CDDB information about a CD
24 *
25 * Example:
26 * <code>KCDDB::Client *cddb = new KCDDB::Client();
27 * cddb->lookup(discSignature);
28 * CDInfo info = cddb->lookupResponse().first();</code>
29 */
30 class KCDDB_EXPORT Client : public QObject
31 {
32 Q_OBJECT
33
34 public:
35
36 /**
37 * Uses settings read from config.
38 */
39 Client();
40
41 virtual ~Client();
42
43 Config & config() const;
44
45 /**
46 * @return a list of CDDB entries that match the disc signature
47 */
48 CDInfoList lookupResponse() const;
49
50 /**
51 * Searches the database for entries matching the offset list.
52 * Use lookupResponse() to get the results
53 *
54 * @param trackOffsetList A List of the start offsets of the tracks,
55 * and the offset of the lead-out track at the end of the list
56 *
57 * @return if the results of the lookup: Success, NoRecordFound, etc
58 */
59 Result lookup(const TrackOffsetList &trackOffsetList);
60 /**
61 * @returns the results of trying to submit
62 */
63 Result submit(const CDInfo &cdInfo, const TrackOffsetList &trackOffsetList);
64
65 /**
66 * Stores the CD-information in the local cache
67 */
68 void store(const CDInfo &cdInfo, const TrackOffsetList &trackOffsetList);
69
70 void setBlockingMode( bool );
71 bool blockingMode() const;
72
73 Q_SIGNALS:
74 /**
75 * emitted when not blocking and lookup() finished.
76 */
77 void finished( KCDDB::Result result );
78
79 protected Q_SLOTS:
80 /**
81 * Called when the lookup is finished with the result
82 */
83 void slotFinished( KCDDB::Result result );
84 /**
85 * Called when the submit is finished with the result
86 */
87 void slotSubmitFinished( KCDDB::Result result );
88
89 private:
90 Result runPendingLookups();
91
92 class Private;
93 Private * const d;
94 };
95}
96
97#endif // KCDDB_CLIENT_H
98// vim:tabstop=2:shiftwidth=2:expandtab:cinoptions=(s,U1,m1
Information about a CD.
Definition cdinfo.h:105
Class used to obtain CDDB information about a CD.
Definition client.h:31
void finished(KCDDB::Result result)
emitted when not blocking and lookup() finished.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:19:58 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.