root/branches/streaming-rework/src/iavdevice.cpp

Revision 435, 2.0 kB (checked in by pieterpalmers, 17 years ago)

src/devicemanager:
- start OSC server for the device manager

src/devicemanager,
src/iavdevice,
src/libieee1394/configrom:
- inherit from OscNode? to become Osc'able

src/bounce,
src/libstreaming/AmdtpStreamProcessor,
src/libstreaming/AmdtpSlaveStreamProcessor:
- fixed bounce device implementation, now working

src/bebob:
- fixed midi bug

General:
- removed 'intermediate XML'
- removed obsolete tests
- removed obsolete files
- removed obsolete API calls

Line 
1 /* iavdevice.h
2  * Copyright (C) 2006 by Daniel Wagner
3  * Copyright (C) 2007 by Pieter Palmers
4  *
5  * This file is part of FreeBoB.
6  *
7  * FreeBoB is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  * FreeBoB 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 General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with FreeBoB; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
19  * MA 02111-1307 USA.
20  */
21
22 #include "iavdevice.h"
23
24 #include "libieee1394/configrom.h"
25 #include "libieee1394/ieee1394service.h"
26
27 #include <iostream>
28 #include <sstream>
29
30 IMPL_DEBUG_MODULE( IAvDevice, IAvDevice, DEBUG_LEVEL_VERBOSE );
31
32 IAvDevice::IAvDevice( std::auto_ptr< ConfigRom >( configRom ),
33                     Ieee1394Service& ieee1394service,
34                     int nodeId )
35     : OscNode()
36     , m_pConfigRom( configRom )
37     , m_p1394Service( &ieee1394service )
38     , m_verboseLevel( DEBUG_LEVEL_NORMAL )
39     , m_nodeId ( nodeId )
40 {
41     addOption(Util::OptionContainer::Option("id",std::string("dev?")));
42    
43     std::ostringstream nodestr;
44     nodestr << "node" << nodeId;
45     setOscBase(nodestr.str());
46     ConfigRom& c = getConfigRom();
47    
48     addChildOscNode(&c);
49 }
50
51
52 ConfigRom&
53 IAvDevice::getConfigRom() const
54 {
55     return *m_pConfigRom;
56 }
57
58 bool
59 IAvDevice::setId( unsigned int id)
60 {
61     // FIXME: decent ID system nescessary
62     std::ostringstream idstr;
63     idstr << "dev" << id;
64     debugOutput( DEBUG_LEVEL_VERBOSE, "Set id to %s...\n", idstr.str().c_str());
65
66     return setOption("id",idstr.str());
67 }
68
69 void
70 IAvDevice::setVerboseLevel(int l)
71 {
72     m_verboseLevel=l;
73     setDebugLevel(l);
74 }
Note: See TracBrowser for help on using the browser.