]> git.sesse.net Git - vlc/blob - modules/gui/qt4/adapters/chromaprint.hpp
Qt: Fix crash introduced by 798ee1ab
[vlc] / modules / gui / qt4 / adapters / chromaprint.hpp
1 /*****************************************************************************
2  * chromaprint.hpp: Fingerprinter helper class
3  *****************************************************************************
4  * Copyright (C) 2012 VLC authors and VideoLAN
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation; either version 2.1 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this program; if not, write to the Free Software Foundation,
18  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
19  *****************************************************************************/
20 #ifndef CHROMAPRINT_HPP
21 #define CHROMAPRINT_HPP
22
23 #ifdef HAVE_CONFIG_H
24 # include "config.h"
25 #endif
26
27 #include <QObject>
28 #include <QString>
29 #include <vlc_fingerprinter.h>
30 #include <vlc_interface.h>
31
32 class Chromaprint : public QObject
33 {
34     Q_OBJECT
35
36 public:
37     Chromaprint( intf_thread_t *p_intf = NULL );
38     virtual ~Chromaprint();
39     bool enqueue( input_item_t *p_item );
40     static int results_available( vlc_object_t *p_this, const char *,
41                                   vlc_value_t, vlc_value_t newval, void *param );
42     fingerprint_request_t * fetchResults();
43     void apply( fingerprint_request_t *, int i_id );
44     static bool isSupported( QString uri );
45
46 signals:
47     void finished();
48
49 private:
50     void finish() { emit finished(); }
51     intf_thread_t *p_intf;
52     fingerprinter_thread_t *p_fingerprinter;
53 };
54
55 #endif // CHROMAPRINT_HPP