root/branches/libffado-2.0/src/bebob/edirol/edirol_fa101.cpp

Revision 1197, 2.2 kB (checked in by wagi, 14 years ago)

Set clock source always to 'Device Controlled'. The FA-101 doesn't support
switching clock source by software.

Line 
1 /*
2  * Copyright (C) 2008 by Daniel Wagner
3  *
4  * This file is part of FFADO
5  * FFADO = Free Firewire (pro-)audio drivers for linux
6  *
7  * FFADO is based upon FreeBoB.
8  *
9  * This program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 2 of the License, or
12  * (at your option) version 3 of the License.
13  *
14  * This program 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
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
21  *
22  */
23
24 #include "edirol_fa101.h"
25
26 namespace BeBoB {
27 namespace Edirol {
28
29 EdirolFa101Device::EdirolFa101Device( DeviceManager& d,
30                                       std::auto_ptr<ConfigRom>( configRom ))
31     : BeBoB::AvDevice( d , configRom)
32 {
33     debugOutput( DEBUG_LEVEL_VERBOSE, "Created BeBoB::Edirol::EdirolFa101Device (NodeID %d)\n",
34                  getConfigRom().getNodeId() );
35
36     m_fixed_clocksource.type = FFADODevice::eCT_Auto;
37     m_fixed_clocksource.valid = true;
38     m_fixed_clocksource.locked = true;
39     m_fixed_clocksource.id = 0;
40     m_fixed_clocksource.slipping = false;
41     m_fixed_clocksource.description = "Device Controlled";
42
43     if (AVC::AVCCommand::getSleepAfterAVCCommand() < 500) {
44         AVC::AVCCommand::setSleepAfterAVCCommand( 500 );
45     }
46 }
47
48 EdirolFa101Device::~EdirolFa101Device()
49 {
50 }
51
52 FFADODevice::ClockSource
53 EdirolFa101Device::getActiveClockSource() {
54     return m_fixed_clocksource;
55 }
56
57 bool
58 EdirolFa101Device::setActiveClockSource(ClockSource s) {
59     // can't change, hence only succeed when identical
60     return s.id == m_fixed_clocksource.id;
61 }
62
63 FFADODevice::ClockSourceVector
64 EdirolFa101Device::getSupportedClockSources() {
65     FFADODevice::ClockSourceVector r;
66     r.push_back(m_fixed_clocksource);
67     return r;
68 }
69
70 void
71 EdirolFa101Device::showDevice()
72 {
73     debugOutput(DEBUG_LEVEL_VERBOSE, "This is a BeBoB::EdirolFa101::EdirolFa101Device\n");
74     BeBoB::AvDevice::showDevice();
75 }
76
77 }
78 }
Note: See TracBrowser for help on using the browser.