root/trunk/freebob/src/ieee1394service.h

Revision 17, 2.2 kB (checked in by pieterpalmers, 19 years ago)

Added AVC1394_SUBUNIT_TYPE_MUSIC define
Added a check for the Music subunit type to printAvcUnitInfo

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
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 <pthread.h>
26
27 #include "freebob.h"
28
29 /* XXX: add those to avc1394.h */
30 #define AVC1394_SUBUNIT_TYPE_AUDIO (1 <<19)
31 #define AVC1394_SUBUNIT_TYPE_PRINTER (2 <<19)
32 #define AVC1394_SUBUNIT_TYPE_CA (6 <<19)
33 #define AVC1394_SUBUNIT_TYPE_PANEL (9 <<19)
34 #define AVC1394_SUBUNIT_TYPE_BULLETIN_BOARD (0xA <<19)
35 #define AVC1394_SUBUNIT_TYPE_CAMERA_STORAGE (0xB <<19)
36 #define AVC1394_SUBUNIT_TYPE_MUSIC (0xC <<19)
37
38 class Ieee1394Service {
39  public:
40     Ieee1394Service();
41     ~Ieee1394Service();
42
43     FBReturnCodes initialize();
44     void shutdown();
45
46     static Ieee1394Service* instance();
47     FBReturnCodes discoveryDevices();
48
49     unsigned int getGenerationCount();
50
51  protected:
52     static int resetHandler( raw1394handle_t handle,
53                              unsigned int iGeneration );
54     void setGenerationCount( unsigned int iGeneration );
55
56     bool startRHThread();
57     void stopRHThread();
58     static void* rHThread( void* arg );
59
60     void printAvcUnitInfo( int iNodeId );
61     void printRomDirectory( int iNodeId,  rom1394_directory* pRomDir );
62  private:
63     static Ieee1394Service* m_pInstance;
64     raw1394handle_t m_handle;
65     raw1394handle_t m_rhHandle;
66     int m_iPort;
67     bool m_bInitialised;
68     pthread_t m_thread;
69     pthread_mutex_t m_mutex;
70     bool m_bRHThreadRunning;
71     unsigned int m_iGenerationCount;
72 };
73
74 #endif
Note: See TracBrowser for help on using the browser.