root/trunk/libffado/src/ffadodevice.cpp

Revision 581, 3.0 kB (checked in by ppalmers, 15 years ago)

- First attempt at mixer control (still disfunctional)
- moved vendor specific code in bebob/*

Line 
1 /*
2  * Copyright (C) 2005-2007 by Daniel Wagner
3  * Copyright (C) 2005-2007 by Pieter Palmers
4  *
5  * This file is part of FFADO
6  * FFADO = Free Firewire (pro-)audio drivers for linux
7  *
8  * FFADO is based upon FreeBoB
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License version 2.1, as published by the Free Software Foundation;
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22  * MA 02110-1301 USA
23  */
24
25 #include "ffadodevice.h"
26
27 #include "libieee1394/configrom.h"
28 #include "libieee1394/ieee1394service.h"
29
30 #include <iostream>
31 #include <sstream>
32
33 #include <assert.h>
34
35 IMPL_DEBUG_MODULE( FFADODevice, FFADODevice, DEBUG_LEVEL_NORMAL );
36
37 FFADODevice::FFADODevice( std::auto_ptr< ConfigRom >( configRom ),
38                     Ieee1394Service& ieee1394service,
39                     int nodeId )
40     : Control::Container()
41     , m_pConfigRom( configRom )
42     , m_p1394Service( &ieee1394service )
43     , m_nodeId ( nodeId )
44 {
45     addOption(Util::OptionContainer::Option("id",std::string("dev?")));
46
47     std::ostringstream nodestr;
48     nodestr << "node" << nodeId;
49 //     setOscBase(nodestr.str());
50     ConfigRom& c = getConfigRom();
51
52 //     addChildOscNode(&c);
53 }
54
55 std::string
56 FFADODevice::getName()
57 {
58     return getConfigRom().getGuidString();
59 }
60
61 bool FFADODevice::compareGUID( FFADODevice *a, FFADODevice *b ) {
62     assert(a);
63     assert(b);
64     return ConfigRom::compareGUID(a->getConfigRom(), b->getConfigRom());
65 }
66
67 ConfigRom&
68 FFADODevice::getConfigRom() const
69 {
70     return *m_pConfigRom;
71 }
72
73 bool
74 FFADODevice::loadFromCache()
75 {
76     return false;
77 }
78
79 bool
80 FFADODevice::saveCache()
81 {
82     return false;
83 }
84
85 bool
86 FFADODevice::setId( unsigned int id)
87 {
88     bool retval;
89     // FIXME: decent ID system nescessary
90     std::ostringstream idstr;
91     idstr << "dev" << id;
92     debugOutput( DEBUG_LEVEL_VERBOSE, "Set id to %s...\n", idstr.str().c_str());
93
94     retval=setOption("id",idstr.str());
95 /*    if (retval) {
96         setOscBase(idstr.str());
97     }*/
98     return retval;
99 }
100
101 void
102 FFADODevice::setVerboseLevel(int l)
103 {
104     debugOutput( DEBUG_LEVEL_VERBOSE, "Setting verbose level to %d...\n", l );
105     setDebugLevel(l);
106 }
107
108 void
109 FFADODevice::showDevice()
110 {
111     debugOutput(DEBUG_LEVEL_NORMAL, "Node...........: %d\n", getNodeId());
112     debugOutput(DEBUG_LEVEL_NORMAL, "GUID...........: %s\n", getConfigRom().getGuidString().c_str());
113    
114     std::string id=std::string("dev? [none]");
115     getOption("id", id);
116      
117     debugOutput(DEBUG_LEVEL_NORMAL, "Assigned ID....: %s\n", id.c_str());
118
119     flushDebugOutput();
120 }
121
122
123 bool
124 FFADODevice::enableStreaming() {
125     return true;
126 }
127
128 bool
129 FFADODevice::disableStreaming() {
130     return true;
131 }
Note: See TracBrowser for help on using the browser.