• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdemultimedia API Reference
  • KDE Home
  • Contact Us
 

libkcddb

  • sources
  • kde-4.14
  • kdemultimedia
  • libkcddb
  • libkcddb
asynccddbplookup.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002 Rik Hemsley (rikkus) <rik@kde.org>
3  Copyright (C) 2002 Benjamin Meyer <ben-devel@meyerhome.net>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 
21 #ifndef KCDDB_ASYNC_CDDBP_LOOKUP_H
22 #define KCDDB_ASYNC_CDDBP_LOOKUP_H
23 
24 
25 #include "cddbplookup.h"
26 
27 namespace KCDDB
28 {
29  class AsyncCDDBPLookup : public CDDBPLookup
30  {
31  Q_OBJECT
32 
33  public:
34 
35  enum State
36  {
37  Idle,
38  WaitingForConnection,
39  WaitingForGreeting,
40  WaitingForHandshake,
41  WaitingForProtoResponse,
42  WaitingForQueryResponse,
43  WaitingForMoreMatches,
44  WaitingForCDInfoResponse,
45  WaitingForCDInfoData,
46  WaitingForQuitResponse
47  };
48 
49  AsyncCDDBPLookup();
50 
51  virtual ~AsyncCDDBPLookup();
52 
53  Result lookup( const QString &, uint, const TrackOffsetList & );
54 
55  signals:
56 
57  void finished( KCDDB::Result );
58  void quit( Result );
59 
60  protected slots:
61 
62  void slotGotError(QAbstractSocket::SocketError error);
63  void slotConnectionSuccess();
64  void slotReadyRead();
65 
66  protected:
67 
68  void doHandshake();
69  void doProto();
70  void doQuery();
71  void doQuit();
72 
73  bool parseQueryResponse( const QString & );
74  void requestCDInfoForMatch();
75  bool parseCDInfoResponse( const QString & );
76  void parseCDInfoData();
77 
78  void read();
79 
80  QString readLine();
81 
82  QString stateToString() const;
83 
84  private:
85 
86  State state_;
87  Result result_;
88  QStringList cdInfoBuffer_;
89  };
90 }
91 
92 #endif // KCDDB_ASYNC_CDDBP_LOOKUP_H
93 // vim:tabstop=2:shiftwidth=2:expandtab:cinoptions=(s,U1,m1
KCDDB::AsyncCDDBPLookup::doQuit
void doQuit()
Definition: asynccddbplookup.cpp:280
KCDDB::AsyncCDDBPLookup::readLine
QString readLine()
Definition: asynccddbplookup.cpp:217
KCDDB::AsyncCDDBPLookup::WaitingForProtoResponse
Definition: asynccddbplookup.h:41
KCDDB::AsyncCDDBPLookup::slotReadyRead
void slotReadyRead()
Definition: asynccddbplookup.cpp:85
KCDDB::AsyncCDDBPLookup::AsyncCDDBPLookup
AsyncCDDBPLookup()
Definition: asynccddbplookup.cpp:29
KCDDB::AsyncCDDBPLookup::~AsyncCDDBPLookup
virtual ~AsyncCDDBPLookup()
Definition: asynccddbplookup.cpp:36
KCDDB::AsyncCDDBPLookup::parseCDInfoResponse
bool parseCDInfoResponse(const QString &)
KCDDB::AsyncCDDBPLookup::State
State
Definition: asynccddbplookup.h:35
KCDDB::AsyncCDDBPLookup::WaitingForCDInfoResponse
Definition: asynccddbplookup.h:44
KCDDB::CDDBPLookup
Definition: cddbplookup.h:31
KCDDB::AsyncCDDBPLookup::Idle
Definition: asynccddbplookup.h:37
KCDDB::AsyncCDDBPLookup::WaitingForGreeting
Definition: asynccddbplookup.h:39
KCDDB::AsyncCDDBPLookup::slotConnectionSuccess
void slotConnectionSuccess()
Definition: asynccddbplookup.cpp:78
KCDDB::AsyncCDDBPLookup::WaitingForMoreMatches
Definition: asynccddbplookup.h:43
cddbplookup.h
KCDDB::AsyncCDDBPLookup::parseCDInfoData
void parseCDInfoData()
Definition: asynccddbplookup.cpp:264
KCDDB::AsyncCDDBPLookup::quit
void quit(Result)
KCDDB::AsyncCDDBPLookup::read
void read()
Definition: asynccddbplookup.cpp:94
QString
QList< uint >
QStringList
KCDDB::AsyncCDDBPLookup::stateToString
QString stateToString() const
Definition: asynccddbplookup.cpp:288
KCDDB::AsyncCDDBPLookup::requestCDInfoForMatch
void requestCDInfoForMatch()
Definition: asynccddbplookup.cpp:247
KCDDB::AsyncCDDBPLookup::parseQueryResponse
bool parseQueryResponse(const QString &)
KCDDB::AsyncCDDBPLookup::WaitingForCDInfoData
Definition: asynccddbplookup.h:45
KCDDB::AsyncCDDBPLookup::WaitingForQuitResponse
Definition: asynccddbplookup.h:46
KCDDB::AsyncCDDBPLookup::doProto
void doProto()
Definition: asynccddbplookup.cpp:231
KCDDB::AsyncCDDBPLookup::doHandshake
void doHandshake()
Definition: asynccddbplookup.cpp:223
KCDDB::AsyncCDDBPLookup::slotGotError
void slotGotError(QAbstractSocket::SocketError error)
Definition: asynccddbplookup.cpp:65
KCDDB::Result
Result
Definition: kcddb.h:37
KCDDB::AsyncCDDBPLookup::doQuery
void doQuery()
Definition: asynccddbplookup.cpp:239
KCDDB::AsyncCDDBPLookup::finished
void finished(KCDDB::Result)
KCDDB::AsyncCDDBPLookup::WaitingForConnection
Definition: asynccddbplookup.h:38
KCDDB::AsyncCDDBPLookup
Definition: asynccddbplookup.h:29
KCDDB::AsyncCDDBPLookup::WaitingForQueryResponse
Definition: asynccddbplookup.h:42
KCDDB::AsyncCDDBPLookup::WaitingForHandshake
Definition: asynccddbplookup.h:40
KCDDB::AsyncCDDBPLookup::lookup
Result lookup(const QString &, uint, const TrackOffsetList &)
Definition: asynccddbplookup.cpp:42
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:28:13 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

libkcddb

Skip menu "libkcddb"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdemultimedia API Reference

Skip menu "kdemultimedia API Reference"
  • libkcddb
  • libkcompactdisc

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal