1 |
/* ieee1394service.h |
---|
2 |
* Copyright (C) 2004 by Daniel Wagner |
---|
3 |
* |
---|
4 |
* This file is part of FreeBob. |
---|
5 |
* |
---|
6 |
* FreeBob is free software; you can redistribute it and/or modify |
---|
7 |
* it under the terms of the GNU General Public License as published by |
---|
8 |
* the Free Software Foundation; either version 2 of the License, or |
---|
9 |
* (at your option) any later version. |
---|
10 |
* FreeBob 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 |
---|
13 |
* GNU General Public License for more details. |
---|
14 |
* |
---|
15 |
* You should have received a copy of the GNU General Public License |
---|
16 |
* along with FreeBob; if not, write to the Free Software |
---|
17 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
---|
18 |
* MA 02111-1307 USA. |
---|
19 |
*/ |
---|
20 |
#ifndef IEEE1394SERVICE_H |
---|
21 |
#define IEEE1394SERVICE_H |
---|
22 |
|
---|
23 |
#include <libraw1394/raw1394.h> |
---|
24 |
#include <libavc1394/rom1394.h> |
---|
25 |
#include <sigc++/sigc++.h> |
---|
26 |
|
---|
27 |
#include "freebob.h" |
---|
28 |
|
---|
29 |
typedef unsigned int GenerationT; |
---|
30 |
|
---|
31 |
class Ieee1394Service { |
---|
32 |
public: |
---|
33 |
Ieee1394Service(); |
---|
34 |
~Ieee1394Service(); |
---|
35 |
|
---|
36 |
FBReturnCodes initialize(); |
---|
37 |
|
---|
38 |
static Ieee1394Service* instance(); |
---|
39 |
FBReturnCodes discoveryDevices(); |
---|
40 |
|
---|
41 |
/** |
---|
42 |
* Current generation count. |
---|
43 |
* |
---|
44 |
* If the count is increased a bus reset has occurred. |
---|
45 |
*/ |
---|
46 |
sigc::signal<void,GenerationT>sigGenerationCount; |
---|
47 |
|
---|
48 |
protected: |
---|
49 |
static int resetHandler( raw1394handle_t handle, |
---|
50 |
unsigned int iGeneration ); |
---|
51 |
|
---|
52 |
bool startRHThread(); |
---|
53 |
void stopRHThread(); |
---|
54 |
static void* rHThread( void* arg ); |
---|
55 |
private: |
---|
56 |
static Ieee1394Service* m_pInstance; |
---|
57 |
raw1394handle_t m_handle; |
---|
58 |
int m_iPort; |
---|
59 |
bool m_bInitialised; |
---|
60 |
pthread_t m_thread; |
---|
61 |
pthread_mutex_t m_mutex; |
---|
62 |
bool m_bRHThreadRunning; |
---|
63 |
}; |
---|
64 |
|
---|
65 |
#endif |
---|